import{h as m}from"./app-DLP8qLDG.js";import{e as c,o as f,j as p,C as g,l as x,A as y,u as b,n as e,D as i,t as u,H as v,g as _}from"./Button-C102TjBP.js";const h={class:"min-h-screen bg-gray-100 flex items-center justify-center p-6"},w={class:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-8 shadow-lg text-center"},N={class:"mt-2 text-sm text-gray-600"},k={class:"font-semibold text-gray-900"},I={class:"mt-3 text-xs text-gray-500 break-all"},B=Object.assign({layout:null},{__name:"ThankYou",props:{order_id:{type:Number,required:!0},return_url:{type:String,required:!0},seconds:{type:Number,default:5}},setup(d){const s=d,r=c(Math.max(0,Number(s.seconds||0)));let o=null,a=null;const n=_(()=>(s.return_url||"").trim()||"/");function l(){window.location.href=n.value}return f(()=>{a=setTimeout(l,r.value*1e3),o=setInterval(()=>{r.value=Math.max(0,r.value-1),r.value<=0&&o&&(clearInterval(o),o=null)},1e3)}),p(()=>{o&&clearInterval(o),a&&clearTimeout(a)}),(V,t)=>(g(),x(v,null,[y(b(m),{title:"Pagamento confirmado"}),e("div",h,[e("div",w,[t[2]||(t[2]=e("h1",{class:"text-lg font-bold text-gray-900"},"Pagamento confirmado",-1)),e("p",N,[t[0]||(t[0]=i(" Você será redirecionado de volta em ",-1)),e("span",k,u(r.value),1),t[1]||(t[1]=i("s. ",-1))]),t[3]||(t[3]=e("div",{class:"mt-5 flex justify-center"},[e("span",{class:"inline-block h-10 w-10 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700"})],-1)),e("button",{type:"button",class:"mt-6 w-full rounded-xl bg-gray-900 px-4 py-3 text-sm font-semibold text-white transition-opacity hover:opacity-90",onClick:l}," Voltar agora "),e("p",I,u(n.value),1)])])],64))}});export{B as default};
