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]=`3688c7a8-91a4-461f-b715-c9519b5e2893`,e._sentryDebugIdIdentifier=`sentry-dbid-3688c7a8-91a4-461f-b715-c9519b5e2893`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Dg as n,Fg as r,Ig as i,ch as a,dn as o,eh as s,hn as c,lh as l,or as u,pn as d,sh as f,th as p,wg as m}from"./entry.client-dr7r6s9a.js";import{n as h}from"./responsive-toolkit-nc72eouk.js";import{t as g}from"./XenonSpinner-hionx0on.js";import{yt as _}from"./workspace-leaf-files-mc5sghv7.js";import{n as v}from"./DialogShell-k2jpaw9r.js";var y=e(u(),1),b=r(),x=e(i(),1),S=t(),C=e=>{let t=new URL(`/migration/clear`,window.location.origin);return t.searchParams.set(`returnUrl`,e),t.toString()},w=o(()=>{let e=(0,b.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,S.jsx)(g,{}),e[0]=t):t=e[0],t},()=>{let{systems:{insiderPreviewGate:e}}=p(),{data:t}=n(e.queries.returnURL.getOptions()),{trackUserAction:r}=a();return(0,x.useEffect)(()=>{t&&(r(`NavigateToLink`,{destinationUrl:t,linkType:`external`},`Press`),window.location.href=C(t))},[t,r]),{}}),T=()=>{let e=(0,b.c)(2),t=w.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,S.jsx)(t,{}),e[0]=t,e[1]=n),n},E=`/assets/welcome-o23agywh.mp4`,D=o(e=>{let t=(0,b.c)(5),{handlePress:n}=e,{locGotIt:r}=s(),i;t[0]===r?i=t[1]:(i=r(),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,S.jsx)(c,{as:`button`,size:`large`,onPress:n,className:_,kind:`brand`,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a},()=>{let{dialog:{mutations:{goBack:e}},settings:t}=f(),{mutate:n}=m(e.getOptions()),{mutate:r}=m(t.mutations.setHasSeenPreviewWelcomeSetting);return{handlePress:()=>{r({settingValue:!0}),n()}}}),O=()=>{let e=(0,b.c)(2),t=D.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,S.jsx)(t,{}),e[0]=t,e[1]=n),n},k=o(e=>{let t=(0,b.c)(18),{handleLoaded:n}=e,{t:r}=l(`PreviewWelcomeDialog`),i=h(),a,o;t[0]===n?(a=t[1],o=t[2]):(a=()=>{n()},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,x.useEffect)(a,o);let s;t[3]===i?s=t[4]:(s=(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-hidden`,children:(0,S.jsx)(`video`,{className:`h-auto max-h-full min-h-0 w-full max-w-[496px] flex-shrink object-contain`,src:E,width:496,height:290,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,onLoadedMetadata:i})}),t[3]=i,t[4]=s);let c;t[5]===r?c=t[6]:(c=r(`Welcome to the new experience!`,{shortKey:`welcome_title_2b5815`}),t[5]=r,t[6]=c);let u;t[7]===r?u=t[8]:(u=r(`We're still polishing things. Spot an issue? Send us feedback. You can switch back anytime in settings.`,{shortKey:`welcome_body_3fa99a`}),t[7]=r,t[8]=u);let f;t[9]!==c||t[10]!==u?(f=(0,S.jsx)(d,{title:c,subtitle:u}),t[9]=c,t[10]=u,t[11]=f):f=t[11];let p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,S.jsx)(O,{}),t[12]=p):p=t[12];let m;t[13]===f?m=t[14]:(m=(0,S.jsxs)(`div`,{className:`flex flex-shrink-0 flex-col items-center gap-layout-vertical-group-of-items-tight`,children:[f,p]}),t[13]=f,t[14]=m);let g;return t[15]!==s||t[16]!==m?(g=(0,S.jsxs)(`div`,{className:`p-template-overlays-modal-container-padding-regular flex h-full min-h-0 flex-col items-center self-stretch overflow-hidden`,children:[s,m]}),t[15]=s,t[16]=m,t[17]=g):g=t[17],g},()=>{let{settings:e}=f(),{data:t}=n(e.queries.hasSeenPreviewWelcomeSetting.getOptions()),{mutate:r}=m(e.mutations.setHasSeenPreviewWelcomeSetting);return{handleLoaded:(0,x.useCallback)(()=>{t!==!0&&r({settingValue:!0})},[t,r])}}),A=()=>{let e=(0,b.c)(2),t=k.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,S.jsx)(t,{}),e[0]=t,e[1]=n),n},j=e=>{let t=(0,b.c)(9),{insiderPreviewGateMode:n}=e,r=v.useComponent(),i=n===`Welcome`,a=!i,o;t[0]!==a||t[1]!==i?(o=(0,y.default)(`bg-container-backgrounds-elevation-background-level-2 bg-cover`,{"h-screen w-screen":a,"modal-floating flex max-h-[90dvh] w-[540px] max-w-[90vw] flex-col xl-10:w-[620px]":i}),t[0]=a,t[1]=i,t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=n===`Farewell`?(0,S.jsx)(T,{}):(0,S.jsx)(A,{}),t[3]=n,t[4]=s);let c;return t[5]!==r||t[6]!==o||t[7]!==s?(c=(0,S.jsx)(r,{autoHeight:!0,className:o,children:s}),t[5]=r,t[6]=o,t[7]=s,t[8]=c):c=t[8],c};export{j as InsiderPreviewGateDialog,j as default};