try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`894c5f59-8e16-43c6-9bab-b6c574fa14f2`,e._sentryDebugIdIdentifier=`sentry-dbid-894c5f59-8e16-43c6-9bab-b6c574fa14f2`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{R as t}from"./vendor-misc-hfpbxrii.js";import{$d as n,Ag as r,Dg as i,Fg as a,Ig as o,Um as s,Ym as c,dn as l,lh as u,mr as d,sh as f,sn as p,st as m,v as h,wg as g}from"./entry.client-dr7r6s9a.js";import{s as _}from"./navigation-stack-m5o0zkpw.js";var v=a(),y=e(o(),1),b=r(),x={entries:[],defaultEntry:{size:{width:230,height:230},imageType:`jpg`}},S=2e3,C=l(e=>{let t=(0,v.c)(23),{displayName:n,nextOnboardingFlowUrl:r,isPending:i}=e,{t:a}=u(`WelcomePage`),o=m(),{clear:s}=_(),c,l;t[0]!==i||t[1]!==r||t[2]!==s||t[3]!==o?(c=()=>{if(i||!r)return;let e=setTimeout(()=>{s(),o(r,{replace:!0})},S);return()=>{clearTimeout(e)}},l=[i,o,s,r],t[0]=i,t[1]=r,t[2]=s,t[3]=o,t[4]=c,t[5]=l):(c=t[4],l=t[5]),(0,y.useEffect)(c,l);let d;t[6]!==n||t[7]!==a?(d=a(`Welcome, {name}`,{values:{name:n},shortKey:`welcome_greeting`}),t[6]=n,t[7]=a,t[8]=d):d=t[8];let f=d,g;t[9]===a?g=t[10]:(g=a(`You're all set!`,{shortKey:`welcome_all_set`}),t[9]=a,t[10]=g);let C=g;if(i){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(p,{className:`h-screen w-full bg-container-backgrounds-elevation-background-level-1`,children:(0,b.jsx)(`div`,{className:`flex size-full items-center justify-center`})}),t[11]=e):e=t[11],e}let w=`${f}. ${C}`,T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,b.jsx)(h,{gamerpicImageConstraints:x,kind:`visual`,"aria-hidden":!0}),t[12]=T):T=t[12];let E;t[13]===f?E=t[14]:(E=(0,b.jsx)(`h1`,{className:`text-center text-noninteractive-content-primary-content type-display1`,children:f}),t[13]=f,t[14]=E);let D;t[15]===C?D=t[16]:(D=(0,b.jsx)(`p`,{className:`text-center text-noninteractive-content-primary-content type-body`,children:C}),t[15]=C,t[16]=D);let O;t[17]!==E||t[18]!==D?(O=(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-layout-vertical-title-and-row-regular`,children:[E,D]}),t[17]=E,t[18]=D,t[19]=O):O=t[19];let k;return t[20]!==w||t[21]!==O?(k=(0,b.jsx)(p,{className:`h-screen w-full bg-container-backgrounds-elevation-background-level-1 pb-layout-horizontal-margin pe-layout-horizontal-margin ps-layout-horizontal-margin pt-layout-horizontal-margin`,children:(0,b.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-center gap-layout-vertical-related-content-in-a-section-loose`,role:`status`,"aria-live":`polite`,"aria-label":w,children:[T,O]})}),t[20]=w,t[21]=O,t[22]=k):k=t[22],k},()=>{let{t:e}=u(`WelcomePage`),{authentication:r,onboarding:a,settings:o}=f(),{pathname:c}=s(),[{redirectUri:l}]=t(n.onboarding.welcome),{data:d,isPending:p}=i(r.queries.userInfo.getActiveUserQuery().getOptions()),{data:m,isPending:h}=i(a.queries.onboardingNavigation.getOptions({pathname:c,redirectUri:l})),{mutate:_}=g(o.mutations.setHasCompletedTVOnboardingSetting.getOptions());(0,y.useEffect)(()=>{_({settingValue:!0})},[_]);let v=p||h;return{displayName:d?.fullName||d?.gamertag.base||d?.gamertag.legacyGamertag||e(`Player`,{shortKey:`welcome_player_fallback`}),nextOnboardingFlowUrl:m?.nextOnboardingFlowUrl||m?.finalDestinationUrl||n.home.$path(),isPending:v}}),w=c(d(()=>(0,b.jsx)(C.useComponent(),{}),`WelcomePage`));export{w as default};