import{_ as C}from"./CuFWX9lm.js";import{_ as y}from"./CnQhJaAR.js";import{u as L}from"./CGa_SUqF.js";import{u as g}from"./Caz6ZtR2.js";import{k as M,G as i,M as o,O as l,a1 as p,u as s,P as v,a7 as N,a9 as V,V as B,X as S,Q as f}from"./BO9AmBA3.js";const $={class:"w-full h-full overflow-y-auto"},j=["onClick"],A={class:"flex ml-2 mt-4 px-4 md:mt-8 space-x-6 items-center"},O=M({__name:"LayoutHeaderMenuMain",props:{categories:{}},setup(F){const{desktop:_,restrictedHeight:r,isLandscape:h}=L(),{menu:m,openLevel:b,closeAllLevels:u,tagNavigation:w}=g(),x=t=>{var a,n;_.value||b("subnavLevel1"),m.value.subnavLevel1.activeCategory=t,m.value.subnavLevel1.isBikeCategory=["bikes","e-bikes"].includes(String((n=(a=t==null?void 0:t.translated)==null?void 0:a.customFields)==null?void 0:n.category_type).toLowerCase()),w(t,"")};return(t,a)=>{var c;const n=C,k=y;return i(),o("nav",{class:p(["h-[calc(100svh-8.125rem)] md:h-[calc(100svh-3.5rem)] flex justify-between w-full md:min-w-48 md:max-w-sm bg-yt-black",s(r)&&((c=t.categories)==null?void 0:c.length)>7?"pt-0":"pt-10"]),"aria-label":"primary",ref:"subnav"},[l("div",$,[l("ul",{class:p(["flex justify-start flex-col w-full",{"pb-16 md:pb-0":s(h)}])},[(i(!0),o(v,null,N(t.categories,e=>{var d;return i(),o(v,{key:e.id},[e.visible?(i(),o("li",{key:0,onClick:V(H=>x(e),["stop","prevent"]),class:p(["yt-hover-underline text-white ml-4 py-2 px-4 md:pl-6 md:pr-32 para-3 lg:leading-8 lg:text-8 cursor-pointer text-left whitespace-nowrap",{"md:bg-yt-white md:text-yt-black md:hover:no-underline":s(m).subnavLevel1.activeCategory===e,"mb-0 md:my-2":s(r),"mb-2 md:my-4":!s(r)}])},[l("p",null,B((d=e==null?void 0:e.translated)==null?void 0:d.name),1)],10,j)):S("",!0)],64)}),128)),l("li",{onClick:a[0]||(a[0]=(...e)=>s(u)&&s(u)(...e)),class:"yt-hover-underline text-white ml-4 mb-2 py-2 md:my-4 px-4 md:pl-6 md:pr-32 para-3 lg:leading-8 lg:text-8 cursor-pointer text-left whitespace-nowrap"},[f(n)]),l("div",A,[f(k,{icon:"white"})])],2)])],2)}}});export{O as _};