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]=`066b7729-fa1b-4ac4-8e4e-0a78502d62f9`,e._sentryDebugIdIdentifier=`sentry-dbid-066b7729-fa1b-4ac4-8e4e-0a78502d62f9`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{t}from"./useLocation-fu2554ly.js";import{Ag as n,Dg as ee,Fg as r,Gn as te,Ig as i,eh as ne,hn as a,or as o,sh as re,wg as ie}from"./entry.client-dr7r6s9a.js";import{t as ae}from"./Announcer-ns276d3u.js";import{r as oe}from"./ControllerPairingContext-lndsofbd.js";import{i as se}from"./routes-cum86uu1.js";import{d as ce,r as le,t as s}from"./Styles-pe7l89m3.js";import{t as ue}from"./getControllerPairingRouterEnvironment-cyamx6ev.js";import{t as de}from"./ControllerPairingHeader-o5r7pkm4.js";import{t as fe}from"./useInitialFocusIn-fziws25j.js";import{t as pe}from"./useCaccsConnectedTranslation-ibv0e51d.js";var me=r(),c=e(o(),1),l=e(i(),1),u=n(),he=4e3,d=()=>{let e=(0,me.c)(71),{locTitle:n,locTitleInactive:r,locMoveInputHere:i}=pe(),{locDone:o,locDisconnect:d}=ne(),{fullscreen:f,onClosed:p,goBackForDialog:m}=oe(),{accs:h}=re(),ge=t(),g=ue(),_=ge.state?.autoDismiss,_e=(0,l.useRef)(null);fe(_e);let v;e[0]===h.queries.accessoryState?v=e[1]:(v=h.queries.accessoryState.getOptions(),e[0]=h.queries.accessoryState,e[1]=v);let{data:y}=ee(v),b;e[2]===h.queries.sessionState?b=e[3]:(b=h.queries.sessionState.getOptions(),e[2]=h.queries.sessionState,e[3]=b);let{data:ve}=ee(b),x=ve?.type===`sessionConnected`&&ve.clientActive,S;e[4]===h.mutations.disconnectAccessory?S=e[5]:(S=h.mutations.disconnectAccessory.getOptions(),e[4]=h.mutations.disconnectAccessory,e[5]=S);let{mutate:C,isPending:ye}=ie(S),w;e[6]===h.mutations.setClientActive?w=e[7]:(w=h.mutations.setClientActive.getOptions(),e[6]=h.mutations.setClientActive,e[7]=w);let{mutate:T,isPending:be}=ie(w),E=ye||be,D,O;e[8]!==y||e[9]!==g?(D=()=>{y&&!y.accessoryId&&g(se.path,{replace:!0})},O=[y,g],e[8]=y,e[9]=g,e[10]=D,e[11]=O):(D=e[10],O=e[11]),(0,l.useEffect)(D,O);let k=y?.deviceDescription,A;e[12]!==x||e[13]!==n||e[14]!==k||e[15]!==r?(A=x?n(k):r(k),e[12]=x,e[13]=n,e[14]=k,e[15]=r,e[16]=A):A=e[16];let j=A,M;e[17]!==p||e[18]!==m?(M=()=>{(p??m)?.()},e[17]=p,e[18]=m,e[19]=M):M=e[19];let N=M,P;e[20]!==y||e[21]!==C||e[22]!==N?(P=()=>{y?.accessoryId&&C(y.accessoryId),N()},e[20]=y,e[21]=C,e[22]=N,e[23]=P):P=e[23];let F=P,I;e[24]===T?I=e[25]:(I=()=>{T()},e[24]=T,e[25]=I);let L=I,R,z;e[26]!==_||e[27]!==x||e[28]!==N?(R=()=>{if(!_||!x)return;let e=setTimeout(N,he);return()=>{clearTimeout(e)}},z=[_,x,N],e[26]=_,e[27]=x,e[28]=N,e[29]=R,e[30]=z):(R=e[29],z=e[30]),(0,l.useEffect)(R,z);let B;e[31]===f?B=e[32]:(B=(0,c.default)(le(f),`!flex !h-full !flex-col !justify-between`),e[31]=f,e[32]=B);let V;e[33]===j?V=e[34]:(V=(0,u.jsx)(de,{title:j,isSingleColumnLayout:!0}),e[33]=j,e[34]=V);let H;e[35]===j?H=e[36]:(H=(0,u.jsx)(ae,{announcements:{announcement:{text:j,priority:`polite`}}}),e[35]=j,e[36]=H);let U;e[37]===f?U=e[38]:(U=(0,c.default)(ce(f),`justify-center`),e[37]=f,e[38]=U);let W;e[39]===U?W=e[40]:(W=(0,u.jsx)(`div`,{className:U}),e[39]=U,e[40]=W);let G=_&&x&&`invisible`,K;e[41]===G?K=e[42]:(K=(0,c.default)(s.buttonContainer,G),e[41]=G,e[42]=K);let q;e[43]===o?q=e[44]:(q=o(),e[43]=o,e[44]=q);let J;e[45]!==N||e[46]!==q?(J=(0,u.jsx)(a,{as:`button`,size:`standard`,kind:`brand`,onPress:N,"data-auto-focus":!0,className:s.buttonSpacing,children:q}),e[45]=N,e[46]=q,e[47]=J):J=e[47];let Y;e[48]!==x||e[49]!==i||e[50]!==L||e[51]!==E?(Y=!x&&(0,u.jsx)(a,{as:`button`,size:`standard`,kind:`standard`,onPress:L,isDisabled:E,className:s.buttonSpacing,children:i()}),e[48]=x,e[49]=i,e[50]=L,e[51]=E,e[52]=Y):Y=e[52];let X;e[53]!==y?.accessoryId||e[54]!==d||e[55]!==F||e[56]!==E?(X=y?.accessoryId&&(0,u.jsx)(a,{as:`button`,size:`standard`,kind:`standard`,onPress:F,isDisabled:E,className:s.buttonSpacing,children:d()}),e[53]=y?.accessoryId,e[54]=d,e[55]=F,e[56]=E,e[57]=X):X=e[57];let Z;e[58]!==J||e[59]!==Y||e[60]!==X?(Z=(0,u.jsxs)(te,{className:`contents`,children:[J,Y,X]}),e[58]=J,e[59]=Y,e[60]=X,e[61]=Z):Z=e[61];let Q;e[62]!==K||e[63]!==Z?(Q=(0,u.jsx)(`div`,{className:K,children:Z}),e[62]=K,e[63]=Z,e[64]=Q):Q=e[64];let $;return e[65]!==B||e[66]!==V||e[67]!==H||e[68]!==W||e[69]!==Q?($=(0,u.jsxs)(`div`,{className:B,ref:_e,children:[V,H,W,Q]}),e[65]=B,e[66]=V,e[67]=H,e[68]=W,e[69]=Q,e[70]=$):$=e[70],$};export{d as CaccsConnected};