1import{_ as h}from"./Button-C8rMeFKe.js";import{_ as E}from"./Heading-Bw0yNW9s.js";import{d as $,h as A,i as N,j as P,k as w,U as L,al as R,l as T,c as u,n as z,w as H,a as I,o as p,e as m,f as y,y as f,b as O,p as n,s as l,t as i,v as c,L as j}from"./index-DIO3W6p_.js";import{S as D,a as M}from"./stripe-BeGrG-s_.js";import{S as U}from"./BackButton-39h5GRsN.js";const q={class:"bottom"},W=$({__name:"Stripe",setup(x){const k=A(),v=N(),d=P(),{t:S}=w(),t=L(),{getLastPaymentByState:B}=R(),_=T(!1),a=u(()=>k.params.tokenValue),C=u(()=>{var e;return(e=t.order)==null?void 0:e.paymentState}),r=u(()=>{var e;return t.order?B((e=t.order)==null?void 0:e.payments,"processing"):null});z(async()=>{typeof a.value=="string"?t.order||await t.fetchOrder({token:a.value}):d.error(S("payment.stripe.error.invalid_token"))}),H(C,e=>{e==="paid"&&v.push({name:"account.order_detail",params:{tokenValue:a.value}})});const V=e=>{d.error(e)};return(e,o)=>{const g=E,b=h;return p(),I("div",null,[m(g,{size:2},{default:n(()=>[l(i(e.$t("payment.stripe.complete-payment.title")),1)]),_:1}),r.value?(p(),y(c(M),{key:0,appearance:c(D),payment:r.value,onHandleError:V,onLoaded:o[0]||(o[0]=s=>_.value=!0)},{"pay-button":n(({submit:s})=>[m(b,{variant:"primary",size:"medium",onClick:s},{default:n(()=>[l(i(e.$t("payment.stripe.pay")),1)]),_:2},1032,["onClick"])]),_:1},8,["appearance","payment"])):f("",!0),!_.value||!r.value?(p(),y(j,{key:1})):f("",!0),O("div",q,[m(c(U),{onClick:o[1]||(o[1]=s=>e.$router.push({name:"account.order_detail",params:{tokenValue:a.value}}))},{default:n(()=>[l(i(e.$t("account.payment.back")),1)]),_:1})])])}}});export{W as default};
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.