import{_ as S}from"./Bgk-2nau.js";import{d as $,e as D,t as R,S as U,aM as E,l as F}from"./BmsEUx_s.js";import{a as G}from"./UWnfKqQJ.js";import{u as O}from"./CGa_SUqF.js";import{r as Q}from"./CmjS35KU.js";import{a as M,E as T,j as X,k as q,G as l,M as i,O as r,V as g,u as e,a9 as I,a1 as A,X as f,Q as L,P as B,a7 as H,I as J}from"./BO9AmBA3.js";function K(){const a=M([]),d=M(0),t=()=>{d.value=window.innerWidth};T(()=>{d.value=window.innerWidth,window.addEventListener("resize",t)}),X(()=>{window.removeEventListener("resize",t)});const m=()=>{a.value=[]},u=o=>!a.value.includes(o.id);return{windowWidth:d,isCollapsed:u,toggleCollapse:o=>{u(o)?a.value.push(o.id):a.value=a.value.filter(c=>c!==o.id)},clearExpandedIds:m}}const Y={class:"flex headline-3 tracking-0"},Z=r("div",{class:"flex flex-1"},null,-1),ee=["aria-expanded"],te={class:"sr-only"},oe={key:0,class:"relative"},ne={class:"overflow-hidden"},ae={key:1,class:"pb-2 break-inside-avoid-column"},pe=q({__name:"LayoutCollapseNavElement",props:{navigationElement:{}},setup(a){const d=a,{navigationElement:t}=d,m=G(),u=$(),{formatLink:_}=D(u),{isCollapsed:o,toggleCollapse:c,clearExpandedIds:V}=K(),{viewportDefaults:W,currentViewportWidth:z}=O(),{lg:j}=W;return R().beforeEach((p,s,v)=>{V(),v()}),(p,s)=>{var h,x,w,C,k,y,b;const v=S,P=F;return l(),i(B,null,[r("div",{class:"flex items-center pt-3 pb-1 text-base font-medium text-yt-white break-all lg:w-fit",onClick:s[1]||(s[1]=I(n=>e(c)(e(t)),["stop","prevent"]))},[r("span",Y,g((x=(h=e(t))==null?void 0:h.translated)==null?void 0:x.name),1),Z,(C=(w=e(t))==null?void 0:w.children)!=null&&C.length?(l(),i("button",{key:0,class:"flex items-center w-12 pl-4 py-4 pr-0 h-2 bg-transparent lg:hidden","aria-expanded":!e(o)(e(t)),onClick:s[0]||(s[0]=I(n=>e(c)(e(t)),["stop","prevent"]))},[r("span",{class:A(["lg:hidden",["text-xl",e(o)(e(t))?"i-carbon-chevron-down":"i-carbon-chevron-up "]])},null,2),r("span",te,g(p.$t("account.menu.openMenu")),1)],8,ee)):f("",!0)]),(k=e(t))!=null&&k.media&&!e(o)(e(t))?(l(),i("div",oe,[r("div",ne,[L(v,{src:e(U)(e(t)),class:"object-cover object-center",alt:"Category image"},null,8,["src"])])])):f("",!0),(b=(y=e(t))==null?void 0:y.children)!=null&&b.length&&(!e(o)(e(t))||e(z)>=e(j))?(l(),i("ul",ae,[(l(!0),i(B,null,H(e(t).children,n=>(l(),i("li",{key:n.id},[L(P,{to:e(_)(e(E)(n)),class:"flex items-center py-1 lg:pt-0 text-sm font-light text-yt-white break-all hover:bg-gray-100 hover:color-yt-black",aria_expanded:!e(o)(n),onClick:s[2]||(s[2]=()=>{e(m).close,e(c)(e(t))})},{default:J(()=>{var N;return[r("span",null,g(("removeBrandName"in p?p.removeBrandName:e(Q))((N=n==null?void 0:n.translated)==null?void 0:N.name)),1)]}),_:2},1032,["to","aria_expanded"])]))),128))])):f("",!0)],64)}}});export{pe as _,K as u};