import{R as u}from"./vendor-AojMz-9-.js";import{P as s}from"./charts-BBtnqFpA.js";function N(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?N=function(e){return typeof e}:N=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(r)}var Q="clover",Ee=function(e){return e===3?"v3":e},Z="https://js.stripe.com",be="".concat(Z,"/").concat(Q,"/stripe.js"),Ce=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Pe=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;var Oe=function(e){return Ce.test(e)||Pe.test(e)},je=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Z,'"]')),t=0;t<e.length;t++){var n=e[t];if(Oe(n.src))return n}return null},G=function(e){var t="",n=document.createElement("script");n.src="".concat(be).concat(t);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(n),n},xe=function(e,t){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"8.6.4",startTime:t})},R=null,T=null,U=null,we=function(e){return function(t){e(new Error("Failed to load Stripe.js",{cause:t}))}},Re=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}},ke=function(e){return R!==null?R:(R=new Promise(function(t,n){if(typeof window>"u"||typeof document>"u"){t(null);return}if(window.Stripe){t(window.Stripe);return}try{var o=je();if(!(o&&e)){if(!o)o=G(e);else if(o&&U!==null&&T!==null){var a;o.removeEventListener("load",U),o.removeEventListener("error",T),(a=o.parentNode)===null||a===void 0||a.removeChild(o),o=G(e)}}U=Re(t,n),T=we(n),o.addEventListener("load",U),o.addEventListener("error",T)}catch(c){n(c);return}}),R.catch(function(t){return R=null,Promise.reject(t)}))},Ae=function(e,t,n){if(e===null)return null;var o=t[0];if(typeof o!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(N(o)," instead."));var a=o.match(/^pk_test/),c=Ee(e.version),f=Q;a&&c!==f&&console.warn("Stripe.js@".concat(c," was loaded on the page, but @stripe/stripe-js@").concat("8.6.4"," expected Stripe.js@").concat(f,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var i=e.apply(void 0,t);return xe(i,n),i},k,ee=!1,te=function(){return k||(k=ke(null).catch(function(e){return k=null,Promise.reject(e)}),k)};Promise.resolve().then(function(){return te()}).catch(function(r){ee||console.warn(r)});var ze=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];ee=!0;var o=Date.now();return te().then(function(a){return Ae(a,t,o)})};function K(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),t.push.apply(t,n)}return t}function Y(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?K(Object(t),!0).forEach(function(n){re(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):K(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function _(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_=function(e){return typeof e}:_=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_(r)}function re(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Le(r,e){if(r==null)return{};var t={},n=Object.keys(r),o,a;for(a=0;a<n.length;a++)o=n[a],!(e.indexOf(o)>=0)&&(t[o]=r[o]);return t}function Ie(r,e){if(r==null)return{};var t=Le(r,e),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(o=0;o<a.length;o++)n=a[o],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function ne(r,e){return Te(r)||Ue(r,e)||Ne(r,e)||_e()}function Te(r){if(Array.isArray(r))return r}function Ue(r,e){var t=r&&(typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"]);if(t!=null){var n=[],o=!0,a=!1,c,f;try{for(t=t.call(r);!(o=(c=t.next()).done)&&(n.push(c.value),!(e&&n.length===e));o=!0);}catch(i){a=!0,f=i}finally{try{!o&&t.return!=null&&t.return()}finally{if(a)throw f}}return n}}function Ne(r,e){if(r){if(typeof r=="string")return z(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return z(r,e)}}function z(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function _e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var m=function(e,t,n){var o=!!n,a=u.useRef(n);u.useEffect(function(){a.current=n},[n]),u.useEffect(function(){if(!o||!e)return function(){};var c=function(){a.current&&a.current.apply(a,arguments)};return e.on(t,c),function(){e.off(t,c)}},[o,t,e,a])},$=function(e){var t=u.useRef(e);return u.useEffect(function(){t.current=e},[e]),t.current},x=function(e){return e!==null&&_(e)==="object"},We=function(e){return x(e)&&typeof e.then=="function"},Me=function(e){return x(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},X="[object Object]",qe=function r(e,t){if(!x(e)||!x(t))return e===t;var n=Array.isArray(e),o=Array.isArray(t);if(n!==o)return!1;var a=Object.prototype.toString.call(e)===X,c=Object.prototype.toString.call(t)===X;if(a!==c)return!1;if(!a&&!n)return e===t;var f=Object.keys(e),i=Object.keys(t);if(f.length!==i.length)return!1;for(var S={},h=0;h<f.length;h+=1)S[f[h]]=!0;for(var E=0;E<i.length;E+=1)S[i[E]]=!0;var l=Object.keys(S);if(l.length!==f.length)return!1;var j=e,P=t,C=function(A){return r(j[A],P[A])};return l.every(C)},oe=function(e,t,n){return x(e)?Object.keys(e).reduce(function(o,a){var c=!x(t)||!qe(e[a],t[a]);return n.includes(a)?(c&&console.warn("Unsupported prop change: options.".concat(a," is not a mutable property.")),o):c?Y(Y({},o||{}),{},re({},a,e[a])):o},null):null},ae="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.",H=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae;if(e===null||Me(e))return e;throw new Error(t)},$e=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ae;if(We(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(o){return H(o,t)})};var n=H(e,t);return n===null?{tag:"empty"}:{tag:"sync",stripe:n}},Be=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"5.4.1"}),e.registerAppInfo({name:"react-stripe-js",version:"5.4.1",url:"https://stripe.com/docs/stripe-js/react"}))},W=u.createContext(null);W.displayName="ElementsContext";var ie=function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},De=function(e){var t=e.stripe,n=e.options,o=e.children,a=u.useMemo(function(){return $e(t)},[t]),c=u.useState(function(){return{stripe:a.tag==="sync"?a.stripe:null,elements:a.tag==="sync"?a.stripe.elements(n):null}}),f=ne(c,2),i=f[0],S=f[1];u.useEffect(function(){var l=!0,j=function(C){S(function(w){return w.stripe?w:{stripe:C,elements:C.elements(n)}})};return a.tag==="async"&&!i.stripe?a.stripePromise.then(function(P){P&&l&&j(P)}):a.tag==="sync"&&!i.stripe&&j(a.stripe),function(){l=!1}},[a,i,n]);var h=$(t);u.useEffect(function(){h!==null&&h!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[h,t]);var E=$(n);return u.useEffect(function(){if(i.elements){var l=oe(n,E,["clientSecret","fonts"]);l&&i.elements.update(l)}},[n,E,i.elements]),u.useEffect(function(){Be(i.stripe)},[i.stripe]),u.createElement(W.Provider,{value:i},o)};De.propTypes={stripe:s.any,options:s.object};var Fe=function(e){var t=u.useContext(W);return ie(t,e)},Xe=function(){var e=Fe("calls useElements()"),t=e.elements;return t};s.func.isRequired;var se=u.createContext(null);se.displayName="CheckoutContext";s.any,s.shape({clientSecret:s.oneOfType([s.string,s.instanceOf(Promise)]).isRequired,elementsOptions:s.object}).isRequired;var B=function(e){var t=u.useContext(se),n=u.useContext(W);if(t){if(n)throw new Error("You cannot wrap the part of your app that ".concat(e," in both <CheckoutProvider> and <Elements> providers."));return t}else return ie(n,e)},Je=["mode"],Ve=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},v=function(e,t){var n="".concat(Ve(e),"Element"),o=function(i){var S=i.id,h=i.className,E=i.options,l=E===void 0?{}:E,j=i.onBlur,P=i.onFocus,C=i.onReady,w=i.onChange,A=i.onEscape,ue=i.onClick,ce=i.onLoadError,le=i.onLoaderStart,pe=i.onNetworksChange,fe=i.onConfirm,de=i.onCancel,me=i.onShippingAddressChange,ve=i.onShippingRateChange,ye=i.onSavedPaymentMethodRemove,he=i.onSavedPaymentMethodUpdate,L=B("mounts <".concat(n,">")),I="elements"in L?L.elements:null,O="checkoutState"in L?L.checkoutState:null,g=(O==null?void 0:O.type)==="success"||(O==null?void 0:O.type)==="loading"?O.sdk:null,ge=u.useState(null),D=ne(ge,2),d=D[0],Se=D[1],b=u.useRef(null),M=u.useRef(null);m(d,"blur",j),m(d,"focus",P),m(d,"escape",A),m(d,"click",ue),m(d,"loaderror",ce),m(d,"loaderstart",le),m(d,"networkschange",pe),m(d,"confirm",fe),m(d,"cancel",de),m(d,"shippingaddresschange",me),m(d,"shippingratechange",ve),m(d,"savedpaymentmethodremove",ye),m(d,"savedpaymentmethodupdate",he),m(d,"change",w);var q;C&&(e==="expressCheckout"?q=C:q=function(){C(d)}),m(d,"ready",q),u.useLayoutEffect(function(){if(b.current===null&&M.current!==null&&(I||g)){var p=null;if(g)switch(e){case"paymentForm":p=g.createPaymentFormElement();break;case"payment":p=g.createPaymentElement(l);break;case"address":if("mode"in l){var J=l.mode,V=Ie(l,Je);if(J==="shipping")p=g.createShippingAddressElement(V);else if(J==="billing")p=g.createBillingAddressElement(V);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":p=g.createExpressCheckoutElement(l);break;case"currencySelector":p=g.createCurrencySelectorElement();break;case"taxId":p=g.createTaxIdElement(l);break;default:throw new Error("Invalid Element type ".concat(n,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else I&&(p=I.create(e,l));b.current=p,Se(p),p&&p.mount(M.current)}},[I,g,l]);var F=$(l);return u.useEffect(function(){if(b.current){var p=oe(l,F,["paymentRequest"]);p&&"update"in b.current&&b.current.update(p)}},[l,F]),u.useLayoutEffect(function(){return function(){if(b.current&&typeof b.current.destroy=="function")try{b.current.destroy(),b.current=null}catch{}}},[]),u.createElement("div",{id:S,className:h,ref:M})},a=function(i){B("mounts <".concat(n,">"));var S=i.id,h=i.className;return u.createElement("div",{id:S,className:h})},c=t?a:o;return c.propTypes={id:s.string,className:s.string,onChange:s.func,onBlur:s.func,onFocus:s.func,onReady:s.func,onEscape:s.func,onClick:s.func,onLoadError:s.func,onLoaderStart:s.func,onNetworksChange:s.func,onConfirm:s.func,onCancel:s.func,onShippingAddressChange:s.func,onShippingRateChange:s.func,onSavedPaymentMethodRemove:s.func,onSavedPaymentMethodUpdate:s.func,options:s.object},c.displayName=n,c.__elementType=e,c},y=typeof window>"u",Ge=u.createContext(null);Ge.displayName="EmbeddedCheckoutProviderContext";var He=function(){var e=B("calls useStripe()"),t=e.stripe;return t};v("auBankAccount",y);v("card",y);v("cardNumber",y);v("cardExpiry",y);v("cardCvc",y);v("iban",y);var Qe=v("payment",y);v("expressCheckout",y);v("paymentRequestButton",y);v("linkAuthentication",y);var Ze=v("address",y);v("shippingAddress",y);v("paymentMethodMessaging",y);v("taxId",y);export{Ze as A,De as E,Qe as P,Xe as a,ze as l,He as u};