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]=`abd5ba25-4aa3-4091-a667-358bac21d08d`,e._sentryDebugIdIdentifier=`sentry-dbid-abd5ba25-4aa3-4091-a667-358bac21d08d`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Fr as r,Gu as i,Hm as a,Um as o,Yh as s,Zm as c,_r as l,hi as u,ng as d,pi as f,qh as p,sn as m}from"./entry.client-mpghtlrl.js";import{ft as h}from"./xds-react-components-ihgca01z.js";import{n as g}from"./DialogShell-ga7ic6wy.js";import{t as _}from"./ConfirmationDialog-gwsu4d5l.js";var v=e(f(),1),y=n(),b=d(),x=l(e=>{let n=(0,y.c)(19),{onConfirm:r,onCancel:i}=e,{t:o}=t(`RemotePlay`),{locGotIt:s,locCancel:c}=a(),l;n[0]===o?l=n[1]:(l=o(`Connecting to remote play will temporarily end your party session.`,{shortKey:`remoteplay_leave_party_warning`}),n[0]=o,n[1]=l);let u;n[2]===o?u=n[3]:(u=o(`You can join it again once you are connected to your console.`,{shortKey:`remoteplay_leave_party_subtitle`}),n[2]=o,n[3]=u);let d;n[4]===s?d=n[5]:(d=s(),n[4]=s,n[5]=d);let f;n[6]!==d||n[7]!==r?(f={text:d,kind:`destructive`,onPress:r},n[6]=d,n[7]=r,n[8]=f):f=n[8];let p;n[9]===c?p=n[10]:(p=c(),n[9]=c,n[10]=p);let m;n[11]!==p||n[12]!==i?(m={text:p,onPress:i},n[11]=p,n[12]=i,n[13]=m):m=n[13];let h;return n[14]!==l||n[15]!==u||n[16]!==f||n[17]!==m?(h=(0,b.jsx)(_,{illustration:`emptyFriendsRequests`,title:l,prompt:u,firstButton:f,secondButton:m}),n[14]=l,n[15]=u,n[16]=f,n[17]=m,n[18]=h):h=n[18],h},({consoleId:e})=>{let t=o().getLogger(`RemotePlayLeavePartyDialog`),n=m(),{dialog:r,activeParty:a}=c(),{mutate:l}=s(r.mutations.goBack.getOptions()),{mutateAsync:u}=s(a.mutations.leaveParty.getActiveUserMutation().getOptions());return{onConfirm:async()=>{try{await u(),n(i.remotePlay.byConsoleId.$buildPath({params:{consoleId:e}}))}catch(e){let n=p(e);t.error(`Failed to end party session before starting remote play: ${n.message}`,n)}},onCancel:l}}),S=e=>{let t=(0,y.c)(15),n=g.useComponent(),i=x.useComponent(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={edge:`bottom`,centered:!0},t[0]=a):a=t[0];let o=h(a),s;t[1]===o?s=t[2]:(s=r(o),t[1]=o,t[2]=s);let c=s,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l={default:!0,MD_10:!1},t[3]=l):l=t[3];let{data:d}=u(l),f=d?c:void 0,p=!d,m;t[4]!==p||t[5]!==d?(m=(0,v.default)(`modal-medium w-template-overlays-modal-size-medium-width-centered flex flex-col bg-container-backgrounds-elevation-background-level-4 bg-cover`,{"modal-floating":p,"modal-docked":d}),t[4]=p,t[5]=d,t[6]=m):m=t[6];let _;t[7]!==i||t[8]!==e?(_=(0,b.jsx)(i,{...e}),t[7]=i,t[8]=e,t[9]=_):_=t[9];let S;return t[10]!==n||t[11]!==m||t[12]!==f||t[13]!==_?(S=(0,b.jsx)(n,{className:m,autoHeight:!0,positionStyle:f,children:_}),t[10]=n,t[11]=m,t[12]=f,t[13]=_,t[14]=S):S=t[14],S};export{S as RemotePlayLeavePartyDialog,S as default};