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]=`e9ffe078-f1c1-49a8-8344-8722f71fe4b0`,e._sentryDebugIdIdentifier=`sentry-dbid-e9ffe078-f1c1-49a8-8344-8722f71fe4b0`)}catch{}import{o as e,r as t}from"./rolldown-runtime-nx40z1zs.js";import{t as n}from"./useIntraDialogHistory-id9u91ur.js";import{t as r}from"./useLocation-gval357w.js";import{Ag as i,Jl as a,Sp as o,fp as s,jg as c,ln as l,ng as u,pi as d,ti as f,up as p}from"./entry.client-mpghtlrl.js";import{r as m}from"./home-pdp-leaf-utils-hnv6pld2.js";import{r as h}from"./ControllerPairingContext-g12j6fyu.js";import{t as g}from"./controllerPairingRouteBindings-jumx2xek.js";import{a as _,c as v,o as y}from"./routes-dojzucd0.js";import{t as b}from"./usePrevious-jzkclgc8.js";import{t as x}from"./DialogShell-ga7ic6wy.js";import{t as S}from"./useBackHandler-nc8l72js.js";import{l as C}from"./Styles-l5eym0go.js";import{t as w}from"./useShouldUseDialogNavigation-hy13sydb.js";import"./getControllerPairingRouterEnvironment-fiqysqef.js";var T=e(c(),1),E=e(d(),1),D=i(),O=u(),k=()=>{let e=(0,D.c)(6),t=w(),{index:i}=n(),a=r().pathname===y.path,{fullscreen:o}=h();if(!t||o)return null;let s;e[0]===o?s=e[1]:(s=C(o),e[0]=o,e[1]=s);let c=i>0&&!a&&t,l;return e[2]!==s||e[3]!==c||e[4]!==t?(l=(0,O.jsx)(f,{onDown:A,children:(0,O.jsx)(x.NavigationHeader,{className:s,showBack:c,showClose:t})}),e[2]=s,e[3]=c,e[4]=t,e[5]=l):l=e[5],l};function A(){return a(!0),!0}var j=e=>{let t=(0,D.c)(6),n=(0,T.useId)(),r=(0,T.useContext)(m),i=r?.addSuppression,a=r?.removeSuppression,o,s;t[0]!==i||t[1]!==a||t[2]!==n||t[3]!==e?(o=()=>{if(!(!i||!a))return i(n,e),()=>{a(n)}},s=[n,e,i,a],t[0]=i,t[1]=a,t[2]=n,t[3]=e,t[4]=o,t[5]=s):(o=t[4],s=t[5]),(0,T.useEffect)(o,s)},M=[],N=[`top-nav`,`dock-nav`,`bottom-nav`,`accelerators`,`page-padding`,`uhf-footer`],P=()=>{let{navigationContext:e,fullscreen:t}=h();return j(e===`page`||t&&e!==`dialog`?N:M),null},F=()=>{let e=(0,D.c)(5),t=o(),{onBack:n,onClosed:r,goBackForDialog:i}=h(),a;return e[0]!==t.history||e[1]!==n||e[2]!==r||e[3]!==i?(a=()=>(t.history.canGoBack()?t.history.back():(n??r??i)?.(),!0),e[0]=t.history,e[1]=n,e[2]=r,e[3]=i,e[4]=a):a=e[4],S(a),null},I=()=>{let e=(0,D.c)(21),{fullscreen:t}=h(),n=r(),i=b(n),o;e[0]!==i||e[1]!==n.pathname?(o=()=>{if(i&&n.pathname===i.pathname)return;let e=setTimeout(()=>{a()},100);return()=>clearTimeout(e)},e[0]=i,e[1]=n.pathname,e[2]=o):o=e[2];let s;e[3]!==n||e[4]!==i?(s=[n,i],e[3]=n,e[4]=i,e[5]=s):s=e[5],(0,T.useEffect)(o,s);let c=!t,u;e[6]!==t||e[7]!==c?(u=(0,E.default)({"!h-full !w-full":t,"flex min-h-0 !w-full grow flex-col":c}),e[6]=t,e[7]=c,e[8]=u):u=e[8];let d,m,g;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,O.jsx)(P,{}),m=(0,O.jsx)(F,{}),g=(0,O.jsx)(k,{}),e[9]=d,e[10]=m,e[11]=g):(d=e[9],m=e[10],g=e[11]);let _=t?`!flex !h-full !flex-col items-start gap-layout-vertical-related-content-in-a-section-loose self-stretch bg-container-backgrounds-elevation-background-level-4 bg-cover`:``,v=t?``:`flex min-h-0 flex-1 flex-col overflow-hidden`,y;e[12]!==_||e[13]!==v?(y=(0,E.default)(_,v),e[12]=_,e[13]=v,e[14]=y):y=e[14];let x;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(`div`,{}),children:(0,O.jsx)(p,{})}),e[15]=x):x=e[15];let S;e[16]===y?S=e[17]:(S=(0,O.jsx)(f,{"data-auto-focus":!0,onUp:L,className:y,children:x}),e[16]=y,e[17]=S);let C;return e[18]!==u||e[19]!==S?(C=(0,O.jsx)(l,{children:(0,O.jsxs)(`div`,{className:u,children:[d,m,g,S]})}),e[18]=u,e[19]=S,e[20]=C):C=e[20],C};function L(){return!1}var R=t({ControllerPairingDialogContent:()=>z});g();var z=()=>{let e=(0,D.c)(12),{isFireOS:t,isKepler:n,initialPath:r,fullscreen:i}=h(),a=t===void 0?!1:t,o=n===void 0?!1:n,c=s(),l,u;e[0]!==r||e[1]!==a||e[2]!==o||e[3]!==c?(l=()=>{c({to:r||(a||o?v.getLink():_.getLink()),replace:!0})},u=[c,a,o,r],e[0]=r,e[1]=a,e[2]=o,e[3]=c,e[4]=l,e[5]=u):(l=e[4],u=e[5]),(0,T.useEffect)(l,u);let d=!i,f;e[6]!==i||e[7]!==d?(f=(0,E.default)(`flex h-full flex-col overflow-x-hidden bg-container-backgrounds-elevation-background-level-4 bg-cover`,{"h-full w-full gap-layout-vertical-related-content-in-a-section-loose px-[120px] pb-[120px] pt-[200px]":i,"modal-xsl-expanded min-h-0 !w-full grow":d}),e[6]=i,e[7]=d,e[8]=f):f=e[8];let p;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,O.jsx)(I,{}),e[9]=p):p=e[9];let m;return e[10]===f?m=e[11]:(m=(0,O.jsx)(`div`,{className:f,children:p}),e[10]=f,e[11]=m),m};export{R as n,z as t};