PageSourceSearch

https://gut39.ru/assets/DesktopNavigation-Doj1r2TG.js

js gut39.ru collected 2026-10-09 22:41:28 UTC 3,698 bytes, 1 lines download raw bytes

1import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n}from"./framework-C-kvl5Nm.js";import{c as r}from"./index-DJ8vc1od.js";import{t as i}from"./link-DMTbWfdQ.js";import{a,i as o,t as s}from"./navigation-Wm4cONpY.js";import{t as c}from"./NavigationEntry-DC7RR2Hb.js";var l=e(t(),1),u=n();function d({item:e,panelId:t,triggerId:n,isOpen:r,onNavigate:a}){return(0,u.jsx)(`div`,{className:`mega-menu`,id:t,role:`region`,"aria-labelledby":n,hidden:!r,children:(0,u.jsxs)(`div`,{className:`mega-menu-grid`,children:[(0,u.jsx)(`div`,{className:`mega-menu-groups`,children:e.groups?.map(e=>(0,u.jsxs)(`section`,{className:`mega-menu-group`,"aria-label":e.title,children:[(0,u.jsx)(`div`,{className:`mega-menu-group-title`,children:e.title}),e.description&&(0,u.jsx)(`p`,{children:e.description}),(0,u.jsx)(`div`,{className:`mega-menu-links`,children:e.items.map(t=>(0,u.jsx)(c,{item:t,onNavigate:a},`${e.title}-${t.label}`))})]},e.title))}),e.featured&&(0,u.jsxs)(`aside`,{className:`mega-menu-featured`,children:[(0,u.jsx)(`span`,{className:`mega-menu-kicker`,children:`НАПРАВЛЕНИЕ`}),(0,u.jsx)(`strong`,{children:e.featured.title}),(0,u.jsx)(`p`,{children:e.featured.description}),e.featured.status===`active`&&e.featured.href?(0,u.jsxs)(i,{href:e.featured.href,onClick:a,children:[e.featured.linkLabel,` `,(0,u.jsx)(`span`,{"aria-hidden":`true`,children:`↗`})]}):null]})]})})}function f(){let e=r()||`/`,t=s(e),n=o(),[c,f]=(0,l.useState)(null),p=(0,l.useRef)(null),m=(0,l.useRef)(null),h=(0,l.useRef)({}),g=()=>{m.current&&clearTimeout(m.current)},_=()=>{g(),m.current=setTimeout(()=>f(null),240)},v=()=>{let e=c;f(null),e&&h.current[e]?.focus()};return(0,l.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&f(null)},t=e=>{e.key===`Escape`&&c&&v()};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t),g()}}),(0,u.jsx)(`nav`,{className:`desktop-navigation`,"aria-label":`Основная навигация`,ref:p,children:(0,u.jsxs)(`div`,{className:`desktop-products`,children:[a.map(e=>{let n=c===e.id,r=t===e.id,a=`mega-${e.id}`,o=`mega-trigger-${e.id}`;return(0,u.jsxs)(`div`,{className:`desktop-nav-item`,onMouseEnter:()=>{g(),f(e.id)},onMouseLeave:_,children:[(0,u.jsxs)(`div`,{className:`desktop-nav-control`,children:[e.status===`active`&&e.href?(0,u.jsxs)(i,{className:r?`desktop-nav-label is-active`:`desktop-nav-label`,href:e.href,"aria-current":r?`page`:void 0,children:[(0,u.jsx)(`span`,{className:`desktop-nav-full-label`,children:e.label}),(0,u.jsx)(`span`,{className:`desktop-nav-short-label`,children:e.shortLabel??e.label})]}):(0,u.jsxs)(`span`,{className:`desktop-nav-label navigation-planned`,"data-nosnippet":!0,children:[(0,u.jsx)(`span`,{className:`desktop-nav-full-label`,children:e.label}),(0,u.jsx)(`span`,{className:`desktop-nav-short-label`,children:e.shortLabel??e.label})]}),(0,u.jsx)(`button`,{className:`desktop-nav-trigger`,id:o,type:`button`,"aria-label":`${n?`Закрыть`:`Открыть`} меню «${e.label}»`,"aria-expanded":n,"aria-controls":a,ref:t=>{h.current[e.id]=t},onClick:()=>f(n?null:e.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),f(n?null:e.id))},children:(0,u.jsx)(`span`,{className:`desktop-nav-chevron`,"aria-hidden":`true`,children:`⌄`})})]}),(0,u.jsx)(d,{item:e,panelId:a,triggerId:o,isOpen:n,onNavigate:()=>f(null)})]},e.id)}),n.map(e=>(0,u.jsx)(i,{className:t===e.id?`desktop-nav-calendar is-active`:`desktop-nav-calendar`,href:e.href,"aria-current":t===e.id?`page`:void 0,children:e.label},e.id))]})})}export{f as DesktopNavigation};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.