1import{j as e}from"./vendor-query-Dspsu0Mh.js";import{r}from"./vendor-react-3BZTkTws.js";import{u as R,s as _}from"./index-CkWryGJ-.js";import{s as p,r as x}from"./handoff-CKqOr5-N.js";import"./vendor-ui-DZnMEabJ.js";import"./vendor-supabase-ZdSbhI3i.js";import"./vendor-charts-BzUQ25mX.js";const w={beginner:"/foundations-starter-kit",emerging:"/pricing",ready:"/sprint"},C={beginner:"Your tier is Beginner. That means the free Foundations Starter Kit is the right next stop.",emerging:"Your tier is Emerging. That means Builder Pro is tuned for where you are.",ready:"Your tier is Ready. That means the Revenue Systems Sprint is the right conversation to have next."},b="/foundations-starter-kit";function L(a){const o=a.trim().toLowerCase();return["beginner","emerging","ready"].includes(o)?o:null}function B(){const{user:a,loading:o}=R(),[i,y]=r.useState(null),[u,v]=r.useState(""),[m,T]=r.useState(""),[c,N]=r.useState(!1),f=r.useRef(!1),h=r.useRef(!1),n=r.useMemo(()=>new URLSearchParams(window.location.search),[]);r.useEffect(()=>{document.title="Readiness Diagnostic Complete | Generative Income";const t=document.createElement("meta");return t.name="robots",t.content="noindex, nofollow",document.head.appendChild(t),()=>{document.head.removeChild(t)}},[]),r.useEffect(()=>{if(o||h.current)return;h.current=!0;const t=n.get("tier")??"",l=n.get("score")??"",d=n.get("source")??n.get("src")??"direct";try{const s=window.dataLayer;Array.isArray(s)&&s.push({event:"diagnostic_handoff",tier:t||"unknown",score:l||null,source:d})}catch(s){console.warn("[welcome] analytics push failed",s)}a?.id&&_.from("events").insert({user_id:a.id,event_type:"diagnostic_handoff",properties:{tier:t||"unknown",score:l||null,source:d,path:window.location.pathname+window.location.search}}).then(({error:s})=>{s&&console.warn("[welcome] handoff log failed",s.message)})},[o,n,a]),r.useEffect(()=>{if(o||f.current)return;const t=L(n.get("tier")??""),l=(n.get("score")??"").trim(),d=(n.get("name")??"").trim(),s=p(x(window.location.search));d&&T(d),l&&v(l),y(t);let g=b;t&&(g=w[t]);const S=window.setTimeout(()=>{f.current=!0,window.location.replace(`${g}${s}`)},1200),E=window.setTimeout(()=>N(!0),3e3);return()=>{window.clearTimeout(S),window.clearTimeout(E)}},[o,n,a]);const j=p(x(window.location.search)),k=`${i?w[i]:b}${j}`;return e.jsx("div",{className:"flex min-h-[calc(100vh-14rem)] items-center justify-center py-10",children:e.jsxs("div",{className:"w-full max-w-[560px] rounded-xl border border-border/70 bg-card p-8 text-center shadow-sm md:p-10",children:[e.jsx("p",{className:"font-mono text-xs font-bold uppercase tracking-[0.28em] text-accent",children:"Readiness Diagnostic Complete"}),e.jsxs("div",{className:"mt-5 space-y-5",children:[e.jsx("h1",{className:"font-satoshi text-3xl font-bold leading-tight text-foreground md:text-4xl",children:m?`Nice work, ${m}.`:"Nice work."}),u&&e.jsxs("p",{className:"text-sm leading-[1.8] text-muted-foreground",children:["Your score: ",e.jsx("span",{className:"font-semibold text-foreground",children:u})]}),e.jsx("p",{className:"text-base leading-[1.8] text-foreground/80",children:"We are opening the next page tuned to your result. This takes a second."}),i&&e.jsx("p",{className:"text-sm leading-[1.8] text-muted-foreground",children:C[i]}),!i&&e.jsx("p",{className:"text-sm leading-[1.8] text-muted-foreground",children:"We could not read a tier from your link, so we are taking you to the free Foundations Starter Kit. That is the safest place to start."}),e.jsxs("div",{className:"h-1 w-full overflow-hidden rounded-full bg-muted",role:"status","aria-live":"polite",children:[e.jsx("span",{className:"sr-only",children:"Loading your next step."}),e.jsx("div",{className:c?"h-full w-full bg-accent":"h-full w-full origin-left animate-[welcome-bar_800ms_ease-out_forwards] bg-accent motion-reduce:animate-none",style:{transform:c?void 0:"scaleX(0)"}})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"If this takes more than a few seconds, use the link below."}),e.jsx("a",{href:k,className:`inline-block rounded text-sm font-medium text-primary hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background ${c?"":"invisible"}`,"aria-hidden":!c,tabIndex:c?0:-1,children:"Continue to your next step manually."})]})]})})}export{B 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.