403Webshell
Server IP : 162.0.217.223  /  Your IP : 216.73.216.150
Web Server : LiteSpeed
System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : mypckeys ( 1539)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mypckeys/www/wp-content/plugins/woo-stripe-payment/packages/blocks/build/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mypckeys/www/wp-content/plugins/woo-stripe-payment/packages/blocks/build/commons.js
/*! For license information please see commons.js.LICENSE.txt */
(self.webpackChunkwcStripeBlocks=self.webpackChunkwcStripeBlocks||[]).push([[223],{926:function(t,e,r){!function(t,e){"use strict";function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t){return o="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},o(t)}function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r,n,o={},a=Object.keys(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function c(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=t&&("undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"]);if(null!=r){var n,o,a=[],i=!0,c=!1;try{for(r=r.call(t);!(i=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);i=!0);}catch(t){c=!0,o=t}finally{try{i||null==r.return||r.return()}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(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 u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var s,f,p,y,m={exports:{}};m.exports=function(){if(y)return p;y=1;var t=f?s:(f=1,s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");function e(){}function r(){}return r.resetWarningCache=e,p=function(){function n(e,r,n,o,a,i){if(i!==t){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function o(){return n}n.isRequired=n;var a={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a}}()();var h=l(m.exports),d=function(t,r,n){var o=!!n,a=e.useRef(n);e.useEffect((function(){a.current=n}),[n]),e.useEffect((function(){if(!o||!t)return function(){};var e=function(){a.current&&a.current.apply(a,arguments)};return t.on(r,e),function(){t.off(r,e)}}),[o,r,t,a])},v=function(t){var r=e.useRef(t);return e.useEffect((function(){r.current=t}),[t]),r.current},b=function(t){return null!==t&&"object"===o(t)},g="[object Object]",w=function t(e,r){if(!b(e)||!b(r))return e===r;var n=Array.isArray(e);if(n!==Array.isArray(r))return!1;var o=Object.prototype.toString.call(e)===g;if(o!==(Object.prototype.toString.call(r)===g))return!1;if(!o&&!n)return e===r;var a=Object.keys(e),i=Object.keys(r);if(a.length!==i.length)return!1;for(var c={},u=0;u<a.length;u+=1)c[a[u]]=!0;for(var l=0;l<i.length;l+=1)c[i[l]]=!0;var s=Object.keys(c);if(s.length!==a.length)return!1;var f=e,p=r;return s.every((function(e){return t(f[e],p[e])}))},O=function(t,e,r){return b(t)?Object.keys(t).reduce((function(o,i){var c=!b(e)||!w(t[i],e[i]);return r.includes(i)?(c&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),o):c?n(n({},o||{}),{},a({},i,t[i])):o}),null):null},E="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",S=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E;if(null===t||b(e=t)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return t;throw new Error(r)},P=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E;if(function(t){return b(t)&&"function"==typeof t.then}(t))return{tag:"async",stripePromise:Promise.resolve(t).then((function(t){return S(t,e)}))};var r=S(t,e);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},j=function(t){t&&t._registerWrapper&&t.registerAppInfo&&(t._registerWrapper({name:"react-stripe-js",version:"2.7.0"}),t.registerAppInfo({name:"react-stripe-js",version:"2.7.0",url:"https://stripe.com/docs/stripe-js/react"}))},x=e.createContext(null);x.displayName="ElementsContext";var _=function(t,e){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(e," in an <Elements> provider."));return t},k=function(t){var r=t.stripe,n=t.options,o=t.children,a=e.useMemo((function(){return P(r)}),[r]),i=c(e.useState((function(){return{stripe:"sync"===a.tag?a.stripe:null,elements:"sync"===a.tag?a.stripe.elements(n):null}})),2),u=i[0],l=i[1];e.useEffect((function(){var t=!0,e=function(t){l((function(e){return e.stripe?e:{stripe:t,elements:t.elements(n)}}))};return"async"!==a.tag||u.stripe?"sync"!==a.tag||u.stripe||e(a.stripe):a.stripePromise.then((function(r){r&&t&&e(r)})),function(){t=!1}}),[a,u,n]);var s=v(r);e.useEffect((function(){null!==s&&s!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")}),[s,r]);var f=v(n);return e.useEffect((function(){if(u.elements){var t=O(n,f,["clientSecret","fonts"]);t&&u.elements.update(t)}}),[n,f,u.elements]),e.useEffect((function(){j(u.stripe)}),[u.stripe]),e.createElement(x.Provider,{value:u},o)};k.propTypes={stripe:h.any,options:h.object};var C=function(t){var r=e.useContext(x);return _(r,t)},L=function(t){return(0,t.children)(C("mounts <ElementsConsumer>"))};L.propTypes={children:h.func.isRequired};var A=["on","session"],M=e.createContext(null);M.displayName="CustomCheckoutSdkContext";var D=function(t,e){if(!t)throw new Error("Could not find CustomCheckoutProvider context; You need to wrap the part of your app that ".concat(e," in an <CustomCheckoutProvider> provider."));return t},T=e.createContext(null);T.displayName="CustomCheckoutContext";var N=function(t){var r=t.stripe,o=t.options,a=t.children,u=e.useMemo((function(){return P(r,"Invalid prop `stripe` supplied to `CustomCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")}),[r]),l=c(e.useState(null),2),s=l[0],f=l[1],p=c(e.useState((function(){return{stripe:"sync"===u.tag?u.stripe:null,customCheckoutSdk:null}})),2),y=p[0],m=p[1],h=function(t,e){m((function(r){return r.stripe&&r.customCheckoutSdk?r:{stripe:t,customCheckoutSdk:e}}))},d=e.useRef(!1);e.useEffect((function(){var t=!0;return"async"!==u.tag||y.stripe?"sync"===u.tag&&u.stripe&&!d.current&&(d.current=!0,u.stripe.initCustomCheckout(o).then((function(t){t&&(h(u.stripe,t),t.on("change",f))}))):u.stripePromise.then((function(e){e&&t&&!d.current&&(d.current=!0,e.initCustomCheckout(o).then((function(t){t&&(h(e,t),t.on("change",f))})))})),function(){t=!1}}),[u,y,o,f]);var g=v(r);e.useEffect((function(){null!==g&&g!==r&&console.warn("Unsupported prop change on CustomCheckoutProvider: You cannot change the `stripe` prop after setting it.")}),[g,r]);var O=v(o);e.useEffect((function(){var t,e;if(y.customCheckoutSdk){!o.clientSecret||b(O)||w(o.clientSecret,O.clientSecret)||console.warn("Unsupported prop change: options.client_secret is not a mutable property.");var r=null==O||null===(t=O.elementsOptions)||void 0===t?void 0:t.appearance,n=null==o||null===(e=o.elementsOptions)||void 0===e?void 0:e.appearance;n&&!w(n,r)&&y.customCheckoutSdk.changeAppearance(n)}}),[o,O,y.customCheckoutSdk]),e.useEffect((function(){j(y.stripe)}),[y.stripe]);var E=e.useMemo((function(){return t=y.customCheckoutSdk,e=s,t?(t.on,t.session,n(n({},i(t,A)),e||t.session())):null;var t,e}),[y.customCheckoutSdk,s]);return y.customCheckoutSdk?e.createElement(M.Provider,{value:y},e.createElement(T.Provider,{value:E},a)):null};N.propTypes={stripe:h.any,options:h.shape({clientSecret:h.string.isRequired,elementsOptions:h.object}).isRequired};var I=function(t){var r=e.useContext(M),n=e.useContext(x);if(r&&n)throw new Error("You cannot wrap the part of your app that ".concat(t," in both <CustomCheckoutProvider> and <Elements> providers."));return r?D(r,t):_(n,t)},R=function(t,r){var n,o="".concat((n=t).charAt(0).toUpperCase()+n.slice(1),"Element"),a=r?function(t){I("mounts <".concat(o,">"));var r=t.id,n=t.className;return e.createElement("div",{id:r,className:n})}:function(r){var n,a=r.id,i=r.className,u=r.options,l=void 0===u?{}:u,s=r.onBlur,f=r.onFocus,p=r.onReady,y=r.onChange,m=r.onEscape,h=r.onClick,b=r.onLoadError,g=r.onLoaderStart,w=r.onNetworksChange,E=r.onConfirm,S=r.onCancel,P=r.onShippingAddressChange,j=r.onShippingRateChange,x=I("mounts <".concat(o,">")),_="elements"in x?x.elements:null,k="customCheckoutSdk"in x?x.customCheckoutSdk:null,C=c(e.useState(null),2),L=C[0],A=C[1],M=e.useRef(null),D=e.useRef(null);d(L,"blur",s),d(L,"focus",f),d(L,"escape",m),d(L,"click",h),d(L,"loaderror",b),d(L,"loaderstart",g),d(L,"networkschange",w),d(L,"confirm",E),d(L,"cancel",S),d(L,"shippingaddresschange",P),d(L,"shippingratechange",j),d(L,"change",y),p&&(n="expressCheckout"===t?p:function(){p(L)}),d(L,"ready",n),e.useLayoutEffect((function(){if(null===M.current&&null!==D.current&&(_||k)){var e=null;k?e=k.createElement(t,l):_&&(e=_.create(t,l)),M.current=e,A(e),e&&e.mount(D.current)}}),[_,k,l]);var T=v(l);return e.useEffect((function(){if(M.current){var t=O(l,T,["paymentRequest"]);t&&M.current.update(t)}}),[l,T]),e.useLayoutEffect((function(){return function(){if(M.current&&"function"==typeof M.current.destroy)try{M.current.destroy(),M.current=null}catch(t){}}}),[]),e.createElement("div",{id:a,className:i,ref:D})};return a.propTypes={id:h.string,className:h.string,onChange:h.func,onBlur:h.func,onFocus:h.func,onReady:h.func,onEscape:h.func,onClick:h.func,onLoadError:h.func,onLoaderStart:h.func,onNetworksChange:h.func,onConfirm:h.func,onCancel:h.func,onShippingAddressChange:h.func,onShippingRateChange:h.func,options:h.object},a.displayName=o,a.__elementType=t,a},B="undefined"==typeof window,G=e.createContext(null);G.displayName="EmbeddedCheckoutProviderContext";var F=function(){var t=e.useContext(G);if(!t)throw new Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return t},U=B?function(t){var r=t.id,n=t.className;return F(),e.createElement("div",{id:r,className:n})}:function(t){var r=t.id,n=t.className,o=F().embeddedCheckout,a=e.useRef(!1),i=e.useRef(null);return e.useLayoutEffect((function(){return!a.current&&o&&null!==i.current&&(o.mount(i.current),a.current=!0),function(){if(a.current&&o)try{o.unmount(),a.current=!1}catch(t){}}}),[o]),e.createElement("div",{ref:i,id:r,className:n})},Y=R("auBankAccount",B),q=R("card",B),V=R("cardNumber",B),$=R("cardExpiry",B),W=R("cardCvc",B),J=R("fpxBank",B),K=R("iban",B),H=R("idealBank",B),X=R("p24Bank",B),z=R("epsBank",B),Z=R("payment",B),Q=R("expressCheckout",B),tt=R("paymentRequestButton",B),et=R("linkAuthentication",B),rt=R("address",B),nt=R("shippingAddress",B),ot=R("paymentMethodMessaging",B),at=R("affirmMessage",B),it=R("afterpayClearpayMessage",B);t.AddressElement=rt,t.AffirmMessageElement=at,t.AfterpayClearpayMessageElement=it,t.AuBankAccountElement=Y,t.CardCvcElement=W,t.CardElement=q,t.CardExpiryElement=$,t.CardNumberElement=V,t.CustomCheckoutProvider=N,t.Elements=k,t.ElementsConsumer=L,t.EmbeddedCheckout=U,t.EmbeddedCheckoutProvider=function(t){var r=t.stripe,n=t.options,o=t.children,a=e.useMemo((function(){return P(r,"Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")}),[r]),i=e.useRef(null),u=e.useRef(null),l=c(e.useState({embeddedCheckout:null}),2),s=l[0],f=l[1];e.useEffect((function(){if(!u.current&&!i.current){var t=function(t){u.current||i.current||(u.current=t,i.current=u.current.initEmbeddedCheckout(n).then((function(t){f({embeddedCheckout:t})})))};"async"!==a.tag||u.current||!n.clientSecret&&!n.fetchClientSecret?"sync"!==a.tag||u.current||!n.clientSecret&&!n.fetchClientSecret||t(a.stripe):a.stripePromise.then((function(e){e&&t(e)}))}}),[a,n,s,u]),e.useEffect((function(){return function(){s.embeddedCheckout?(i.current=null,s.embeddedCheckout.destroy()):i.current&&i.current.then((function(){i.current=null,s.embeddedCheckout&&s.embeddedCheckout.destroy()}))}}),[s.embeddedCheckout]),e.useEffect((function(){j(u)}),[u]);var p=v(r);e.useEffect((function(){null!==p&&p!==r&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")}),[p,r]);var y=v(n);return e.useEffect((function(){null!=y&&(null!=n?(void 0===n.clientSecret&&void 0===n.fetchClientSecret&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),null!=y.clientSecret&&n.clientSecret!==y.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=y.fetchClientSecret&&n.fetchClientSecret!==y.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=y.onComplete&&n.onComplete!==y.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it.")):console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them."))}),[y,n]),e.createElement(G.Provider,{value:s},o)},t.EpsBankElement=z,t.ExpressCheckoutElement=Q,t.FpxBankElement=J,t.IbanElement=K,t.IdealBankElement=H,t.LinkAuthenticationElement=et,t.P24BankElement=X,t.PaymentElement=Z,t.PaymentMethodMessagingElement=ot,t.PaymentRequestButtonElement=tt,t.ShippingAddressElement=nt,t.useCustomCheckout=function(){!function(t){var r=e.useContext(M);D(r,t)}("calls useCustomCheckout()");var t=e.useContext(T);if(!t)throw new Error("Could not find CustomCheckout Context; You need to wrap the part of your app that calls useCustomCheckout() in an <CustomCheckoutProvider> provider.");return t},t.useElements=function(){return C("calls useElements()").elements},t.useStripe=function(){return I("calls useStripe()").stripe}}(e,r(609))},427:(t,e,r)=>{"use strict";r.d(e,{c:()=>l});var n="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",i=null,c=Promise.resolve().then((function(){return t=null,null!==i||(i=new Promise((function(e,r){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&t&&console.warn(a),window.Stripe)e(window.Stripe);else try{var i=function(){for(var t=document.querySelectorAll('script[src^="'.concat(n,'"]')),e=0;e<t.length;e++){var r=t[e];if(o.test(r.src))return r}return null}();i&&t?console.warn(a):i||(i=function(t){var e=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(n).concat(e);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(r),r}(t)),i.addEventListener("load",(function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))})),i.addEventListener("error",(function(){r(new Error("Failed to load Stripe.js"))}))}catch(t){return void r(t)}else e(null)}))),i;var t})),u=!1;c.catch((function(t){u||console.warn(t)}));var l=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];u=!0;var n=Date.now();return c.then((function(t){return function(t,e,r){if(null===t)return null;var n=t.apply(void 0,e);return function(t,e){t&&t._registerWrapper&&t._registerWrapper({name:"stripe-js",version:"1.54.2",startTime:e})}(n,r),n}(t,e,n)}))}},510:(t,e,r)=>{"use strict";r.r(e);var n=r(703),o=r(926),a=r(279),i=r(0),c=r(954),u=r(834),l=r(87);function s(t){return s="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},s(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var p=(0,n.getSetting)("stripeBNPLCart_data").stripe_affirm;if((0,c.Mb)()&&p&&p.cartEnabled){var y=function(t){var e,r,n,a,c,u,y,m=t.cart.cartTotals,h=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=s(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=s(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==s(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({amount:parseInt(m.total_price),currency:m.currency_code},p.cartMessageOptions);return r=(e={amount:parseInt(m.total_price),currency:m.currency_code}).amount,a=void 0===(n=e.billingCountry)?null:n,c=e.currency,u=p.requirements,y=p.accountCountry,(a?c in u&&y===a&&5e3<=r&&r<=3e6:c in u&&5e3<=r&&r<=3e6)?l.createElement(i.TotalsWrapper,null,l.createElement("div",{className:"wc-block-components-totals-item wc-stripe-cart-message-container stripe_affirm"},l.createElement(o.AffirmMessageElement,{options:h}))):null};(0,a.registerPlugin)("wc-stripe-blocks-affirm",{render:function(){var t=function(t){return l.createElement(u.A,null,l.createElement(o.Elements,{stripe:c.eV,options:{locale:p.elementOptions.locale}},l.createElement(y,t)))};return l.createElement(i.ExperimentalOrderMeta,null,l.createElement(t,null))},scope:"woocommerce-checkout"})}var m=r(87);function h(t){return h="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},h(t)}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==h(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var b=(0,n.getSetting)("stripeBNPLCart_data").stripe_afterpay;if((0,c.Mb)()&&b&&b.cartEnabled){var g=function(t){var e=t.cart,r=e.billingAddress,n=e.cartTotals,a=n.currency_code,c=n.currency_minor_unit,u=n.total_price,l=r.country,s=function(t){var e=t.total,r=t.currency,n=!1,o=t.country,a=b.requiredParams,i=b.accountCountry,c=!!a.hasOwnProperty(r)&&a[r];if(c){var u=null==c?void 0:c[0];Array.isArray(u)||(u=[u]),n=u.indexOf(i)>-1&&("EUR"!==r||!o||i===o)&&e>(null==c?void 0:c[1])&&e<(null==c?void 0:c[2])}return n}({total:parseInt(u)/Math.pow(10,c),currency:a,country:l});if(s)return m.createElement(i.TotalsWrapper,null,m.createElement("div",{className:"wc-block-components-totals-item wc-stripe-cart-message-container stripe_afterpay"},m.createElement(o.AfterpayClearpayMessageElement,{options:v(v({},b.cartMessageOptions),{amount:parseInt(u),currency:a,isCartEligible:!0})})))};(0,a.registerPlugin)("wc-stripe-blocks-afterpay",{render:function(t){var e=function(t){return m.createElement(u.A,null,m.createElement(o.Elements,{stripe:c.eV,options:{locale:b.elementOptions.locale}},m.createElement(g,t)))};return m.createElement(i.ExperimentalOrderMeta,null,m.createElement(e,null))},scope:"woocommerce-checkout"})}var w=r(87);function O(t){return O="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},O(t)}function E(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var S=(0,n.getSetting)("stripeBNPLCart_data").stripe_klarna;if((0,c.Mb)()&&S&&S.cartEnabled){var P=S.requiredParams,j=function(t){var e=t.cart.cartTotals,r=e.currency_code,n=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=O(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=O(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==O(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({amount:parseInt(e.total_price),currency:e.currency_code,paymentMethodTypes:["klarna"]},S.messageOptions);return(0,c.jc)({requiredParams:P,currency:r})?w.createElement(i.TotalsWrapper,null,w.createElement("div",{className:"wc-block-components-totals-item wc-stripe-cart-message-container stripe_klarna"},w.createElement(o.PaymentMethodMessagingElement,{options:n}))):null};(0,a.registerPlugin)("wc-stripe-blocks-klarna",{render:function(){var t=function(t){return w.createElement(u.A,null,w.createElement(o.Elements,{stripe:c.eV,options:{locale:S.elementOptions.locale}},w.createElement(j,t)))};return w.createElement(i.ExperimentalOrderMeta,null,w.createElement(t,null))},scope:"woocommerce-checkout"})}},979:(t,e,r)=>{"use strict";r.d(e,{Fy:()=>S,YR:()=>_,g5:()=>p,in:()=>n.i});var n=r(214),o=r(942),a=r.n(o);r(87);var i=r(87),c=r(87);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)}var l=["getData","content"];function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==u(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var p=function(t){var e=t.getData,r=t.content,n=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,l),o=r,a=e("description"),u=(0,i.useRef)(null);return(0,i.useEffect)((function(){u.current&&0==u.current.childNodes.length&&u.current.classList.add("no-content")})),c.createElement(c.Fragment,null,a&&c.createElement(y,{desc:a,payment_method:e("name")}),c.createElement("div",{ref:u,className:"wc-stripe-blocks-payment-method-content"},c.createElement(o,f(f({},n),{},{getData:e}))))},y=function(t){var e=t.desc,r=t.payment_method;return c.createElement("div",{className:"wc-stripe-blocks-payment-method__desc ".concat(r)},c.createElement("p",null,e))},m=r(455),h=r.n(m),d=r(954),v=r(87);function b(t){return b="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},b(t)}function g(){g=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",d={};function v(){}function w(){}function O(){}var E={};l(E,i,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,i)&&(E=P);var j=O.prototype=v.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==b(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(b(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=l(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function w(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function O(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return E(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?E(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 E(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var S=function(t){var e=t.i18n,r=t.active,n=t.paymentMethodType,o=t.cardFormComplete,a=void 0!==o&&o,c=t.onChange,u=void 0===c?null:c,l=t.createPaymentMethod,s=O((0,i.useState)(null),2),f=s[0],p=s[1],y=O((0,i.useState)(""),2),m=y[0],b=y[1],E=O((0,i.useState)(!1),2),S=E[0],j=E[1];return(0,i.useEffect)((function(){r&&a&&"card"===n&&(j(!0),b(""),l().then(function(){var t,e=(t=g().mark((function t(e){var r,n;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=6;break}return t.next=3,h()({url:(0,d.aM)("create/payment_intent"),method:"POST",data:{payment_method_id:e.id,payment_method:"stripe_cc"}});case 3:n=t.sent,p(n.installments),null!==(r=Object.keys(n.installments))&&void 0!==r&&r.length&&b(Object.keys(n.installments)[0]);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){w(a,n,o,i,c,"next",t)}function c(t){w(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}()).catch((function(t){console.log(t)})).finally((function(){return j(!1)})))}),[r,a,n,l]),r&&"card"===n?v.createElement("div",{className:"wc-stripe-installments__container"},v.createElement("label",{className:"wc-stripe-installments__label"},e.installments.pay),v.createElement(P,{i18n:e,installment:m,onChange:function(t){b(t.target.value),u&&u(t.target.value)},installments:f,isLoading:S})):null},P=function(t){var e,r=t.installment,n=t.installments,o=t.onChange,i=t.isLoading,c=t.i18n;return e=i?v.createElement("option",{value:"",disabled:!0},c.installments.loading):null===n?v.createElement("option",{value:"",disabled:!0},c.installments.complete_form):Object.keys(n).map((function(t){return v.createElement("option",{key:t,value:t,dangerouslySetInnerHTML:{__html:n[t].text}})})),v.createElement("select",{value:r,onChange:o,className:a()("wc-stripe-installment__options",{loading:i})},e)},j=r(703),x=(r(87),(0,j.getSetting)("stripeGeneralData"),r(87)),_=function(t){var e=t.text;return x.createElement("div",{className:"wc-stripe-mandate--container"},x.createElement("p",{className:"wc-stripe-mandate-container--text"},e))}},214:(t,e,r)=>{"use strict";r.d(e,{i:()=>a});var n=r(87),o=/^(248|38|666)$/.test(r.j)?["title","icons","paymentMethod"]:null;var a=function(t){var e=t.title,r=t.icons,a=t.paymentMethod,i=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,o).components,c=i.PaymentMethodLabel,u=i.PaymentMethodIcons;return Array.isArray(r)||(r=[r]),n.createElement("span",{className:"wc-stripe-label-container ".concat(a)},n.createElement(c,{text:e}),n.createElement(u,{icons:r,align:"left"}))}},834:(t,e,r)=>{"use strict";r.d(e,{A:()=>p});var n=r(87),o=r(87);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 i(t,e){for(var r=0;r<e.length;r++){var n=e[r];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 e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.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+""}function u(t,e,r){return e=s(e),function(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)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,l()?Reflect.construct(e,r||[],s(t).constructor):e.apply(t,r))}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(l=function(){return!!t})()}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function f(t,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},f(t,e)}var p=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=u(this,e,[t])).state={hasError:!1,msg:""},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(e,t),r=e,a=[{key:"getDerivedStateFromError",value:function(t){return{hasError:!0,msg:(null==t?void 0:t.message)||t}}}],(n=[{key:"render",value:function(){return this.state.hasError?this.props.showError?o.createElement(o.Fragment,null,o.createElement("div",{className:"wc-stripe-error-message"},this.state.msg)):null:this.props.children}}])&&i(r.prototype,n),a&&i(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(n.Component)},728:(t,e,r)=>{"use strict";r.r(e);var n=r(87),o=r(83),a=r(954),i=r(926),c=r(87);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 l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.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+""}function f(t,e,r){return e=y(e),function(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)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,p()?Reflect.construct(e,r||[],y(t).constructor):e.apply(t,r))}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function m(t,e){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},m(t,e)}const h=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=f(this,e,[t])).state={hasError:!1,error:null,errorInfo:null},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m(t,e)}(e,t),r=e,(n=[{key:"componentDidCatch",value:function(t,e){this.setState({hasError:!0,error:t,errorInfo:e})}},{key:"render",value:function(){return this.state.hasError?c.createElement(c.Fragment,null,this.state.error&&c.createElement("div",{className:"wc-stripe-block-error"},this.state.error.toString()),this.state.errorInfo&&c.createElement("div",{className:"wc-stripe-block-error"},this.state.errorInfo.componentStack)):this.props.children}}])&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(n.Component);var d=r(673),v=r(87),b=["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"],g=["getData"],w=["cartTotals"];function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function E(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var S=(0,a.mt)("stripe_applepay_data"),P=function(t){return v.createElement(h,null,v.createElement("div",{className:"wc-stripe-apple-pay-container"},v.createElement(i.Elements,{stripe:a.eV},v.createElement(j,t))))},j=function(t){var e,r,o=t.getData,a=t.onClick,c=t.onClose,u=t.billing,l=t.shippingData,s=t.eventRegistration,f=t.emitResponse,p=t.onSubmit,y=t.activePaymentMethod,m=(E(t,b),s.onPaymentSetup),h=f.noticeContexts,g=(0,i.useStripe)(),w=(e=(0,d.Xp)(),r=1,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return O(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(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.")}())[0],S=(0,d.Tn)();(0,d.R)({payment_method:o("name"),width:375});var P=(0,d.DA)({getData:o,billing:u,shippingData:l,onPaymentSetup:m,emitResponse:f,error:w,onSubmit:p,activePaymentMethod:y,exportedValues:S}).setPaymentMethod;(0,d.Jy)({getData:o,eventRegistration:s,emitResponse:f,activePaymentMethod:y,messageContext:h.EXPRESS_PAYMENTS});var j=(0,d.zc)({getData:o,onClose:c,stripe:g,billing:u,shippingData:l,setPaymentMethod:P,exportedValues:S,canPay:function(t){return null!=t&&t.applePay}}).paymentRequest,x=(0,n.useCallback)((function(t){j&&(t.preventDefault(),a(),j.show())}),[j,a]);return j?v.createElement("button",{className:"apple-pay-button ".concat(o("buttonStyle")),style:{ApplePayButtonType:o("buttonType")},onClick:x}):null},x=function(t){var e=t.getData;return E(t,g),v.createElement("div",{className:"apple-pay-block-editor"},v.createElement("img",{src:e("editorIcon")}))};((0,a.Mb)()&&S("cartCheckoutEnabled")||(0,a.MC)()&&S("expressCheckoutEnabled"))&&(0,o.registerExpressPaymentMethod)({name:S("name"),canMakePayment:function(t){var e=t.cartTotals;if(E(t,w),S("isAdmin"))return!0;var r=e.currency_code,n=e.total_price;return(0,a.Lk)({country:S("countryCode"),currency:r.toLowerCase(),total:{label:S("totalLabel"),amount:parseInt(n)}},(function(t){return null!=t&&t.applePay}))},content:v.createElement(P,{getData:S}),edit:v.createElement(x,{getData:S}),supports:{showSavedCards:S("showSavedCards"),showSaveOption:S("showSaveOption"),features:S("features")}})},84:(t,e,r)=>{"use strict";r.r(e);var n=r(87),o=r(83),a=r(954),i=r(926),c=r(979),u=r(756),l=r(673),s=r(87);function f(t){return f="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},f(t)}function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==f(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(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 h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var d={focus:"focused",empty:"empty",invalid:"invalid"},v=function(t){var e=t.type,r=t.src;return e?s.createElement("img",{className:"wc-stripe-card ".concat(e),src:r}):null};const b=function(t){var e=t.getData,r=t.onChange,o=t.onComplete,c=m((0,n.useState)(""),2),u=c[0],f=c[1],p=(0,n.useRef)([]),h=m((0,n.useState)(null),2),b=h[0],g=h[1],w=(0,i.useElements)(),O=e("customForm"),E=(0,a.Y_)(O),S=E.component,P=void 0===S?null:S,j=E.breakpoint,x=void 0===j?475:j,_=e("postalCodeEnabled"),k={},C=(0,n.useRef)({cardNumber:{},cardExpiry:{},cardCvc:{}});["cardNumber","cardExpiry","cardCvc"].forEach((function(t){k[t]=y(y({classes:d},e("cardOptions")),e("customFieldOptions")[t])}));var L=(0,n.useCallback)((function(t){p.current.includes(t)||p.current.push(t)}),[]);(0,l.L7)({name:"creditCardForm",width:x,node:b,className:"small-form"});var A=(0,n.useCallback)((function(t){for(var r=0,n=Object.keys(e("cards"));r<n.length;r++){var o=n[r];if(o===t)return e("cards")[o]}return""}),[]);return P?s.createElement("div",{className:"wc-stripe-custom-form ".concat(O),ref:g},(0,n.cloneElement)(P,{postalCodeEnabled:_,options:k,onChange:function(t){return L(t),function(e){if(r(e),C.current[e.elementType]=e,"cardNumber"===e.elementType&&("unknown"===e.brand?f(""):f(e.brand)),e.complete){var n=p.current.indexOf(t);if(p.current[n+1]){var a=p.current[n+1];w.getElement(a).focus()}}var i;o((i=C.current,Object.keys(i).filter((function(t){return!!i[t].complete})).length===Object.keys(i).length))}},CardIcon:s.createElement(v,{type:u,src:A(u)}),i18n:e("i18n")})):s.createElement("div",{className:"wc-stripe-custom-form-error"},s.createElement("p",null,e("i18n").unsupported_form))};var g=r(87);function w(t){return w="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},w(t)}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==w(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const S=function(t){var e=t.getData,r=t.billing,o=t.onChange,c=t.onComplete,u={card:{}},l=(0,n.useMemo)((function(){var t;return E(E({},{value:{postalCode:null==r||null===(t=r.billingAddress)||void 0===t?void 0:t.postcode},hidePostalCode:(0,a.Sh)("postcode"),iconStyle:"default"}),e("cardOptions"))}),[r.billingAddress]);return g.createElement("div",{className:"wc-stripe-inline-form"},g.createElement(i.CardElement,{options:l,onChange:function(t){o(t),u[t.elementType]=t,c(Object.keys(u).filter((function(t){return!!u[t].complete})).length===Object.keys(u).length)}}))};var P=r(427),j=r(703),x=r(468),_=r(87),k=["options"];function C(t){return C="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},C(t)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function A(){return A=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},A.apply(this,arguments)}function M(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function D(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=C(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==C(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var T=(0,j.getSetting)("stripeGeneralData"),N=T.publishableKey,I=T.stripeParams,R=(0,x.cloneDeep)(I);R.hasOwnProperty("betas")&&R.betas.indexOf("link_autofill_modal_beta_1")>-1&&delete R.betas[R.betas.indexOf("link_autofill_modal_beta_1")];var B=(0,P.c)(N,R),G=(0,a.mt)("stripe_cc_data"),F=G("i18n"),U=function(t){t.options;var e,r,o=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,k),a=(e=(0,n.useState)(!1),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(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=a[0],s=a[1],f=G("installmentsActive"),p=(0,i.useStripe)(),y=o.billing.billingAddress,m=o.eventRegistration,h=o.emitResponse,d=o.shouldSavePayment,v=y.email,b=y.phone,g=y.first_name,w=y.last_name,O=m.onCheckoutFail,E=h.noticeContexts,S=G("name"),P=(0,n.useCallback)((function(t){s(t.complete)}),[]),j=(0,l.d0)({billingAddress:y,eventRegistration:m,emitResponse:h,shouldSavePayment:d,noticeContexts:E,name:S}),x=j.createPaymentMethod,C=j.addPaymentMethodData;(0,l.iy)({emitResponse:h,subscriber:O,messageContext:h.noticeContexts.PAYMENTS});var A={defaultValues:{billingDetails:{name:"".concat(g," ").concat(w),email:v,phone:b}},fields:{billingDetails:{address:"never"}},wallets:{applePay:"never",googlePay:"never"}};return _.createElement(_.Fragment,null,_.createElement(i.PaymentElement,{options:A,onChange:P}),_.createElement(c.Fy,{active:f,i18n:F,paymentMethodType:"card",stripe:p,cardFormComplete:u,createPaymentMethod:x,onChange:function(t){return C({_stripe_installment_plan:t})}}))};const Y=function(t){var e,r=t.billing,n=t.cartData,o=t.shouldSavePayment,a=(n.extensions,r.cartTotal),c=r.currency,u=D({mode:"payment",currency:null==c||null===(e=c.code)||void 0===e?void 0:e.toLowerCase()},G("elementOptions"));return o&&(u.mode="subscription"),0>=a.value&&(u=D(D({},u),{},{mode:"setup"})),["payment","subscription"].includes(u.mode)&&(u.amount=a.value),_.createElement(_.Fragment,null,_.createElement(i.Elements,{stripe:B,options:u},_.createElement(U,A({},t,{options:u}))))};var q=r(87);function V(t){return V="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},V(t)}function $(){$=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new L(n||[]);return o(i,"_invoke",{value:x(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",d={};function v(){}function b(){}function g(){}var w={};l(w,i,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=g.prototype=v.prototype=Object.create(w);function P(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==V(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function x(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(V(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},P(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(S),l(S,u,"Generator"),l(S,i,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function W(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function J(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){W(a,n,o,i,c,"next",t)}function c(t){W(a,n,o,i,c,"throw",t)}i(void 0)}))}}function K(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return H(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(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 H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var X=(0,a.mt)("stripe_cc_data"),z=function(t){var e=K((0,n.useState)(!1),2),r=e[0],o=e[1];if((0,n.useEffect)((function(){a.eV.catch((function(t){o(t)}))}),[o]),r)throw new Error(r);return X("isPaymentElement")?q.createElement(Y,t):q.createElement(i.Elements,{stripe:a.eV,options:X("elementOptions")},q.createElement(Z,t))},Z=function(t){var e=t.getData,r=t.billing,o=t.shippingData,a=t.emitResponse,u=t.eventRegistration,s=t.activePaymentMethod,f=t.shouldSavePayment,p=K((0,l.Xp)(),2),y=p[0],m=p[1],h=K((0,n.useState)(!1),2),d=h[0],v=h[1],g=u.onPaymentSetup,w=(0,i.useStripe)(),O=(0,i.useElements)(),E=(0,n.useCallback)((function(){var t=e("customFormActive")?i.CardNumberElement:i.CardElement;return{card:O.getElement(t)}}),[w,O]),P=(0,l.dN)({getData:e,cartTotal:r.cartTotal,setError:m}),j=P.setupIntent,x=P.removeSetupIntent,_=(0,l.DA)({getData:e,billing:r,shippingData:o,emitResponse:a,error:y,onPaymentSetup:g,shouldSavePayment:f,setupIntent:j,removeSetupIntent:x,getPaymentMethodArgs:E,activePaymentMethod:s}),k=_.getCreatePaymentMethodArgs,C=_.addPaymentMethodData;(0,l.Jy)({getData:e,eventRegistration:u,emitResponse:a,activePaymentMethod:s,shouldSavePayment:f});var L=(0,n.useCallback)(J($().mark((function t(){var e,r,n;return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.next=3,w.createPaymentMethod(k());case 3:return null!=(n=t.sent)&&null!==(e=n.paymentMethod)&&void 0!==e&&e.id&&(r=n.paymentMethod.id),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)}))),[w,k]),A=e("customFormActive")?b:S;return q.createElement("div",{className:"wc-stripe-card-container"},q.createElement(A,{getData:e,billing:r,onChange:function(t){t.error?m(t.error):m(!1)},onComplete:v}),e("installmentsActive")&&q.createElement(c.Fy,{i18n:e("i18n"),paymentMethodName:e("name"),cardFormComplete:d,addPaymentMethodData:C,getPaymentMethod:L}))};(0,o.registerPaymentMethod)({name:X("name"),label:q.createElement(c.in,{title:X("title"),paymentMethod:X("name"),icons:X("icons")}),ariaLabel:"Credit Cards",canMakePayment:function(){return a.eV},content:q.createElement(c.g5,{content:z,getData:X}),savedTokenComponent:q.createElement(u.A,{getData:X,confirmation_method:"manual"}),edit:q.createElement(c.g5,{content:z,getData:X}),supports:{showSavedCards:X("showSavedCards"),showSaveOption:X("showSaveOption"),features:X("features")}});var Q=r(87),tt=function(t){var e=t.CardIcon,r=t.options,n=t.onChange,o=t.i18n;return Q.createElement("div",{className:"wc-stripe-bootstrap-form"},Q.createElement("div",{className:"row"},Q.createElement("div",{className:"col-md-6 mb-3"},Q.createElement(i.CardNumberElement,{className:"md-form md-outline stripe-input",options:r.cardNumber,onChange:n(i.CardNumberElement)}),Q.createElement("label",{htmlFor:"stripe-card-number"},o.labels.number),e),Q.createElement("div",{className:"col-md-3 mb-3"},Q.createElement(i.CardExpiryElement,{className:"md-form md-outline stripe-input",options:r.cardExpiry,onChange:n(i.CardExpiryElement)}),Q.createElement("label",{htmlFor:"stripe-exp"},o.labels.exp)),Q.createElement("div",{className:"col-md-3 mb-3"},Q.createElement(i.CardCvcElement,{className:"md-form md-outline stripe-input",options:r.cardCvc,onChange:n(i.CardCvcElement)}),Q.createElement("label",{htmlFor:"stripe-cvv"},o.labels.cvv))))};(0,a.Tt)({id:"bootstrap",breakpoint:475,component:Q.createElement(tt,null)});var et=r(87),rt=function(t){var e=t.CardIcon,r=t.options,o=t.onChange,a=t.i18n;return(0,n.useEffect)((function(){}),[]),et.createElement("div",{className:"wc-stripe-simple-form"},et.createElement("div",{className:"row"},et.createElement("div",{className:"field"},et.createElement("div",{className:"field-item"},et.createElement(i.CardNumberElement,{id:"stripe-card-number",className:"input empty",options:r.cardNumber,onChange:o(i.CardNumberElement)}),et.createElement("label",{htmlFor:"stripe-card-number","data-tid":""},a.labels.number),et.createElement("div",{className:"baseline"}),e))),et.createElement("div",{className:"row"},et.createElement("div",{className:"field half-width"},et.createElement("div",{className:"field-item"},et.createElement(i.CardExpiryElement,{id:"stripe-exp",className:"input empty",options:r.cardExpiry,onChange:o(i.CardExpiryElement)}),et.createElement("label",{htmlFor:"stripe-exp","data-tid":""},a.labels.exp),et.createElement("div",{className:"baseline"}))),et.createElement("div",{className:"field half-width cvc"},et.createElement("div",{className:"field-item"},et.createElement(i.CardCvcElement,{id:"stripe-cvv",className:"input empty",options:r.cardCvc,onChange:o(i.CardCvcElement)}),et.createElement("label",{htmlFor:"stripe-cvv","data-tid":""},a.labels.cvv),et.createElement("div",{className:"baseline"})))))};(0,a.Tt)({id:"simple",component:et.createElement(rt,null),breakpoint:375})},572:(t,e,r)=>{"use strict";r.r(e);var n=r(83),o=r(954),a=r(87),i=r(455),c=r.n(i),u=r(926);function l(t){return function(t){if(Array.isArray(t))return s(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 s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(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.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}(0,r(703).getSetting)("stripeGeneralData");var f=function(t){var e=t.billing,r=t.processingCountry,n=t.totalPriceLabel,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ESTIMATED",i=e.cartTotal,c=e.cartTotalItems,u=e.currency;return{countryCode:r,currencyCode:u.code,totalPriceStatus:a,totalPrice:(0,o.k7)(i.value,u.minorUnit).toString(),displayItems:p(c,u.minorUnit),totalPriceLabel:n}},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=[],n=["total_tax","total_shipping"];return t.forEach((function(t){(0<t.value||t.key&&n.includes(t.key))&&r.push({label:t.label,type:"LINE_ITEM",price:(0,o.k7)(t.value,e).toString()})})),r},y=function(t){var e=[];return t.forEach((function(t,r){var n=t.shipping_rates.map((function(t){var e=document.createElement("textarea");e.innerHTML=t.name;var n=(0,o.$g)(t.price,t.currency_code);return{id:(0,o.jT)(r,t.rate_id),label:e.value,description:"".concat(n)}}));e=[].concat(l(e),l(n))})),e},m=(0,o.UC)({name:function(t,e){return t.first_name=e.split(" ").slice(0,-1).join(" "),t.last_name=e.split(" ").pop(),t},countryCode:"country",address1:"address_1",address2:"address_2",locality:"city",administrativeArea:"state",postalCode:"postcode",email:"email",phoneNumber:"phone"});function h(t){return h="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},h(t)}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function v(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=h(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==h(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function b(){b=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",d="completed",v={};function g(){}function w(){}function O(){}var E={};l(E,i,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,i)&&(E=P);var j=O.prototype=g.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==h(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===d){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,v;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(h(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=l(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function g(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){g(a,n,o,i,c,"next",t)}function c(t){g(a,n,o,i,c,"throw",t)}i(void 0)}))}}function O(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||E(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 E(t,e){if(t){if("string"==typeof t)return S(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var P={type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],assuranceDetailsRequired:!0}},j={apiVersion:2,apiVersionMinor:0};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 _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=x(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==x(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var A=r(673),M=r(87),D=["getData","setErrorMessage","billing","shippingData","canMakePayment","checkoutStatus","eventRegistration","activePaymentMethod","onClick","onClose"];function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var N=(0,o.mt)("stripeGeneralData")().publishableKey;const I=function(t){var e,r,n=t.getData,i=t.setErrorMessage,l=t.billing,s=t.shippingData,p=t.canMakePayment,h=t.checkoutStatus,d=t.eventRegistration,g=t.activePaymentMethod,x=t.onClick,k=t.onClose,L=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,D),I={merchantId:n("merchantId"),merchantName:n("merchantName")},R=(e=(0,A.Xp)(),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(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.")}()),B=R[0],G=(R[1],(0,a.useRef)()),F=L.onSubmit,U=L.emitResponse,Y=d.onPaymentSetup,q=(0,A.Tn)(),V="long"===n("buttonStyle").buttonType?390:375,$=(0,A.DA)({getData:n,billing:l,shippingData:s,onPaymentSetup:Y,emitResponse:U,error:B,exportedValues:q,onSubmit:F,checkoutStatus:h,activePaymentMethod:g}).setPaymentMethod,W=function(t){var e=t.publishableKey,r=t.merchantInfo,n=t.billing,i=t.shippingData,c=(0,t.getData)(),u=c.processingCountry,l=c.totalPriceLabel,s=(0,a.useRef)({shippingData:i,billing:n});(0,a.useEffect)((function(){s.current={shippingData:i,billing:n}}));var p=(0,a.useCallback)((function(){var t=s.current,n=t.billing,a=t.shippingData,i=n.billingAddress,c=a.shippingRates,p=C(C({},{emailRequired:(0,o.Im)(i.email),merchantInfo:r,allowedPaymentMethods:[C(C({},{type:"CARD",tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:"stripe","stripe:version":"2018-10-31","stripe:publishableKey":e}}}),P)],shippingAddressRequired:a.needsShipping,transactionInfo:f({billing:n,processingCountry:u,totalPriceLabel:l}),callbackIntents:["PAYMENT_AUTHORIZATION"]}),j);if(p.allowedPaymentMethods[0].parameters.billingAddressRequired=!0,p.allowedPaymentMethods[0].parameters.billingAddressParameters={format:"FULL",phoneNumberRequired:(0,o.Sh)(a.needsShipping?"shipping-phone":"phone",i.country)&&(0,o.Im)(i.phone)},p.shippingAddressRequired){p.callbackIntents=[].concat(function(t){return function(t){if(Array.isArray(t))return _(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 _(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(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.")}()}(p.callbackIntents),["SHIPPING_ADDRESS","SHIPPING_OPTION"]),p.shippingOptionRequired=!0;var m=function(t){var e=y(t),r=e.map((function(t){return t.id})).slice(0,1).shift();return t.forEach((function(t,e){t.shipping_rates.forEach((function(t){t.selected&&(r=(0,o.jT)(e,t.rate_id))}))})),{shippingOptions:e,defaultSelectedOptionId:r}}(c);m.shippingOptions.length>0&&(p=C(C({},p),{},{shippingOptionParameters:m}))}return p}),[]);return p}({getData:n,publishableKey:N,merchantInfo:I,billing:l,shippingData:s}),J=function(t){var e=t.merchantInfo,r=t.buildPaymentRequest,n=t.billing,i=t.shippingData,l=t.canMakePayment,s=t.setErrorMessage,f=t.setPaymentMethod,p=t.exportedValues,y=t.onClick,h=t.onClose,d=t.getData,g=d().environment,P=O((0,a.useState)(),2),j=P[0],x=P[1],_=O((0,a.useState)(null),2),k=_[0],C=_[1],L=(0,a.useRef)(n),A=(0,a.useRef)(i),M=i.needsShipping,D=(0,u.useStripe)();(0,a.useEffect)((function(){L.current=n,A.current=i}));var T=(0,a.useCallback)((function(t){var e,r,n={},o=A.current.shippingAddress;null!=t&&null!==(e=t.paymentMethodData)&&void 0!==e&&null!==(e=e.info)&&void 0!==e&&e.billingAddress&&(n=t.paymentMethodData.info.billingAddress,p.billingAddress=L.current.billingAddress=m(n,{email:t.email||L.current.billingAddress.email,phoneNumber:n.phoneNumber||L.current.billingAddress.phone})),null!=t&&t.shippingAddress&&(p.shippingAddress=m(t.shippingAddress),null!=p&&null!==(r=p.billingAddress)&&void 0!==r&&r.phone&&!o.phone&&(p.shippingAddress.phone=p.billingAddress.phone))}),[]),N=(0,a.useCallback)((function(t){for(;t.firstChild;)t.removeChild(t.firstChild)}),[k]),I=(0,a.useCallback)(w(b().mark((function t(){var e,n,a;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return y(),t.prev=1,t.next=4,j.loadPaymentData(r());case 4:return e=t.sent,T(e),n=JSON.parse(e.paymentMethodData.tokenizationData.token),t.next=9,D.createPaymentMethod({type:"card",card:{token:n.id},billing_details:(0,o.C8)(L.current.billingAddress)});case 9:if(!(a=t.sent).error){t.next=12;break}throw new o.g8(a.error);case 12:f(a.paymentMethod.id),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),"CANCELED"===(null===t.t0||void 0===t.t0?void 0:t.t0.statusCode)?h():(console.log((0,o.u1)(t.t0)),s((0,o.u1)(t.t0)));case 18:case"end":return t.stop()}}),t,null,[[1,15]])}))),[D,j,y,r]),R=(0,a.useCallback)(w(b().mark((function t(){var e,r;return b().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!j||!D){t.next=7;break}return t.next=4,l;case 4:e=j.createButton(v({onClick:I},d("buttonStyle"))),"rect"===d("buttonShape")&&(null===(r=e.querySelector("button"))||void 0===r||null===(r=r.classList)||void 0===r||r.remove("new_style")),C(e);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),console.log(t.t0);case 12:case"end":return t.stop()}}),t,null,[[0,9]])}))),[D,j,I]),B=(0,a.useMemo)((function(){var t={environment:g,merchantInfo:e,paymentDataCallbacks:{onPaymentAuthorized:function(){return Promise.resolve({transactionState:"SUCCESS"})}}};return M&&(t.paymentDataCallbacks.onPaymentDataChanged=function(t){var e=A.current,r=t.shippingAddress,n=t.shippingOptionData,a=(0,o.D$)(n.id),i=["default","shipping_option_unselected"].includes(n.id)?null:n.id;return new Promise((function(t,n){c()({method:"POST",url:(0,o.aM)("payment/data"),data:{address:m(r),shipping_method:i,page_id:null}}).then((function(e){e.code?t(e.data.data):t(e.data.paymentRequestUpdate)})).catch((function(e){t(e.data)})).finally((function(){i&&"shipping_option_unselected"!==i&&e.setSelectedRates.apply(e,function(t){return function(t){if(Array.isArray(t))return S(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||E(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.")}()}(a))}))}))}),t}),[M]);return(0,a.useEffect)((function(){x(new google.payments.api.PaymentsClient(B))}),[B]),(0,a.useEffect)((function(){R()}),[R]),{button:k,removeButton:N}}({merchantInfo:I,buildPaymentRequest:W,billing:l,shippingData:s,eventRegistration:d,canMakePayment:p,setErrorMessage:i,onSubmit:F,setPaymentMethod:$,exportedValues:q,onClick:x,onClose:k,getData:n}),K=J.button,H=J.removeButton;return(0,A.Jy)({getData:n,eventRegistration:d,emitResponse:U,activePaymentMethod:g}),(0,A.R)({payment_method:n("name"),width:V}),(0,a.useEffect)((function(){K&&(H(G.current),G.current.append(K))}),[K]),M.createElement("div",{className:"wc-stripe-gpay-button-container",ref:G})};var R=r(249),B=r.n(R),G=r(87),F=["getData","components"],U=["getData"];function Y(t){return Y="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},Y(t)}function q(){return q=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},q.apply(this,arguments)}function V(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function $(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function W(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==Y(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var J,K,H=(0,o.mt)("stripe_googlepay_data"),X=(J=new(B().payments.api.PaymentsClient)({environment:H("environment"),merchantInfo:{merchantId:H("merchantId"),merchantName:H("merchantName")}}),K=W(W({},j),{},{allowedPaymentMethods:[P]}),J.isReadyToPay(K).then((function(){return!0})).catch((function(t){return console.log(t),!1}))),z=function(t){var e,r,n,i=t.getData,c=t.components,l=V(t,F),s=c.ValidationInputError,f={errorMessage:(r=(0,a.useState)(!1),n=2,e=function(t){if(Array.isArray(t))return t}(r)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(r,n)||function(t,e){if(t){if("string"==typeof t)return L(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?L(t,e):void 0}}(r,n)||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.")}())[0],setErrorMessage:e[1]},p=f.errorMessage,y=f.setErrorMessage;return G.createElement("div",{className:"wc-stripe-gpay-container"},G.createElement(u.Elements,{stripe:o.eV},G.createElement(I,q({getData:i,canMakePayment:X,setErrorMessage:y},l)),p&&G.createElement(s,{errorMessage:p})))},Z=function(t){var e=t.getData,r=(V(t,U),e("buttonStyle").buttonType),n=e("editorIcons").long;return G.createElement("div",{className:"gpay-block-editor ".concat(r)},G.createElement("img",{src:n}))};((0,o.Mb)()&&H("cartCheckoutEnabled")||(0,o.MC)()&&H("expressCheckoutEnabled"))&&(0,n.registerExpressPaymentMethod)({name:H("name"),canMakePayment:function(){return o.eV.then((function(t){return t.error?t:X}))},content:G.createElement(z,{getData:H}),edit:G.createElement(Z,{getData:H}),supports:{showSavedCards:H("showSavedCards"),showSaveOption:H("showSaveOption"),features:H("features")}})},673:(t,e,r)=>{"use strict";r.d(e,{Jy:()=>g,L7:()=>B,dP:()=>ut,d0:()=>J,Tn:()=>C,R:()=>G,zc:()=>I,iy:()=>h,mk:()=>Q,DA:()=>m,dN:()=>x,Xp:()=>k});var n=r(87),o=r(926),a=r(954);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 c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function y(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var m="suspendedStart",h="suspendedYield",d="executing",v="completed",b={};function g(){}function w(){}function O(){}var E={};f(E,u,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,u)&&(E=P);var j=O.prototype=g.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,c,u){var l=y(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=m;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=y(e,r,n);if("normal"===l.type){if(o=n.done?v:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=y(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(i(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=f(O,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,f(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),f(_.prototype,l,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(p(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),f(j,s,"Generator"),f(j,u,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function u(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){u(a,n,o,i,c,"next",t)}function c(t){u(a,n,o,i,c,"throw",t)}i(void 0)}))}}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){p(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function p(t,e,r){var n;return n=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==i(n)?n:n+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}(0,a.mt)("stripeGeneralData");var m=function(t){var e,r,i=t.getData,u=t.billing,s=t.shippingData,m=t.onPaymentSetup,h=t.emitResponse,d=t.error,v=t.onSubmit,b=t.activePaymentMethod,g=t.paymentType,w=void 0===g?"card":g,O=t.setupIntent,E=void 0===O?null:O,S=t.removeSetupIntent,P=void 0===S?null:S,j=t.shouldSavePayment,x=void 0!==j&&j,_=t.exportedValues,k=void 0===_?{}:_,C=t.getPaymentMethodArgs,L=void 0===C?function(){return{}}:C,A=u.billingAddress,M=s.shippingAddress,D=(e=(0,n.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(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.")}()),T=D[0],N=D[1],I=(0,o.useStripe)(),R=(0,n.useRef)(L),B=(0,n.useRef)({});(0,n.useEffect)((function(){R.current=L}),[L]);var G=(0,n.useCallback)((function(t){B.current=f(f({},B.current),t)}),[]),F=(0,n.useCallback)((function(){return f(f({},{type:w,billing_details:(0,a.C8)(null!=k&&k.billingAddress?k.billingAddress:A)}),R.current())}),[A,w,L]),U=(0,n.useCallback)((function(t,e){var r={meta:{paymentMethodData:f(p(p({},"".concat(i("name"),"_token_key"),t),"".concat(i("name"),"_save_source_key"),e),B.current)}};return null!=k&&k.billingAddress&&(r.meta.billingAddress=f(f({},a.jH),k.billingAddress)),null!=k&&k.shippingAddress&&(r.meta.shippingAddress=f(f({},a.os),k.shippingAddress)),r}),[A,M]);return(0,n.useEffect)((function(){T&&"string"==typeof T&&v()}),[T,v]),(0,n.useEffect)((function(){var t=m(l(c().mark((function t(){var e,r;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(b===i("name")){t.next=2;break}return t.abrupt("return",null);case 2:if(e=null,r=null,t.prev=3,!d){t.next=6;break}throw new a.g8(d);case 6:if(!E){t.next=16;break}return t.next=9,I.confirmCardSetup(E.client_secret,{payment_method:F()});case 9:if(!(e=t.sent).error){t.next=12;break}throw new a.g8(e.error);case 12:r=e.setupIntent.payment_method,P(),t.next=26;break;case 16:if(!T){t.next=20;break}r=T,t.next=26;break;case 20:return t.next=22,I.createPaymentMethod(F());case 22:if(!(e=t.sent).error){t.next=25;break}throw new a.g8(e.error);case 25:r=e.paymentMethod.id;case 26:return t.abrupt("return",(0,a.Zw)(h.responseTypes,U(r,x)));case 29:return t.prev=29,t.t0=t.catch(3),console.log(t.t0),N(null),t.abrupt("return",(0,a.A7)(h.responseTypes,t.t0.error,{messageContext:h.noticeContexts.PAYMENTS}));case 34:case"end":return t.stop()}}),t,null,[[3,29]])}))));return function(){return t()}}),[T,A,m,I,E,b,x]),{setPaymentMethod:N,getCreatePaymentMethodArgs:F,addPaymentMethodData:G}},h=function(t){var e=t.emitResponse,r=t.subscriber,o=t.messageContext,a=void 0===o?null:o;(0,n.useEffect)((function(){var t=r((function(t){var r;return null!=t&&null!==(r=t.processingResponse.paymentDetails)&&void 0!==r&&r.stripeErrorMessage?{type:e.responseTypes.ERROR,message:t.processingResponse.paymentDetails.stripeErrorMessage,messageContext:a||e.noticeContexts.PAYMENTS}:null}));return function(){return t()}}),[r,a,e.responseTypes.ERROR,e.noticeContexts.PAYMENTS])};function d(t){return d="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},d(t)}function v(){v=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",b={};function g(){}function w(){}function O(){}var E={};l(E,i,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,i)&&(E=P);var j=O.prototype=g.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==d(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=l(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function b(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var g=function(t){var e=t.getData,r=t.eventRegistration,i=t.emitResponse,c=t.activePaymentMethod,u=t.shouldSavePayment,l=void 0!==u&&u,s=t.messageContext,f=void 0===s?null:s,p=(0,o.useStripe)(),y=r.onCheckoutSuccess,m=r.onCheckoutFail;h({emitResponse:i,subscriber:m,messageContext:f}),(0,n.useEffect)((function(){var t=y(function(){var t,r=(t=v().mark((function t(r){var n;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.redirectUrl,e("name")!==c){t.next=5;break}return t.next=4,(0,a.J3)({redirectUrl:n,emitResponse:i,name:c,savePaymentMethod:l});case 4:return t.abrupt("return",t.sent);case 5:return t.abrupt("return",null);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){b(a,n,o,i,c,"next",t)}function c(t){b(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return r.apply(this,arguments)}}());return function(){return t()}}),[p,y,c,l])},w=r(455),O=r.n(w);function E(t){return E="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},E(t)}function S(){S=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",d={};function v(){}function b(){}function g(){}var w={};l(w,i,(function(){return this}));var O=Object.getPrototypeOf,P=O&&O(O(D([])));P&&P!==r&&n.call(P,i)&&(w=P);var j=g.prototype=v.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==E(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(E(e)+" is not iterable")}return b.prototype=g,o(j,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function P(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var x=function(t){var e,r,o=t.cartTotal,i=t.setError,c=(e=(0,n.useState)((0,a.pf)("setupIntent")),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(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];(0,n.useEffect)((function(){var t=function(){var t,e=(t=S().mark((function t(){var e;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!u){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,O()({url:(0,a.aM)("create/setup_intent"),method:"POST"});case 4:(e=t.sent).code?i(e.message):((0,a.NQ)("setupIntent",e.intent),l(e.intent));case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){P(a,n,o,i,c,"next",t)}function c(t){P(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return e.apply(this,arguments)}}();(0,a.Jq)()||(0,a.bO)()&&0==o.value?u||t():l(null)}),[o.value]);var s=(0,n.useCallback)((function(){(0,a.is)("setupIntent")}),[o.value]);return{setupIntent:u,removeSetupIntent:s}};function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var k=function(){var t,e,r=(t=(0,n.useState)(!1),e=2,function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return _(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(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.")}());return[r[0],r[1]]},C=function(){return(0,n.useRef)({}).current};function L(t){return L="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},L(t)}function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==L(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}r(923);var N=(0,a.UC)(),I=function(t){var e,r,o=t.getData,i=t.onClose,c=t.stripe,u=t.billing,l=t.shippingData,s=t.setPaymentMethod,f=t.exportedValues,p=t.canPay,y=l.needsShipping,m=l.shippingRates,h=u.cartTotalItems,d=u.currency,v=u.cartTotal,b=(e=(0,n.useState)(null),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||D(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.")}()),g=b[0],w=b[1],E=(0,n.useRef)({}),S=(0,n.useRef)(l),P=(0,n.useRef)(u);(0,n.useEffect)((function(){S.current=l,P.current=u}),[l,u]),(0,n.useEffect)((function(){if(c){var t={country:o("countryCode"),currency:null==d?void 0:d.code.toLowerCase(),total:{amount:v.value,label:v.label,pending:y},requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:(0,a.Sh)(y?"shipping-phone":"phone"),requestShipping:y,displayItems:(0,a.VM)(h,d)};t.requestShipping&&(t.shippingOptions=(0,a.NM)(m)),E.current=t;var e=c.paymentRequest(E.current);e.canMakePayment().then((function(t){p(t)?w(e):w(null)}))}}),[c,v.value,y,m,h,d.code]);var j=(0,n.useCallback)((function(t){var e=S.current,r=t.shippingAddress,n=N(r);O()({method:"POST",url:(0,a.aM)("shipping-address"),data:{address:n,payment_method:o("name"),page_id:"checkout"}}).then((function(r){t.updateWith(r.data.newData),e.setShippingAddress(M(M({},e.shippingAddress),n))})).catch((function(t){console.log(t)}))}),[]),x=(0,n.useCallback)((function(t){var e=t.shippingOption,r=S.current;O()({method:"POST",url:(0,a.aM)("shipping-method"),data:{shipping_method:e.id,payment_method:o("name"),page_id:null}}).then((function(n){t.updateWith(n.data.newData),r.setSelectedRates.apply(r,function(t){return function(t){if(Array.isArray(t))return T(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||D(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.")}()}((0,a.D$)(e.id)))})).catch((function(t){console.log(t)}))}),[]),_=(0,n.useCallback)((function(t){var e=S.current.shippingAddress,r=P.current,n=t.paymentMethod,o=t.payerName,a=void 0===o?null:o,i=t.payerEmail,c=void 0===i?null:i,u=t.payerPhone,l=void 0===u?null:u;null!=n&&n.billing_details.address&&(f.billingAddress=M(M({},r.billingAddress),N(n.billing_details.address,{payerName:a})),!f.billingAddress.email&&c&&(f.billingAddress.email=c),!f.billingAddress.phone&&l&&(f.billingAddress.phone=l)),t.shippingAddress&&(f.shippingAddress=M(M({},e),N(t.shippingAddress)),!f.shippingAddress.phone&&l&&(f.shippingAddress.phone=l)),s(n.id),t.complete("success")}),[]);return(0,n.useEffect)((function(){g&&(E.current.requestShipping&&(g.on("shippingaddresschange",j),g.on("shippingoptionchange",x)),g.on("cancel",i),g.on("paymentmethod",_))}),[i,g,j,_]),{paymentRequest:g}};function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var B=function(t){var e,r,o=t.name,i=t.width,c=t.node,u=t.className,l=(e=(0,n.useState)(window.innerWidth),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return R(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?R(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.")}()),s=l[0],f=l[1],p=(0,n.useCallback)((function(t){var e=(0,a.pf)(t);return e?parseInt(e):0}),[]),y=(0,n.useCallback)((function(t,e){return(0,a.NQ)(t,e)}),[]);(0,n.useEffect)((function(){var t="function"==typeof c?c():c;if(t){var e=p(o);(!e||i>e)&&y(o,i),t.clientWidth<i?t.classList.add(u):t.clientWidth>e&&t.classList.remove(u)}}),[s,c]),(0,n.useEffect)((function(){var t=function(){return f(window.innerWidth)};return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)}}))},G=function(t){var e=t.payment_method,r=t.width,o=(0,n.useCallback)((function(){var t=document.getElementById("express-payment-method-".concat(e));return t?t.parentNode:null}),[]);B({name:"expressMaxWidth",width:r,node:o,className:"wc-stripe-express__sm"})};function F(t){return F="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},F(t)}function U(){U=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new L(n||[]);return o(i,"_invoke",{value:x(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",d={};function v(){}function b(){}function g(){}var w={};l(w,i,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=g.prototype=v.prototype=Object.create(w);function P(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==F(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function x(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(F(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},P(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(S),l(S,u,"Generator"),l(S,i,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function Y(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function q(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){Y(a,n,o,i,c,"next",t)}function c(t){Y(a,n,o,i,c,"throw",t)}i(void 0)}))}}function V(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach((function(e){W(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function W(t,e,r){var n;return n=function(t,e){if("object"!=F(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=F(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==F(n)?n:n+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var J=function(t){var e=t.billingAddress,r=t.eventRegistration,i=t.emitResponse,c=t.name,u=t.shouldSavePayment,l=t.noticeContexts,s=r.onPaymentSetup,f=r.onCheckoutSuccess,p=(0,n.useRef)({billingAddress:e}),y=(0,n.useRef)({}),m=(0,o.useStripe)(),h=(0,o.useElements)(),d=(0,n.useCallback)((function(t,e){return{meta:{paymentMethodData:$(W(W({},"".concat(c,"_token_key"),t),"".concat(c,"_save_source_key"),e),y.current)}}}),[]),v=(0,n.useCallback)((function(t){y.current=$($({},y.current),t)}),[]),b=(0,n.useCallback)(q(U().mark((function t(){var e,r;return U().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=p.current.billingAddress,t.next=3,h.submit();case 3:return t.next=5,m.createPaymentMethod({elements:h,params:{billing_details:$({phone:"",email:""},(0,a.C8)(e))}});case 5:if(!(r=t.sent).error){t.next=8;break}return t.abrupt("return",r);case 8:return t.abrupt("return",r.paymentMethod);case 9:case"end":return t.stop()}}),t)}))),[m,h]);return(0,n.useEffect)((function(){p.current.billingAddress=e})),(0,n.useEffect)((function(){var t=s(q(U().mark((function t(){var e,r;return U().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,b();case 3:if(!(e=t.sent).error){t.next=6;break}throw new a.g8(e.error);case 6:return r=e.id,p.current.paymentMethod=r,t.abrupt("return",(0,a.Zw)(i.responseTypes,d(r,u)));case 11:return t.prev=11,t.t0=t.catch(0),t.abrupt("return",(0,a.A7)(i.responseTypes,t.t0,{messageContext:l.PAYMENTS}));case 14:case"end":return t.stop()}}),t,null,[[0,11]])}))));return function(){return t()}}),[s,b,u]),(0,n.useEffect)((function(){var t=f(function(){var t=q(U().mark((function t(e){var r;return U().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.redirectUrl,t.next=3,(0,a.J3)({redirectUrl:r,emitResponse:i,name:c,savePaymentMethod:u,data:W({},"".concat(c,"_token_key"),p.current.paymentMethod)});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());return function(){return t()}}),[f,u,c]),{createPaymentMethod:b,addPaymentMethodData:v}};function K(t){return K="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},K(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new L(n||[]);return o(i,"_invoke",{value:x(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",d={};function v(){}function b(){}function g(){}var w={};l(w,i,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=g.prototype=v.prototype=Object.create(w);function P(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==K(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function x(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(K(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},P(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(S),l(S,u,"Generator"),l(S,i,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function X(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function z(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Z(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?z(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=K(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=K(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==K(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Q=function(t){var e=t.name,r=t.emitResponse,i=t.billingAddress,c=t.onCheckoutSuccess,u=t.activePaymentMethod,l=(0,n.useRef)({emitResponse:r,billingAddress:i}),s=(0,o.useStripe)(),f=(0,o.useElements)();(0,n.useEffect)((function(){l.current=Z(Z({},l.current),{},{billingAddress:i,emitResponse:r})}),[r,i]),(0,n.useEffect)((function(){var t=c(function(){var t,r=(t=H().mark((function t(r){var n,o,i,c,p;return H().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.redirectUrl,u!==e){t.next=7;break}if(!(o=(0,a.LI)(n))){t.next=7;break}return i=l.current,c=i.billingAddress,p=i.emitResponse,t.next=6,(0,a.aC)({args:o,stripe:s,elements:f,emitResponse:p,billingAddress:c});case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){X(a,n,o,i,c,"next",t)}function c(t){X(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return r.apply(this,arguments)}}());return t}),[s,f,c,u])};function tt(t){return tt="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},tt(t)}function et(){et=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new L(n||[]);return o(i,"_invoke",{value:x(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",y="suspendedYield",m="executing",h="completed",d={};function v(){}function b(){}function g(){}var w={};l(w,i,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(A([])));E&&E!==r&&n.call(E,i)&&(w=E);var S=g.prototype=v.prototype=Object.create(w);function P(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==tt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function x(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:y,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function _(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(tt(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},P(j.prototype),l(j.prototype,c,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new j(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},P(S),l(S,u,"Generator"),l(S,i,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function rt(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function nt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){rt(a,n,o,i,c,"next",t)}function c(t){rt(a,n,o,i,c,"throw",t)}i(void 0)}))}}function ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(r),!0).forEach((function(e){it(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function it(t,e,r){var n;return n=function(t,e){if("object"!=tt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e),(e="symbol"==tt(n)?n:n+"")in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ut=function(t){var e,r,i=t.name,c=t.emitResponse,u=t.billingAddress,l=t.eventRegistration,s=t.shouldSavePayment,f=t.shouldCreatePaymentMethod,p=void 0===f||f,y=(e=(0,n.useState)(""),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return ct(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ct(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.")}()),m=y[0],h=y[1],d=l.onPaymentSetup,v=l.onCheckoutSuccess,b=(0,o.useStripe)(),g=(0,o.useElements)(),w=(0,n.useRef)({billingAddress:u,paymentMethodData:{}}),O=(0,n.useCallback)((function(t,e){w.current.paymentMethodData=at(at({},w.current.paymentMethodData),{},it({},t,e))}),[]),E=(0,n.useCallback)(nt(et().mark((function t(){var e,r;return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=w.current.billingAddress,t.prev=1,t.next=4,g.submit();case 4:if(!(r=t.sent).error){t.next=7;break}throw r.error;case 7:if(!p){t.next=14;break}return t.next=10,b.createPaymentMethod({elements:g,params:{billing_details:at({phone:"",email:""},(0,a.C8)(e))}});case 10:if(!(r=t.sent).error){t.next=13;break}throw r.error;case 13:return t.abrupt("return",r.paymentMethod);case 14:return t.abrupt("return",{});case 17:throw t.prev=17,t.t0=t.catch(1),t.t0;case 20:case"end":return t.stop()}}),t,null,[[1,17]])}))),[b,g,p]);return(0,n.useEffect)((function(){w.current=at(at({},w.current),{},{billingAddress:u,paymentMethodType:m})}),[u,m]),(0,n.useEffect)((function(){var t=d(nt(et().mark((function t(){var e,r;return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=w.current.paymentMethodType,t.prev=1,t.next=4,E();case 4:return r=t.sent,t.abrupt("return",(0,a.Zw)(c.responseTypes,{meta:{paymentMethodData:at(it(it(it({},"".concat(i,"_token_key"),r.id),"".concat(i,"_save_source_key"),s),"_stripe_payment_method_type",e),w.current.paymentMethodData)}}));case 8:return t.prev=8,t.t0=t.catch(1),t.abrupt("return",(0,a.A7)(c.responseTypes,t.t0,{messageContext:c.noticeContexts.PAYMENTS}));case 11:case"end":return t.stop()}}),t,null,[[1,8]])}))));return t}),[b,g,d,s,E]),(0,n.useEffect)((function(){return v(nt(et().mark((function t(){return et().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)}))))}),[v]),{paymentMethodType:m,createPaymentMethod:E,setPaymentMethodType:h,addPaymentMethodData:O}}},654:(t,e,r)=>{"use strict";r.r(e);var n=r(0);const o=JSON.parse('{"apiVersion":2,"name":"wc-stripe/link-block","version":"1.0.0","title":"Stripe Link block","category":"woocommerce","description":"Adds a Stripe Link integration to the checkout block","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-fields-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"woo-stripe-payment"}');var a=r(926),i=r(143),c=r(594),u=r(83),l=r(87),s=r(954);function f(t){return f="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},f(t)}function p(){p=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function y(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var m="suspendedStart",h="suspendedYield",d="executing",v="completed",b={};function g(){}function w(){}function O(){}var E={};l(E,i,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,i)&&(E=P);var j=O.prototype=g.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=y(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==f(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=m;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=y(e,r,n);if("normal"===l.type){if(o=n.done?v:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=y(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(f(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=l(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==f(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var v=(0,s.UC)(),b=(0,s.mt)("stripe_link_checkout_data"),g=function(t){var e,r,n=t.email,o=(e=(0,l.useState)(),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(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=o[0],f=o[1],y=(0,a.useStripe)(),g=(0,a.useElements)(),w=(0,l.useRef)({email:n,oldEmail:n,isProcessing:!1}),O=b("launchLink"),E=(0,i.useDispatch)(c.PAYMENT_STORE_KEY),S=E.__internalSetActivePaymentMethod,P=E.__internalSetPaymentMethodData,j=E.__internalSetExpressPaymentError,x=E.__internalSetExpressPaymentStarted,_=(0,i.useDispatch)(c.CHECKOUT_STORE_KEY).__internalSetBeforeProcessing,k=(0,i.useDispatch)(c.CART_STORE_KEY),C=k.setBillingAddress,L=k.setShippingAddress,A=(0,i.useSelect)((function(t){return{isProcessing:t(c.PAYMENT_STORE_KEY).isPaymentProcessing()}}));(0,l.useEffect)((function(){y&&g&&!u&&f(y.linkAutofillModal(g))}),[y,g,u]),(0,l.useEffect)((function(){if(u&&O){var t=w.current.email;u.launch({email:t})}}),[u]),(0,l.useEffect)((function(){var t=w.current,e=t.oldEmail,r=void 0===e?"":e,o=t.isProcessing;u&&r!==n&&(void 0===o||!o)&&(u.launch({email:n}),w.current.oldEmail=n)}),[u,n]),(0,l.useEffect)((function(){w.current.email=n,w.current.isProcessing=A.isProcessing}),[n,A.isProcessing]),(0,l.useEffect)((function(){u&&(u.on("autofill",function(){var t,e=(t=p().mark((function t(e){var r,n,o,a,i,c;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return w.current.event=e,r=e.value,n=r.billingAddress,o=void 0===n?null:n,a=r.shippingAddress,i=void 0===a?null:a,t.prev=2,t.next=5,g.submit();case 5:return t.next=7,y.createPaymentMethod({elements:g,params:{billing_details:o}});case 7:if(!(c=t.sent).error){t.next=10;break}throw c.error;case 10:o&&C(m(m(m({},s.jH),v(m(m({},o.address),{},{recipient:o.name}))),{},{email:w.current.email})),i&&L(m(m({},s.os),v(m(m({},i.address),{},{recipient:i.name})))),P({stripe_cc_token_key:c.paymentMethod.id,stripe_cc_save_source_key:!1}),_(),t.next=20;break;case 16:t.prev=16,t.t0=t.catch(2),console.log(t.t0),j(t.t0.message);case 20:case"end":return t.stop()}}),t,null,[[2,16]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){h(a,n,o,i,c,"next",t)}function c(t){h(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}()),u.on("authenticated",(function(t){x(),S(b("name"))})))}),[u,y,g,_,C,L,P,S,j,x])};function w(t){return w="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},w(t)}function O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E(n.key),n)}}function E(t){var e=function(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==w(e)?e:e+""}function S(t,e,r){return e=j(e),function(t,e){if(e&&("object"===w(e)||"function"==typeof e))return e;if(void 0!==e)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,P()?Reflect.construct(e,r||[],j(t).constructor):e.apply(t,r))}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(P=function(){return!!t})()}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},j(t)}function x(t,e){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},x(t,e)}const _=function(t){function e(t){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=S(this,e,[t])).state={hasError:!1},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&x(t,e)}(e,t),r=e,o=[{key:"getDerivedStateFromError",value:function(t){return{hasError:!0}}}],(n=[{key:"render",value:function(){return this.state.hasError?null:this.props.children}}])&&O(r.prototype,n),o&&O(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(l.Component);var k=r(87),C=(0,s.mt)("stripe_link_checkout_data"),L=function(t){var e=t.cart.billingAddress.email,r=C("linkIcon");return C("popupEnabled")&&g({email:e}),function(t){var e=t.enabled,r=t.icon;(0,l.useEffect)((function(){if(e){var t=document.getElementById("email");if(t&&!t.classList.contains("stripe-link-icon-container")){(function(t){var e=document.querySelector(t);e&&e.remove()})(".wc-stripe-link-icon"),t.classList.add("stripe-link-icon-container");var n=document.createElement("template");n.innerHTML=r,t.parentElement.append(n.content.firstChild)}}}))}({enabled:r,icon:r}),k.createElement("div",{style:{display:"none"}},k.createElement(a.PaymentElement,{options:{fields:{billingDetails:{address:"never"}},wallets:{applePay:"never",googlePay:"never"}}}))};(0,u.registerExpressPaymentMethod)({name:C("name"),canMakePayment:function(t){return!1},content:k.createElement(L,null),edit:k.createElement(L,null),supports:{showSavedCards:C("showSavedCards"),showSaveOption:C("showSaveOption"),features:C("features")}}),(0,n.registerCheckoutBlock)({metadata:o,component:function(){var t=(0,i.useSelect)((function(t){return t(c.CART_STORE_KEY).getCartData()})),e={mode:"payment",paymentMethodCreation:"manual",amount:parseInt(t.totals.total_price),currency:t.totals.currency_code.toLowerCase(),payment_method_types:["card","link"]};return 0===parseInt(t.totals.total_price)&&(e={mode:"setup",currency:t.totals.currency_code.toLowerCase()}),k.createElement(_,null,k.createElement(a.Elements,{stripe:s.eV,options:e},k.createElement(L,{cart:t})))}})},710:(t,e,r)=>{"use strict";r.r(e);var n=r(87),o=r(83),a=r(954),i=r(926),c=r(0),u=r(703),l=r(673),s=r(979),f=r(87);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)}var y=["billingAddress","cartTotals"];function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=p(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==p(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function(r){var n=r.billingAddress,o=r.cartTotals,i=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(r,y),c=o.currency_code,u=n.country,l=t("countries"),s=t("allowedCountries"),f=t("features"),p=!1;if(t("isAdmin"))p=!0;else{if((0,a.bO)()&&!f.includes("subscriptions"))return!1;if((0,a.Jq)()&&!f.includes("pre-orders"))return!1;t("currencies").includes(c)&&(p="all_except"===s?!t("exceptCountries").includes(u):"specific"===s?t("specificCountries").includes(u):!(l.length>0)||l.includes(u)),e&&p&&(p=e(d({settings:t,billingAddress:n,cartTotals:o},i)))}return p}},b=function(t){var e,r=t.getData,n=t.billing,o=t.cartData,c=t.mandate,u=void 0!==c&&c,l=t.mandateText,p=void 0===l?"":l,y=r("name"),m=o.extensions,h=n.cartTotal,v=n.currency,b=d({mode:"payment",currency:null==v||null===(e=v.code)||void 0===e?void 0:e.toLowerCase()},m[y].elementOptions);return h.value<=0&&(b.mode="setup"),["payment","subscription"].includes(b.mode)&&(b.amount=h.value),f.createElement(i.Elements,{stripe:a.eV,options:b},f.createElement(g,t),u&&f.createElement(s.YR,{text:p}))},g=function(t){var e,r,o=t.getData,a=t.billing,s=t.emitResponse,p=t.shouldSavePayment,y=t.eventRegistration,h=t.activePaymentMethod,v=t.shouldCreatePaymentMethod,b=void 0===v||v,g=o("name"),w=a.billingAddress,O=y.onCheckoutSuccess,E=y.onCheckoutFail,S=(e=(0,n.useState)(!1),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(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.")}()),P=S[0],j=S[1],x=d({defaultValues:{billingDetails:{phone:w.phone,email:w.email,name:"".concat(w.first_name," ").concat(w.last_name),address:{country:w.country,state:w.state}}},fields:{billingDetails:{address:"never",name:"never",email:"never"}},wallets:{applePay:"never",googlePay:"never"}},o("paymentElementOptions"));if((0,l.iy)({emitResponse:s,subscriber:E,messageContext:s.noticeContexts.PAYMENTS}),(0,l.dP)({name:g,emitResponse:s,billingAddress:w,shouldSavePayment:p,eventRegistration:y,shouldCreatePaymentMethod:b}),(0,l.mk)({name:g,emitResponse:s,billingAddress:w,onCheckoutSuccess:O,activePaymentMethod:h}),P){var _=(0,u.getSetting)("stripeErrorMessages").payment_unavailable;return f.createElement(c.StoreNotice,{status:"warning",isDismissible:!1},_.replace("%s",P.message))}return f.createElement(i.PaymentElement,{options:x,onChange:function(t){},onLoadError:function(t){var e=t.error;j(e)}})},w=r(834),O=r(87);function E(t){return E="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},E(t)}function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var j=(0,a.mt)("stripe_klarna_data"),x=function(t){var e,r,o,c=t.title,u=t.paymentMethod,l=t.icons,f=t.components,p=f.PaymentMethodLabel,y=(0,n.useState)(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=E(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=E(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==E(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({amount:null===(e=j("cartTotals"))||void 0===e?void 0:e.value,currency:j("currency"),paymentMethodTypes:["klarna"]},j("messageOptions"))),m=(o=2,function(t){if(Array.isArray(t))return t}(r=y)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(t,e):void 0}}(r,o)||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.")}()),h=m[0],d=m[1];return(0,n.useEffect)((function(){var t=function(t){d(t.detail.options)};return document.addEventListener("stripeKlarnaChange",t),function(){return document.removeEventListener("stripeKlarnaChange",t)}}),[]),j("paymentSections").includes("checkout")?O.createElement("div",{className:"wc-stripe-label-container"},O.createElement(p,{text:c}),O.createElement("div",{className:"wc-stripe-klarna-message-container"},O.createElement(w.A,null,O.createElement(i.Elements,{stripe:a.eV,options:{locale:j("elementOptions").locale}},O.createElement(i.PaymentMethodMessagingElement,{options:h}))))):O.createElement(s.in,{paymentMethod:u,title:c,icons:l,components:f})};j()&&(0,o.registerPaymentMethod)({name:j("name"),label:O.createElement(x,{title:j("title"),paymentMethod:j("name"),icons:j("icon")}),ariaLabel:"Klarna",placeOrderButtonLabel:j("placeOrderButtonLabel"),canMakePayment:v(j,(function(t){var e,r=t.settings,n=t.billingAddress,o=t.cartTotals,i=n.country,c=o.currency_code,u=r("requiredParams");return e={amount:parseInt(o.total_price),currency:o.currency_code,countryCode:i},document.dispatchEvent(new CustomEvent("stripeKlarnaChange",{detail:{options:e}})),(0,a.jc)({eea_countries:j("eea_countries"),accountCountry:j("accountCountry"),requiredParams:u,currency:c,country:i})})),content:O.createElement(s.g5,{content:b,getData:j}),edit:O.createElement(s.g5,{content:b,getData:j}),supports:{showSavedCards:!1,showSaveOption:!1,features:j("features")}});var _=r(87),k=(0,a.mt)("stripe_ideal_data");k()&&(0,o.registerPaymentMethod)({name:k("name"),label:_.createElement(s.in,{title:k("title"),paymentMethod:k("name"),icons:k("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:k("placeOrderButtonLabel"),canMakePayment:v(k),content:_.createElement(s.g5,{content:b,getData:k}),edit:_.createElement(s.g5,{content:b,getData:k}),supports:{showSavedCards:!1,showSaveOption:!1,features:k("features")}});var C=r(87),L=(0,a.mt)("stripe_p24_data");L()&&(0,o.registerPaymentMethod)({name:L("name"),label:C.createElement(s.in,{title:L("title"),paymentMethod:L("name"),icons:L("icon")}),ariaLabel:"P24",placeOrderButtonLabel:L("placeOrderButtonLabel"),canMakePayment:v(L),content:C.createElement(s.g5,{content:b,getData:L}),edit:C.createElement(s.g5,{content:b,getData:L}),supports:{showSavedCards:!1,showSaveOption:!1,features:L("features")}});var A=r(87),M=(0,a.mt)("stripe_bancontact_data");M()&&(0,o.registerPaymentMethod)({name:M("name"),label:A.createElement(s.in,{title:M("title"),paymentMethod:M("name"),icons:M("icon")}),ariaLabel:"Bancontact",placeOrderButtonLabel:M("placeOrderButtonLabel"),canMakePayment:v(M),content:A.createElement(s.g5,{content:b,getData:M}),edit:A.createElement(s.g5,{content:b,getData:M}),supports:{showSavedCards:!1,showSaveOption:!1,features:M("features")}});var D=r(87),T=(0,a.mt)("stripe_giropay_data");T()&&(0,o.registerPaymentMethod)({name:T("name"),label:D.createElement(s.in,{title:T("title"),paymentMethod:T("name"),icons:T("icon")}),ariaLabel:"Giropay",placeOrderButtonLabel:T("placeOrderButtonLabel"),canMakePayment:v(T),content:D.createElement(s.g5,{content:b,getData:T}),edit:D.createElement(s.g5,{content:b,getData:T}),supports:{showSavedCards:!1,showSaveOption:!1,features:T("features")}});var N=r(87),I=(0,a.mt)("stripe_eps_data");I()&&(0,o.registerPaymentMethod)({name:I("name"),label:N.createElement(s.in,{title:I("title"),paymentMethod:I("name"),icons:I("icon")}),ariaLabel:"EPS",placeOrderButtonLabel:I("placeOrderButtonLabel"),canMakePayment:v(I),content:N.createElement(s.g5,{content:b,getData:I}),edit:N.createElement(s.g5,{content:b,getData:I}),supports:{showSavedCards:!1,showSaveOption:!1,features:I("features")}});var R=r(87),B=(0,a.mt)("stripe_multibanco_data");B()&&(0,o.registerPaymentMethod)({name:B("name"),label:R.createElement(s.in,{title:B("title"),paymentMethod:B("name"),icons:B("icon")}),ariaLabel:"MultiBanco",placeOrderButtonLabel:B("placeOrderButtonLabel"),canMakePayment:v(B),content:R.createElement(s.g5,{content:b,getData:B}),edit:R.createElement(s.g5,{content:b,getData:B}),supports:{showSavedCards:!1,showSaveOption:!1,features:B("features")}});var G=r(87),F=(0,a.mt)("stripe_sepa_data");F()&&(0,o.registerPaymentMethod)({name:F("name"),label:G.createElement(s.in,{title:F("title"),paymentMethod:F("name"),icons:F("icon")}),ariaLabel:"SEPA",placeOrderButtonLabel:F("placeOrderButtonLabel"),canMakePayment:v(F),content:G.createElement(s.g5,{content:b,getData:F,mandate:!F("mandate"),mandateText:F("mandateText")}),edit:G.createElement(s.g5,{content:b,getData:F,mandate:!F("mandate"),mandateText:F("mandateText")}),supports:{showSavedCards:!0,showSaveOption:!0,features:F("features")}});var U=r(87),Y=(0,a.mt)("stripe_sofort_data");Y()&&(0,o.registerPaymentMethod)({name:Y("name"),label:U.createElement(s.in,{title:Y("title"),paymentMethod:Y("name"),icons:Y("icon")}),ariaLabel:"Sofort",placeOrderButtonLabel:Y("placeOrderButtonLabel"),canMakePayment:v(Y),content:U.createElement(s.g5,{content:b,getData:Y}),edit:U.createElement(s.g5,{content:b,getData:Y}),supports:{showSavedCards:!1,showSaveOption:!1,features:Y("features")}});var q=r(87),V=(0,a.mt)("stripe_wechat_data");V()&&(0,o.registerPaymentMethod)({name:V("name"),label:q.createElement(s.in,{title:V("title"),paymentMethod:V("name"),icons:V("icon")}),ariaLabel:"WeChat",canMakePayment:v(V),content:q.createElement(s.g5,{content:b,getData:V,shouldCreatePaymentMethod:!1}),edit:q.createElement(s.g5,{content:b,getData:V,shouldCreatePaymentMethod:!1}),placeOrderButtonLabel:V("placeOrderButtonLabel"),supports:{showSavedCards:!1,showSaveOption:!1,features:V("features")}});var $=r(87),W=(0,a.mt)("stripe_fpx_data");W()&&(0,o.registerPaymentMethod)({name:W("name"),label:$.createElement(s.in,{title:W("title"),paymentMethod:W("name"),icons:W("icon")}),ariaLabel:"FPX",placeOrderButtonLabel:W("placeOrderButtonLabel"),canMakePayment:v(W),content:$.createElement(s.g5,{content:b,getData:W}),edit:$.createElement(s.g5,{content:b,getData:W}),supports:{showSavedCards:!1,showSaveOption:!1,features:W("features")}});var J=r(87),K=(0,a.mt)("stripe_becs_data");K()&&(0,o.registerPaymentMethod)({name:K("name"),label:J.createElement(s.in,{title:K("title"),paymentMethod:K("name"),icons:K("icon")}),ariaLabel:"BECS",placeOrderButtonLabel:K("placeOrderButtonLabel"),canMakePayment:v(K),content:J.createElement(s.g5,{content:b,getData:K}),edit:J.createElement(s.g5,{content:b,getData:K}),supports:{showSavedCards:!1,showSaveOption:!1,features:K("features")}});var H=r(87),X=(0,a.mt)("stripe_grabpay_data");X()&&(0,o.registerPaymentMethod)({name:X("name"),label:H.createElement(s.in,{title:X("title"),paymentMethod:X("name"),icons:X("icon")}),ariaLabel:"GrabPay",placeOrderButtonLabel:X("placeOrderButtonLabel"),canMakePayment:v(X),content:H.createElement(s.g5,{content:b,getData:X,confirmationMethod:"confirmGrabPayPayment"}),edit:H.createElement(s.g5,{content:b,getData:X}),supports:{showSavedCards:!1,showSaveOption:!1,features:X("features")}});var z=r(214),Z=r(87),Q=(0,a.mt)("stripe_alipay_data");Q()&&(0,o.registerPaymentMethod)({name:Q("name"),label:Z.createElement(z.i,{title:Q("title"),paymentMethod:Q("name"),icons:Q("icon")}),ariaLabel:"Alipay",placeOrderButtonLabel:Q("placeOrderButtonLabel"),canMakePayment:v(Q),content:Z.createElement(s.g5,{content:b,getData:Q}),edit:Z.createElement(s.g5,{content:b,getData:Q}),supports:{showSavedCards:!1,showSaveOption:!1,features:Q("features")}});var tt=r(87);function et(t){return et="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},et(t)}var rt=["title","getData"];function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ot(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=et(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==et(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function at(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var it=(0,a.mt)("stripe_afterpay_data"),ct=function(t){var e,r,o=t.title,c=t.getData,u=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,rt),l=u.components.PaymentMethodLabel,f=(e=(0,n.useState)({amount:c("cartTotal"),currency:c("currency"),isCartEligible:!0}),r=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return at(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?at(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.")}()),p=f[0],y=f[1];return(0,n.useEffect)((function(){var t=function(t){return y(t.detail.options)};return document.addEventListener("stripeAfterpayChange",t),function(){return document.removeEventListener("stripeAfterpayChange",t)}}),[]),c("paymentSections").includes("checkout")?tt.createElement("div",{className:"wc-stripe-label-container"},tt.createElement(l,{text:o}),tt.createElement("div",{className:"wc-stripe-afterpay-message-container"},tt.createElement(w.A,null,tt.createElement(i.Elements,{stripe:a.eV,options:{locale:c("elementOptions").locale}},tt.createElement("div",{className:"wc-stripe-blocks-afterpay__label"},tt.createElement(i.AfterpayClearpayMessageElement,{options:ot(ot({},c("checkoutMessageOptions")),p)})))))):tt.createElement(s.in,{paymentMethod:u.paymentMethod,title:o,icons:u.icons,components:u.components})};it()&&(0,o.registerPaymentMethod)({name:it("name"),label:tt.createElement(ct,{title:it("title"),paymentMethod:it("name"),icons:it("icon"),getData:it}),ariaLabel:it("title"),placeOrderButtonLabel:it("placeOrderButtonLabel"),canMakePayment:v(it,(function(t){t.settings;var e,r=t.cartTotals,n=t.billingAddress,o=r.currency_code,a=r.currency_minor_unit,i=r.total_price,c=n.country,u=function(t){var e=t.total,r=t.currency,n=!1,o=t.country,a=it("requiredParams"),i=it("accountCountry"),c=!!a.hasOwnProperty(r)&&a[r];if(c){var u=null==c?void 0:c[0];Array.isArray(u)||(u=[u]),n=u.indexOf(i)>-1&&("EUR"!==r||!o||i===o)&&e>(null==c?void 0:c[1])&&e<(null==c?void 0:c[2])}return n}({total:parseInt(i)/Math.pow(10,a),currency:o,country:c});return e={amount:parseInt(r.total_price),currency:o,isCartEligible:u},document.dispatchEvent(new CustomEvent("stripeAfterpayChange",{detail:{options:e}})),u})),content:tt.createElement(s.g5,{content:b,getData:it}),edit:tt.createElement(s.g5,{content:b,getData:it}),supports:{showSavedCards:!1,showSaveOption:!1,features:it("features")}});var ut=r(87),lt=(0,a.mt)("stripe_boleto_data");lt()&&(0,o.registerPaymentMethod)({name:lt("name"),label:ut.createElement(s.in,{title:lt("title"),paymentMethod:lt("name"),icons:lt("icon")}),ariaLabel:"Boleto",placeOrderButtonLabel:lt("placeOrderButtonLabel"),canMakePayment:v(lt),content:ut.createElement(s.g5,{content:b,getData:lt,shouldCreatePaymentMethod:!1}),edit:ut.createElement(s.g5,{content:b,getData:lt,shouldCreatePaymentMethod:!1}),supports:{showSavedCards:!1,showSaveOption:!1,features:lt("features")}});var st=r(87),ft=(0,a.mt)("stripe_oxxo_data");ft()&&(0,o.registerPaymentMethod)({name:ft("name"),label:st.createElement(s.in,{title:ft("title"),paymentMethod:ft("name"),icons:ft("icon")}),ariaLabel:"OXXO",placeOrderButtonLabel:ft("placeOrderButtonLabel"),canMakePayment:v(ft),content:st.createElement(s.g5,{content:b,getData:ft,confirmationMethod:"confirmOxxoPayment"}),edit:st.createElement(s.g5,{content:b,getData:ft}),supports:{showSavedCards:!1,showSaveOption:!1,features:ft("features")}});var pt=r(87);function yt(t){return yt="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},yt(t)}var mt=["title","components"];function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var vt=(0,a.mt)("stripe_affirm_data"),bt=function(t){var e,r,o,c=t.title,u=t.components,l=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,mt),f=u.PaymentMethodLabel,p=(0,n.useState)(function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=yt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=yt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==yt(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({amount:null===(e=vt("cartTotals"))||void 0===e?void 0:e.value,currency:vt("currency")},vt("messageOptions"))),y=(o=2,function(t){if(Array.isArray(t))return t}(r=p)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(r,o)||function(t,e){if(t){if("string"==typeof t)return dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dt(t,e):void 0}}(r,o)||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.")}()),m=y[0],h=y[1];return(0,n.useEffect)((function(){var t=function(t){h(t.detail.options)};return document.addEventListener("stripeAffirmChange",t),function(){return document.removeEventListener("stripeAffirmChange",t)}}),[]),vt("paymentSections").includes("checkout")?pt.createElement("div",{className:"wc-stripe-label-container"},pt.createElement(f,{text:c}),pt.createElement(w.A,null,pt.createElement("div",{className:"wc-stripe-affirm-message-container"},pt.createElement(i.Elements,{stripe:a.eV,options:{locale:vt("elementOptions").locale}},pt.createElement(i.AffirmMessageElement,{options:m}))))):pt.createElement(s.in,{paymentMethod:l.paymentMethod,title:c,icons:l.icons,components:u})};vt()&&(0,o.registerPaymentMethod)({name:vt("name"),label:pt.createElement(bt,{title:vt("title"),paymentMethod:vt("name"),icons:vt("icon")}),ariaLabel:"Affirm",placeOrderButtonLabel:vt("placeOrderButtonLabel"),canMakePayment:function(t){var e,r=t.cart,n=r.cartTotals,o=r.billingAddress,a=n.currency_code,i=parseInt(n.total_price);return vt("requirements"),vt("accountCountry"),e={amount:i,currency:a},document.dispatchEvent(new CustomEvent("stripeAffirmChange",{detail:{options:e}})),function(t){var e=t.amount,r=t.billingCountry,n=void 0===r?null:r,o=t.currency,a=vt("requirements"),i=vt("accountCountry");return n?o in a&&i===n&&5e3<=e&&e<=3e6:o in a&&5e3<=e&&e<=3e6}({amount:i,billingCountry:o.country,currency:a})},content:pt.createElement(s.g5,{content:b,getData:vt,confirmationMethod:"confirmAffirmPayment"}),edit:pt.createElement(s.g5,{content:b,getData:vt}),supports:{showSavedCards:!1,showSaveOption:!1,features:vt("features")}});var gt=r(87),wt=(0,a.mt)("stripe_blik_data");wt()&&(0,o.registerPaymentMethod)({name:wt("name"),label:gt.createElement(s.in,{title:wt("title"),paymentMethod:wt("name"),icons:wt("icon")}),ariaLabel:"BLIK",placeOrderButtonLabel:wt("placeOrderButtonLabel"),canMakePayment:v(wt),content:gt.createElement(s.g5,{content:b,getData:wt,shouldCreatePaymentMethod:!1}),edit:gt.createElement(s.g5,{content:b,getData:wt}),supports:{showSavedCards:!1,showSaveOption:!1,features:wt("features")}});var Ot=r(87),Et=(0,a.mt)("stripe_konbini_data");Et()&&(0,o.registerPaymentMethod)({name:Et("name"),label:Ot.createElement(s.in,{title:Et("title"),paymentMethod:Et("name"),icons:Et("icon")}),ariaLabel:"Konbini",placeOrderButtonLabel:Et("placeOrderButtonLabel"),canMakePayment:v(Et),content:Ot.createElement(s.g5,{content:b,getData:Et}),edit:Ot.createElement(s.g5,{content:b,getData:Et}),supports:{showSavedCards:!1,showSaveOption:!1,features:Et("features")}});var St=r(87),Pt=(0,a.mt)("stripe_paynow_data");Pt()&&(0,o.registerPaymentMethod)({name:Pt("name"),label:St.createElement(s.in,{title:Pt("title"),paymentMethod:Pt("name"),icons:Pt("icon")}),ariaLabel:"PayNow",placeOrderButtonLabel:Pt("placeOrderButtonLabel"),canMakePayment:v(Pt),content:St.createElement(s.g5,{content:b,getData:Pt}),edit:St.createElement(s.g5,{content:b,getData:Pt}),supports:{showSavedCards:!1,showSaveOption:!1,features:Pt("features")}});var jt=r(87),xt=(0,a.mt)("stripe_promptpay_data");xt()&&(0,o.registerPaymentMethod)({name:xt("name"),label:jt.createElement(s.in,{title:xt("title"),paymentMethod:xt("name"),icons:xt("icon")}),ariaLabel:"PromptPay",placeOrderButtonLabel:xt("placeOrderButtonLabel"),canMakePayment:v(xt),content:jt.createElement(s.g5,{content:b,getData:xt}),edit:jt.createElement(s.g5,{content:b,getData:xt}),supports:{showSavedCards:!1,showSaveOption:!1,features:xt("features")}});var _t=r(87),kt=(0,a.mt)("stripe_swish_data");kt()&&(0,o.registerPaymentMethod)({name:kt("name"),label:_t.createElement(s.in,{title:kt("title"),paymentMethod:kt("name"),icons:kt("icon")}),ariaLabel:"Swish",placeOrderButtonLabel:kt("placeOrderButtonLabel"),canMakePayment:v(kt),content:_t.createElement(s.g5,{content:b,getData:kt,confirmationMethod:"confirmSwishPayment"}),edit:_t.createElement(s.g5,{content:b,getData:kt}),supports:{showSavedCards:!1,showSaveOption:!1,features:kt("features")}});var Ct=r(87),Lt=(0,a.mt)("stripe_amazonpay_data");Lt()&&(0,o.registerPaymentMethod)({name:Lt("name"),label:Ct.createElement(s.in,{title:Lt("title"),paymentMethod:Lt("name"),icons:Lt("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:Lt("placeOrderButtonLabel"),canMakePayment:v(Lt),content:Ct.createElement(s.g5,{content:b,getData:Lt}),edit:Ct.createElement(s.g5,{content:b,getData:Lt}),supports:{showSavedCards:!1,showSaveOption:!1,features:Lt("features")}});var At=r(87),Mt=(0,a.mt)("stripe_cashapp_data");Mt()&&(0,o.registerPaymentMethod)({name:Mt("name"),label:At.createElement(s.in,{title:Mt("title"),paymentMethod:Mt("name"),icons:Mt("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:Mt("placeOrderButtonLabel"),canMakePayment:v(Mt),content:At.createElement(s.g5,{content:b,getData:Mt}),edit:At.createElement(s.g5,{content:b,getData:Mt}),supports:{showSavedCards:!1,showSaveOption:!1,features:Mt("features")}});var Dt=r(87),Tt=(0,a.mt)("stripe_revolut_data");Tt()&&(0,o.registerPaymentMethod)({name:Tt("name"),label:Dt.createElement(s.in,{title:Tt("title"),paymentMethod:Tt("name"),icons:Tt("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:Tt("placeOrderButtonLabel"),canMakePayment:v(Tt),content:Dt.createElement(s.g5,{content:b,getData:Tt}),edit:Dt.createElement(s.g5,{content:b,getData:Tt}),supports:{showSavedCards:!1,showSaveOption:!1,features:Tt("features")}});var Nt=r(87),It=(0,a.mt)("stripe_zip_data");It()&&(0,o.registerPaymentMethod)({name:It("name"),label:Nt.createElement(s.in,{title:It("title"),paymentMethod:It("name"),icons:It("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:It("placeOrderButtonLabel"),canMakePayment:v(It),content:Nt.createElement(s.g5,{content:b,getData:It}),edit:Nt.createElement(s.g5,{content:b,getData:It}),supports:{showSavedCards:!1,showSaveOption:!1,features:It("features")}});var Rt=r(87),Bt=(0,a.mt)("stripe_mobilepay_data");Bt()&&(0,o.registerPaymentMethod)({name:Bt("name"),label:Rt.createElement(s.in,{title:Bt("title"),paymentMethod:Bt("name"),icons:Bt("icon")}),ariaLabel:"Ideal",placeOrderButtonLabel:Bt("placeOrderButtonLabel"),canMakePayment:v(Bt),content:Rt.createElement(s.g5,{content:b,getData:Bt}),edit:Rt.createElement(s.g5,{content:b,getData:Bt}),supports:{showSavedCards:!1,showSaveOption:!1,features:Bt("features")}});var Gt=r(756),Ft=r(87),Ut=(0,a.mt)("stripe_ach_data");Ut()&&(0,o.registerPaymentMethod)({name:Ut("name"),label:Ft.createElement(s.in,{title:Ut("title"),paymentMethod:Ut("name"),icons:Ut("icons")}),ariaLabel:"ACH Payment",canMakePayment:function(t){return"USD"===t.cartTotals.currency_code&&"US"===Ut("accountCountry")},content:Ft.createElement(s.g5,{content:b,getData:Ut,mandate:!Ut("mandate"),mandateText:Ut("mandateText")}),edit:Ft.createElement(s.g5,{content:b,getData:Ut,mandate:!Ut("mandate"),mandateText:Ut("mandateText")}),savedTokenComponent:Ft.createElement(Gt.A,{getData:Ut}),placeOrderButtonLabel:Ut("placeOrderButtonLabel"),supports:{showSavedCards:Ut("showSavedCards"),showSaveOption:Ut("showSaveOption"),features:Ut("features")}});var Yt=r(87),qt=(0,a.mt)("stripe_twint_data");qt()&&(0,o.registerPaymentMethod)({name:qt("name"),label:Yt.createElement(s.in,{title:qt("title"),paymentMethod:qt("name"),icons:qt("icon")}),ariaLabel:"Twint",placeOrderButtonLabel:qt("placeOrderButtonLabel"),canMakePayment:v(qt),content:Yt.createElement(s.g5,{content:b,getData:qt}),edit:Yt.createElement(s.g5,{content:b,getData:qt}),supports:{showSavedCards:!1,showSaveOption:!1,features:qt("features")}})},629:(t,e,r)=>{"use strict";r.r(e);var n=r(87),o=r(83),a=r(954),i=r(673),c=r(926),u=r(87),l=["getData","onClick","onClose","billing","shippingData","eventRegistration","emitResponse","onSubmit","activePaymentMethod"],s=["getData"];function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function p(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var y=(0,a.mt)("stripe_payment_request_data"),m=function(t){return u.createElement("div",{className:"wc-stripe-payment-request-container"},u.createElement(c.Elements,{stripe:a.eV},u.createElement(h,t)))},h=function(t){var e,r,o=t.getData,a=t.onClick,s=t.onClose,y=t.billing,m=t.shippingData,h=t.eventRegistration,d=t.emitResponse,v=t.onSubmit,b=t.activePaymentMethod,g=(p(t,l),h.onPaymentSetup),w=d.noticeContexts,O=(0,c.useStripe)(),E=(e=(0,i.Xp)(),r=1,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(e,r)||function(t,e){if(t){if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(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.")}())[0],S=(0,i.Tn)();(0,i.R)({payment_method:o("name"),width:375});var P=(0,i.DA)({getData:o,billing:y,shippingData:m,onPaymentSetup:g,emitResponse:d,error:E,onSubmit:v,activePaymentMethod:b,exportedValues:S}).setPaymentMethod;(0,i.Jy)({getData:o,eventRegistration:h,emitResponse:d,activePaymentMethod:b,messageContext:w.EXPRESS_PAYMENTS});var j=(0,i.zc)({getData:o,onClose:s,stripe:O,billing:y,shippingData:m,eventRegistration:h,setPaymentMethod:P,exportedValues:S,canPay:function(t){return null!=t&&!t.applePay&&t.googlePay}}).paymentRequest,x=(0,n.useMemo)((function(){return{paymentRequest:j,style:{paymentRequestButton:o("paymentRequestButton")}}}),[j]);return j?u.createElement(c.PaymentRequestButtonElement,{options:x,onClick:a}):null},d=function(t){t.getData,p(t,s);var e=(0,n.useRef)();return(0,n.useEffect)((function(){var t=window.devicePixelRatio;e.current.width=20*t,e.current.height=20*t;var r=e.current.getContext("2d");r.scale(t,t),r.beginPath(),r.arc(10,10,10,0,2*Math.PI),r.fillStyle="#986fff",r.fill()})),u.createElement("div",{className:"payment-request-block-editor"},u.createElement("div",{className:"icon-container"},u.createElement("span",null,"Buy now"),u.createElement("canvas",{className:"PaymentRequestButton-icon",ref:e}),u.createElement("i",{className:"payment-request-arrow"})))};((0,a.Mb)()&&y("cartCheckoutEnabled")||(0,a.MC)()&&y("expressCheckoutEnabled"))&&(0,o.registerExpressPaymentMethod)({name:y("name"),canMakePayment:function(t){var e=t.cartTotals,r=e.currency_code,n=e.total_price;return(0,a.Lk)({country:y("countryCode"),currency:r.toLowerCase(),total:{label:y("totalLabel"),amount:parseInt(n)}},(function(t){return null!=t&&!t.applePay&&t.googlePay}))},content:u.createElement(m,{getData:y}),edit:u.createElement(d,{getData:y}),supports:{showSavedCards:y("showSavedCards"),showSaveOption:y("showSaveOption"),features:y("features")}})},756:(t,e,r)=>{"use strict";r.d(e,{A:()=>f});var n=r(87),o=r(673),a=r(954);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 c(){c=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function y(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var m="suspendedStart",h="suspendedYield",d="executing",v="completed",b={};function g(){}function w(){}function O(){}var E={};f(E,u,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,u)&&(E=P);var j=O.prototype=g.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,c,u){var l=y(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==i(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=m;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=y(e,r,n);if("normal"===l.type){if(o=n.done?v:h,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=y(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(i(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=f(O,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,f(t,s,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),f(_.prototype,l,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(p(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),f(j,s,"Generator"),f(j,u,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function u(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function l(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?l(Object(r),!0).forEach((function(e){var n,o,a,c;n=t,o=e,a=r[e],c=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==i(c)?c:c+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}const f=/^(248|38|666)$/.test(r.j)?function(t){var e=t.eventRegistration,r=t.emitResponse,i=t.billing,l=t.getData,f=t.confirmation_method,p=void 0===f?"automatic":f,y=e.onCheckoutSuccess,m=e.onCheckoutFail,h=i.billingAddress,d=(0,n.useRef)({emitResponse:r,billingAddress:h});(0,n.useEffect)((function(){d.current=s(s({},d.current),{},{emitResponse:r,billingAddress:h})}),[r,h]),(0,o.iy)({emitResponse:r,subscriber:m,messageContext:r.noticeContexts.PAYMENTS});var v=(0,n.useCallback)(function(){var t,e=(t=c().mark((function t(e){var r,n,o,i,u,s;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.redirectUrl,n=d.current,o=n.emitResponse,i=n.billingAddress,"automatic"!==p){t.next=12;break}if(!(u=(0,a.LI)(r))){t.next=10;break}return t.next=6,a.eV;case 6:return s=t.sent,t.next=9,(0,a.aC)({args:u,stripe:s,emitResponse:o,billingAddress:i});case 9:case 14:return t.abrupt("return",t.sent);case 10:t.next=15;break;case 12:return t.next=14,(0,a.J3)({redirectUrl:r,getData:l,emitResponse:o});case 15:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){u(a,n,o,i,c,"next",t)}function c(t){u(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),[p]);return(0,n.useEffect)((function(){var t=y(v);return function(){return t()}}),[y,v]),null}:null},531:(t,e,r)=>{"use strict";r.r(e);var n=r(87),o=r(83),a=r(926),i=r(979),c=r(954),u=r(756),l=r(673),s=r(87);function f(t){return f="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},f(t)}var p=["getData"];function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){var n,o,a,i;n=t,o=e,a=r[e],i=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o),(o="symbol"==f(i)?i:i+"")in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(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 d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var v=(0,c.mt)("stripe_upm_data"),b=v("i18n"),g=function(t){var e=t.billing,r=t.emitResponse,o=t.shouldSavePayment,c=t.eventRegistration,u=t.activePaymentMethod,f=v("name"),p=v("installmentsActive"),y=(0,a.useStripe)(),d=h((0,n.useState)({complete:!1,paymentMethodType:""}),2),g=d[0],w=d[1],O=h((0,n.useState)(!0),2),E=O[0],S=O[1],P=e.billingAddress,j=c.onCheckoutSuccess,x=c.onCheckoutFail,_=r.noticeContexts;(0,l.iy)({emitResponse:r,subscriber:x,messageContext:_.PAYMENTS});var k=(0,l.dP)({name:f,emitResponse:r,billingAddress:P,shouldSavePayment:o,eventRegistration:c,shouldCreatePaymentMethod:E}),C=(k.paymentMethodType,k.createPaymentMethod),L=k.setPaymentMethodType,A=k.addPaymentMethodData;(0,l.mk)({name:f,emitResponse:r,billingAddress:P,onCheckoutSuccess:j,activePaymentMethod:u});var M=(0,n.useCallback)((function(t){var e=t.value,r=void 0===e?null:e,n=t.complete,o=void 0!==n&&n;null!=r&&r.type&&(L(r.type),S(!["blik","boleto"].includes(r.type))),w({complete:o,paymentMethodType:r.type})}),[]),D=m({defaultValues:{billingDetails:{phone:P.phone,email:P.email,name:"".concat(P.first_name," ").concat(P.last_name)}},fields:{billingDetails:{address:"never",name:"never",email:"never"}},wallets:{applePay:"never",googlePay:"never"}},v("paymentElementOptions"));return s.createElement(s.Fragment,null,s.createElement(a.PaymentElement,{options:D,onChange:M}),s.createElement(i.Fy,{active:p,i18n:b,paymentMethodType:g.paymentMethodType,stripe:y,cardFormComplete:g.complete,createPaymentMethod:C,onChange:function(t){return A("_stripe_installment_plan",t)}}))},w=function(t){t.getData;var e,r=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,p),n=r.billing,o=r.cartData,i=r.shouldSavePayment,u=o.extensions,l=n.cartTotal,f=n.currency,y=m({mode:"payment",currency:null==f||null===(e=f.code)||void 0===e?void 0:e.toLowerCase()},u.stripe_upm.elementOptions);return i&&(y.mode="subscription"),l.value<=0&&(y=m(m({},y),{},{mode:"setup"})),["payment","subscription"].includes(y.mode)&&(y.amount=l.value),s.createElement(a.Elements,{stripe:c.eV,options:y},s.createElement(g,r))};(0,o.registerPaymentMethod)({name:v("name"),label:s.createElement(i.in,{title:v("title"),paymentMethod:v("name"),icons:v("icons")}),ariaLabel:"Credit Cards",canMakePayment:function(){return c.eV},content:s.createElement(i.g5,{content:w,getData:v}),savedTokenComponent:s.createElement(u.A,{getData:v,confirmation_method:"automatic"}),edit:s.createElement(i.g5,{content:w,getData:v}),supports:{showSavedCards:v("showSavedCards"),showSaveOption:v("showSaveOption"),features:v("features")}})},954:(t,e,r)=>{"use strict";r.d(e,{$g:()=>tt,A7:()=>U,C8:()=>q,D$:()=>H,Im:()=>W,J3:()=>X,Jq:()=>it,LI:()=>mt,Lk:()=>at,MC:()=>yt,Mb:()=>pt,NM:()=>et,NQ:()=>lt,Sh:()=>K,Tt:()=>R,UC:()=>Z,VM:()=>nt,Y_:()=>B,Zw:()=>F,aC:()=>z,aM:()=>G,bO:()=>ct,eV:()=>I,g8:()=>$,is:()=>ft,jH:()=>vt,jT:()=>rt,jc:()=>ht,k7:()=>J,mt:()=>V,os:()=>dt,pf:()=>st,u1:()=>Y});var n=r(427),o=r(703),a=r(455),i=r.n(a),c=r(910),u=248==r.j?["id"]:null;function l(t){return function(t){if(Array.isArray(t))return h(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(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 s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var a=e&&e.prototype instanceof g?e:g,i=Object.create(a.prototype),c=new M(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var y="suspendedStart",m="suspendedYield",h="executing",v="completed",b={};function g(){}function w(){}function O(){}var E={};l(E,i,(function(){return this}));var S=Object.getPrototypeOf,P=S&&S(S(D([])));P&&P!==r&&n.call(P,i)&&(E=P);var j=O.prototype=g.prototype=Object.create(E);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=p(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==d(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=y;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=C(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===y)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=p(e,r,n);if("normal"===l.type){if(o=n.done?v:m,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=p(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=O,o(j,"constructor",{value:O,configurable:!0}),o(O,"constructor",{value:w,configurable:!0}),w.displayName=l(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,l(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(_.prototype),l(_.prototype,c,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new _(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,u,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(A),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function f(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function p(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){f(a,n,o,i,c,"next",t)}function c(t){f(a,n,o,i,c,"throw",t)}i(void 0)}))}}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||m(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 m(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function d(t){return d="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},d(t)}function v(t){var e="function"==typeof Map?new Map:void 0;return v=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(b())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(t.bind.apply(t,n));return r&&g(o,r.prototype),o}(t,arguments,w(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,t)},v(t)}function b(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(b=function(){return!!t})()}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function E(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){S(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function S(t,e,r){return(e=P(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function P(t){var e=function(t,e){if("object"!=d(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}var j,x,_=(0,o.getSetting)("stripeGeneralData"),k=_.publishableKey,C=_.stripeParams,L=(0,o.getSetting)("stripeErrorMessages"),A=(0,o.getSetting)("countryLocale",{}),M=/^([\w]+)\:(.+)$/,D=(0,o.getSetting)("stripeGeneralData").routes,T={},N={recipient:function(t,e){return t.first_name=e.split(" ").slice(0,-1).join(" "),t.last_name=e.split(" ").pop(),t},payerName:function(t,e){return t.first_name=e.split(" ").slice(0,-1).join(" "),t.last_name=e.split(" ").pop(),t},country:"country",addressLine:function(t,e){return e[0]&&(t.address_1=e[0]),e[1]&&(t.address_2=e[1]),t},line1:"address_1",line2:"address_2",city:"city",region:"state",state:"state",postalCode:"postcode",postal_code:"postcode",payerEmail:"email",payerPhone:"phone"},I=new Promise((function(t,e){(0,n.c)(k,C).then((function(e){t(e)})).catch((function(e){t({error:e})}))})),R=function(t){var e=t.id,r=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,u);T[e]=r},B=function(t){return T.hasOwnProperty(t)?T[t]:{}},G=function(t){return null!=D&&D[t]?D[t]:console.log("".concat(t," is not a valid route"))},F=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return E({type:t.SUCCESS},e)},U=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return E({type:t.ERROR,message:Y(e)},r)},Y=function(t){return"string"==typeof t?t:null!=t&&t.code&&null!=L&&L[t.code]?L[t.code]:null!=t&&t.statusCode?null!=L&&L[t.statusCode]?L[t.statusCode]:t.statusMessage:t.message},q=function(t){var e={name:"".concat(t.first_name," ").concat(t.last_name),address:{city:t.city||null,country:t.country||null,line1:t.address_1||null,line2:t.address_2||null,postal_code:t.postcode||null,state:t.state||null}};return null!=t&&t.phone&&(e.phone=t.phone),null!=t&&t.email&&(e.email=t.email),e},V=function(t){return function(e){return e?(0,o.getSetting)(t)[e]:(0,o.getSetting)(t)}},$=/^(38|666|919|996)$/.test(r.j)?null:function(t){function e(t){var r,n,o,a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=this,o=e,a=[t.message],o=w(o),r=function(t,e){if(e&&("object"===d(e)||"function"==typeof e))return e;if(void 0!==e)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)}(n,b()?Reflect.construct(o,a||[],w(n).constructor):o.apply(n,a))).error=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g(t,e)}(e,t),r=e,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(v(Error)),W=function(t){return"string"==typeof t?0==t.length||""==t:Array.isArray(t)?0==array.length:"object"!==d(t)||0==Object.keys(t).length},J=function(t,e){return t/Math.pow(10,e)},K=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(["phone","shipping-phone","email"].indexOf(t)>-1){var r=document.getElementById(t);return!!r&&r.required}var n=function(t){var e=E({},A.default);return t&&null!=A&&A[t]&&(e=Object.entries(A[t]).reduce((function(t,e){var r=y(e,2),n=r[0],o=r[1];return t[n]=E(E({},t[n]),o),t}),e),["phone","shipping-phone","email"].forEach((function(t){var r=document.getElementById(t);r&&(e[t]={required:r.required})}))),e}(e);return[t]in n&&n[t].required},H=function(t){var e=t.match(M);if(e){var r=e[1];return[e[2],r]}return[]},X=/^9(19|96)$/.test(r.j)?null:(j=p(s().mark((function t(e){var r,n,o,a,c,u,l,f,p,y,m,h,d,v,b,g,w,O;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.redirectUrl,n=e.emitResponse,o=e.name,a=e.method,c=void 0===a?"confirmCardPayment":a,u=e.savePaymentMethod,l=void 0!==u&&u,f=e.data,p=void 0===f?{}:f,t.prev=1,!(y=r.match(/#response=(.+)/))){t.next=28;break}return m=JSON.parse(window.atob(decodeURIComponent(y[1]))),h=m.type,d=m.client_secret,v=m.order_id,b=m.order_key,t.next=7,I;case 7:if(g=t.sent,"payment_intent"!==h){t.next=14;break}return t.next=11,g[c](d);case 11:w=t.sent,t.next=17;break;case 14:return t.next=16,g.confirmCardSetup(d);case 16:w=t.sent;case 17:if(!w.error){t.next=19;break}return t.abrupt("return",U(n.responseTypes,w.error,{messageContext:n.noticeContexts.PAYMENTS}));case 19:return p=E(E({},p),{},S({order_id:v,order_key:b},"".concat(o,"_save_source_key"),l)),t.next=22,i()({url:G("process/payment"),method:"POST",data:p});case 22:if(!(O=t.sent).messages){t.next=25;break}return t.abrupt("return",U(n.responseTypes,O.messages,{messageContext:n.noticeContexts.PAYMENTS}));case 25:return t.abrupt("return",F(n.responseTypes,{redirectUrl:O.redirect}));case 28:return t.abrupt("return",F(n.responseTypes));case 29:t.next=35;break;case 31:return t.prev=31,t.t0=t.catch(1),console.log(t.t0),t.abrupt("return",U(n.responseTypes,t.t0,{messageContext:n.noticeContexts.PAYMENTS}));case 35:case"end":return t.stop()}}),t,null,[[1,31]])}))),function(t){return j.apply(this,arguments)}),z=/^(248|38|666)$/.test(r.j)?(x=p(s().mark((function t(e){var r,n,o,a,i,c,u,l,f,p,y,m,h,d,v,b;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.args,n=e.stripe,o=e.elements,a=void 0===o?null:o,i=e.emitResponse,c=e.billingAddress,u=r.type,l=r.client_secret,f=r.status,p=r.return_url,y=void 0===p?null:p,m=r.confirmation_args,h=void 0===m?null:m,!["requires_action","requires_payment_method","requires_confirmation"].includes(f)){t.next=32;break}if(t.prev=3,"payment_intent"!==u){t.next=10;break}return t.next=7,n.confirmPayment(E(E({},a&&{elements:a}),{},{clientSecret:l,redirect:"if_required",confirmParams:E({return_url:y,payment_method_data:{billing_details:q(c)},expand:["payment_method"]},h&&h)}));case 7:d=t.sent,t.next=13;break;case 10:return t.next=12,n.confirmSetup({clientSecret:l,redirect:"always",confirmParams:{return_url:y,payment_method_data:{billing_details:q(c)},expand:["payment_method"]}});case 12:d=t.sent;case 13:if(!d.error){t.next=15;break}throw d.error;case 15:if(v=d.paymentIntent.payment_method,!["promptpay","swish","paynow","cashapp"].includes(v.type)){t.next=21;break}if("requires_action"!==d.paymentIntent.status){t.next=19;break}throw{code:"payment_cancelled"};case 19:if("requires_payment_method"!==d.paymentIntent.status){t.next=21;break}throw{code:d.paymentIntent.last_payment_error.code};case 21:return(b=new URL(y)).searchParams.append("payment_intent",d.paymentIntent.id),b.searchParams.append("payment_intent_client_secret",d.paymentIntent.client_secret),t.abrupt("return",F(i.responseTypes,{redirectUrl:b.toString()}));case 27:return t.prev=27,t.t0=t.catch(3),t.abrupt("return",U(i.responseTypes,t.t0,{messageContext:i.noticeContexts.PAYMENTS}));case 30:t.next=33;break;case 32:return t.abrupt("return",F(i.responseTypes));case 33:case"end":return t.stop()}}),t,null,[[3,27]])}))),function(t){return x.apply(this,arguments)}):null,Z=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N;return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};e=E(E({},e),Q(r));for(var o=0,a=Object.entries(t);o<a.length;o++){var i,c=y(a[o],2),u=c[0],l=c[1];null!==(i=e)&&void 0!==i&&i[u]&&("function"==typeof l?l(n,e[u]):n[l]=e[u])}return n}},Q=function(t){return Object.keys(t).filter((function(e){return Boolean(t[e])})).reduce((function(e,r){return E(E({},e),{},S({},r,t[r]))}),{})},tt=function(t,e){var r,n=(0,c.getCurrency)(e),o=n.prefix,a=n.suffix,i=n.decimalSeparator,u=n.minorUnit,l=n.thousandSeparator;if(""==t||void 0===t)return t;t="string"==typeof t?parseInt(t,10):t;var s="",f=(t=(t/=Math.pow(10,u)).toString().replace(".",i)).indexOf(i);f<0?u>0&&(t+="".concat(i).concat(new Array(u+1).join("0"))):(s=t.substr(f+1)).length<u&&(t+=new Array(u-s.length+1).join("0"));var p=t.match(new RegExp("(\\d+)\\".concat(i,"(\\d+)")));return p&&(t=p[1],s=p[2]),t=t.replace(new RegExp("\\B(?=(\\d{3})+(?!\\d))","g"),"".concat(l)),o+(t=(null===(r=s)||void 0===r?void 0:r.length)>0?t+i+s:t)+a},et=function(t){var e=[];return t.forEach((function(t,r){t.shipping_rates.sort((function(t){return t.selected?-1:1}));var n=t.shipping_rates.map((function(t){var e=document.createElement("textarea");return e.innerHTML=t.name,tt(t.price,t.currency_code),{id:rt(r,t.rate_id),label:e.value,amount:parseInt(t.price,10)}}));e=[].concat(l(e),l(n))})),e},rt=function(t,e){return"".concat(t,":").concat(e)},nt=function(t,e){e.minorUnit;var r=[],n=["total_tax","total_shipping"];return t.forEach((function(t){(0<t.value||t.key&&n.includes(t.key))&&r.push({label:t.label,pending:!1,amount:t.value})})),r},ot={},at=function(t,e){var r=t.country,n=t.currency,o=t.total;return new Promise((function(t,a){var i=[r,n,o.amount].reduce((function(t,e){return"".concat(t,"-").concat(e)}));return n?i in ot?t(ot[i]):I.then((function(c){if(c.error)return a(c.error);c.paymentRequest({country:r,currency:n,total:o}).canMakePayment().then((function(r){return ot[i]=e(r),t(ot[i])}))})).catch(a):t(!1)}))},it=function(){var t=(0,o.getSetting)("stripePaymentData");return t&&t.pre_order},ct=function(){var t=(0,o.getSetting)("stripePaymentData");return t&&t.subscription},ut=function(t){return"".concat("stripe:").concat(t)},lt=function(t,e){var r=Math.floor((new Date).getTime()/1e3)+900;"sessionStorage"in window&&sessionStorage.setItem(ut(t),JSON.stringify({value:e,exp:r}))},st=function(t){if("sessionStorage"in window)try{var e=JSON.parse(sessionStorage.getItem(ut(t)));if(e){var r=e.value,n=e.exp;if(!(Math.floor((new Date).getTime()/1e3)>n))return r;ft(ut(t))}}catch(t){}return null},ft=function(t){"sessionStorage"in window&&sessionStorage.removeItem(ut(t))},pt=function(){return"cart"===(0,o.getSetting)("stripeGeneralData").page},yt=function(){return"checkout"===(0,o.getSetting)("stripeGeneralData").page},mt=function(t){var e=t.match(/#response=(.+)/),r=null;return e&&(r=JSON.parse(window.atob(decodeURIComponent(e[1])))),r},ht=function(t){var e=t.eea_countries,r=t.accountCountry,n=t.requiredParams,o=t.currency,a=t.country,i=void 0===a?null:a,c=!1;if(!i)return o in n;var u=[].concat(l(e),["GB","CH"]);return u.includes(r)?u.includes(i)&&(c=o in n&&n[o].includes(i)):c=o in n&&n[o].includes(i),c},dt={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},vt=E(E({},dt),{},{email:""})},942:(t,e)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t="",e=0;e<arguments.length;e++){var r=arguments[e];r&&(t=i(t,a(r)))}return t}function a(t){if("string"==typeof t||"number"==typeof t)return t;if("object"!=typeof t)return"";if(Array.isArray(t))return o.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var e="";for(var r in t)n.call(t,r)&&t[r]&&(e=i(e,r));return e}function i(t,e){return e?t?t+" "+e:t+e:t}t.exports?(o.default=o,t.exports=o):void 0===(r=function(){return o}.apply(e,[]))||(t.exports=r)}()}}]);
//# sourceMappingURL=commons.js.map

Youez - 2016 - github.com/yon3zu
LinuXploit