1import{bC as C,aB as q,r as g,j as e,aI as $,S as W,m,i as R,M as _,n as A,o as d,A as I,L as y,aw as T,ak as j,u as B}from"./index-BbNhRGL9.js";import{u as M}from"./useQuery-vXKwFUGO.js";import{P as b}from"./stripe-products-C1Sz0HJA.js";function K(){const{locationSlug:o}=C(),[u]=q(),N=u.get("type")||"inquiry",l=u.get("program"),[w,v]=g.useState(!1),[c,x]=g.useState(!1),h=l&&b[l]?l:"solo_retreat",i=b[h],p=Math.round(i.price*.85),{data:t,isLoading:k}=M({queryKey:["location-thank-you",o],queryFn:async()=>{const{data:s,error:a}=await j.from("locations").select("id, name, slug, city, state_province, image_url").eq("slug",o).single();if(a)throw a;return s},enabled:!!o}),L=async()=>{x(!0);try{const{data:s,error:a}=await j.functions.invoke("create-program-checkout",{body:{programKey:h,applyCoupon:!0}});if(a)throw a;s!=null&&s.url&&window.open(s.url,"_blank")}catch{B.error("Something went wrong. Please try again.")}finally{x(!1)}},r=N==="question",S=r?"Question Received":"Inquiry Received",P=r?"We've received your question and will get back to you shortly.":"Thank you for your interest! We'll reach out soon with pricing and availability.";if(k)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx($,{className:"h-8 w-8 animate-spin text-primary"})});const n=(t==null?void 0:t.name)||"This Location",f=t!=null&&t.city&&(t!=null&&t.state_province)?`${t.city}, ${t.state_province}`:"";return e.jsxs(e.Fragment,{children:[e.jsx(W,{title:`Thank You - ${n}`,description:`Thank you for your ${r?"question":"inquiry"} about ${n}. We'll be in touch soon.`,noIndex:!0}),e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-4 py-16",children:e.jsxs(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"max-w-lg w-full text-center",children:[e.jsx(m.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},className:"mb-6",children:e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-primary/10",children:e.jsx(R,{className:"h-10 w-10 text-primary"})})}),e.jsx("h1",{className:"font-serif text-3xl md:text-4xl font-medium text-foreground mb-3",children:S}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground mb-4",children:[e.jsx(_,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium text-foreground",children:n}),f&&e.jsxs("span",{className:"text-muted-foreground",children:["· ",f]})]}),e.jsx("p",{className:"text-muted-foreground text-lg mb-8",children:P}),e.jsxs("div",{className:"bg-muted/50 rounded-lg p-6 mb-8 text-left",children:[e.jsx("h2",{className:"font-medium text-foreground mb-4",children:"What happens next?"}),e.jsx("ol",{className:"space-y-3",children:[r?"We'll review your question about the property.":"We'll check availability and pricing for your dates.","A retreat specialist will personally reach out within 24 hours.",r?"We'll answer your question and help with next steps.":"We'll guide you through booking your perfect solo retreat."].map((s,a)=>e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary text-primary-foreground text-sm flex items-center justify-center font-medium",children:a+1}),e.jsx("span",{className:"text-muted-foreground",children:s})]},a))})]}),!r&&!w&&e.jsxs(m.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6,duration:.5},className:"bg-card border-2 border-primary/30 rounded-xl p-6 mb-8 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(A,{className:"h-5 w-5 text-primary"}),e.jsx("span",{className:"text-xs uppercase tracking-widest text-primary font-medium",children:"One-Time Offer"})]}),e.jsxs("h3",{className:"font-serif text-xl text-foreground mb-2",children:["Secure your ",i.label," program today & save 15%"]}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Lock in your program at a discounted rate while we finalize your location details."}),e.jsxs("div",{className:"flex items-baseline gap-3 mb-4",children:[e.jsxs("span",{className:"text-2xl font-serif font-medium text-foreground",children:["$",p.toLocaleStr
1ing()]}),e.jsxs("span",{className:"text-lg text-muted-foreground line-through",children:["$",i.price.toLocaleString()]}),e.jsxs("span",{className:"text-xs bg-primary/10 text-primary px-2 py-0.5 rounded-full font-medium",children:["Save $",(i.price-p).toLocaleString()]})]}),e.jsxs(d,{onClick:L,disabled:c,className:"w-full",size:"lg",children:[c?"Preparing...":"Claim Your 15% Discount",!c&&e.jsx(I,{className:"ml-2 w-4 h-4"})]}),e.jsx("p",{className:"text-xs text-muted-foreground text-center mt-3",children:"Payment terms available through Klarna, Afterpay, etc."}),e.jsx("button",{onClick:()=>v(!0),className:"w-full text-center text-sm text-muted-foreground hover:text-foreground mt-3 transition-colors",children:"No thanks, I'll wait"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[t&&e.jsx(d,{asChild:!0,variant:"outline",children:e.jsxs(y,{to:`/locations/${t.slug}`,children:[e.jsx(T,{className:"h-4 w-4 mr-2"}),"Back to ",n]})}),e.jsx(d,{asChild:!0,children:e.jsx(y,{to:"/locations",children:"Browse More Locations"})})]})]})})]})}export{K 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.