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]=`0df9dfeb-03c7-443c-a905-0866bed34df1`,e._sentryDebugIdIdentifier=`sentry-dbid-0df9dfeb-03c7-443c-a905-0866bed34df1`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{T as t}from"./vendor-misc-dys7qi6h.js";import{$m as n,Ag as r,Bt as i,Gu as a,Hm as o,Ms as s,Oi as c,Qh as l,Um as u,Zm as d,_r as f,jg as p,ng as m,sn as h,xr as g,yr as _}from"./entry.client-mpghtlrl.js";var v=e(p(),1),y=r(),b=m(),x=e=>`/migration/clear?${new URLSearchParams({returnUrl:e}).toString()}`,S=e=>{let t=(0,y.c)(7),{returnURL:n}=e,{locReturn:r}=o(),i;t[0]===n?i=t[1]:(i=x(n),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r(),t[2]=r,t[3]=a);let s;return t[4]!==i||t[5]!==a?(s=(0,b.jsx)(g,{as:`a`,size:`large`,className:`flex min-w-component-action-text-standard-min-width flex-1 content-center items-center gap-8 px-internal-container-padding-regular py-component-action-text-standard-container-padding-top-and-bottom`,kind:`brand`,href:i,children:a}),t[4]=i,t[5]=a,t[6]=s):s=t[6],s},C=f(S,()=>{let{systems:{insiderPreviewGate:e}}=u(),{data:t}=l(e.queries.returnURL.getOptions());return{returnURL:t??`https://www.xbox.com/play`}}),w=()=>{let e=(0,y.c)(2),t=C.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,b.jsx)(t,{}),e[0]=t,e[1]=n),n},T=e=>{let t=(0,y.c)(15),{isAllowed:r,isPending:a,isEnabled:o}=e,{t:s}=n(`PreviewWelcomeDialog`),c;t[0]===s?c=t[1]:(c=()=>s(`You're early`,{shortKey:`non_insider_title`}),t[0]=s,t[1]=c);let l=c,u;t[2]===s?u=t[3]:(u=()=>s(`The new experience isn't available for you just yet.  Let's get you back to familiar ground`,{shortKey:`non_insider_body`}),t[2]=s,t[3]=u);let d=u;if(a||!o||r){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`div`,{className:`h-screen w-screen`,children:(0,b.jsx)(i,{className:`h-1/2 w-1/2`})}),t[4]=e):e=t[4],e}let f;t[5]===l?f=t[6]:(f=l(),t[5]=l,t[6]=f);let p;t[7]===d?p=t[8]:(p=d(),t[7]=d,t[8]=p);let m;t[9]!==f||t[10]!==p?(m=(0,b.jsx)(_,{title:f,illustration:`errorAccess`,subtitle:p}),t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,b.jsx)(w,{}),t[12]=h):h=t[12];let g;return t[13]===m?g=t[14]:(g=(0,b.jsx)(`div`,{className:`flex h-screen w-screen items-center justify-center`,children:(0,b.jsxs)(`div`,{className:`gap-layout-vertical-gutter flex flex-col items-center`,children:[m,h]})}),t[13]=m,t[14]=g),g},E=f(T,()=>{let{insiderPreviewGate:e}=d(),n=h(),[{redirectUri:r}]=t(a.insiderPreviewGate),{data:i,isPending:o}=l(e.queries.isPreviewGateEnabled.getOptions()),{data:c,isPending:u}=l(e.queries.isPreviewAccessAllowed.getOptions()),f=o||u,p=c??!1,m=i??!0;return(0,v.useEffect)(()=>{!f&&(p||!m)&&n(s(r,a.home.$path()),{replace:!0})},[f,p,m,n,r]),{isAllowed:p,isPending:f,isEnabled:m}}),D=c(()=>(0,b.jsx)(E.useComponent(),{}),`InsiderPreviewGatePage`);export{T as n,S as r,D as t};