woocommerce-paypal-payments/assets/ppcp-sdk-v6-js-boot.js

1 line
No EOL
60 KiB
JavaScript

(()=>{"use strict";function t(r){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(r)}function r(){var t,n,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function u(r,o,i,a){var u=o&&o.prototype instanceof l?o:l,f=Object.create(u.prototype);return e(f,"_invoke",function(r,e,o){var i,a,u,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,a=0,u=t,p.n=e,c}};function y(r,e){for(a=r,u=e,n=0;!s&&l&&!o&&n<f.length;n++){var o,i=f[n],y=p.p,d=i[2];r>3?(o=d===e)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=r<2&&y<i[1])?(a=0,p.v=e,p.n=i[1]):y<d&&(o=r<3||i[0]>e||e>d)&&(i[4]=r,i[5]=e,p.n=d,a=0))}if(o||r>1)return c;throw s=!0,e}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),a=f,u=d;(n=a<2?t:u)||!s;){i||(a?a<3?(a>1&&(p.n=-1),y(a,u)):p.n=u:p.v=u);try{if(l=2,i){if(a||(o="next"),n=i[o]){if(!(n=n.call(i,u)))throw TypeError("iterator result is not an object");if(!n.done)return n;u=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((n=(s=p.n<0)?u:r.call(e,p))!==c)break}catch(r){i=t,a=1,u=r}finally{l=1}}return{value:n,done:s}}}(r,i,a),!0),f}var c={};function l(){}function f(){}function s(){}n=Object.getPrototypeOf;var p=[][i]?n(n([][i]())):(e(n={},i,function(){return this}),n),y=s.prototype=l.prototype=Object.create(p);function d(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,e(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t}return f.prototype=s,e(y,"constructor",s),e(s,"constructor",f),f.displayName="GeneratorFunction",e(s,a,"GeneratorFunction"),e(y),e(y,a,"Generator"),e(y,i,function(){return this}),e(y,"toString",function(){return"[object Generator]"}),(r=function(){return{w:u,m:d}})()}function e(t,r,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}e=function(t,r,n,o){function a(r,n){e(t,r,function(t){return this._invoke(r,n,t)})}r?i?i(t,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[r]=n:(a("next",0),a("throw",1),a("return",2))},e(t,r,n,o)}function n(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function o(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?n(Object(e),!0).forEach(function(r){i(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):n(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function i(r,e,n){return(e=function(r){var e=function(r){if("object"!=t(r)||!r)return r;var e=r[Symbol.toPrimitive];if(void 0!==e){var n=e.call(r,"string");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(r);return"symbol"==t(e)?e:e+""}(e))in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function a(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function u(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function u(t){a(i,n,o,u,c,"next",t)}function c(t){a(i,n,o,u,c,"throw",t)}u(void 0)})}}function c(_x){return l.apply(this,arguments)}function l(){return l=u(r().m(function t(e){var n,i,a,u,c,l,f,s,p,y,d=arguments;return r().w(function(t){for(;;)switch(t.n){case 0:return n=e.endpoint,i=e.nonce,a=d.length>1&&void 0!==d[1]?d[1]:{},t.n=1,fetch(n,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify(o({nonce:i},a))});case 1:return u=t.v,t.n=2,u.json();case 2:if((c=t.v).success){t.n=3;break}throw(y=new Error((null===(l=c.data)||void 0===l?void 0:l.message)||"")).isUserFacing=Boolean(null===(f=c.data)||void 0===f?void 0:f.message),y.errors=null===(s=c.data)||void 0===s?void 0:s.errors,y.refresh=Boolean(null===(p=c.data)||void 0===p?void 0:p.refresh),y;case 3:return t.a(2,c.data)}},t)})),l.apply(this,arguments)}function f(t,r,e){return s.apply(this,arguments)}function s(){return(s=u(r().m(function t(e,n,o){return r().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,fetch(n,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",Nonce:e.nonce},body:JSON.stringify(o)});case 1:if(t.v.ok){t.n=2;break}throw new Error("Store API request failed.");case 2:return t.a(2)}},t)}))).apply(this,arguments)}function p(){return"undefined"!=typeof jQuery||(console.error("[PPCP SDK v6] jQuery not present"),!1)}function y(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return d(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(d(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,d(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,d(s,"constructor",l),d(l,"constructor",c),c.displayName="GeneratorFunction",d(l,o,"GeneratorFunction"),d(s),d(s,o,"Generator"),d(s,n,function(){return this}),d(s,"toString",function(){return"[object Generator]"}),(y=function(){return{w:i,m:p}})()}function d(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}d=function(t,r,e,n){function i(r,e){d(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},d(t,r,e,n)}function v(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,r)||function(t,r){if(t){if("string"==typeof t)return m(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?m(t,r):void 0}}(t,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.")}()}function m(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function h(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}var b={},g=null,w={product:"product-details",cart:"cart",checkout:"checkout","mini-cart":"mini-cart"};function _(t){return b[t]||(b[t]=new Promise(function(r,e){var n=document.createElement("script");n.src=t,n.async=!0,n.onload=r,n.onerror=function(){n.remove(),delete b[t],e(new Error("Failed to load PayPal SDK v6 script."))},document.head.appendChild(n)})),b[t]}function j(t,r){return g||(g=function(_x,t){return S.apply(this,arguments)}(t,r).catch(function(t){throw g=null,t})),g}function S(){var t;return t=y().m(function t(r,e){var n,o,i,a,u;return y().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Promise.all([_(r.sdk_url),c(r.ajax.client_token)]);case 1:if(o=t.v,i=v(o,2),a=i[1],null!==(n=window.paypal)&&void 0!==n&&n.createInstance){t.n=2;break}throw new Error("PayPal SDK v6 global not found after script load.");case 2:return t.n=3,window.paypal.createInstance({clientToken:a.client_token,components:["paypal-payments","venmo-payments"],pageType:w[e]||"checkout",locale:r.locale});case 3:return u=t.v,document.dispatchEvent(new CustomEvent("ppcp-sdk-v6-ready",{detail:{sdkInstance:u}})),t.a(2,u)}},t)}),S=function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){h(i,n,o,a,u,"next",t)}function u(t){h(i,n,o,a,u,"throw",t)}a(void 0)})},S.apply(this,arguments)}function O(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return P(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(P(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,P(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,P(s,"constructor",l),P(l,"constructor",c),c.displayName="GeneratorFunction",P(l,o,"GeneratorFunction"),P(s),P(s,o,"Generator"),P(s,n,function(){return this}),P(s,"toString",function(){return"[object Generator]"}),(O=function(){return{w:i,m:p}})()}function P(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}P=function(t,r,e,n){function i(r,e){P(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},P(t,r,e,n)}function k(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function E(_x,t){return T.apply(this,arguments)}function T(){var t;return t=O().m(function t(r,e){var n,o,i,a,u,c;return O().w(function(t){for(;;)switch(t.n){case 0:return n=e.currencyCode,o=e.countryCode,i=e.amount,a={currencyCode:n},o&&(a.countryCode=o),i&&(a.amount=i),t.n=1,r.findEligibleMethods(a);case 1:if(u=t.v,(c={paypal:u.isEligible("paypal"),venmo:u.isEligible("venmo"),paylater:u.isEligible("paylater"),payLaterDetails:null}).paylater)try{c.payLaterDetails=u.getDetails("paylater")}catch(t){}return t.a(2,c)}},t)}),T=function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){k(i,n,o,a,u,"next",t)}function u(t){k(i,n,o,a,u,"throw",t)}a(void 0)})},T.apply(this,arguments)}function x(t){return x="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},x(t)}function A(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,C(n.key),n)}}function C(t){var r=function(t){if("object"!=x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=x(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==x(r)?r:r+""}var F=function(){return t=function t(r,e,n,o){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=r,this.quantity=e,this.variations=n,this.extra=o},(r=[{key:"data",value:function(){return{id:this.id,quantity:this.quantity,variations:this.variations,extra:this.extra}}}])&&A(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();const G=F;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 M(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,n)}return e}function D(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?M(Object(e),!0).forEach(function(r){q(t,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):M(Object(e)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))})}return t}function q(t,r,e){return(r=L(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}function N(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L(n.key),n)}}function L(t){var r=function(t){if("object"!=I(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=I(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==I(r)?r:r+""}function R(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(R=function(){return!!t})()}function Q(){return Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,r,e){var n=function(t,r){for(;!{}.hasOwnProperty.call(t,r)&&null!==(t=H(t)););return t}(t,r);if(n){var o=Object.getOwnPropertyDescriptor(n,r);return o.get?o.get.call(arguments.length<3?t:e):o.value}},Q.apply(null,arguments)}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function U(t,r){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},U(t,r)}var K=function(t){function r(t,e,n,o){var i;return function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,r),(i=function(t,r,e){return r=H(r),function(t,r){if(r&&("object"==I(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,R()?Reflect.construct(r,e||[],H(t).constructor):r.apply(t,e))}(this,r,[t,e,null,o])).booking=n,i}return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&U(t,r)}(r,t),e=r,n=[{key:"data",value:function(){return D(D({},(t=r,e=this,"function"==typeof(n=Q(H(1&3?t.prototype:t),"data",e))?function(t){return n.apply(e,t)}:n)([])),{},{booking:this.booking});var t,e,n}}],n&&N(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}(G);const B=K;function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function J(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V(n.key),n)}}function V(t){var r=function(t){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=$(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==$(r)?r:r+""}var W=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"form.woocommerce-checkout";!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.target=r}return r=t,n=[{key:"fullPage",value:function(){return new t(window)}}],(e=[{key:"setTarget",value:function(t){this.target=t}},{key:"block",value:function(){jQuery(this.target).block({message:null,overlayCSS:{background:"#fff",opacity:.6},baseZ:1e4})}},{key:"unblock",value:function(){jQuery(this.target).unblock()}}])&&J(r.prototype,e),n&&J(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,e,n}();const Y=W;function Z(t){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(t)}function z(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,r)||function(t,r){if(t){if("string"==typeof t)return X(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?X(t,r):void 0}}(t,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.")}()}function X(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}var tt={"#billing_email":["email_address"],"#billing_last_name":["name","surname"],"#billing_first_name":["name","given_name"],"#billing_country":["address","country_code"],"#billing_address_1":["address","address_line_1"],"#billing_address_2":["address","address_line_2"],"#billing_state":["address","admin_area_1"],"#billing_city":["address","admin_area_2"],"#billing_postcode":["address","postal_code"],"#billing_phone":["phone"]};function rt(t){var r,e,n,o,i,a,u,c;return{email_address:t.email_address,phone:t.phone,name:{surname:null===(r=t.name)||void 0===r?void 0:r.surname,given_name:null===(e=t.name)||void 0===e?void 0:e.given_name},address:{country_code:null===(n=t.address)||void 0===n?void 0:n.country_code,address_line_1:null===(o=t.address)||void 0===o?void 0:o.address_line_1,address_line_2:null===(i=t.address)||void 0===i?void 0:i.address_line_2,admin_area_1:null===(a=t.address)||void 0===a?void 0:a.admin_area_1,admin_area_2:null===(u=t.address)||void 0===u?void 0:u.admin_area_2,postal_code:null===(c=t.address)||void 0===c?void 0:c.postal_code}}}function et(){var t,r,e=null!==(t=null===(r=window)||void 0===r||null===(r=r.PayPalCommerceGateway)||void 0===r?void 0:r.payer)&&void 0!==t?t:window._PpcpPayerSessionDetails;if(!e)return null;var n,o,i,a=(i={},Object.entries(tt).forEach(function(t){var r=z(t,2),e=r[0],n=r[1],o=function(t){var r;return null===(r=document.querySelector(t))||void 0===r?void 0:r.value}(e);o&&function(t,r,e){for(var n=t,o=0;o<r.length-1;o++)n=n[r[o]]=n[r[o]]||{};n[r[r.length-1]]=e}(i,n,o)}),i.phone&&"string"==typeof i.phone&&(i.phone={phone_type:"HOME",phone_number:{national_number:i.phone}}),i);return a?(n=a,(o=function(t,r){for(var e=0,n=Object.entries(r);e<n.length;e++){var i=z(n[e],2),a=i[0],u=i[1];null!=u&&("object"===Z(u)?t[a]=o(t[a]||{},u):t[a]=u)}return t})(rt(e),rt(n))):rt(e)}function nt(t){return nt="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},nt(t)}function ot(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return it(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?it(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var _n=0,n=function(){};return{s:n,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:n}}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(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}function it(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function at(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ut(n.key),n)}}function ut(t){var r=function(t){if("object"!=nt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=nt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nt(r)?r:r+""}var ct=function(){return t=function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.cartItemKeys=r},(r=[{key:"getEndpoint",value:function(){var t="/?wc-ajax=%%endpoint%%";return"undefined"!=typeof wc_cart_fragments_params&&wc_cart_fragments_params.wc_ajax_url&&(t=wc_cart_fragments_params.wc_ajax_url),t.toString().replace("%%endpoint%%","remove_from_cart")}},{key:"addFromPurchaseUnits",value:function(t){var r,e=ot(t||[]);try{for(e.s();!(r=e.n()).done;){var n,o=ot(r.value.items||[]);try{for(o.s();!(n=o.n()).done;){var i=n.value;i.cart_item_key&&this.cartItemKeys.push(i.cart_item_key)}}catch(t){o.e(t)}finally{o.f()}}}catch(t){e.e(t)}finally{e.f()}return this}},{key:"removeFromCart",value:function(){var t=this;return new Promise(function(r,e){if(t.cartItemKeys&&t.cartItemKeys.length){var n,o=t.cartItemKeys.length,i=0,a=function(){++i>=o&&r()},u=ot(t.cartItemKeys);try{for(u.s();!(n=u.n()).done;){var c=n.value,l=new URLSearchParams;l.append("cart_item_key",c),c?fetch(t.getEndpoint(),{method:"POST",credentials:"same-origin",body:l}).then(function(t){return t.json()}).then(function(){a()}).catch(function(){a()}):a()}}catch(t){u.e(t)}finally{u.f()}}else r()})}}])&&at(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();const lt=ct;function ft(t){return ft="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},ft(t)}function st(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,r)||yt(t,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.")}()}function pt(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=yt(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var _n=0,n=function(){};return{s:n,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:n}}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(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}function yt(t,r){if(t){if("string"==typeof t)return dt(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?dt(t,r):void 0}}function dt(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function vt(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mt(n.key),n)}}function mt(t){var r=function(t){if("object"!=ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=ft(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(r)?r:r+""}var ht=function(){return t=function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)},r=[{key:"getPrefixedFields",value:function(t,r){var e,n={},o=pt(new FormData(t).entries());try{for(o.s();!(e=o.n()).done;){var i=st(e.value,2),a=i[0],u=i[1];r&&!a.startsWith(r)||(n[a]=u)}}catch(t){o.e(t)}finally{o.f()}return n}},{key:"getFilteredFields",value:function(t,r,e){var n,o=new FormData(t),i={},a={},u=pt(o.entries());try{var c=function(){var t=st(n.value,2),o=t[0],u=t[1];if(-1!==o.indexOf("[]")){var c=o;a[c]=a[c]||0,o=o.replace("[]","[".concat(a[c],"]")),a[c]++}return o?r&&-1!==r.indexOf(o)||e&&e.some(function(t){return o.startsWith(t)})?0:void(i[o]=u):0};for(u.s();!(n=u.n()).done;)c()}catch(t){u.e(t)}finally{u.f()}return i}}],null&&vt(t.prototype,null),r&&vt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();function bt(t){return bt="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},bt(t)}function gt(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wt(n.key),n)}}function wt(t){var r=function(t){if("object"!=bt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=bt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==bt(r)?r:r+""}var _t,jt,St,Ot=function(){return t=function t(){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t)},r=[{key:"cleanHashParams",value:function(){var t=this;if(window.location.hash){var r=window.location.hash.substring(1).split("&").filter(function(r){var e=r.split("=")[0];return!t.PAYPAL_PARAMS.includes(e)});if(r.length>0){var e="#"+r.join("&");window.history.replaceState(null,"",window.location.pathname+window.location.search+e)}else window.history.replaceState(null,"",window.location.pathname+window.location.search)}}},{key:"isResumeFlow",value:function(){return!!window.location.hash&&window.location.hash.substring(1).split("&").some(function(t){return"switch_initiated_time"===t.split("=")[0]})}},{key:"reloadButtonsIfRequired",value:function(t){this.isResumeFlow()&&(this.cleanHashParams(),jQuery(t).trigger("ppcp-reload-buttons"))}}],null&&gt(t.prototype,null),r&&gt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r}();_t=Ot,St=["onApprove","token","PayerID","payerID","button_session_id","billingToken","orderID","switch_initiated_time","onCancel","onError"],(jt=wt(jt="PAYPAL_PARAMS"))in _t?Object.defineProperty(_t,jt,{value:St,enumerable:!0,configurable:!0,writable:!0}):_t[jt]=St;const Pt=Ot;function kt(t){return kt="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},kt(t)}function Et(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function Tt(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xt(n.key),n)}}function xt(t){var r=function(t){if("object"!=kt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=kt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kt(r)?r:r+""}var At=function(){return function(t,r){return r&&Tt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(r,e,n,o){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=r,this.cartUpdater=e,this.formElement=n,this.errorHandler=o,this.cartHelper=null},[{key:"subscriptionsConfiguration",value:function(t){var r=this;return{createSubscription:function(e,n){return n.subscription.create({plan_id:t,custom_id:r.config.subscription_custom_id})},onApprove:function(t,e){fetch(r.config.ajax.approve_subscription.endpoint,{method:"POST",credentials:"same-origin",body:JSON.stringify({nonce:r.config.ajax.approve_subscription.nonce,order_id:t.orderID,subscription_id:t.subscriptionID})}).then(function(t){return t.json()}).then(function(){var t=r.getSubscriptionProducts();fetch(r.config.ajax.change_cart.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:r.config.ajax.change_cart.nonce,products:t})}).then(function(t){return t.json()}).then(function(t){if(!t.success)throw console.log(t),Error(t.data.message);location.href=r.config.redirect})})},onError:function(t){console.error(t),Pt.reloadButtonsIfRequired(r.config.button.wrapper)}}}},{key:"getSubscriptionProducts",value:function(){var t=document.querySelector('[name="add-to-cart"]').value;return[new G(t,1,this.variations(),this.extraFields())]}},{key:"configuration",value:function(){var t,r,e=this;return{createOrder:this.createOrder(),onApprove:(t=this,r=this.errorHandler,function(e,n){var o=Y.fullPage();o.block();var i=!t.config.vaultingEnabled||"venmo"!==e.paymentSource,a={nonce:t.config.ajax.approve_order.nonce,order_id:e.orderID,funding_source:window.ppcpFundingSource,should_create_wc_order:i};return i&&e.payer&&(a.payer=e.payer),i&&e.shippingAddress&&(a.shipping_address=e.shippingAddress),fetch(t.config.ajax.approve_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(a)}).then(function(t){return t.json()}).then(function(e){var o;if(!e.success)return r.genericError(),n.restart().catch(function(){r.genericError()});var i,a=null===(o=e.data)||void 0===o?void 0:o.order_received_url;i=a||t.config.redirect,setTimeout(function(){window.location.href=i},200)}).finally(function(){o.unblock()})}),onError:function(t){e.refreshMiniCart(),t&&"create-order-error"===t.type||e.errorHandler.genericError(),Pt.reloadButtonsIfRequired(e.config.button.wrapper)},onCancel:function(){e.isBookingProduct()?e.cleanCart():e.refreshMiniCart(),Pt.reloadButtonsIfRequired(e.config.button.wrapper)}}}},{key:"getProducts",value:function(){var t=this;if(this.isBookingProduct()){var r=document.querySelector('[name="add-to-cart"]').value;return[new B(r,1,ht.getPrefixedFields(this.formElement,"wc_bookings_field"),this.extraFields())]}if(this.isGroupedProduct()){var e=[];return this.formElement.querySelectorAll('input[type="number"]').forEach(function(r){if(r.value){var n=r.getAttribute("name").match(/quantity\[([\d]*)\]/);if(2===n.length){var o=parseInt(n[1]),i=parseInt(r.value);e.push(new G(o,i,null,t.extraFields()))}}}),e}var n=document.querySelector('[name="add-to-cart"]').value,o=document.querySelector('[name="quantity"]').value,i=this.variations();return[new G(n,o,i,this.extraFields())]}},{key:"extraFields",value:function(){return ht.getFilteredFields(this.formElement,["add-to-cart","quantity","product_id","variation_id"],["attribute_","wc_bookings_field"])}},{key:"createOrder",value:function(){var t=this;this.cartHelper=null;var r=this.errorHandler;return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.clear(),t.cartUpdater.update(function(e){t.cartHelper=(new lt).addFromPurchaseUnits(e);var n=et(),o=void 0!==t.config.bn_codes[t.config.context]?t.config.bn_codes[t.config.context]:"";return fetch(t.config.ajax.create_order.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify({nonce:t.config.ajax.create_order.nonce,purchase_units:e,payer:n,bn_code:o,payment_method:"ppcp-gateway",funding_source:window.ppcpFundingSource,context:t.config.context})}).then(function(t){return t.json()}).then(function(t){if(!t.success)throw console.error(t),r.clear(),r.message(t.data.message),{type:"create-order-error"};return t.data.id})},t.getProducts(),o.updateCartOptions||{})}}},{key:"updateCart",value:function(t){return this.cartUpdater.update(function(t){return t},this.getProducts(),t)}},{key:"variations",value:function(){return this.hasVariations()?function(t){return function(t){if(Array.isArray(t))return Et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,r){if(t){if("string"==typeof t)return Et(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Et(t,r):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.formElement.querySelectorAll("[name^='attribute_']")).map(function(t){return{value:t.value,name:t.name}}):null}},{key:"hasVariations",value:function(){return this.formElement.classList.contains("variations_form")}},{key:"isGroupedProduct",value:function(){return this.formElement.classList.contains("grouped_form")}},{key:"isBookingProduct",value:function(){return!!this.formElement.querySelector(".wc-booking-product-id")}},{key:"cleanCart",value:function(){var t=this;this.cartHelper.removeFromCart().then(function(){t.refreshMiniCart()}).catch(function(r){t.refreshMiniCart()})}},{key:"refreshMiniCart",value:function(){jQuery(document.body).trigger("wc_fragment_refresh")}}])}();const Ct=At;function Ft(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return Gt(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(Gt(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Gt(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,Gt(s,"constructor",l),Gt(l,"constructor",c),c.displayName="GeneratorFunction",Gt(l,o,"GeneratorFunction"),Gt(s),Gt(s,o,"Generator"),Gt(s,n,function(){return this}),Gt(s,"toString",function(){return"[object Generator]"}),(Ft=function(){return{w:i,m:p}})()}function Gt(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Gt=function(t,r,e,n){function i(r,e){Gt(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},Gt(t,r,e,n)}function It(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function Mt(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){It(i,n,o,a,u,"next",t)}function u(t){It(i,n,o,a,u,"throw",t)}a(void 0)})}}var Dt=function(t){return window.location.assign(t)};function qt(){var t=document.querySelector('form [name="add-to-cart"]')||document.querySelector('form [name="product_id"]'),r=null==t?void 0:t.closest("form");if(!r)throw new Error("Product form not found.");return new Ct(null,null,r,null).getProducts().map(function(t){return t.data()})}function Nt(_x,t,r){return Lt.apply(this,arguments)}function Lt(){return(Lt=Mt(Ft().m(function t(r,e,n){var o,i,a,u,l,f;return Ft().w(function(t){for(;;)switch(t.n){case 0:if(o=[],"product"!==e){t.n=2;break}return t.n=1,c(r.ajax.change_cart,{products:qt()});case 1:o=t.v;case 2:return i={context:e,purchase_units:o,payment_method:"ppcp-gateway",funding_source:n||"paypal",save_order_in_session:1},"checkout"===e&&((a=document.querySelector("form.checkout"))&&(i.form_encoded=new URLSearchParams(new FormData(a)).toString(),i.createaccount=!(null===(u=a.querySelector("#createaccount"))||void 0===u||!u.checked)),(l=et())&&(i.payer=l)),t.n=3,c(r.ajax.create_order,i);case 3:return f=t.v,t.a(2,{orderId:f.id})}},t)}))).apply(this,arguments)}function Rt(t,r,e,n){return Qt.apply(this,arguments)}function Qt(){return(Qt=Mt(Ft().m(function t(r,e,n,o){var i,a,u,l,f,s;return Ft().w(function(t){for(;;)switch(t.p=t.n){case 0:return a=!r.vaulting_enabled||"venmo"!==n,t.p=1,t.n=2,c(r.ajax.approve_order,{order_id:o,funding_source:n,should_create_wc_order:a});case 2:u=t.v,t.n=6;break;case 3:if(t.p=3,s=t.v,a){t.n=4;break}throw s;case 4:return t.n=5,c(r.ajax.approve_order,{order_id:o,funding_source:n,should_create_wc_order:!1});case 5:u=t.v;case 6:if(null===(i=u)||void 0===i||!i.order_received_url){t.n=7;break}return Dt(u.order_received_url),t.a(2);case 7:if("checkout"!==e||"undefined"==typeof jQuery){t.n=8;break}if(!(l=jQuery("form.checkout")).length){t.n=8;break}return(f=document.querySelector("#payment_method_ppcp-gateway"))&&!f.checked&&(f.checked=!0,jQuery(f).trigger("change")),l.trigger("submit"),t.a(2);case 8:Dt(r.urls.checkout);case 9:return t.a(2)}},t,null,[[1,3]])}))).apply(this,arguments)}function Ht(t,r){return Ut.apply(this,arguments)}function Ut(){return(Ut=Mt(Ft().m(function t(r,e){return Ft().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,c(r.ajax.update_shipping,{order_id:e});case 1:return t.a(2)}},t)}))).apply(this,arguments)}function Kt(t){return Bt.apply(this,arguments)}function Bt(){return(Bt=Mt(Ft().m(function t(r){var e,n,o,i,a,u,c;return Ft().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,fetch(r.ajax.wc_store_api.cart,{credentials:"same-origin"});case 1:return i=t.v,t.n=2,i.json();case 2:if(a=t.v,u=null!==(e=null==a||null===(n=a.totals)||void 0===n?void 0:n.currency_minor_unit)&&void 0!==e?e:2,c=parseInt(null==a||null===(o=a.totals)||void 0===o?void 0:o.total_price,10),!isNaN(c)){t.n=3;break}return t.a(2,"");case 3:return t.a(2,(c/Math.pow(10,u)).toFixed(u));case 4:return t.p=4,t.v,t.a(2,"")}},t,null,[[0,4]])}))).apply(this,arguments)}function $t(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return Jt(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(Jt(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Jt(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,Jt(s,"constructor",l),Jt(l,"constructor",c),c.displayName="GeneratorFunction",Jt(l,o,"GeneratorFunction"),Jt(s),Jt(s,o,"Generator"),Jt(s,n,function(){return this}),Jt(s,"toString",function(){return"[object Generator]"}),($t=function(){return{w:i,m:p}})()}function Jt(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Jt=function(t,r,e,n){function i(r,e){Jt(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},Jt(t,r,e,n)}function Vt(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function Wt(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){Vt(i,n,o,a,u,"next",t)}function u(t){Vt(i,n,o,a,u,"throw",t)}a(void 0)})}}function Yt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{country:t.countryCode||"",state:t.adminArea1||t.state||"",postcode:t.postalCode||"",city:t.adminArea2||t.city||""}}function Zt(){return(Zt=Wt($t().m(function t(r,e){var n;return $t().w(function(t){for(;;)switch(t.n){case 0:return n=e.ajax.wc_store_api,t.n=1,f(n,n.update_customer,{shipping_address:Yt(r.shippingAddress)});case 1:return t.n=2,Ht(e,r.orderId);case 2:return t.a(2)}},t)}))).apply(this,arguments)}function zt(){return(zt=Wt($t().m(function t(r,e){var n,o,i;return $t().w(function(t){for(;;)switch(t.n){case 0:if(o=e.ajax.wc_store_api,!(i=null===(n=r.selectedShippingOption)||void 0===n?void 0:n.id)){t.n=1;break}return t.n=1,f(o,o.select_shipping_rate,{rate_id:i});case 1:return t.n=2,Ht(e,r.orderId);case 2:return t.a(2)}},t)}))).apply(this,arguments)}function Xt(t){return Xt="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},Xt(t)}function tr(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,rr(n.key),n)}}function rr(t){var r=function(t){if("object"!=Xt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=Xt(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xt(r)?r:r+""}var er=function(){return function(t,r){return r&&tr(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(r,e){!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),this.genericErrorText=r,this.wrapper=e},[{key:"genericError",value:function(){this.clear(),this.message(this.genericErrorText)}},{key:"appendPreparedErrorMessageElement",value:function(t){this._getMessageContainer().replaceWith(t)}},{key:"message",value:function(t){this._addMessage(t),this._scrollToMessages()}},{key:"messages",value:function(t){var r=this;t.forEach(function(t){return r._addMessage(t)}),this._scrollToMessages()}},{key:"currentHtml",value:function(){return this._getMessageContainer().outerHTML}},{key:"_addMessage",value:function(t){if("undefined"!=typeof String&&!Xt(String)||0===t.length)throw new Error("A new message text must be a non-empty string.");var r=this._getMessageContainer(),e=this._prepareMessageElement(t);r.appendChild(e)}},{key:"_scrollToMessages",value:function(){jQuery.scroll_to_notices(jQuery(".woocommerce-error"))}},{key:"_getMessageContainer",value:function(){var t=document.querySelector("ul.woocommerce-error");return null===t&&((t=document.createElement("ul")).setAttribute("class","woocommerce-error"),t.setAttribute("role","alert"),jQuery(this.wrapper).prepend(t)),t}},{key:"_prepareMessageElement",value:function(t){var r=document.createElement("li");return r.innerHTML=t,r}},{key:"clear",value:function(){jQuery(".woocommerce-error, .woocommerce-message").remove()}}])}();const nr=er;var or={};function ir(t){console.error("[PPCP SDK v6]",t);var r=document.querySelector(".woocommerce-notices-wrapper")||document.querySelector(".woocommerce")||document.body,e=new nr(or.generic_error||"",r);return null!=t&&t.refresh&&p()&&jQuery(document.body).trigger("update_checkout"),Array.isArray(null==t?void 0:t.errors)&&t.errors.length?(e.clear(),void e.messages(t.errors)):null!=t&&t.isUserFacing&&t.message?(e.clear(),void e.message(t.message)):void(or.generic_error&&e.genericError())}function ar(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return ur(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(ur(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,ur(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,ur(s,"constructor",l),ur(l,"constructor",c),c.displayName="GeneratorFunction",ur(l,o,"GeneratorFunction"),ur(s),ur(s,o,"Generator"),ur(s,n,function(){return this}),ur(s,"toString",function(){return"[object Generator]"}),(ar=function(){return{w:i,m:p}})()}function ur(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}ur=function(t,r,e,n){function i(r,e){ur(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},ur(t,r,e,n)}function cr(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}var lr={paypal:"createPayPalOneTimePaymentSession",venmo:"createVenmoOneTimePaymentSession",paylater:"createPayLaterOneTimePaymentSession"};function fr(t){"product"===t&&p()&&jQuery(document.body).trigger("wc_fragment_refresh")}function sr(t,r,e,n){var o,i,a={onApprove:function(t){return(o=ar().m(function o(){return ar().w(function(o){for(;;)switch(o.p=o.n){case 0:return o.p=0,o.n=1,Rt(e,n,r,t.orderId);case 1:o.n=3;break;case 2:o.p=2,ir(o.v);case 3:return o.a(2)}},o,null,[[0,2]])}),function(){var t=this,r=arguments;return new Promise(function(e,n){var i=o.apply(t,r);function a(t){cr(i,e,n,a,u,"next",t)}function u(t){cr(i,e,n,a,u,"throw",t)}a(void 0)})})();var o},onCancel:function(){fr(n)},onError:function(t){fr(n),ir(t)}};return"paypal"===r&&(null===(o=e.shipping)||void 0===o?void 0:o.handle_in_paypal)&&((null===(i=e.shipping)||void 0===i?void 0:i.need_shipping)||"product"===n)&&(a.onShippingAddressChange=function(t){return function(_x,t){return Zt.apply(this,arguments)}(t,e)},a.onShippingOptionsChange=function(t){return function(t,r){return zt.apply(this,arguments)}(t,e)}),t[lr[r]](a)}function pr(t,r){return function(t){if(Array.isArray(t))return t}(t)||function(t,r){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===r){if(Object(e)!==e)return;c=!1}else for(;!(c=(n=i.call(e)).done)&&(u.push(n.value),u.length!==r);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,r)||function(t,r){if(t){if("string"==typeof t)return yr(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?yr(t,r):void 0}}(t,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.")}()}function yr(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function dr(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return vr(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(vr(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,vr(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,vr(s,"constructor",l),vr(l,"constructor",c),c.displayName="GeneratorFunction",vr(l,o,"GeneratorFunction"),vr(s),vr(s,o,"Generator"),vr(s,n,function(){return this}),vr(s,"toString",function(){return"[object Generator]"}),(dr=function(){return{w:i,m:p}})()}function vr(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}vr=function(t,r,e,n){function i(r,e){vr(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},vr(t,r,e,n)}function mr(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function hr(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){mr(i,n,o,a,u,"next",t)}function u(t){mr(i,n,o,a,u,"throw",t)}a(void 0)})}}var br={paypal:{tagName:"paypal-button",type:"pay"},venmo:{tagName:"venmo-button",type:"pay"},paylater:{tagName:"paypal-pay-later-button",type:""}};function gr(t,r,e,n,o){var i=document.createElement(t);return r&&i.setAttribute("type",r),e.colorClass&&(i.className=e.colorClass),e.borderRadius&&i.style.setProperty("--paypal-button-border-radius",e.borderRadius),e.height&&(i.style.height=e.height),i.addEventListener("click",hr(dr().m(function t(){return dr().w(function(t){for(;;)switch(t.p=t.n){case 0:return t.p=0,t.n=1,n.start({presentationMode:"auto"},o());case 1:t.n=3;break;case 2:t.p=2,ir(t.v);case 3:return t.a(2)}},t,null,[[0,2]])}))),i}function wr(t){var r=t.wrapper,e=t.sessions,n=t.styles,o=t.createOrderForFunding,i=t.payLaterDetails;r.innerHTML="";for(var a=[],u=0,c=Object.entries(br);u<c.length;u++){var l=pr(c[u],2),f=l[0],s=l[1];if(e[f]&&("paylater"!==f||null!=i&&i.productCode)){var p=gr(s.tagName,s.type,n,e[f],o(f));"paylater"===f&&(p.productCode=i.productCode,i.countryCode&&(p.countryCode=i.countryCode)),r.appendChild(p),a.push(p)}}return a}function _r(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return jr(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?jr(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var _n=0,n=function(){};return{s:n,n:function(){return _n>=t.length?{done:!0}:{done:!1,value:t[_n++]}},e:function(t){throw t},f:n}}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(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){a=!0,o=t},f:function(){try{i||null==e.return||e.return()}finally{if(a)throw o}}}}function jr(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function Sr(){var t,r,e="function"==typeof Symbol?Symbol:{},n=e.iterator||"@@iterator",o=e.toStringTag||"@@toStringTag";function i(e,n,o,i){var c=n&&n.prototype instanceof u?n:u,l=Object.create(c.prototype);return Or(l,"_invoke",function(e,n,o){var i,u,c,l=0,f=o||[],s=!1,p={p:0,n:0,v:t,a:y,f:y.bind(t,4),d:function(r,e){return i=r,u=0,c=t,p.n=e,a}};function y(e,n){for(u=e,c=n,r=0;!s&&l&&!o&&r<f.length;r++){var o,i=f[r],y=p.p,d=i[2];e>3?(o=d===n)&&(c=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=y&&((o=e<2&&y<i[1])?(u=0,p.v=n,p.n=i[1]):y<d&&(o=e<3||i[0]>n||n>d)&&(i[4]=e,i[5]=n,p.n=d,u=0))}if(o||e>1)return a;throw s=!0,n}return function(o,f,d){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&y(f,d),u=f,c=d;(r=u<2?t:c)||!s;){i||(u?u<3?(u>1&&(p.n=-1),y(u,c)):p.n=c:p.v=c);try{if(l=2,i){if(u||(o="next"),r=i[o]){if(!(r=r.call(i,c)))throw TypeError("iterator result is not an object");if(!r.done)return r;c=r.value,u<2&&(u=0)}else 1===u&&(r=i.return)&&r.call(i),u<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((r=(s=p.n<0)?c:e.call(n,p))!==a)break}catch(r){i=t,u=1,c=r}finally{l=1}}return{value:r,done:s}}}(e,o,i),!0),l}var a={};function u(){}function c(){}function l(){}r=Object.getPrototypeOf;var f=[][n]?r(r([][n]())):(Or(r={},n,function(){return this}),r),s=l.prototype=u.prototype=Object.create(f);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Or(t,o,"GeneratorFunction")),t.prototype=Object.create(s),t}return c.prototype=l,Or(s,"constructor",l),Or(l,"constructor",c),c.displayName="GeneratorFunction",Or(l,o,"GeneratorFunction"),Or(s),Or(s,o,"Generator"),Or(s,n,function(){return this}),Or(s,"toString",function(){return"[object Generator]"}),(Sr=function(){return{w:i,m:p}})()}function Or(t,r,e,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Or=function(t,r,e,n){function i(r,e){Or(t,r,function(t){return this._invoke(r,e,t)})}r?o?o(t,r,{value:e,enumerable:!n,configurable:!n,writable:!n}):t[r]=e:(i("next",0),i("throw",1),i("return",2))},Or(t,r,e,n)}function Pr(t,r,e,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void e(t)}u.done?r(c):Promise.resolve(c).then(n,o)}function kr(t){return function(){var r=this,e=arguments;return new Promise(function(n,o){var i=t.apply(r,e);function a(t){Pr(i,n,o,a,u,"next",t)}function u(t){Pr(i,n,o,a,u,"throw",t)}a(void 0)})}}!function(t){if(t){var r;r=t.labels,or=r||{};var e=[];t.page_context&&e.push({context:t.page_context,wrapperSelector:t.wrapper}),e.push({context:"mini-cart",wrapperSelector:t.mini_cart_wrapper});var n=t.page_context||"mini-cart",o=t.amount,i=null,a={};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",y):y(),p()&&(jQuery(document.body).on("updated_checkout wc_fragments_loaded wc_fragments_refreshed",y),jQuery(document.body).on("updated_cart_totals added_to_cart removed_from_cart",function(){(function(){return d.apply(this,arguments)})().catch(function(t){console.error("[PPCP SDK v6]",t)})}))}function u(){return i||(i=kr(Sr().m(function r(){var e;return Sr().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,j(t,n);case 1:return e=r.v,r.a(2,E(e,{currencyCode:t.currency,countryCode:t.buyer_country,amount:o}))}},r)}))().catch(function(t){throw i=null,t})),i}function c(t){return a[t]||(a[t]=function(_x){return l.apply(this,arguments)}(t).catch(function(r){throw delete a[t],r})),a[t]}function l(){return(l=kr(Sr().m(function r(e){var o,i,a,c,l,f;return Sr().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,j(t,n);case 1:return o=r.v,r.n=2,u();case 2:for(i=r.v,a={payLaterDetails:i.payLaterDetails,map:{}},c=0,l=["paypal","venmo","paylater"];c<l.length;c++)i[f=l[c]]&&(a.map[f]=sr(o,f,t,e));return r.a(2,a)}},r)}))).apply(this,arguments)}function f(t){return s.apply(this,arguments)}function s(){return(s=kr(Sr().m(function r(e){var n,o,i,a;return Sr().w(function(r){for(;;)switch(r.n){case 0:if((n=document.querySelector(e.wrapperSelector))&&!(n.childElementCount>0)){r.n=1;break}return r.a(2);case 1:return r.n=2,c(e.context);case 2:o=r.v,i=o.map,a=o.payLaterDetails,wr({wrapper:n,sessions:i,styles:t.button_styles[e.context]||{},createOrderForFunding:function(r){return function(){return Nt(t,e.context,r)}},payLaterDetails:a});case 3:return r.a(2)}},r)}))).apply(this,arguments)}function y(){var t,r=_r(e);try{for(r.s();!(t=r.n()).done;)f(t.value).catch(function(t){console.error("[PPCP SDK v6]",t)})}catch(t){r.e(t)}finally{r.f()}}function d(){return(d=kr(Sr().m(function r(){var n,c,l,f,s,p,d,v,m,h,b,g;return Sr().w(function(r){for(;;)switch(r.n){case 0:if(!i){r.n=2;break}return r.n=1,i.catch(function(){return null});case 1:b=r.v,r.n=3;break;case 2:b=null;case 3:return n=b,r.n=4,Kt(t);case 4:if(g=r.v){r.n=5;break}g=o;case 5:return o=g,i=null,r.n=6,u();case 6:if(c=r.v,l=["paypal","venmo","paylater"],!n||l.some(function(t){return n[t]!==c[t]})){for(f=0,s=Object.keys(a);f<s.length;f++)p=s[f],delete a[p];d=_r(e);try{for(d.s();!(v=d.n()).done;)m=v.value,(h=document.querySelector(m.wrapperSelector))&&(h.innerHTML="")}catch(t){d.e(t)}finally{d.f()}}y();case 7:return r.a(2)}},r)}))).apply(this,arguments)}}(window.wc_ppcp_sdk_v6)})();