(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.blocks,r=window.wp.i18n,n=window.wp.element,a=window.wp.blockEditor,o=window.wp.components,c=window.React;var i,l,s,u=e.n(c);!function(e){e.INITIAL="initial",e.PENDING="pending",e.REJECTED="rejected",e.RESOLVED="resolved"}(i||(i={})),function(e){e.LOADING_STATUS="setLoadingStatus",e.RESET_OPTIONS="resetOptions",e.SET_BRAINTREE_INSTANCE="braintreeInstance"}(l||(l={})),function(e){e.NUMBER="number",e.CVV="cvv",e.EXPIRATION_DATE="expirationDate",e.EXPIRATION_MONTH="expirationMonth",e.EXPIRATION_YEAR="expirationYear",e.POSTAL_CODE="postalCode"}(s||(s={}));var p=function(){return p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r because window.").concat(c,".").concat(i," is undefined."),s="string"==typeof a?a:a.join(",");if(!s.includes(r)){var u=[s,r].filter(Boolean).join();l+="\nTo fix the issue, add '".concat(r,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n``.")}return l}function w(e){var t=e,r=m;t[r];var n=d(t,[r+""]);return"react-paypal-js-".concat(function(e){for(var t="",r=0;r component. Failed to initialize: ".concat(e))})}return!1===S.current.isEligible()?(x(!1),B):w.current?(S.current.render(w.current).catch(function(e){null!==w.current&&0!==w.current.children.length&&D(function(){throw new Error("Failed to render component. ".concat(e))})}),B):B},f(f([k],y,!0),[b.fundingSource],!1)),(0,c.useEffect)(function(){null!==_&&(!0===l?_.disable().catch(function(){}):_.enable().catch(function(){}))},[l,_]),u().createElement(u().Fragment,null,L?u().createElement("div",{ref:w,style:h,className:g}):s)};function j(e,t){void 0===t&&(t={});var r=document.createElement("script");return r.src=e,Object.keys(t).forEach(function(e){r.setAttribute(e,t[e]),"data-csp-nonce"===e&&r.setAttribute("nonce",t["data-csp-nonce"])}),r}function k(e,t){if(void 0===t&&(t=Promise),C(e,t),"undefined"==typeof document)return t.resolve(null);var r=function(e){var t,r,n=e.sdkBaseUrl,a=e.environment,o=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(n=Object.getOwnPropertySymbols(e);a component. ".concat(e))})})}(e.Marks(p({},a)))}},[i,a.fundingSource]),u().createElement(u().Fragment,null,m?u().createElement("div",{ref:s,className:r}):n)};_.displayName="PayPalMarks";var T=function(e){var t=e.className,r=void 0===t?"":t,n=e.forceReRender,a=void 0===n?[]:n,o=d(e,["className","forceReRender"]),i=N()[0],l=i.isResolved,s=i.options,m=(0,c.useRef)(null),y=(0,c.useRef)(null),b=(0,c.useState)(null)[1];return(0,c.useEffect)(function(){if(!1!==l){var e=P(s[v]);if(void 0===e||void 0===e.Messages)return b(function(){throw new Error(E({reactComponentName:T.displayName,sdkComponentKey:"messages",sdkRequestedComponents:s.components,sdkDataNamespace:s[v]}))});y.current=e.Messages(p({},o)),y.current.render(m.current).catch(function(e){null!==m.current&&0!==m.current.children.length&&b(function(){throw new Error("Failed to render component. ".concat(e))})})}},f([l],a,!0)),u().createElement("div",{ref:m,className:r})};T.displayName="PayPalMessages";var A=function(e){var t,r=e.options,n=void 0===r?{clientId:"test"}:r,a=e.children,o=e.deferLoading,s=void 0!==o&&o,d=(0,c.useReducer)(S,{options:p(p({},n),(t={},t.dataJsSdkLibrary=y,t[b]=y,t[m]="".concat(w(n)),t)),loadingStatus:s?i.INITIAL:i.PENDING}),f=d[0],v=d[1];return(0,c.useEffect)(function(){if(!1===s&&f.loadingStatus===i.INITIAL)return v({type:l.LOADING_STATUS,value:i.PENDING});if(f.loadingStatus===i.PENDING){var e=!0;return k(f.options).then(function(){e&&v({type:l.LOADING_STATUS,value:i.RESOLVED})}).catch(function(t){console.error("".concat("Failed to load the PayPal JS SDK script."," ").concat(t)),e&&v({type:l.LOADING_STATUS,value:{state:i.REJECTED,message:String(t)}})}),function(){e=!1}}},[f.options,s,f.loadingStatus]),u().createElement(O.Provider,{value:p(p({},f),{dispatch:v})},a)};function L(){}function x(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function o(r,n,a,o){var l=n&&n.prototype instanceof i?n:i,s=Object.create(l.prototype);return D(s,"_invoke",function(r,n,a){var o,i,l,s=0,u=a||[],p=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,r){return o=t,i=0,l=e,d.n=r,c}};function f(r,n){for(i=r,l=n,t=0;!p&&s&&!a&&t3?(a=m===n)&&(l=o[(i=o[4])?5:(i=3,3)],o[4]=o[5]=e):o[0]<=f&&((a=r<2&&fn||n>m)&&(o[4]=r,o[5]=n,d.n=m,i=0))}if(a||r>1)return c;throw p=!0,n}return function(a,u,m){if(s>1)throw TypeError("Generator is already running");for(p&&1===u&&f(u,m),i=u,l=m;(t=i<2?e:l)||!p;){o||(i?i<3?(i>1&&(d.n=-1),f(i,l)):d.n=l:d.v=l);try{if(s=2,o){if(i||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,i<2&&(i=0)}else 1===i&&(t=o.return)&&t.call(o),i<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),i=1);o=e}else if((t=(p=d.n<0)?l:r.call(n,d))!==c)break}catch(t){o=e,i=1,l=t}finally{s=1}}return{value:t,done:p}}}(r,a,o),!0),s}var c={};function i(){}function l(){}function s(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(D(t={},n,function(){return this}),t),p=s.prototype=i.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,D(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return l.prototype=s,D(p,"constructor",s),D(s,"constructor",l),l.displayName="GeneratorFunction",D(s,a,"GeneratorFunction"),D(p),D(p,a,"Generator"),D(p,n,function(){return this}),D(p,"toString",function(){return"[object Generator]"}),(x=function(){return{w:o,m:d}})()}function D(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}D=function(e,t,r,n){function o(t,r){D(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(o("next",0),o("throw",1),o("return",2))},D(e,t,r,n)}function B(e,t,r,n,a,o,c){try{var i=e[o](c),l=i.value}catch(e){return void r(e)}i.done?t(l):Promise.resolve(l).then(n,a)}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r