← Back
Editing: ppcp-axo-block-js-index.js
(()=>{"use strict";const t={n:e=>{const n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},cw:t=>{var e;return()=>{if(t){var n=t;t=0,e={exports:{}},n.call(e.exports,e,e.exports)}return e.exports}},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.hasOwn(t,e)};var e=t.cw(function(t,e){var n=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===r}(t)}(t)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){return!1!==e.clone&&e.isMergeableObject(t)?u((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function i(t,e,n){return t.concat(e).map(function(t){return o(t,n)})}function a(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}(t))}function c(t,e){try{return e in t}catch(t){return!1}}function u(t,e,r){(r=r||{}).arrayMerge=r.arrayMerge||i,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=o;var l=Array.isArray(e);return l===Array.isArray(t)?l?r.arrayMerge(t,e,r):function(t,e,n){var r={};return n.isMergeableObject(t)&&a(t).forEach(function(e){r[e]=o(t[e],n)}),a(e).forEach(function(i){(function(t,e){return c(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(c(t,i)&&n.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return u;var n=e.customMerge(t);return"function"==typeof n?n:u}(i,n)(t[i],e[i],n):r[i]=o(e[i],n))}),r}(t,e,r):o(e,r)}u.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,n){return u(t,n,e)},{})};var l=u;t.exports=l});const n=window.wp.element,r=window.wp.i18n,o=window.wc.wcBlocksRegistry,i=window.wp.data;function a(t){return a="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},a(t)}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function l(t,e,n){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return f(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var p=[][r]?e(e([][r]())):(f(e={},r,function(){return this}),e),d=l.prototype=c.prototype=Object.create(p);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,f(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return u.prototype=l,f(d,"constructor",l),f(l,"constructor",u),u.displayName="GeneratorFunction",f(l,o,"GeneratorFunction"),f(d),f(d,o,"Generator"),f(d,r,function(){return this}),f(d,"toString",function(){return"[object Generator]"}),(s=function(){return{w:i,m:y}})()}function f(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}f=function(t,e,n,r){function i(e,n){f(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},f(t,e,n,r)}function p(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function d(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){p(i,r,o,a,c,"next",t)}function c(t){p(i,r,o,a,c,"throw",t)}a(void 0)})}}function y(_x){return v.apply(this,arguments)}function v(){return(v=d(s().m(function t(e){var n,r;return s().w(function(t){for(;;)switch(t.p=t.n){case 0:return n=null,t.p=1,t.n=2,e.json();case 2:n=t.v,t.n=4;break;case 3:t.p=3,t.v;case 4:if(!n){t.n=5;break}return t.a(2,n);case 5:throw(r=new Error("Endpoint returned no usable JSON (HTTP ".concat(e.status,")."))).status=e.status,r;case 6:return t.a(2)}},t,null,[[1,3]])}))).apply(this,arguments)}function m(t){return b.apply(this,arguments)}function b(){return b=d(s().m(function t(e){var n,r,o,i,a,c,l,f,p,d,v=arguments;return s().w(function(t){for(;;)switch(t.n){case 0:return n=e.endpoint,r=e.nonce,o=v.length>1&&void 0!==v[1]?v[1]:{},t.n=1,fetch(n,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(u({nonce:r},o))});case 1:return i=t.v,t.n=2,y(i);case 2:if((a=t.v).success){t.n=3;break}throw(d=new Error((null===(c=a.data)||void 0===c?void 0:c.message)||"")).isUserFacing=Boolean(null===(l=a.data)||void 0===l?void 0:l.message),d.errors=null===(f=a.data)||void 0===f?void 0:f.errors,d.refresh=Boolean(null===(p=a.data)||void 0===p?void 0:p.refresh),d.status=i.status,d;case 3:return t.a(2,a.data)}},t)})),b.apply(this,arguments)}var h=["locale"];function g(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return w(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(w(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,w(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,w(f,"constructor",l),w(l,"constructor",u),u.displayName="GeneratorFunction",w(l,o,"GeneratorFunction"),w(f),w(f,o,"Generator"),w(f,r,function(){return this}),w(f,"toString",function(){return"[object Generator]"}),(g=function(){return{w:i,m:p}})()}function w(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}w=function(t,e,n,r){function i(e,n){w(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},w(t,e,n,r)}function S(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function O(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function k(_x,t){return j.apply(this,arguments)}function j(){var t;return t=g().m(function t(e,n){var r,o,i;return g().w(function(t){for(;;)switch(t.p=t.n){case 0:if(r=n.locale,o=S(n,h),!r){t.n=4;break}return t.p=1,t.n=2,e.createInstance(n);case 2:return t.a(2,t.v);case 3:if(t.p=3,"ERR_DEV_UNSUPPORTED_LOCALE"===(null==(i=t.v)?void 0:i.code)){t.n=4;break}throw i;case 4:return t.a(2,e.createInstance(o))}},t,null,[[1,3]])}),j=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){O(i,r,o,a,c,"next",t)}function c(t){O(i,r,o,a,c,"throw",t)}a(void 0)})},j.apply(this,arguments)}var _="__ppcpV6ScriptPromises";function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=function(t){return t[_]||(t[_]={}),t[_]}(e);return n[t]||(n[t]=new Promise(function(r,o){var i=e.document.createElement("script");i.src=t,i.async=!0,i.onload=r,i.onerror=function(){i.remove(),delete n[t],o(new Error("Failed to load script: ".concat(t)))},e.document.head.appendChild(i)})),n[t]}function P(t){return P="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},P(t)}function A(t,e,n){return(e=function(t){var e=function(t){if("object"!=P(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==P(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var T=A(A({},"googlepay",{configKey:"google_pay",sdkComponent:"googlepay-payments",gatewayId:"ppcp-googlepay"}),"applepay",{configKey:"apple_pay",sdkComponent:"applepay-payments",gatewayId:"ppcp-applepay",fundingSource:"apple_pay"}),x=Object.keys(T);function C(t){return x.filter(function(e){return function(t,e){var n;return!(null===(n=function(t,e){var n=T[e];return n?t[n.configKey]:void 0}(t,e))||void 0===n||!n.enabled)}(t,e)}).map(function(t){return T[t].sdkComponent})}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 G(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function N(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return D(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(D(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,D(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,D(f,"constructor",l),D(l,"constructor",u),u.displayName="GeneratorFunction",D(l,o,"GeneratorFunction"),D(f),D(f,o,"Generator"),D(f,r,function(){return this}),D(f,"toString",function(){return"[object Generator]"}),(N=function(){return{w:i,m:p}})()}function D(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}D=function(t,e,n,r){function i(e,n){D(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},D(t,e,n,r)}function L(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function R(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,F(r.key),r)}}function F(t){var e=function(t){if("object"!=I(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(e)?e:e+""}var M="__ppcpV6TokenRefresh",B=function(){return e=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.listeners=[],this.timer=null,this.refreshAt=0,this.retryIn=void 0,this.refreshing=!1,this.busy=!1,this.pendingInstance=null,this.renewInstance=null},n=[{key:"start",value:function(t,e){var n=this;this.renewInstance=t,document.addEventListener("visibilitychange",function(){"visible"===document.visibilityState&&n.refreshAt&&Date.now()>=n.refreshAt&&n.refresh()}),this.planNextRefresh(e)}},{key:"subscribe",value:function(t){var e=this;return this.listeners.push(t),function(){var n=e.listeners.indexOf(t);n>=0&&e.listeners.splice(n,1)}}},{key:"setBusy",value:function(t){if(this.busy=Boolean(t),!this.busy&&this.pendingInstance){var e=this.pendingInstance;this.pendingInstance=null,this.notify(e)}}},{key:"planNextRefresh",value:function(t){this.retryIn=t.retry_in,this.scheduleRefresh(t.refresh_in)}},{key:"scheduleRefresh",value:function(t){var e=this;if(Number.isFinite(t)){var n=1e3*t;clearTimeout(this.timer),this.refreshAt=Date.now()+n,this.timer=setTimeout(function(){return e.refresh()},n)}}},{key:"refresh",value:(t=N().m(function t(){var e,n,r,o;return N().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!this.refreshing){t.n=1;break}return t.a(2);case 1:return this.refreshing=!0,t.p=2,t.n=3,this.renewInstance();case 3:e=t.v,n=e.sdkInstance,r=e.tokenData,this.planNextRefresh(r),this.busy?this.pendingInstance=n:this.notify(n),t.n=5;break;case 4:t.p=4,o=t.v,console.error("[PPCP SDK v6] Client token refresh failed",o),this.scheduleRefresh(this.retryIn);case 5:return t.p=5,this.refreshing=!1,t.f(5);case 6:return t.a(2)}},t,this,[[2,4,5,6]])}),r=function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){L(i,r,o,a,c,"next",t)}function c(t){L(i,r,o,a,c,"throw",t)}a(void 0)})},function(){return r.apply(this,arguments)})},{key:"notify",value:function(t){(function(t){return function(t){if(Array.isArray(t))return G(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return G(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(t,e):void 0}}(t)||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.")}()})(this.listeners).forEach(function(e){try{e(t)}catch(t){console.error("[PPCP SDK v6]",t)}})}}],n&&R(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var t,e,n,r}();function U(t){return U="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},U(t)}function H(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return q(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(q(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,q(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,q(f,"constructor",l),q(l,"constructor",u),u.displayName="GeneratorFunction",q(l,o,"GeneratorFunction"),q(f),q(f,o,"Generator"),q(f,r,function(){return this}),q(f,"toString",function(){return"[object Generator]"}),(H=function(){return{w:i,m:p}})()}function q(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}q=function(t,e,n,r){function i(e,n){q(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},q(t,e,n,r)}function J(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function W(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?J(Object(n),!0).forEach(function(e){V(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):J(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function V(t,e,n){return(e=function(t){var e=function(t){if("object"!=U(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=U(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==U(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function K(t){return function(t){if(Array.isArray(t))return z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||X(t)||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.")}()}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||X(t,e)||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 X(t,e){if(t){if("string"==typeof t)return z(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(t,e):void 0}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Q(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Y(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Q(i,r,o,a,c,"next",t)}function c(t){Q(i,r,o,a,c,"throw",t)}a(void 0)})}}var Z="__ppcpV6InstancePromise",tt="__ppcpV6ClientMetadataId";function et(){return window[Z]||null}function nt(){var t,e;return window[tt]||(window[tt]=(null===(t=window.crypto)||void 0===t||null===(e=t.randomUUID)||void 0===e?void 0:e.call(t))||"ppcp-".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2))),window[tt]}var rt={product:"product-details",cart:"cart",checkout:"checkout","pay-now":"checkout","mini-cart":"mini-cart","cart-block":"cart","checkout-block":"checkout"};function ot(t,e){var n,r,o,i;return et()||(window[Z]=(n=function(_x,t){return it.apply(this,arguments)}(t,e),o=new Error("PayPal SDK v6 did not load within ".concat(15e3," ms.")),i=new Promise(function(t,e){r=setTimeout(function(){return e(o)},15e3)}),Promise.race([n,i]).finally(function(){return clearTimeout(r)})).then(function(t){var e=t.sdkInstance,n=t.tokenData;return function(t,e){(window[M]||(window[M]=new B),window[M]).start(t,e)}(t.renewInstance,n),document.dispatchEvent(new CustomEvent("ppcp-sdk-v6-ready",{detail:{sdkInstance:e}})),e}).catch(function(t){throw delete window[Z],t})),et()}function it(){return it=Y(H().m(function t(e,n){var r,o,i,a,c,u,l,s,f,p,d;return H().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Promise.all([E(e.sdk_url),m(e.ajax.client_token)]);case 1:if(u=t.v,l=$(u,2),s=l[1],null!==(r=window.paypal)&&void 0!==r&&r.createInstance){t.n=2;break}throw new Error("PayPal SDK v6 global not found after script load.");case 2:return f=["paypal-payments"],Object.values(e.venmo_button||{}).some(Boolean)&&f.push("venmo-payments"),null!==(o=e.card_fields)&&void 0!==o&&o.enabled&&f.push("card-fields"),null!==(i=e.card_button)&&void 0!==i&&i.row&&f.push("paypal-guest-payments"),null!==(a=e.fastlane)&&void 0!==a&&a.enabled&&f.push("fastlane"),f.push.apply(f,K(C(e))),null!==(c=e.messages)&&void 0!==c&&c.enabled&&f.push("paypal-messages"),p={clientToken:s.client_token,components:f,pageType:rt[n]||"checkout",locale:e.locale,clientMetadataId:nt()},t.n=3,k(window.paypal,p);case 3:return d=t.v,t.a(2,{sdkInstance:d,tokenData:s,renewInstance:function(){var t=Y(H().m(function t(){var n,r;return H().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,m(e.ajax.client_token);case 1:return n=t.v,t.n=2,k(window.paypal,W(W({},p),{},{clientToken:n.client_token}));case 2:return r=t.v,window[Z]=Promise.resolve(r),t.a(2,{sdkInstance:r,tokenData:n})}},t)}));return function(){return t.apply(this,arguments)}}()})}},t)})),it.apply(this,arguments)}function at(){var t,e,n,r=window.wc_ppcp_sdk_v6?window.wc_ppcp_sdk_v6:((null===(e=window.wc)||void 0===e||null===(e=e.wcSettings)||void 0===e||null===(n=e.getSetting)||void 0===n?void 0:n.call(e,"paymentMethodData"))||{})["ppcp-sdk-v6"]||null;return null!=r&&null!==(t=r.fastlane)&&void 0!==t&&t.enabled?r:null}function ct(t){return ct="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},ct(t)}function ut(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return lt(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(lt(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,lt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,lt(f,"constructor",l),lt(l,"constructor",u),u.displayName="GeneratorFunction",lt(l,o,"GeneratorFunction"),lt(f),lt(f,o,"Generator"),lt(f,r,function(){return this}),lt(f,"toString",function(){return"[object Generator]"}),(ut=function(){return{w:i,m:p}})()}function lt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}lt=function(t,e,n,r){function i(e,n){lt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},lt(t,e,n,r)}function st(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ft(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pt(r.key),r)}}function pt(t){var e=function(t){if("object"!=ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ct(e)?e:e+""}var dt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.namespace=e,this.connection=null,this.identity=null,this.profile=null,this.FastlaneCardComponent=null,this.FastlanePaymentComponent=null,this.FastlaneWatermarkComponent=null},e=[{key:"connect",value:function(t){var e=at();return e?this.connectV6(e,t):this.connectV5(t)}},{key:"connectV6",value:(n=ut().m(function t(e,n){var r,o;return ut().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,ot(e,e.page_context||"checkout");case 1:return r=t.v,o=this,t.n=2,r.createFastlane(n);case 2:o.init.call(o,t.v);case 3:return t.a(2)}},t,this)}),r=function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){st(i,r,o,a,c,"next",t)}function c(t){st(i,r,o,a,c,"throw",t)}a(void 0)})},function(_x,t){return r.apply(this,arguments)})},{key:"connectV5",value:function(t){var e=this;return new Promise(function(n,r){window[e.namespace]?window[e.namespace].Fastlane(t).then(function(t){e.init(t),n()}).catch(function(t){console.error(t),r(t)}):r(new Error("Namespace ".concat(e.namespace," not found on window object")))})}},{key:"init",value:function(t){this.connection=t,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(t){this.connection.setLocale(t)}}],e&&ft(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n,r}();const yt=dt;function vt(t){var e,n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",i=null===(e=window.wc_ppcp_axo)||void 0===e?void 0:e.wp_debug,a=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,c=null===(r=window.wc_ppcp_axo)||void 0===r?void 0:r.logging_enabled;if(i)switch(o){case"error":console.error("[AXO] ".concat(t));break;case"warn":console.warn("[AXO] ".concat(t));break;default:console.log("[AXO] ".concat(t))}a&&c&&fetch(a,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:window.wc_ppcp_axo.ajax.frontend_logger.nonce,log:{message:t,level:o}})})}function mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return bt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bt(t,e):void 0}}(t,e)||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 bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ht(t){return ht="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},ht(t)}var gt=function(t){return"object"===ht(t)&&null!==t},wt=function(t){return gt(t)?Object.fromEntries(Object.entries(t).map(function(t){var e=mt(t,2),n=e[0],r=e[1];return[n,gt(r)?wt(r):r]}).filter(function(t){var e=mt(t,2),n=(e[0],e[1]);return gt(n)?Object.keys(n).length>0:function(t){return""!==t}(n)})):t};function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Ot=["VISA","MASTERCARD","AMEX","DISCOVER"];const kt=function(t){var e=t.merchant_country||"US";return(0,n.useMemo)(function(){var n,r,o=new Set((null===(n=t.allowed_cards)||void 0===n?void 0:n[e])||Ot),i=new Set((t.disable_cards||[]).map(function(t){return t.toUpperCase()}));return(r=o,function(t){if(Array.isArray(t))return St(t)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(t,e){if(t){if("string"==typeof t)return St(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?St(t,e):void 0}}(r)||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.")}()).filter(function(t){return!i.has(t)})},[t.allowed_cards,t.disable_cards,e])};function jt(t){return jt="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},jt(t)}function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(n),!0).forEach(function(e){Pt(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Pt(t,e,n){return(e=function(t){var e=function(t){if("object"!=jt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var At="woocommerce-paypal-payments/axo-block",Tt={isPayPalLoaded:!1,isGuest:!0,isAxoActive:!1,isAxoScriptLoaded:!1,isEmailSubmitted:!1,isEmailLookupCompleted:!1,shippingAddress:null,cardDetails:null,phoneNumber:"",cardChangeHandler:null};if(!(0,i.select)(At)){var xt=(0,i.createReduxStore)(At,{reducer:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tt,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case"SET_IS_PAYPAL_LOADED":return Et(Et({},t),{},{isPayPalLoaded:e.payload});case"SET_IS_GUEST":return Et(Et({},t),{},{isGuest:e.payload});case"SET_IS_AXO_ACTIVE":return Et(Et({},t),{},{isAxoActive:e.payload});case"SET_IS_AXO_SCRIPT_LOADED":return Et(Et({},t),{},{isAxoScriptLoaded:e.payload});case"SET_IS_EMAIL_SUBMITTED":return Et(Et({},t),{},{isEmailSubmitted:e.payload});case"SET_IS_EMAIL_LOOKUP_COMPLETED":return Et(Et({},t),{},{isEmailLookupCompleted:e.payload});case"SET_SHIPPING_ADDRESS":return Et(Et({},t),{},{shippingAddress:e.payload});case"SET_CARD_DETAILS":return Et(Et({},t),{},{cardDetails:e.payload});case"SET_PHONE_NUMBER":return Et(Et({},t),{},{phoneNumber:e.payload});case"SET_CARD_CHANGE_HANDLER":return Et(Et({},t),{},{cardChangeHandler:e.payload});default:return t}},actions:{setIsPayPalLoaded:function(t){return{type:"SET_IS_PAYPAL_LOADED",payload:t}},setIsGuest:function(t){return{type:"SET_IS_GUEST",payload:t}},setIsAxoActive:function(t){return{type:"SET_IS_AXO_ACTIVE",payload:t}},setIsAxoScriptLoaded:function(t){return{type:"SET_IS_AXO_SCRIPT_LOADED",payload:t}},setIsEmailSubmitted:function(t){return{type:"SET_IS_EMAIL_SUBMITTED",payload:t}},setIsEmailLookupCompleted:function(t){return{type:"SET_IS_EMAIL_LOOKUP_COMPLETED",payload:t}},setShippingAddress:function(t){return{type:"SET_SHIPPING_ADDRESS",payload:t}},setCardDetails:function(t){return{type:"SET_CARD_DETAILS",payload:t}},setPhoneNumber:function(t){return{type:"SET_PHONE_NUMBER",payload:t}},setCardChangeHandler:function(t){return{type:"SET_CARD_CHANGE_HANDLER",payload:t}}},selectors:{getIsPayPalLoaded:function(t){return t.isPayPalLoaded},getIsGuest:function(t){return t.isGuest},getIsAxoActive:function(t){return t.isAxoActive},getIsAxoScriptLoaded:function(t){return t.isAxoScriptLoaded},getIsEmailSubmitted:function(t){return t.isEmailSubmitted},getIsEmailLookupCompleted:function(t){return t.isEmailLookupCompleted},getShippingAddress:function(t){return t.shippingAddress},getCardDetails:function(t){return t.cardDetails},getPhoneNumber:function(t){return t.phoneNumber},getCardChangeHandler:function(t){return t.cardChangeHandler}}});(0,i.register)(xt)}var Ct=function(t){(0,i.dispatch)(At).setIsGuest(t)},It=function(t){(0,i.dispatch)(At).setIsEmailLookupCompleted(t)};function Gt(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return Nt(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(Nt(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Nt(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Nt(f,"constructor",l),Nt(l,"constructor",u),u.displayName="GeneratorFunction",Nt(l,o,"GeneratorFunction"),Nt(f),Nt(f,o,"Generator"),Nt(f,r,function(){return this}),Nt(f,"toString",function(){return"[object Generator]"}),(Gt=function(){return{w:i,m:p}})()}function Nt(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Nt=function(t,e,n,r){function i(e,n){Nt(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Nt(t,e,n,r)}function Dt(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}const Rt=function(t,e,r){var o,a,c=(o=(0,n.useState)(null),a=2,function(t){if(Array.isArray(t))return t}(o)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(o,a)||function(t,e){if(t){if("string"==typeof t)return Lt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lt(t,e):void 0}}(o,a)||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.")}()),u=c[0],l=c[1],s=(0,n.useRef)(!1),f=(0,n.useRef)({axoConfig:e,ppcpConfig:r}),p=(0,n.useCallback)(wt,[]),d=(0,i.useSelect)(function(t){return{isPayPalLoaded:t(At).getIsPayPalLoaded()}},[]).isPayPalLoaded,y=kt(e),v=(0,n.useMemo)(function(){return p(f.current.axoConfig.style_options)},[p]),m=function(t){return(0,n.useMemo)(function(){var e=t.enabled_shipping_locations||[];return Array.isArray(e)?e:[]},[t.enabled_shipping_locations])}(e);return(0,n.useEffect)(function(){var e=function(){var e,n=(e=Gt().m(function e(){var n,r,o;return Gt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!s.current&&!u&&d){e.n=1;break}return e.a(2);case 1:return s.current=!0,vt("Init Fastlane"),e.p=2,r=new yt(t),f.current.axoConfig.environment.is_sandbox&&window.localStorage.setItem("axoEnv","sandbox"),e.n=3,r.connect({locale:null===(n=f.current.ppcpConfig)||void 0===n?void 0:n.locale,styles:v,cardOptions:{allowedBrands:y},shippingAddressOptions:{allowedLocations:m}});case 3:r.setLocale("en_us"),l(r),e.n=5;break;case 4:e.p=4,o=e.v,vt("Failed to initialize Fastlane: ".concat(o),"error");case 5:return e.p=5,s.current=!1,e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(t){Dt(i,r,o,a,c,"next",t)}function c(t){Dt(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return n.apply(this,arguments)}}();e()},[u,v,d,t,y,m]),(0,n.useEffect)(function(){f.current={axoConfig:e,ppcpConfig:r}},[e,r]),u},Ft=function(){var t=(0,i.useSelect)(function(t){return t("wc/store/cart").getCustomerData()}),e=(0,i.useDispatch)("wc/store/cart"),r=e.setShippingAddress,o=e.setBillingAddress,a=(0,n.useCallback)(function(t){r(t)},[r]),c=(0,n.useCallback)(function(t){o(t)},[o]);return(0,n.useMemo)(function(){return{shippingAddress:t.shippingAddress,billingAddress:t.billingAddress,setShippingAddress:a,setBillingAddress:c}},[t.shippingAddress,t.billingAddress,a,c])};function Mt(t,e){void 0===e&&(e={});var n=document.createElement("script");return n.src=t,Object.keys(e).forEach(function(t){n.setAttribute(t,e[t]),"data-csp-nonce"===t&&n.setAttribute("nonce",e["data-csp-nonce"])}),n}function Bt(t,e){if(void 0===e&&(e=Promise),Ht(t,e),"undefined"==typeof document)return e.resolve(null);var n=function(t){var e,n,r=t.sdkBaseUrl,o=t.environment,i=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(t,["sdkBaseUrl","environment"]),a=r||function(t){return"sandbox"===t?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(o),c=i,u=Object.keys(c).filter(function(t){return void 0!==c[t]&&null!==c[t]&&""!==c[t]}).reduce(function(t,e){var n,r=c[e].toString();return n=function(t,e){return(e?"-":"")+t.toLowerCase()},"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)).substring(0,4)||"crossorigin"===e?t.attributes[e]=r:t.queryParams[e]=r,t},{queryParams:{},attributes:{}}),l=u.queryParams,s=u.attributes;return l["merchant-id"]&&-1!==l["merchant-id"].indexOf(",")&&(s["data-merchant-id"]=l["merchant-id"],l["merchant-id"]="*"),{url:"".concat(a,"?").concat((e=l,n="",Object.keys(e).forEach(function(t){0!==n.length&&(n+="&"),n+=t+"="+e[t]}),n)),attributes:s}}(t),r=n.url,o=n.attributes,i=o["data-namespace"]||"paypal",a=Ut(i);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(t,e){var n=document.querySelector('script[src="'.concat(t,'"]'));if(null===n)return null;var r=Mt(t,e),o=n.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(r.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach(function(t){o.dataset[t]!==r.dataset[t]&&(i=!1)}),i?n:null}(r,o)&&a?e.resolve(a):function(t,e){void 0===e&&(e=Promise),Ht(t,e);var n=t.url,r=t.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)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.onSuccess,n=t.onError,r=Mt(t.url,t.attributes);r.onerror=n,r.onload=e,document.head.insertBefore(r,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return t()},onError:function(){var t=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(t)}})})}({url:r,attributes:o},e).then(function(){var t=Ut(i);if(t)return t;throw new Error("The window.".concat(i," global variable is not available."))})}function Ut(t){return window[t]}function Ht(t,e){if("object"!=typeof t||null===t)throw new Error("Expected an options object.");var n=t.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}function qt(t){return qt="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},qt(t)}function Jt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||Vt(t,e)||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 Wt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Vt(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var _n=0,r=function(){};return{s:r,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:r}}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 o,i=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==n.return||n.return()}finally{if(a)throw o}}}}function Vt(t,e){if(t){if("string"==typeof t)return Kt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kt(t,e):void 0}}function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function $t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Xt(r.key),r)}}function Xt(t){var e=function(t){if("object"!=qt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==qt(e)?e:e+""}"function"==typeof SuppressedError&&SuppressedError;var zt=function(){return t=function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.paypal=null,this.buttons=new Map,this.messages=new Map,this.renderEventName="ppcp-render",document.ppcpWidgetBuilderStatus=function(){console.log({buttons:e.buttons,messages:e.messages})},jQuery(document).off(this.renderEventName).on(this.renderEventName,function(){e.renderAll()})},(e=[{key:"setPaypal",value:function(t){this.paypal=t,jQuery(document).trigger("ppcp-paypal-loaded",t)}},{key:"registerButtons",value:function(t,e){t=this.sanitizeWrapper(t),this.buttons.set(this.toKey(t),{wrapper:t,options:e})}},{key:"renderButtons",value:function(t){t=this.sanitizeWrapper(t);var e=this.toKey(t);if(this.buttons.has(e)&&!this.hasRendered(t)){var n=this.buttons.get(e),r=this.paypal.Buttons(n.options);if(r.isEligible()){var o=this.buildWrapperTarget(t);o&&(r.hasReturned()?r.resume():r.render(o))}else this.buttons.delete(e)}}},{key:"renderAllButtons",value:function(){var t,e=Wt(this.buttons);try{for(e.s();!(t=e.n()).done;){var n=Jt(t.value,1)[0];this.renderButtons(n)}}catch(t){e.e(t)}finally{e.f()}}},{key:"removeButtons",value:function(t){var e,n=Wt(this.buttons);try{for(n.s();!(e=n.n()).done;){var r=Jt(e.value,2),o=r[0],i=r[1];(Array.isArray(i.wrapper)?i.wrapper[0]:i.wrapper)===t&&this.buttons.delete(o)}}catch(t){n.e(t)}finally{n.f()}}},{key:"registerMessages",value:function(t,e){this.messages.set(t,{wrapper:t,options:e})}},{key:"renderMessages",value:function(t){var e=this;if(this.messages.has(t)){var n=this.messages.get(t);if(this.hasRendered(t))document.querySelector(t).setAttribute("data-pp-amount",n.options.amount);else{var r=this.paypal.Messages(n.options);r.render(n.wrapper),setTimeout(function(){e.hasRendered(t)||r.render(n.wrapper)},100)}}}},{key:"renderAllMessages",value:function(){var t,e=Wt(this.messages);try{for(e.s();!(t=e.n()).done;){var n=Jt(t.value,2),r=n[0];n[1],this.renderMessages(r)}}catch(t){e.e(t)}finally{e.f()}}},{key:"renderAll",value:function(){this.renderAllButtons(),this.renderAllMessages()}},{key:"hasRendered",value:function(t){var e=t;if(Array.isArray(t)){e=t[0];var n,r=Wt(t.slice(1));try{for(r.s();!(n=r.n()).done;)e+=" .item-"+n.value}catch(t){r.e(t)}finally{r.f()}}var o=document.querySelector(e);return o&&o.hasChildNodes()}},{key:"sanitizeWrapper",value:function(t){return Array.isArray(t)&&1===(t=t.filter(function(t){return!!t})).length&&(t=t[0]),t}},{key:"buildWrapperTarget",value:function(t){var e=t;if(Array.isArray(t)){var n=jQuery(t[0]);if(!n.length)return;var r="item-"+t[1],o=n.find("."+r);o.length||(o=jQuery('<div class="'.concat(r,'"></div>')),n.append(o)),e=o.get(0)}return jQuery(e).length?e:null}},{key:"toKey",value:function(t){return Array.isArray(t)?JSON.stringify(t):t}}])&&$t(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();window.widgetBuilder=window.widgetBuilder||new zt;const Qt=window.widgetBuilder;function Yt(){return Yt.c||(Yt.c=t.n(e()))}e();var Zt=function(t){return t.replace(/([-_]\w)/g,function(t){return t[1].toUpperCase()})},te=["checkout","checkout-block","pay-now"],ee=function(t){var e=function(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[Zt(n)]=t[n]);return e}(t.url_params);t.script_attributes&&(e=Yt()()(e,t.script_attributes));var n=function(t){var e=function(t){var e,n,r;if(!0!==(null==t||null===(e=t.user)||void 0===e?void 0:e.is_logged))return null;var o=null==t||null===(n=t.save_payment_methods)||void 0===n?void 0:n.id_token;return o?!0===(null==t||null===(r=t.vault_component)||void 0===r?void 0:r.is_eligible)&&te.includes(null==t?void 0:t.context)?null:o:null}(t);return e?{"data-user-id-token":e}:{}}(t);return Yt()().all([e,n])};function ne(t){return ne="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},ne(t)}function re(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return oe(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(oe(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,oe(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,oe(f,"constructor",l),oe(l,"constructor",u),u.displayName="GeneratorFunction",oe(l,o,"GeneratorFunction"),oe(f),oe(f,o,"Generator"),oe(f,r,function(){return this}),oe(f,"toString",function(){return"[object Generator]"}),(re=function(){return{w:i,m:p}})()}function oe(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}oe=function(t,e,n,r){function i(e,n){oe(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},oe(t,e,n,r)}function ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ae(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ie(Object(n),!0).forEach(function(e){ce(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ce(t,e,n){return(e=function(t){var e=function(t){if("object"!=ne(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ne(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ne(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ue(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var le=new Map,se=new Map,fe=function(){var t,e=(t=re().m(function t(e,n){var r,o;return re().w(function(t){for(;;)switch(t.n){case 0:if(e){t.n=1;break}throw new Error("Namespace is required");case 1:if(!le.has(e)){t.n=2;break}return console.log("Script already loaded for namespace: ".concat(e)),t.a(2,le.get(e));case 2:if(!se.has(e)){t.n=3;break}return console.log("Script loading in progress for namespace: ".concat(e)),t.a(2,se.get(e));case 3:return r=ae(ae({},ee(n)),{},{"data-namespace":e}),o=new Promise(function(t,n){Bt(r).then(function(n){Qt.setPaypal(n),le.set(e,n),console.log("Script loaded for namespace: ".concat(e)),t(n)}).catch(function(t){console.error("Failed to load script for namespace: ".concat(e),t),n(t)}).finally(function(){se.delete(e)})}),se.set(e,o),t.a(2,o)}},t)}),function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){ue(i,r,o,a,c,"next",t)}function c(t){ue(i,r,o,a,c,"throw",t)}a(void 0)})});return function(_x,t){return e.apply(this,arguments)}}();function pe(t){return pe="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},pe(t)}function de(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return ye(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(ye(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,ye(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,ye(f,"constructor",l),ye(l,"constructor",u),u.displayName="GeneratorFunction",ye(l,o,"GeneratorFunction"),ye(f),ye(f,o,"Generator"),ye(f,r,function(){return this}),ye(f,"toString",function(){return"[object Generator]"}),(de=function(){return{w:i,m:p}})()}function ye(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}ye=function(t,e,n,r){function i(e,n){ye(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},ye(t,e,n,r)}function ve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function me(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ve(Object(n),!0).forEach(function(e){be(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function be(t,e,n){return(e=function(t){var e=function(t){if("object"!=pe(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pe(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function he(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function ge(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return we(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(we(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,we(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,we(f,"constructor",l),we(l,"constructor",u),u.displayName="GeneratorFunction",we(l,o,"GeneratorFunction"),we(f),we(f,o,"Generator"),we(f,r,function(){return this}),we(f,"toString",function(){return"[object Generator]"}),(ge=function(){return{w:i,m:p}})()}function we(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}we=function(t,e,n,r){function i(e,n){we(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},we(t,e,n,r)}function Se(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}const Oe=function(t){var e=t.fastlaneSdk,r=t.name,o=void 0===r?"fastlane-watermark-container":r,i=t.includeAdditionalInfo,a=void 0===i||i,c=(0,n.useRef)(null),u=(0,n.useRef)(null);return(0,n.useEffect)(function(){var t=function(){var t,n=(t=ge().m(function t(){var n,r;return ge().w(function(t){for(;;)switch(t.p=t.n){case 0:if(c.current){t.n=1;break}return t.a(2);case 1:return c.current.innerHTML="",t.p=2,t.n=3,e.FastlaneWatermarkComponent({includeAdditionalInfo:a});case 3:n=t.v,u.current=n,n.render("#".concat(o)),t.n=5;break;case 4:t.p=4,r=t.v,vt("Error rendering watermark: ".concat(r),"error");case 5:return t.a(2)}},t,null,[[2,4]])}),function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Se(i,r,o,a,c,"next",t)}function c(t){Se(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return n.apply(this,arguments)}}();return t(),function(){c.current&&(c.current.innerHTML="")}},[e,o,a]),React.createElement("div",{id:o,ref:c})};var ke={container:null,root:null},je=function(){if(ke.root&&ke.root.unmount(),ke.container)if(ke.container.parentNode)ke.container.parentNode.removeChild(ke.container);else{var t=document.querySelector(".wc-block-checkout-axo-block-watermark-container");t&&t.remove()}Object.assign(ke,{container:null,root:null})};const _e=function(t){var e=t.fastlaneSdk,r=(0,i.useSelect)(function(t){return t(At).getIsAxoActive()}),o=(0,i.useSelect)(function(t){return t(At).getIsAxoScriptLoaded()}),a=window.wc_ppcp_axo;return(0,n.useEffect)(function(){if("1"===(null==a?void 0:a.show_watermark))return r||!r&&!o?(function(){var t=document.querySelector(".wp-block-woocommerce-checkout-contact-information-block .wc-block-components-text-input");if(t&&!ke.container){var e=t.querySelector('input[id="email"]');if(e){ke.container=document.createElement("div"),ke.container.setAttribute("class","wc-block-checkout-axo-block-watermark-container");var r=t.querySelector(".wc-block-axo-email-submit-button-container")||e;r.parentNode.insertBefore(ke.container,r.nextSibling),ke.root=(0,n.createRoot)(ke.container)}}}(),function(t){var e,r=t.isAxoActive,o=t.fastlaneSdk;e=r||t.isAxoScriptLoaded?r?(0,n.createElement)(Oe,{fastlaneSdk:o,name:"fastlane-watermark-email",includeAdditionalInfo:!0}):null:(0,n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"}),ke.root&&ke.root.render(e)}({isAxoActive:r,isAxoScriptLoaded:o,fastlaneSdk:e})):je(),je},[e,r,o]),null},Ee=function(t){var e=t.handleSubmit,n=(0,i.useSelect)(function(t){return{isGuest:t(At).getIsGuest(),isAxoActive:t(At).getIsAxoActive(),isEmailSubmitted:t(At).getIsEmailSubmitted()}}),o=n.isGuest,a=n.isAxoActive,c=n.isEmailSubmitted;return o&&a?React.createElement("button",{type:"button",onClick:e,className:"wc-block-components-button wp-element-button ".concat(c?"is-loading":""),disabled:c},React.createElement("span",{className:"wc-block-components-button__text",style:{visibility:c?"hidden":"visible"}},(0,r.__)("Continue","woocommerce-paypal-payments")),c&&React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}})):null};function Pe(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return Ae(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(Ae(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Ae(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Ae(f,"constructor",l),Ae(l,"constructor",u),u.displayName="GeneratorFunction",Ae(l,o,"GeneratorFunction"),Ae(f),Ae(f,o,"Generator"),Ae(f,r,function(){return this}),Ae(f,"toString",function(){return"[object Generator]"}),(Pe=function(){return{w:i,m:p}})()}function Ae(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ae=function(t,e,n,r){function i(e,n){Ae(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Ae(t,e,n,r)}function Te(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var xe=null,Ce={container:null,root:null,unsubscribe:null},Ie=null,Ge=function(){return xe||(xe=document.getElementById("email")),xe},Ne=function(t,e){t&&e||vt("Shipping or billing address is missing: ".concat(JSON.stringify({shippingAddress:t,billingAddress:e})),"warn");var n={shippingAddress:t,billingAddress:e};vt("Snapshot data: ".concat(JSON.stringify(n)));try{localStorage.setItem("axoOriginalCheckoutFields",JSON.stringify(n))}catch(t){vt("Error saving to localStorage: ".concat(t),"error")}},De=function(t,e,n){var r,o;vt("Populating WooCommerce fields with profile data: ".concat(JSON.stringify(t)));var a=(0,i.dispatch)("wc/store/checkout");"function"==typeof a.__internalSetUseShippingAsBilling&&a.__internalSetUseShippingAsBilling(!1);var c=t.shippingAddress,u=c.address,l=c.name,s=c.phoneNumber,f={first_name:l.firstName,last_name:l.lastName,address_1:u.addressLine1,address_2:u.addressLine2||"",city:u.adminArea2,state:u.adminArea1||"",postcode:u.postalCode,country:u.countryCode,phone:s.nationalNumber};vt("Setting WooCommerce shipping address: ".concat(JSON.stringify(f))),e(f);var p=null!==(r=null===(o=t.card)||void 0===o||null===(o=o.paymentSource)||void 0===o||null===(o=o.card)||void 0===o?void 0:o.billingAddress)&&void 0!==r?r:null;if(p){var d={first_name:t.name.firstName,last_name:t.name.lastName,address_1:p.addressLine1,address_2:p.addressLine2||"",city:p.adminArea2,state:p.adminArea1,postcode:p.postalCode,country:p.countryCode};vt("Setting WooCommerce billing address: ".concat(JSON.stringify(d))),n(d)}"function"==typeof a.setEditingShippingAddress&&a.setEditingShippingAddress(!1),"function"==typeof a.setEditingBillingAddress&&a.setEditingBillingAddress(!1)};const Le=function(t){var e=t.onChangeShippingAddressClick;return React.createElement("a",{className:"wc-block-axo-change-link",role:"button",onClick:function(t){t.preventDefault(),e()}},(0,r.__)("Choose a different shipping address","woocommerce-paypal-payments"))},Re=function(t){var e=t.onChangeShippingAddressClick;return(0,n.useEffect)(function(){var t=document.querySelector("#shipping-fields .wc-block-components-checkout-step__heading");if(t&&!t.querySelector(".wc-block-checkout-axo-block-card__edit")){var r=document.createElement("span");r.className="wc-block-checkout-axo-block-card__edit",t.appendChild(r);var o=(0,n.createRoot)(r);return o.render(React.createElement(Le,{onChangeShippingAddressClick:e})),function(){o.unmount(),r.remove()}}},[e]),null};var Fe=function(t){if(!document.querySelector("#shipping-fields .wc-block-checkout-axo-block-card__edit")){var e=document.createElement("div");document.body.appendChild(e),(0,n.createRoot)(e).render(React.createElement(Re,{onChangeShippingAddressClick:t}))}};function Me(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return Be(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(Be(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Be(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Be(f,"constructor",l),Be(l,"constructor",u),u.displayName="GeneratorFunction",Be(l,o,"GeneratorFunction"),Be(f),Be(f,o,"Generator"),Be(f,r,function(){return this}),Be(f,"toString",function(){return"[object Generator]"}),(Me=function(){return{w:i,m:p}})()}function Be(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Be=function(t,e,n,r){function i(e,n){Be(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Be(t,e,n,r)}function Ue(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var He=function(t,e){vt("Update the phone prefill value: ".concat(e)),t.updatePrefills({phoneNumber:e})};var qe="wc/store/checkout",Je=function(){var t=(0,i.useSelect)(function(t){var e=t(qe);return{isEditingShippingAddress:!e.getEditingShippingAddress||e.getEditingShippingAddress(),isEditingBillingAddress:!e.getEditingBillingAddress||e.getEditingBillingAddress()}},[]),e=t.isEditingShippingAddress,r=t.isEditingBillingAddress,o=(0,i.useDispatch)(qe),a=o.setEditingShippingAddress,c=o.setEditingBillingAddress;return{isEditingShippingAddress:e,isEditingBillingAddress:r,setShippingAddressEditing:(0,n.useCallback)(function(t){"function"==typeof a&&a(t)},[a]),setBillingAddressEditing:(0,n.useCallback)(function(t){"function"==typeof c&&c(t)},[c])}};function We(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return Ve(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(Ve(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Ve(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Ve(f,"constructor",l),Ve(l,"constructor",u),u.displayName="GeneratorFunction",Ve(l,o,"GeneratorFunction"),Ve(f),Ve(f,o,"Generator"),Ve(f,r,function(){return this}),Ve(f,"toString",function(){return"[object Generator]"}),(We=function(){return{w:i,m:p}})()}function Ve(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ve=function(t,e,n,r){function i(e,n){Ve(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},Ve(t,e,n,r)}function Ke(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function $e(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Ke(i,r,o,a,c,"next",t)}function c(t){Ke(i,r,o,a,c,"throw",t)}a(void 0)})}}function Xe(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return ze(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(ze(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,ze(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,ze(f,"constructor",l),ze(l,"constructor",u),u.displayName="GeneratorFunction",ze(l,o,"GeneratorFunction"),ze(f),ze(f,o,"Generator"),ze(f,r,function(){return this}),ze(f,"toString",function(){return"[object Generator]"}),(Xe=function(){return{w:i,m:p}})()}function ze(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}ze=function(t,e,n,r){function i(e,n){ze(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},ze(t,e,n,r)}function Qe(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function Ye(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){Qe(i,r,o,a,c,"next",t)}function c(t){Qe(i,r,o,a,c,"throw",t)}a(void 0)})}}function Ze(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return tn(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(tn(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,tn(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,tn(f,"constructor",l),tn(l,"constructor",u),u.displayName="GeneratorFunction",tn(l,o,"GeneratorFunction"),tn(f),tn(f,o,"Generator"),tn(f,r,function(){return this}),tn(f,"toString",function(){return"[object Generator]"}),(Ze=function(){return{w:i,m:p}})()}function tn(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}tn=function(t,e,n,r){function i(e,n){tn(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},tn(t,e,n,r)}function en(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}const nn=function(t,e,r,o,a){var c=(0,i.useDispatch)(At),u=c.setIsAxoActive,l=c.setIsAxoScriptLoaded,s=c.setShippingAddress,f=c.setCardDetails,p=c.setCardChangeHandler,d=function(t,e,r){var o=(0,i.useDispatch)(At).setIsPayPalLoaded,a=(0,i.useSelect)(function(t){return{isPayPalLoaded:t(At).getIsPayPalLoaded()}},[]).isPayPalLoaded;return(0,n.useEffect)(function(){var n=function(){var n,i=(n=de().m(function n(){var i,c,u,l;return de().w(function(n){for(;;)switch(n.p=n.n){case 0:if(!at()){n.n=1;break}return o(!0),n.a(2);case 1:if(a||!r){n.n=8;break}return i=window.wc_ppcp_axo,n.p=2,n.n=3,fetch(i.ajax.axo_script_attributes.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:i.ajax.axo_script_attributes.nonce})});case 3:return c=n.v,n.n=4,c.json();case 4:if((u=n.v).success){n.n=5;break}return vt("Failed to load axo script attributes: ".concat(u.data.message),"error"),n.a(2);case 5:return n.n=6,fe(t,me(me({},e),{},{script_attributes:me(me({},e.script_attributes),{},{"data-sdk-client-token":u.data.sdk_client_token})}));case 6:o(!0),n.n=8;break;case 7:n.p=7,l=n.v,vt("Error loading PayPal script for namespace: ".concat(t,". Error: ").concat(l),"error");case 8:return n.a(2)}},n,null,[[2,7]])}),function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){he(i,r,o,a,c,"next",t)}function c(t){he(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return i.apply(this,arguments)}}();n()},[e,r,a]),a}(t,e,r),y=function(t){var e=Je().setBillingAddressEditing,r=Ft().setBillingAddress,o=(0,i.useDispatch)(At).setCardDetails;return(0,n.useCallback)(Ye(Xe().m(function n(){var i,a,c,u,l,s,f,p,d,y,v;return Xe().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=4;break}return n.n=1,t.profile.showCardSelector();case 1:if(a=n.v,c=a.selectionChanged,u=a.selectedCard,!c||null==u||null===(i=u.paymentSource)||void 0===i||!i.card){n.n=3;break}return l=u.paymentSource.card,s=l.name,f=l.billingAddress,p="",d="",s&&(y=s.split(" "),p=y[0],d=y.slice(1).join(" ")),v={first_name:p,last_name:d,address_1:(null==f?void 0:f.addressLine1)||"",address_2:(null==f?void 0:f.addressLine2)||"",city:(null==f?void 0:f.adminArea2)||"",state:(null==f?void 0:f.adminArea1)||"",postcode:(null==f?void 0:f.postalCode)||"",country:(null==f?void 0:f.countryCode)||""},n.n=2,Promise.all([new Promise(function(t){o(u),t()}),new Promise(function(t){r(v),t()}),new Promise(function(t){e(!1),t()})]);case 2:n.n=4;break;case 3:vt("Selected card or billing address is missing.","error");case 4:return n.a(2)}},n)})),[t,o,r,e])}(o),v=function(t,e){var r=Je().setShippingAddressEditing,o=Ft().setShippingAddress;return(0,n.useCallback)($e(We().m(function n(){var i,a,c,u,l,s,f;return We().w(function(n){for(;;)switch(n.n){case 0:if(!t){n.n=3;break}return n.n=1,t.profile.showShippingAddressSelector();case 1:if(i=n.v,a=i.selectionChanged,c=i.selectedAddress,!a){n.n=3;break}return e(c),u=c.address,l=c.name,s=c.phoneNumber,f={first_name:l.firstName,last_name:l.lastName,address_1:u.addressLine1,address_2:u.addressLine2||"",city:u.adminArea2,state:u.adminArea1||"",postcode:u.postalCode,country:u.countryCode,phone:s.nationalNumber},n.n=2,new Promise(function(t){o(f),t()});case 2:return n.n=3,new Promise(function(t){r(!1),t()});case 3:return n.a(2)}},n)})),[t,e,o,r])}(o,s),m=Ft(),b=m.shippingAddress,h=m.billingAddress,g=m.setShippingAddress,w=m.setBillingAddress;return function(t){var e,r,o,a,c,u=(0,i.useDispatch)(At).setPhoneNumber,l=(0,i.useSelect)(function(t){return{phoneNumber:t(At).getPhoneNumber()}}).phoneNumber,s=Ft(),f=s.shippingAddress,p=s.billingAddress,d=(0,n.useRef)((e=He,r={timeoutId:null,args:null},o=function(){r.timeoutId&&window.clearTimeout(r.timeoutId),r.timeoutId=null,r.args=null},a=function(){r.timeoutId&&(e.apply(null,r.args||[]),o())},c=function(){o();for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];r.args=e,r.timeoutId=window.setTimeout(a,250)},c.cancel=o,c.flush=a,c)).current,y=(0,n.useCallback)(function(){var t=(null==p?void 0:p.phone)||"",e=(null==f?void 0:f.phone)||"",n=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/^\+?[01]+/,"").replace(/[^0-9]/g,"");return 10===t.length?t:""}(t||e);n&&n!==l&&u(n)},[p,f,l,u]);(0,n.useEffect)(function(){y()},[y]),(0,n.useEffect)(function(){t&&l&&d(t,l)},[d,t,l]),(0,n.useEffect)(function(){return function(){null!=d&&d.cancel&&d.cancel()}},[d])}(a),function(t){var e=(0,i.useDispatch)(At),r=e.setShippingAddress,o=e.setCardDetails,a=e.setIsGuest,c=(0,n.useRef)(!1);(0,n.useEffect)(function(){if(t&&!c.current){var e=new URLSearchParams(window.location.search);if("1"===e.get("ppcp_fastlane_error")){e.delete("ppcp_fastlane_error");var n=new URL(window.location);n.search=e.toString(),window.history.replaceState({},"",n),c.current=!0;var i=function(){var e,n=(e=Ze().m(function e(){var n,i,c,u,l;return Ze().w(function(e){for(;;)switch(e.p=e.n){case 0:if(e.p=0,null==(n=document.getElementById("email"))||!n.value){e.n=3;break}return e.n=1,t.identity.lookupCustomerByEmail(n.value);case 1:if(i=e.v,wp.data.dispatch(At).setIsEmailSubmitted(!0),null==i||!i.customerContextId){e.n=3;break}return c=i.customerContextId,e.n=2,t.identity.triggerAuthenticationFlow(c);case 2:"succeeded"===(null==(u=e.v)?void 0:u.authenticationState)&&(l=u.profileData,a(!1),null!=l&&l.shippingAddress&&r(l.shippingAddress),null!=l&&l.card&&o(l.card),It(!0));case 3:e.n=5;break;case 4:e.p=4,e.v,vt("Failed to restore Fastlane session","warn");case 5:return e.a(2)}},e,null,[[0,4]])}),function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(t){en(i,r,o,a,c,"next",t)}function c(t){en(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return n.apply(this,arguments)}}();i()}}},[t,r,o,a])}(o),(0,n.useEffect)(function(){var t,e,n;t=".wc-block-components-express-payment--checkout, .wp-block-woocommerce-checkout-express-payment-block",e="wc-block-axo-is-authenticated",(n=function(){var n=document.querySelector(t);n?(0,i.select)(At).getIsGuest()?n.classList.remove(e):n.classList.add(e):vt("Authentication class target element not found: ".concat(t),"warn")})(),(0,i.subscribe)(function(){n()}),function(){var t=".wp-block-woocommerce-checkout-fields-block",e="wc-block-axo-email-lookup-completed",n=function(){var n=document.querySelector(t);n?(0,i.select)(At).getIsEmailLookupCompleted()?n.classList.add(e):n.classList.remove(e):vt("Email lookup completed class target element not found: ".concat(t),"warn")};n(),(0,i.subscribe)(function(){n()})}(),function(){var t=".wp-block-woocommerce-checkout-fields-block",e="wc-block-axo-is-loaded",n="wc-block-axo-is-authenticated",r="wc-block-axo-email-lookup-completed",o=function(){var o=document.querySelector(t);if(o){var a=(0,i.select)(At).getIsAxoActive(),c=(0,i.select)(At).getIsGuest(),u=(0,i.select)(At).getIsEmailLookupCompleted();a?o.classList.add(e):o.classList.remove(e),c?o.classList.remove(n):o.classList.add(n),u?o.classList.add(r):o.classList.remove(r)}else vt("Checkout block class target element not found: ".concat(t),"warn")};o(),(0,i.subscribe)(function(){o()})}()},[]),(0,n.useEffect)(function(){if(function(t){var e=document.createElement("div");document.body.appendChild(e),(0,n.createRoot)(e).render((0,n.createElement)(_e,{fastlaneSdk:t}))}(o),d&&o){l(!0),u(!0),p(y);var t=function(t,e,n,r,o,i,a,c,u){return function(){var l,s=(l=Me().m(function l(s){var f,p,d,y,v;return Me().w(function(l){for(;;)switch(l.p=l.n){case 0:if(l.p=0,vt("Email value being looked up: ".concat(s)),t){l.n=1;break}throw new Error("FastlaneSDK is not initialized");case 1:if(t.identity){l.n=2;break}throw new Error("FastlaneSDK identity object is not available");case 2:return l.n=3,t.identity.lookupCustomerByEmail(s);case 3:if(f=l.v,vt("Lookup response: ".concat(JSON.stringify(f))),f&&""===f.customerContextId&&It(!0),f&&f.customerContextId){l.n=4;break}return vt("No customerContextId found in the response","warn"),l.a(2);case 4:return l.n=5,t.identity.triggerAuthenticationFlow(f.customerContextId);case 5:if((p=l.v)&&p.authenticationState){l.n=6;break}throw new Error("Invalid authentication response");case 6:d=p.authenticationState,y=p.profileData,p&&It(!0),"succeeded"===d?(r(o,i),Ct(!1),y&&y.shippingAddress&&e(y.shippingAddress),y&&y.card&&n(y.card),vt("Profile Data: ".concat(JSON.stringify(y))),De(y,a,c),Fe(u)):vt("Authentication failed or did not succeed","warn"),l.n=8;break;case 7:throw l.p=7,v=l.v,vt("Error during email lookup or authentication:\n\t\t\t\t".concat(v)),v;case 8:return l.a(2)}},l,null,[[0,7]])}),function(){var t=this,e=arguments;return new Promise(function(n,r){var o=l.apply(t,e);function i(t){Ue(o,n,r,i,a,"next",t)}function a(t){Ue(o,n,r,i,a,"throw",t)}i(void 0)})});return function(_x){return s.apply(this,arguments)}}()}(o,s,f,Ne,b,h,g,w,v);!function(t){var e=Ge();if(e){var r=function(){var n,r=(n=Pe().m(function n(){var r;return Pe().w(function(n){for(;;)switch(n.p=n.n){case 0:if(!wp.data.select(At).getIsEmailSubmitted()&&e.value){n.n=1;break}return n.a(2);case 1:return wp.data.dispatch(At).setIsEmailSubmitted(!0),o(),n.p=2,n.n=3,t(e.value);case 3:n.n=5;break;case 4:n.p=4,r=n.v,vt("Error during email submission: ".concat(r),"error");case 5:return n.p=5,wp.data.dispatch(At).setIsEmailSubmitted(!1),o(),n.f(5);case 6:return n.a(2)}},n,null,[[2,4,5,6]])}),function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){Te(i,r,o,a,c,"next",t)}function c(t){Te(i,r,o,a,c,"throw",t)}a(void 0)})});return function(){return r.apply(this,arguments)}}();Ie=function(t){var e=wp.data.select(At).getIsAxoActive();"Enter"===t.key&&e&&(t.preventDefault(),r())},e.addEventListener("keydown",Ie),Ce.container||(Ce.container=document.createElement("div"),Ce.container.setAttribute("class","wc-block-axo-email-submit-button-container"),e.parentNode.insertBefore(Ce.container,e.nextSibling),Ce.root=(0,n.createRoot)(Ce.container));var o=function(){Ce.root&&Ce.root.render((0,n.createElement)(Ee,{handleSubmit:r}))};o(),Ce.unsubscribe=wp.data.subscribe(function(){o()})}else vt("Email input element not found. Functionality not added.","warn")}(t)}},[d,o,u,l,b,h,g,w,v,y,s,f,a,p]),d};function rn(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return on(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(on(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,on(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,on(f,"constructor",l),on(l,"constructor",u),u.displayName="GeneratorFunction",on(l,o,"GeneratorFunction"),on(f),on(f,o,"Generator"),on(f,r,function(){return this}),on(f,"toString",function(){return"[object Generator]"}),(rn=function(){return{w:i,m:p}})()}function on(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}on=function(t,e,n,r){function i(e,n){on(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},on(t,e,n,r)}function an(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function cn(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){an(i,r,o,a,c,"next",t)}function c(t){an(i,r,o,a,c,"throw",t)}a(void 0)})}}function un(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return ln(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ln(t,e):void 0}}(t,e)||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 ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var sn={VISA:"visa-light.svg",MASTERCARD:"mastercard-light.svg",AMEX:"amex-light.svg",DISCOVER:"discover-light.svg",DINERS:"dinersclub-light.svg",JCB:"jcb-light.svg",UNIONPAY:"unionpay-light.svg"};const fn=function(t){t.fastlaneSdk,t.showWatermark;var e,r,o=(0,i.useSelect)(function(t){return{card:t(At).getCardDetails()}},[]).card,a=null!==(e=null==o||null===(r=o.paymentSource)||void 0===r?void 0:r.card)&&void 0!==e?e:{},c=a.brand,u=a.lastDigits,l=a.expiry,s=a.name,f=(0,n.useMemo)(function(){return sn[c]?React.createElement("img",{className:"wc-block-axo-block-card__meta-icon",title:c,src:"".concat(window.wc_ppcp_axo.icons_directory).concat(sn[c]),alt:c}):React.createElement("span",null,c)},[c]),p=l?"".concat(l.split("-")[1],"/").concat(l.split("-")[0]):"";return React.createElement("div",{className:"wc-block-checkout-axo-block-card"},React.createElement("div",{className:"wc-block-checkout-axo-block-card__inner"},React.createElement("div",{className:"wc-block-checkout-axo-block-card__content"},React.createElement("div",{className:"wc-block-checkout-axo-block-card__meta"},React.createElement("div",{className:"wc-block-checkout-axo-block-card__meta-logo"},f),React.createElement("div",{className:"wc-block-checkout-axo-block-card__meta-container"},React.createElement("div",{className:"wc-block-checkout-axo-block-card__meta-digits"},"•••• ".concat(u)),React.createElement("div",{className:"wc-block-checkout-axo-block-card__meta-name"},s),React.createElement("div",{className:"wc-block-checkout-axo-block-card__meta-expiry"},p))))))},pn=function(){var t=(0,i.useSelect)(function(t){return{isGuest:t(At).getIsGuest(),cardDetails:t(At).getCardDetails(),cardChangeHandler:t(At).getCardChangeHandler()}},[]),e=t.isGuest,o=t.cardDetails,a=t.cardChangeHandler;return!e&&o&&a?(0,n.createElement)("a",{className:"wc-block-checkout-axo-block-card__edit wc-block-axo-change-link",role:"button",onClick:function(t){t.preventDefault(),a()}},(0,r.__)("Choose a different card","woocommerce-paypal-payments")):null};function dn(){var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof c?r:c,l=Object.create(u.prototype);return yn(l,"_invoke",function(n,r,o){var i,c,u,l=0,s=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return i=e,c=0,u=t,p.n=n,a}};function d(n,r){for(c=n,u=r,e=0;!f&&l&&!o&&e<s.length;e++){var o,i=s[e],d=p.p,y=i[2];n>3?(o=y===r)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=n<2&&d<i[1])?(c=0,p.v=r,p.n=i[1]):d<y&&(o=n<3||i[0]>r||r>y)&&(i[4]=n,i[5]=r,p.n=y,c=0))}if(o||n>1)return a;throw f=!0,r}return function(o,s,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===s&&d(s,y),c=s,u=y;(e=c<2?t:u)||!f;){i||(c?c<3?(c>1&&(p.n=-1),d(c,u)):p.n=u:p.v=u);try{if(l=2,i){if(c||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,c<2&&(c=0)}else 1===c&&(e=i.return)&&e.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=t}else if((e=(f=p.n<0)?u:n.call(r,p))!==a)break}catch(e){i=t,c=1,u=e}finally{l=1}}return{value:e,done:f}}}(n,o,i),!0),l}var a={};function c(){}function u(){}function l(){}e=Object.getPrototypeOf;var s=[][r]?e(e([][r]())):(yn(e={},r,function(){return this}),e),f=l.prototype=c.prototype=Object.create(s);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,yn(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,yn(f,"constructor",l),yn(l,"constructor",u),u.displayName="GeneratorFunction",yn(l,o,"GeneratorFunction"),yn(f),yn(f,o,"Generator"),yn(f,r,function(){return this}),yn(f,"toString",function(){return"[object Generator]"}),(dn=function(){return{w:i,m:p}})()}function yn(t,e,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}yn=function(t,e,n,r){function i(e,n){yn(t,e,function(t){return this._invoke(e,n,t)})}e?o?o(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(i("next",0),i("throw",1),i("return",2))},yn(t,e,n,r)}function vn(t,e,n,r,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}function mn(t){return function(){var e=this,n=arguments;return new Promise(function(r,o){var i=t.apply(e,n);function a(t){vn(i,r,o,a,c,"next",t)}function c(t){vn(i,r,o,a,c,"throw",t)}a(void 0)})}}function bn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var hn=function(t){var e,r,o=t.fastlaneSdk,a=t.onPaymentLoad,c=(e=(0,n.useState)(!1),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return bn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bn(t,e):void 0}}(e,r)||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.")}()),u=c[0],l=c[1],s=(0,i.useSelect)(function(t){return{isGuest:t(At).getIsGuest(),isEmailLookupCompleted:t(At).getIsEmailLookupCompleted(),cardDetails:t(At).getCardDetails()}},[]),f=s.isGuest,p=s.isEmailLookupCompleted,d=s.cardDetails,y=window.wc_ppcp_axo,v=(0,n.useCallback)(mn(dn().m(function t(){var e,n;return dn().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!(f&&p&&u||!f&&!d)){t.n=4;break}return t.p=1,t.n=2,o.FastlaneCardComponent({fields:{cardholderName:{enabled:"yes"===y.name_on_card}}});case 2:e=t.v,document.querySelector("#fastlane-card")&&(e.render("#fastlane-card"),a(e)),t.n=4;break;case 3:t.p=3,n=t.v,vt("Error loading payment component: ".concat(n),"error");case 4:return t.a(2)}},t,null,[[1,3]])})),[f,p,u,d,o,a]);return(0,n.useEffect)(function(){f&&p&&l(!0)},[f,p]),(0,n.useEffect)(function(){u&&v()},[u,v]),function(){var t=wc.wcSettings.getSetting("ppcp-axo-gateway_data");return f&&!p?React.createElement("div",{id:"ppcp-axo-block-radio-content"},t.description):f&&p||!f&&!d?React.createElement("div",{id:"fastlane-card"}):React.createElement(fn,{fastlaneSdk:o,showWatermark:!f})}()};const gn=function(t){var e=t.components,n=t.config,r=window.wc_ppcp_axo,o=e.PaymentMethodIcons;return React.createElement(React.Fragment,null,React.createElement("span",{dangerouslySetInnerHTML:{__html:n.title}}),React.createElement(o,{icons:null==r?void 0:r.card_icons}),React.createElement(pn,null))};function wn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Sn="ppcpBlocksPaypalAxo",On=wc.wcSettings.getSetting("".concat("ppcp-axo-gateway","_data")),kn=function(t){var e,o,a,c,u,l=t.eventRegistration,s=t.emitResponse,f=l.onPaymentSetup,p=(c=(0,n.useState)(null),u=2,function(t){if(Array.isArray(t))return t}(c)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,c=[],u=!0,l=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(c.push(r.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(c,u)||function(t,e){if(t){if("string"==typeof t)return wn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wn(t,e):void 0}}(c,u)||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.")}()),d=p[0],y=p[1],v=function(t){var e=un((0,n.useState)(!1),2),r=e[0],o=e[1],i=un((0,n.useState)(t),2),a=i[0],c=i[1];return(0,n.useEffect)(function(){var t=function(){var t=at();if(t)return c(t),void o(!0);void 0!==window.PayPalCommerceGateway?(c(window.PayPalCommerceGateway),o(!0)):vt("PayPal Commerce Gateway config not loaded.","error")};return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t(),function(){document.removeEventListener("DOMContentLoaded",t)}},[]),{isConfigLoaded:r,ppcpConfig:a}}(On),m=v.isConfigLoaded,b=v.ppcpConfig,h=window.wc_ppcp_axo,g=Rt(Sn,h,b),w=function(t,e,r){var o=(0,i.useSelect)(function(t){return{cardDetails:t(At).getCardDetails()}},[]).cardDetails;return(0,n.useCallback)(cn(rn().m(function n(){var i,a,c;return rn().w(function(n){for(;;)switch(n.n){case 0:if(i=!(null==o||!o.id),(a=null==o?void 0:o.id)||!e){n.n=2;break}return n.n=1,e.getPaymentToken(r).then(function(t){return t.id});case 1:a=n.v;case 2:if(a){n.n=3;break}return c="tokenization error",e||(c="initialization error"),n.a(2,{type:t.responseTypes.ERROR,message:"Could not process the payment (".concat(c,")")});case 3:return n.a(2,{type:t.responseTypes.SUCCESS,meta:{paymentMethodData:{fastlane_member:i,axo_nonce:a}}})}},n)})),[null==o?void 0:o.id,t.responseTypes.ERROR,t.responseTypes.SUCCESS,e,r])}(s,d,(e=Ft(),o=e.billingAddress,a=e.shippingAddress,(0,n.useMemo)(function(){var t,e=((t=o).first_name||t.last_name)&&t.address_1&&t.city&&t.postcode&&t.country?o:a;return{cardholderName:{fullName:"".concat(e.first_name," ").concat(e.last_name)},billingAddress:{addressLine1:e.address_1,addressLine2:e.address_2,adminArea1:e.state,adminArea2:e.city,postalCode:e.postcode,countryCode:e.country}}},[o,a]))),S=nn(Sn,b,m,g,d),O=function(t,e,r){return(0,n.useEffect)(function(){var n=t(e);return function(){n()}},[t,e]),{handlePaymentLoad:(0,n.useCallback)(function(t){r(t)},[r])}}(f,w,y).handlePaymentLoad;return function(){var t=(0,i.useDispatch)(At),e=t.setIsAxoActive,r=t.setIsGuest,o=t.setIsEmailLookupCompleted,a=Ft(),c=a.setShippingAddress,u=a.setBillingAddress;(0,n.useEffect)(function(){return function(){vt("Cleaning up: Restoring WooCommerce fields"),function(t,e){var n;vt("Attempting to restore original fields");try{n=localStorage.getItem("axoOriginalCheckoutFields"),vt("Data retrieved from localStorage: ".concat(JSON.stringify(n)))}catch(t){vt("Error retrieving from localStorage: ".concat(t),"error")}if(n)try{var r=JSON.parse(n);r.shippingAddress?t(r.shippingAddress):vt("No shipping address found in saved data","warn"),r.billingAddress?(vt("Restoring billing address:\n\t\t\t\t\t".concat(JSON.stringify(r.billingAddress))),e(r.billingAddress)):vt("No billing address found in saved data","warn")}catch(t){vt("Error parsing saved data: ".concat(t))}else vt("No data found in localStorage under axoOriginalCheckoutFields","warn")}(c,u)}},[c,u]),(0,n.useEffect)(function(){return function(){var t,i;vt("Cleaning up Axo component"),e(!1),r(!0),o(!1),(t=document.querySelector("#shipping-fields .wc-block-checkout-axo-block-card__edit"))&&((0,n.createRoot)(t).unmount(),t.remove()),je(),Ce.root&&(vt("Removing email functionality"),(i=Ge())&&Ie&&i.removeEventListener("keydown",Ie),Ce.root&&Ce.root.unmount(),Ce.unsubscribe&&Ce.unsubscribe(),Ce.container&&Ce.container.parentNode&&Ce.container.parentNode.removeChild(Ce.container),Ce={container:null,root:null,unsubscribe:null},Ie=null)}},[])}(),m?S?g?React.createElement(hn,{fastlaneSdk:g,onPaymentLoad:O}):React.createElement(React.Fragment,null,(0,r.__)("Loading Fastlane…","woocommerce-paypal-payments")):React.createElement(React.Fragment,null,(0,r.__)("Loading PayPal script…","woocommerce-paypal-payments")):React.createElement(React.Fragment,null,(0,r.__)("Loading configuration…","woocommerce-paypal-payments"))};(0,o.registerPaymentMethod)({name:On.id,label:React.createElement(gn,{config:On}),content:React.createElement(kn,null),edit:(0,n.createElement)(On.title),ariaLabel:On.title,canMakePayment:function(){return!0},supports:{showSavedCards:!0,features:On.supports}})})();
Save File
Cancel