PageSourceSearch

https://app.mhpsalesmanager.com/assets/thank-you-DtZQyAUM.js

js mhpsalesmanager.com collected 2026-10-09 03:11:14 UTC 6,237 bytes, 1 lines download raw bytes

1import{d as S,u as j,j as e,L as C,ae as E,C as y,a as k,Z as D,ag as q,B as L,aG as $,a3 as I,aH as A,A as Y}from"./index-DPtD9kJm.js";import{b as B,d as P}from"./timezone-CIolQoT6.js";import{G as U}from"./globe-Dahp-vpR.js";function x({title:d,description:m}){const[,l]=S();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-canvas p-4",children:e.jsx(y,{className:"w-full max-w-md",children:e.jsx($,{icon:I,title:d,description:m,action:e.jsxs(L,{variant:"outline",onClick:()=>l("/"),children:[e.jsx(A,{className:"mr-2 size-4"}),"Go to home"]})})})})}function i({label:d,value:m}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:d}),e.jsx("p",{className:"mt-1 font-medium",children:m})]})}function K(){var v;const[,d]=S(),l=new URLSearchParams(window.location.search).get("scheduleId"),{data:n,isLoading:b,error:f}=j({queryKey:["/api/public/self-showing-schedules",l],queryFn:async()=>{if(!l)throw new Error("No schedule ID provided");try{const a=await fetch(`/api/public/self-showing-schedules/${l}`);if(!a.ok){const o=await a.text();console.error("[ThankYou] Error response:",o);let r=`Failed to fetch schedule: ${a.status} ${a.statusText}`;try{r=JSON.parse(o).message||r}catch{o&&(r=o)}throw new Error(r)}return(await a.json()).schedule}catch(a){throw console.error("[ThankYou] Error fetching schedule:",a),a}},enabled:!!l,retry:2}),c=n==null?void 0:n.lotId,{data:s,isLoading:F,error:g}=j({queryKey:["/api/lots",c],queryFn:async()=>{var o;if(!c)throw new Error("No unit ID available");try{const r=await fetch("/api/public/lots?limit=1000");if(r.ok){const N=(o=(await r.json()).lots)==null?void 0:o.find(z=>z.id===c);if(N)return N}}catch(r){console.warn("[ThankYou] Public endpoint failed, trying authenticated endpoint:",r)}const a=await fetch(`/api/lots/${c}`,{headers:Y.getAuthHeaders(),credentials:"include"});if(!a.ok)throw new Error(`Failed to fetch lot: ${a.status} ${a.statusText}`);return await a.json()},enabled:!!c,retry:3}),{data:T}=j({queryKey:["/api/parks",s==null?void 0:s.parkId],queryFn:async()=>{var u;if(!(s!=null&&s.parkId))return null;const a=await fetch("/api/public/lots?limit=1000");if(a.ok){const r=(u=(await a.json()).lots)==null?void 0:u.find(h=>h.id===c);return(r==null?void 0:r.park)||null}return null},enabled:!!s&&!!s.parkId&&!s.park}),t=(s==null?void 0:s.park)||T;if(!l)return e.jsx(x,{title:"Invalid request",description:"This link is missing its schedule reference. Open the link from your confirmation message again."});if(b||F)return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-canvas",children:e.jsx(C,{label:"Loading your showing details…"})});if(f)return e.jsx(x,{title:"We could not load this showing",description:f instanceof Error?f.message:"Failed to load showing information."});if(!n&&!b)return e.jsx(x,{title:"Showing not found",description:"This showing schedule no longer exists. Contact the community manager if you believe this is a mistake."});if(g||!s)return e.jsx(x,{title:"We could not load this unit",description:g instanceof Error?g.message:"Failed to load unit information."});const w=(t==null?void 0:t.state)||((v=s==null?void 0:s.park)==null?void 0:v.state),p=B(w);return e.jsx("div",{className:"min-h-screen bg-canvas",children:e.jsxs("div",{className:"container mx-auto max-w-3xl px-4 py-12",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("span",{className:"mx-auto flex size-14 items-center justify-center rounded-full bg-success/10 text-success",children:e.jsx(E,{className:"size-7"})}),e.jsx("h1",{className:"mt-5 text-display-md font-bold",children:"Your showing is confirmed"}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-muted-foreground",children:"Your identity has been verified. Here are the details of your visit."})]}),n&&e.jsx(y,{className:"mt-8",children:e.jsxs(k,{className:"divide-y",children:[e.jsxs("div",{className:"flex items-start gap-3 pb-4",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(D,{className:"size-4"})}),e.jsx(i,{label:"Date",value:new Date(n.startDt).toLocaleDateString("en-US",{timeZone:p.iana,weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),e.jsxs("div",{className:"flex items-start gap-3 py-4",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(q,{className:"size-4"})}),e.jsx(i,{label:"Time",value:`${new Date(n.startDt).toLocaleTimeString("en-US",{timeZone:p.iana,hour:"numeric",minute:"2-digit",hour12:!0})} to ${new Date(n.endDt).toLocaleTimeString("en-US",{timeZone:p.iana,hour:"numeric",minute:"2-digit",hour12:!0})}`})]}),e.jsxs("div",{className:"flex items-start gap-3 pt-4",children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:e.jsx(U,{className:"size-4"})}),e.jsx(i,{label:"Timezone",value:P(w)})]})]})}),e.jsx(y,{className:"mt-6",children:e.jsxs(k,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:[e.jsx(i,{label:"Unit",value:s.nameOrNumber||"Not specified"}),(t==null?void 0:t.name)&&e.jsx(i,{label:"Community",value:t.name})]}),(t==null?void 0:t.address)&&e.jsx(i,{label:"Address",value:e.jsxs(e.Fragment,{children:[t.address,t.city&&t.state&&e.jsxs("span",{className:"block text-sm font-normal text-muted-foreground",children:[t.city,", ",t.state," ",t.zipCode||""]})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-6 border-t pt-6 md:grid-cols-4",children:[s.bedrooms!==null&&s.bedrooms!==void 0&&e.jsx(i,{label:"Bedrooms",value:s.bedrooms}),s.bathrooms!==null&&s.bathrooms!==void 0&&e.jsx(i,{label:"Bathrooms",value:s.bathrooms}),s.sqFt&&e.jsx(i,{label:"Square feet",value:`${s.sqFt.toLocaleStr
1ing()} sq ft`}),s.price&&e.jsx(i,{label:"Price",value:`$${parseFloat(s.price).toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0})}`})]})]})}),e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsx(L,{onClick:()=>d("/"),children:"Browse more properties"})})]})})}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.