1import{P as S,R as A,O as c,z as n,M as P,at as B,U as _,V as k,T as C}from"./index-CDp3i4jH.js";import{u as R}from"./analytics-C39vVpvl.js";import{A as T,f,B as F,a0 as L,C as M,g as O}from"./Routing-CeCKMLmz.js";import"./authSession-C9srQm5Z.js";const r=P("ApplicationThankYou"),g={reviewTitle:"A quick note before you continue",reviewTimeline:"Please bear with us as weâve experienced a recent surge in applications. We manually review every application and are gradually letting people into our beta, so it may take about a week to hear back from us.",reviewMatchmaker:"We encourage you to talk with your AI Matchmaker in the waitlist room. The more your matchmaker learns about you, the better theyâll be able to match you once youâre in.",reviewNextStep:"Your application isnât finished yet. Continue through the remaining onboarding steps to enter the waitlist room.",reviewCtaText:"Continue application"},j=5e3;function E(e,t,a){return Promise.race([e,new Promise((i,o)=>setTimeout(()=>o(new Error(`${a} timed out after ${t}ms`)),t))])}let h=null;async function U(){if(h)return h;try{const e=_(k,"appConfig","applicationThankYouContent"),t=await E(C(e),j,"fetchContent");h=t.exists()?{...g,...t.data()}:g}catch(e){r.capture("fetch_content_failed","warning",{error:e==null?void 0:e.message}),h=g}return h}async function Y(){var e;try{const t=_(k,"appConfig","remoteSettings"),a=await E(C(t),j,"isEnabled");if(!a.exists())return r.capture("remote_settings_doc_missing","warning"),!1;const i=(e=a.data())==null?void 0:e.APPLICATION_THANK_YOU;return(i==null?void 0:i.enabled)===!0}catch(t){return r.capture("is_enabled_check_failed","warning",{error:t==null?void 0:t.message}),!1}}function z(){return n.jsx("div",{"aria-hidden":"true",style:{width:72,height:72,margin:"0 auto 1.5rem",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",background:"rgba(201,169,110,0.08)",border:"0.5px solid var(--brand-accent-border, rgba(201,169,110,0.3))",fontFamily:"var(--brand-font-head, Georgia, serif)",fontSize:"1.75rem",color:"var(--brand-accent, #C9A96E)"},children:"â"})}function D({loadError:e}){return n.jsx(T,{children:n.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1rem",padding:"2rem",textAlign:"center"},children:[n.jsx(B,{name:"crescent",style:{"--color":"var(--brand-accent, #C9A96E)",width:32,height:32}}),n.jsx(f,{size:"sm",style:{color:"var(--brand-text-subtle, #8A8478)"},children:e?`Finishing⦠(${e})`:"Finishing your paymentâ¦"})]})})}function V({enabled:e,data:t,stopTimer:a,nextRoute:i,router:o,analyticsRef:l,setContent:s,setReady:d}){if(a({enabled:e}),!e){r.info("thank_you_disabled_skipping",{nextRoute:i}),o.push(i,"forward","replace");return}s(t),d(!0),l.current.trackEvent("application_thank_you_viewed")}function H({error:e,nextRoute:t,router:a,setLoadError:i}){r.captureError("thank_you_init_failed",e,{nextRoute:t}),i((e==null?void 0:e.message)||"Failed to load"),a.push(t,"forward","replace")}function W({user:e,router:t,analyticsRef:a,nextRoute:i,isEligible:o}){const[l,s]=c.useState(g),[d,u]=c.useState(!1),[y,w]=c.useState(null),m=e==null?void 0:e.uid,p=e==null?void 0:e.onboardingStep,x=e==null?void 0:e.identityVerified;return c.useEffect(()=>{if(r.setContext({userId:m,step:p}),r.info("mounted",{nextRoute:i,identityVerified:x,onboardingStep:p}),!o){t.push(i,"forward","replace");return}const I=r.time("thank_you_init");let v=!1;return Promise.all([Y(),U()]).then(([b,N])=>{v||V({enabled:b,data:N,stopTimer:I,nextRoute:i,router:t,analyticsRef:a,setContent:s,setReady:u})}).catch(b=>{v||H({error:b,nextRoute:i,router:t,setLoadError:w})}),()=>{v=!0}},[t,i,a,m,p,x,o]),{content:l,ready:d,loadError:y}}function $(e){return e!=null&&e.identityVerified?e!=null&&e.hasCompletedPhotoUpload?"/personality-games":"/onboarding-photos":"/identity"}function q(e){return((e==null?void 0:e.gender)||"").toLowerCase()==="male"&&(e==null?void 0:e.applicationFeePaid)===!0}function G({content:e,handleContinue:t,isNavigating:a}){return n.jsx("div",{className:"application-review-shell",children:n.jsxs(F,{className:"application-review-dialog",role:"dialog","aria-modal":"true","aria-label":e.reviewTitle,children:[n.jsx(z,{}
1),n.jsx(L,{children:"Payment confirmed"}),n.jsx(M,{as:"h1",size:"md",style:{marginBottom:"1.5rem"},children:e.reviewTitle}),n.jsxs("div",{className:"application-review-copy",children:[n.jsx(f,{children:e.reviewTimeline}),n.jsx(f,{children:e.reviewMatchmaker}),n.jsx(f,{className:"application-review-thanks",children:"Thank you for your patience!"})]}),n.jsx("div",{className:"application-review-next-step",children:n.jsx(f,{size:"sm",children:e.reviewNextStep})}),n.jsx(O,{fullWidth:!0,onClick:t,loading:a,loadingLabel:"Continuing",children:e.reviewCtaText})]})})}function Z(){const e=S(),t=A(),a=R(),[i,o]=c.useState(!1),l=c.useRef(!1),s=$(e),d=q(e),u=c.useRef(a);u.current=a;const{content:y,ready:w,loadError:m}=W({user:e,router:t,analyticsRef:u,nextRoute:s,isEligible:d}),p=c.useCallback(()=>{l.current||(l.current=!0,o(!0),r.info("thank_you_continue",{nextRoute:s}),u.current.trackEvent("application_thank_you_continue"),t.push(s,"root","replace"))},[t,s]);return w?n.jsx(T,{children:n.jsx(G,{content:y,handleContinue:p,isNavigating:i})}):n.jsx(D,{loadError:m})}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.