1import{aN as p,aC as h,h as k,u as C,r as n,j as u,y as t,l as S}from"./main-YMQGOH2g.js";import{l as _}from"./index-U9JJOqTM.js";import{B as w}from"./billing-redirect-message-YwD2ukxO.js";import{C as y,a as L}from"./checkout-product-summary-DLzvd70w.js";import"./TaskAlt-Cdd-rcAO.js";import"./skeleton-k6cKF9QF.js";import"./billing-queries-C0kCp5Cn.js";import"./formatted-price-DVSpJGz8.js";import"./product-feature-list-DTqUT6Z4.js";function $(){const{productId:e,priceId:s}=p(),r=h(),{billing:{stripe_public_key:l}}=k(),[b]=C(),a=b.get("payment_intent_client_secret"),[d,o]=n.useState(),g=n.useRef(!1);return n.useEffect(()=>{g.current||(_(l).then(async m=>{if(!m||!a){o(c());return}m.retrievePaymentIntent(a).then(async({paymentIntent:i})=>{(i==null?void 0:i.status)==="succeeded"?(await x(i.id),o(c("succeeded",e,s)),window.location.href="/billing"):o(c(i==null?void 0:i.status,e,s))})}),g.current=!0)},[l,a,s,e]),a?u.jsxs(y,{children:[u.jsx(w,{config:d}),u.jsx(L,{showBillingLine:!1})]}):(r("/"),null)}function c(e,s,r){switch(e){case"succeeded":return{message:t("Subscription successful!"),status:"success",buttonLabel:t("Return to site"),link:"/billing"};case"processing":return{message:t("Payment processing. We'll update you when payment is received."),status:"success",buttonLabel:t("Return to site"),link:"/billing"};case"requires_payment_method":return{message:t("Payment failed. Please try another payment method."),status:"error",buttonLabel:t("Go back"),link:f(s,r)};default:return{message:t("Something went wrong"),status:"error",buttonLabel:t("Go back"),link:f(s,r)}}}function f(e,s){return e&&s?`/checkout/${e}/${s}`:"/"}function x(e){return S.post("billing/stripe/store-subscription-details-locally",{payment_intent_id:e})}export{$ as Component}; 2//# sourceMappingURL=checkout-stripe-done-DB2pL9Yw.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.