1import{_ as w}from"./BodJxGTV.js";import{e as b,s as B,h as S,B as z,m,i as j,a7 as E,c as r,a,b as o,w as l,j as P,n as I,a8 as T,p as C,o as i,d as v}from"./D3mXZbvm.js";import{B as x}from"./CbyiM6aK.js";import{S as A}from"./D0HDmefO.js";import{s as N}from"./BF8o2BCO.js";import{_ as M}from"./DlAUqK2U.js";const O={class:"max-w-md w-full space-y-8 bg-white p-8 rounded-2xl shadow-sm border border-gray-100"},R={key:0,class:"text-center space-y-6"},V={class:"flex justify-center py-4"},L={key:1,class:"text-center space-y-6 animate-fade-in"},$={class:"flex justify-center"},G={class:"bg-green-100 rounded-full p-4"},K={class:"pt-6"},U={key:2,class:"text-center space-y-6"},W=b({__name:"index",setup(q){const g=B().params.id,d=S(),{request:y}=z(),e=m(null),c=m(!0);let n=null;async function u(){try{const s=await y(`/api/v3/orders/${g}`,{method:"GET",headers:{Authorization:`Bearer ${d.token}`}});s.ok&&(e.value=s.data,e.value.state==="finalized"&&(f(),_()))}catch(s){console.error("Error fetching order:",s)}finally{c.value=!1}}function _(){const s=`gtm_purchase_sent_${e.value.identifier||e.value.id}`;if(localStorage.getItem(s)){console.log("GTM purchase event already sent, skipping...");return}T()?.push({event:"purchase",transaction_id:e.value.identifier||e.value.id,value:e.value.total?.net||e.value.price?.total?.gross,currency:e.value.currency||"USD",package_name:e.value.package?.name,enhanced_conversion_data:{email:e.value.userProfile?.email||e.value.user?.email,name:e.value.userProfile?.name||e.value.user?.name}}),localStorage.setItem(s,"1")}const h=()=>{n||(n=N(()=>{u()},2e3))},f=()=>{n&&(clearInterval(n),n=null)};return j(()=>{d.initializeToken(),u(),h()}),E(()=>{f()}),(s,t)=>{const k=C("font-awesome-icon"),p=w;return i(),r("div",{class:I(["min-h-screen bg-gray-50 flex flex-col items-center px-4 sm:px-6 lg:px-8",c.value||e.value?.state==="under_payment"||e.value?.state==="finalized"?"justify-start pt-24":"justify-center"])},[a("div",O,[c.value||e.value?.state==="under_payment"?(i(),r("div",R,[t[0]||(t[0]=a("h1",{class:"text-3xl font-extrabold text-gray-900"},"Payment in progress",-1)),t[1]||(t[1]=a("p",{class:"text-gray-600 text-lg"},"Waiting for payment confirmation...",-1)),a("div",V,[o(A,{size:"lg",color:"primary"})]),t[2]||(t[2]=a("p",{class:"text-sm text-gray-400"},"Please do not close this page.",-1))])):e.value?.state==="finalized"?(i(),r("div",L,[a("div",$,[a("div",G,[o(k,{icon:"check-circle",class:"text-[80px] text-green-600"})])]),t[4]||(t[4]=a("h1",{class:"text-3xl font-extrabold text-gray-900"},"Payment successful",-1)),t[5]||(t[5]=a("div",{class:"space-y-4"},[a("p",{class:"text-gray-600"}," Thank you for your purchase! Your transaction has been completed successfully. "),a("p",{class:"text-gray-600 text-sm"}," Enjoy your experience with Rocketwriter! ")],-1)),a("div",K,[o(p,{to:"/template"},{default:l(()=>[o(x,{variant:"primary",block:"",size:"lg"},{default:l(()=>[...t[3]||(t[3]=[v(" LET'S CREATE A BOOK ",-1)])]),_:1})]),_:1})])])):(i(),r("div",U,[t[7]||(t[7]=P('<div class="flex justify-center" data-v-35f08a4f><div class="bg-red-100 rounded-full p-4 text-red-600" data-v-35f08a4f><svg class="w-12 h-12" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-35f08a4f><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" data-v-35f08a4f></path></svg></div></div><h1 class="text-2xl font-bold text-gray-900" data-v-35f08a4f>Order not found</h1><p class="text-gray-600" data-v-35f08a4f>We couldn't find the order you're looking for.</p>',3)),o(p,{to:"/pricing"},{default:l(()=>[o(x,{variant:"ghost",block:"",class:"mt-4"},{default:l(()=>[...t[6]||(t[6]=[v("Back to Pricing",-1)])]),_:1})]),_:1})]))])],2)}}}),Z=M(W,[["__scopeId","data-v-35f08a4f"]]);export{Z 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.