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]=`674991f5-07b6-4489-834a-c41bb3dcb4e5`,e._sentryDebugIdIdentifier=`sentry-dbid-674991f5-07b6-4489-834a-c41bb3dcb4e5`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Fg as n,G as r,Ig as i,U as a,dn as o,eh as s,hn as c,ig as l,lh as u,mr as d,sh as f,th as p,wg as m}from"./entry.client-dr7r6s9a.js";import{t as h}from"./DialogShell-k2jpaw9r.js";var g=n(),_=e(i(),1),v=t(),y=o(d(({onLaunchOnConsole:e,onGetHelp:t})=>{let{t:n}=u(`RemotePlay`),{locGetHelp:i,locLaunchOnConsole:o}=s();return(0,v.jsxs)(`div`,{className:`flex flex-col`,children:[(0,v.jsx)(h.NavigationHeader,{title:{title:{text:n(`Remote features must be enabled`,{shortKey:`remoteplay_features_enabled_remote_5700b7`}),sizeClassName:`type-title2`}},showClose:!0}),(0,v.jsxs)(h.ScrollContainer,{className:`px-template-overlays-modal-container-padding-regular pb-template-overlays-modal-container-padding-regular flex flex-col items-start gap-[24px] self-stretch pt-0`,children:[(0,v.jsxs)(`div`,{className:`flex flex-col items-start gap-[8px] self-stretch`,children:[(0,v.jsx)(`p`,{className:`text-noninteractive-content-secondary-content type-body`,children:(0,v.jsx)(r,{text:`On your console, open <Bold>Settings > Devices & connections > Remote features</Bold> and select the checkbox to enable remote features.`,namespace:`RemotePlay`,comment:`Text inside <Bold> will be made strong (bolded).`,shortKey:`remoteplay_manual_instructions`,components:{Bold:(0,v.jsx)(`strong`,{})}})}),(0,v.jsxs)(`div`,{className:`flex w-full items-center gap-4`,children:[(0,v.jsx)(`hr`,{className:`flex flex-[1_0_0] items-start border-noninteractive-content-secondary-content`}),(0,v.jsx)(`span`,{className:`uppercase text-noninteractive-content-secondary-content type-body`,children:n(`Or`,{shortKey:`remoteplay_or_a03`})}),(0,v.jsx)(`hr`,{className:`flex flex-[1_0_0] items-start border-noninteractive-content-secondary-content`})]}),(0,v.jsx)(`p`,{className:`text-center text-noninteractive-content-secondary-content type-body`,children:n(`Sign in to your console and use the button below to automatically launch the remote features setup flow.`,{shortKey:`remoteplay_automatically_features_642ffe`})})]}),(0,v.jsxs)(`div`,{className:a(`xs-10:(flex-[1_0_0] flex-col gap-layout-vertical-group-of-items-regular)`,`flex items-start self-stretch`,`xsl-10:(items-center gap-[16px])`),children:[(0,v.jsx)(c,{as:`button`,kind:`brand`,size:`standard`,onPress:e,className:a(`max-w-component-action-text-standard-max-width xsl-10:(flex flex-[1_0_0]) min-w-component-action-text-standard-min-width self-stretch`),children:o()}),(0,v.jsx)(c,{as:`button`,kind:`standard`,size:`standard`,onPress:t,className:a(`max-w-component-action-text-standard-max-width xsl-10:(flex flex-[1_0_0]) min-w-component-action-text-standard-min-width self-stretch`),children:i()})]})]})]})},`ConnectConsole`),()=>{let{dialog:e,remotePlay:t,toasts:n}=f(),{mutateAsync:r}=m(e.mutations.goBack.getOptions()),{mutateAsync:i}=m(t.mutations.enableRemotePlay.getActiveUserMutation().getOptions()),a=p().getLogger(`ConnectConsole`),[o,s]=(0,_.useState)(!1),{mutateAsync:c}=m(n.mutations.showStandardToast.getOptions()),{t:d}=u(`RemotePlay`),h=(0,_.useCallback)(async()=>{await r()},[r]);return{isLoading:o,onLaunchOnConsole:(0,_.useCallback)(()=>{(async()=>{s(!0);try{await i(),await h()}catch(e){let t=l(e);a.error(`Error setting up remote play: ${t.message}`),await c({content:d(`We're having trouble completing your request, please try again.`,{shortKey:`remoteplay_completing_trouble_reque_79315f`}),level:`error`,namespace:`RemotePlay`})}finally{s(!1)}})().catch(e=>{a.error(`Unhandled error in onLaunchOnConsole: ${l(e).message}`)})},[i,a,h,c,d]),onGetHelp:(0,_.useCallback)(()=>{h().catch(e=>{a.error(`Unhandled error in onGetHelp: ${l(e).message}`)})},[a,h])}}),b=()=>{let e=(0,g.c)(2),t=y.useComponent(),n;return e[0]===t?n=e[1]:(n=(0,v.jsx)(h,{dismissable:!0,dimBackground:!0,className:`modal-floating modal-large bg-container-backgrounds-elevation-background-level-4 shadow-l4`,autoHeight:!0,children:(0,v.jsx)(t,{})}),e[0]=t,e[1]=n),n};export{b as ConnectConsoleDialog,b as default};