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]=`7931d172-e74c-463a-a1c2-089d4d155f76`,e._sentryDebugIdIdentifier=`sentry-dbid-7931d172-e74c-463a-a1c2-089d4d155f76`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{$m as t,Ag as n,Fr as r,Hm as i,Yh as a,Zm as o,_r as s,hi as c,jg as l,ng as u,pi as d,xr as f}from"./entry.client-mpghtlrl.js";import{ft as p,y as m}from"./xds-react-components-ihgca01z.js";import{n as h,t as g}from"./DialogShell-ga7ic6wy.js";var _=e(d(),1),v=n(),y=e(l(),1),b=u(),x=s(e=>{let n=(0,v.c)(35),{currentName:r,onSave:a,onCancel:o}=e,{t:s}=t(`RemotePlay`),{locCancel:c}=i(),[l,u]=(0,y.useState)(r),d=!l||l===r,p;n[0]!==d||n[1]!==a||n[2]!==l?(p=()=>{d||a(l)},n[0]=d,n[1]=a,n[2]=l,n[3]=p):p=n[3];let h=p,_;n[4]===h?_=n[5]:(_=e=>{e.key!==`Enter`||e.repeat||e.nativeEvent.isComposing||(e.preventDefault(),h())},n[4]=h,n[5]=_);let x=_,S;n[6]===s?S=n[7]:(S=s(`What do you want to call this console?`,{shortKey:`rename_console_prompt_9c8b8c`}),n[6]=s,n[7]=S);let C;n[8]===S?C=n[9]:(C={title:{text:S,sizeClassName:`type-section3`}},n[8]=S,n[9]=C);let w=C,T;n[10]===w?T=n[11]:(T=(0,b.jsx)(g.NavigationHeader,{className:`flex items-start self-stretch`,title:w,showClose:!0}),n[10]=w,n[11]=T);let E;n[12]!==l||n[13]!==x?(E=(0,b.jsx)(m,{value:l,onChange:u,onKeyDown:x,maxLength:36}),n[12]=l,n[13]=x,n[14]=E):E=n[14];let D;n[15]===s?D=n[16]:(D=s(`Save`,{shortKey:`save_8e12d7`}),n[15]=s,n[16]=D);let O;n[17]!==h||n[18]!==d||n[19]!==D?(O=(0,b.jsx)(f,{as:`button`,onPress:h,kind:`brand`,className:`flex-1`,isDisabled:d,children:D}),n[17]=h,n[18]=d,n[19]=D,n[20]=O):O=n[20];let k;n[21]===c?k=n[22]:(k=c(),n[21]=c,n[22]=k);let A;n[23]!==o||n[24]!==k?(A=(0,b.jsx)(f,{as:`button`,onPress:o,className:`flex-1`,children:k}),n[23]=o,n[24]=k,n[25]=A):A=n[25];let j;n[26]!==O||n[27]!==A?(j=(0,b.jsxs)(`div`,{className:`flex flex-row gap-layout-horizontal-gap`,children:[O,A]}),n[26]=O,n[27]=A,n[28]=j):j=n[28];let M;n[29]!==E||n[30]!==j?(M=(0,b.jsxs)(`div`,{className:`px-template-overlays-modal-container-padding-regular pb-template-overlays-modal-container-padding-regular flex flex-col gap-layout-vertical-related-content-in-a-section-tight`,children:[E,j]}),n[29]=E,n[30]=j,n[31]=M):M=n[31];let N;return n[32]!==T||n[33]!==M?(N=(0,b.jsxs)(b.Fragment,{children:[T,M]}),n[32]=T,n[33]=M,n[34]=N):N=n[34],N},({deviceId:e,name:t})=>{let{remotePlay:n,dialog:r}=o(),{mutate:i}=a(n.mutations.setConsoleName.getActiveUserMutation()),{mutate:s}=a(r.mutations.goBack.getOptions());return{currentName:t,onSave:t=>{i({name:t,deviceId:e}),s()},onCancel:()=>s()}}),S=e=>{let t=(0,v.c)(15),n=h.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=p(a),s;t[1]===o?s=t[2]:(s=r(o),t[1]=o,t[2]=s);let l=s,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u={default:!0,MD_10:!1},t[3]=u):u=t[3];let{data:d}=c(u),f=d?l:void 0,m=!d,g;t[4]!==m||t[5]!==d?(g=(0,_.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":m,"modal-docked":d}),t[4]=m,t[5]=d,t[6]=g):g=t[6];let y;t[7]!==i||t[8]!==e?(y=(0,b.jsx)(i,{...e}),t[7]=i,t[8]=e,t[9]=y):y=t[9];let S;return t[10]!==n||t[11]!==g||t[12]!==f||t[13]!==y?(S=(0,b.jsx)(n,{className:g,autoHeight:!0,positionStyle:f,children:y}),t[10]=n,t[11]=g,t[12]=f,t[13]=y,t[14]=S):S=t[14],S};export{S as RenameConsoleDialog,S as default};