PageSourceSearch

https://www.volvotrucks.fi/clientlibs-edge/production/202609171319…/components/structure/main-navigation.js

js volvotrucks.fi collected 2026-10-05 03:23:43 UTC 14,115 bytes, 6 lines download raw bytes

1(()=>{"use strict";var e,t,i,n,o,r,l={75434(e,t,i){i.d(t,{Ay:()=>o});var n=i(96115);function o(){window.adobeDataLayer=window.adobeDataLayer||[];let e=window.adobeDataLayer,t={...n.A.component.data.interaction},i=["h1","h2","h3","h4","h5","h6"];function o(i){let o,r=(Object.keys(o={...t,...i}).forEach(e=>{var t;return(""===(t=o[e])||null===t||Array.isArray(t)&&0===t.length)&&delete o[e]}),{event:n.A.component.events.interaction,_volvo:{universal:{web:{component:o}}},web:{webInteraction:{type:"other"}}});r&&e.push(r)}function r(){o(t)}return{init:function(e,i){t={...t,...i},e&&e.addEventListener("click",r)},interaction:o,getNearestHeading:function(e){let t="";return function e(n){if(!n)return"";let o=n.parentElement;if(!o)return"";if(t)return t;let r=[];return r=i.includes(o.tagName.toLowerCase())||o.classList.contains("font-volvo")?[o]:Array.from(o.querySelectorAll(i.join(", "))),o.classList.contains("root")?t="":0===r.length?e(o):t=r.at(-1)&&r.at(-1).textContent,t}(e)}}}},96115(e,t,i){i.d(t,{A:()=>o});let n={URL:"",language:"",name:"",milestone:"",type:""},o={application:{events:{interaction:"applicationInteraction"},data:{interaction:{name:"",stepNumber:"",stepName:"",subStep:"",action:"",selectedOptions:null,applicationInteraction:{value:1}}}},component:{events:{interaction:"componentInteraction"},data:{interaction:{parent:"",name:"",displayText:"",action:"",title:"",type:"",href:"",details:"",placement:"",selectedOptions:void 0,componentInteraction:{value:1}}}},form:{events:{error:"formSubmitError",success:"formSubmitSuccess",view:"formView"},data:{success:{formSubmitSuccess:{value:1}},error:{formSubmitError:{value:1}},view:{formView:{value:1}}}},download:{eventName:"fileDownload",fixedValues:{download:"download",downloadlist:"downloadlist",eventList:"eventlist",eventInformation:"event information",calendar:"calendar"}},scroll:{events:{interaction:"siteScroll"},data:{interaction:{siteScroll:{value:1},depth:""}},values:{percentages:[25,50,75,100]}},video:{events:{milestone:"videoMilestone",pause:"videoPause",play:"videoPlay"},data:{milestone:{...n,videoMilestone:{value:1}},pause:{...n,videoPause:{value:1}},play:{...n,videoPlay:{value:1}}},values:{milestones:[0,25,50,75,95]}},searchResultClick:{events:{searchResultClick:"searchResultClick"},data:{term:void 0,results:{numberPerPage:void 0,numberTotal:void 0,clickedResult:{index:void 0,title:void 0,url:void 0,category:void 0}},searchResultClick:{value:1},location:void 0,type:"QR"}},siteSearch:{events:{siteSearch:"siteSearch"},data:{autoComplete:{clicked:!1,value:void 0},term:void 0,results:{numberPerPage:void 0,numberTotal:void 0},siteSearch:{value:1},selectedOptions:void 0,location:void 0,type:"QR"}},attributes:{analyticsForm:"data-analytics-form"},selectors:{invalidFormControls:":invalid:not(form),vcdk-dropdown[error],vcdk-checkbox-group[error],vcdk-radio-group[error]",downloadLink:".eventlist__downloadLink"}}},37439(e,t,i){var n=i(38443),o=i(97503),r=i(23073),l=i(7967),a=i(10996),s=i(360),c=i(48183),u=i(75434),d=i(72420),v=i(24256),m=i(14837);let p={group:".cmp-navigation__group",groupVisible:".cmp-navigation__group--visible",item0:".cmp-navigation__item--level-0",item0Link:".cmp-navigation__item--level-0 > .cmp-navigation__item-link",item1:".cmp-navigation__item--level-1",item1Link:".cmp-navigation__item--level-1 > .cmp-navigation__item-link",item2:".cmp-navigation__item--level-2",item2Link:".cmp-navigation__item--level-2 > .cmp-navigation__item-link",items:".cmp-navigation__item",item1NoFeature:".cmp-navigation__item--level-1:not(.cmp-navigation__feature)",link:".cmp-navigation__item-link",linkText:".cmp-navigation__item-link-text",linkIcon:".cmp-navigation__item-link-icon",mainNav:".main-nav",feature:".cmp-navigation__feature",subnav:".subnav__container",headerTopLink:".header-top-links .cmp-list--default .cmp-list__item-link .cmp-list__item-text",headerTopItem:".header-top-links .cmp-list--default .cmp-list__item",topBanner:".top-banner"},f="cmp-navigation__item--level-0",h="cmp-navigation__group--column5",g="cmp-navigation__group--column4",k="navigation--open",b="navigation--has-subnav",y="cmp-navigation__group--open",_="cmp-navigation__item--overview",A="cmp-navigation__item--nonclickableheader",L="aria-expanded",w="aria-current",S=e=>Array.from(e.parentElement.children),E=(e,t)=>e[t+1]?.querySelector(p.link)||e[0]?.querySelector(p.link),O=(e,t)=>e[t-1]?.querySelector(p.link)||e[e.length-1]?.querySelector(p.link),I=e=>{let{link:t}=e.detail;t.setAttribute(L,"true")},N=e=>{let{link:t}=e.detail;t.setAttribute(L,"false")};class T extends n.A{constructor(e,t){super(e,t),this.init()}init(){var e;let t,i,n,r,l;this.mainNavCloseBtn=this.el.querySelector(p.mainNavClose),this.setListeners(),this.onResize(window.innerWidth),this.checkForSubnav(),(0,c.A)(this.el),(function(){let e=(0,u.Ay)(),t={parent:"header",name:"navigation",displayText:"",action:"click",title:"navigation",type:"",href:"",details:"",placement:"header"},i="cmp-navigation__item-link",n="cmp-navigation__item-link-text",o="[href]",r=".main-nav",l=".subnav__container";function a(a){let{target:s}=a;[n,i].some(e=>s.classList.contains(e))&&function(i){var n;let a,{target:s}=i,c=s.closest(o);(0,d.U8)(c.href)&&e.interaction({...t,...{displayText:c.textContent.trim()||"",href:c.href||"",type:(a="",null!==(n=c).closest(r)?a="main navigation":null!==n.closest(l)&&(a="sub navigation"),a),details:c.getAttribute("data-breadcrumb")||""}})}(a)}return{init:function(){document.addEventListener("click",a)}}})().init(),e=this.el,t=0,i=(e,i)=>{let n=p[`item${i}`],o=p[`item${i+1}`];
1e.forEach(e=>{let r=e.closest(n),l=r?.querySelector(p.group);if(l){let n=function(){return t+=1}(),a=l.querySelectorAll(`${o}:not(${p.feature})`).length;if(a>0){let t=document.createElement("span");t.classList.add(m.classUtilVisuallyHidden),t.setAttribute("id",`submenu-count-${n}`),t.textContent=`Has ${a} sub-item${a>1?"s":""}`,r.appendChild(t),e.setAttribute("aria-describedby",`link-${n} submenu-count-${n}`)}e.setAttribute("id",`link-${n}`),l.setAttribute("id",`panel-${n}`),0===i&&(e.setAttribute(L,"false"),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-controls",`panel-${n}`))}})},n=e.querySelectorAll(p.item0Link),r=e.querySelectorAll(p.item1Link),(l=e.querySelectorAll(`[${w}="page"]`)).length>1&&l.forEach(e=>{e.href!==window.location.href&&e.removeAttribute(w)}),i(n,0),i(r,1),e.addEventListener("mouseenter",t=>{if(!(0,o.Lv)())return;let i=t.target.closest(p.item0);if(i&&e.contains(i)){let e=i.querySelector(p.link);e&&e.setAttribute(L,"true")}},!0),e.addEventListener("mouseleave",t=>{if(!(0,o.Lv)())return;let i=t.target.closest(p.item0);if(i&&e.contains(i)){let e=i.querySelector(p.link);e&&e.setAttribute(L,"false")}},!0),e.addEventListener("focusin",t=>{let i=t.target.closest(p.link);i&&(0,o.Lv)()&&i.parentElement.classList.contains(f)&&e.querySelectorAll(p.item0Link).forEach(e=>{e!==i?e.setAttribute(L,"false"):e.setAttribute(L,"true")})}),e.addEventListener("keydown",t=>{let i=t.target.closest(p.link);if(i){let n,r;(0,o.Lv)()&&(n=i.closest(p.item0),r=i.closest(p.item1),i.closest(p.item2)?((e,t)=>{let i,n=t.closest(p.item2),o=S(n),r=o.indexOf(n),l=n?.closest(p.group).previousElementSibling,a=S(l.closest(p.item1)),s=a.indexOf(l.closest(p.item1));if("ArrowDown"===e.key){e.preventDefault();let t=o[r+1]?.querySelector(p.link);t?t.focus():E(a,s)?.focus()}"ArrowUp"===e.key&&(e.preventDefault(),0===r&&l?l.focus():O(o,r)?.focus()),"ArrowRight"===e.key&&(e.preventDefault(),E(a,s)?.focus()),"ArrowLeft"===e.key&&(e.preventDefault(),O(a,s)?.focus()),"Escape"===e.key&&(i=n.closest(p.group).previousElementSibling)&&i.focus()})(t,i):r?((e,t)=>{let i=t.closest(p.item1),n=S(i),o=n.indexOf(i);if("ArrowDown"===e.key){e.preventDefault();let t=i.querySelector(p.item2Link);t?t.focus():E(n,o)?.focus()}if("ArrowRight"===e.key&&(e.preventDefault(),E(n,o)?.focus()),"ArrowLeft"===e.key&&(e.preventDefault(),O(n,o)?.focus()),"Escape"===e.key){let t;e.preventDefault(),(t=i.closest(p.group).previousElementSibling)&&t.focus()}})(t,i):n&&((e,t,i)=>{let n=t.closest(p.item0)?.querySelector(p.group);if("Tab"===e.key&&n&&t.setAttribute(L,"false"),"ArrowDown"===e.key){e.preventDefault();let t=n?.querySelector(p.item1Link);t?.focus()}if("ArrowRight"===e.key){e.preventDefault();let n=Array.from(i.querySelectorAll(p.item0Link)),o=(n.indexOf(t)+1)%n.length;n[o]?.focus()}if("ArrowLeft"===e.key){e.preventDefault();let n=Array.from(i.querySelectorAll(p.item0Link)),o=(n.indexOf(t)-1+n.length)%n.length;n[o]?.focus()}})(t,i,e))}}),e.addEventListener(a.MAIN_NAVIGATION_ITEM_OPEN,I),e.addEventListener(a.MAIN_NAVIGATION_ITEM_CLOSE,N),document.addEventListener("click",t=>{t.target.closest(p.group)||e.querySelectorAll(p.item0Link).forEach(e=>{e.setAttribute(L,"false")})})}onKeydown(e){(0,o.Lv)()||"Escape"!==e.key||this.closeMainNavigation()}setListeners(){(0,o.Tg)([480,768,960],this.onResize.bind(this)),window.pubsub.sub(a.SIDENAV_OPEN,this.openMainNavigation.bind(this)),window.pubsub.sub(a.SIDENAV_CLOSE,this.closeMainNavigation.bind(this)),document.addEventListener("keydown",this.onKeydown.bind(this))}onResize(e){e<960?this.initMobile():(this.initDesktop(),this.closeMainNavigation()),this.fixAAMobile(e<960)}initMobile(){this.mobileInited||(this.mobileInited=!0,this.setLevels(),this.el.addEventListener("click",this.onClickNavigationMenu.bind(this)),this.initHeaderTopLinks())}initHeaderTopLinks(){let e=this.el.querySelectorAll(p.headerTopItem);if(e.length>5){let t=e.length-5;for(let i=0;i<t;i++)(0,r.Bt)(e[i])}(0,r.$r)(this.el.querySelectorAll(p.headerTopLink)).forEach(e=>{let t=e.lastChild;if(3===t.nodeType){let i=e.dataset.linkText;i&&i.length>11&&(t.textContent=i.substring(0,11)+"...")}})}initDesktop(){this.desktopInited||(this.desktopInited=!0,this.checkColumns())}checkColumns(){let e=(0,r.$r)(this.el.querySelectorAll(p.item0)),t=this.options.isVolvoGroup?4:5,i=this.options.isVolvoGroup?g:h;
1e&&e.length&&e.forEach(e=>{let n=e.querySelector(p.group),o=n?.querySelectorAll(p.item1NoFeature);o?.length>=t&&n.classList.add(i)})}setLevels(){this.linksAccordion=[],this.findAll(p.items).forEach(e=>{let t=e.querySelector(p.group),i=e.querySelector(p.link);e.classList.contains(A)||(t&&e.classList.contains(f)?(this.createOverviewLinks(e,i,t),i.dataset.href=i.href,this.linksAccordion.push(i)):e.classList.add(_))})}createOverviewLinks(e,t,i){let n=document.createElement("li"),o=t.cloneNode(!0),r=parseInt(e.className.match(/cmp-navigation__item--level-(\d)/)[1],10),l=o.querySelector(p.linkText),a=o.querySelectorAll(p.linkIcon);l&&(l.textContent=this.options.i18n.overview),a.length&&a.forEach(e=>{e.icon=(0,v.T)()}),n.className=`
2            cmp-navigation__item
3            cmp-navigation__item--level-${r+1}
4            ${_}
5            hidden-desktop
6        `,n.appendChild(o),i.insertBefore(n,i.childNodes[0])}openMainNavigation(){this.el.classList.add(k),document.body.classList.add(k)}closeMainNavigation(){this.el.classList.remove(k),document.body.classList.remove(k),this.el.style.top=""}onClickNavigationMenu(e){let t=e.target;if(!(window.innerWidth>=960)){if(t===this.el)return void this.closeMainNavigation();this.handleItemClick(t,e)}}handleItemClick(e,t){this.closePreviousItemIfNeeded(e);let i=e.closest(p.items);i&&this.shouldToggleGroup(i,e)&&this.toggleGroup(i,e,t)}closePreviousItemIfNeeded(e){this.currentOpenItem&&!this.currentOpenItem.contains(e)&&(this.currentOpenItem.classList.remove(y),(0,s.w3)(this.el,a.MAIN_NAVIGATION_ITEM_CLOSE,{detail:{link:this.currentOpenItem.querySelector(p.link)}}))}shouldToggleGroup(e,t){let i=e.classList.contains(A),n=t.closest(p.link)?.nextElementSibling&&[f].some(t=>e.classList.contains(t));return i||n}toggleGroup(e,t,i){this.currentOpenItem=e,this.currentOpenItem.classList.toggle(y),i.preventDefault();let n=this.currentOpenItem.classList.contains(y)?a.MAIN_NAVIGATION_ITEM_OPEN:a.MAIN_NAVIGATION_ITEM_CLOSE;(0,s.w3)(this.el,n,{detail:{link:t}})}checkForSubnav(){document.querySelector(p.subnav)&&this.el.classList.add(b)}fixAAMobile(e){this.linksAccordion&&this.linksAccordion.forEach(t=>{e?t.href="#":t.href=t.dataset.href})}}(0,l.kz)({Navigation:T})}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return l[e].call(i.exports,i,i.exports,s),i.exports}s.m=l,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(i,n){if(1&n&&(i=this(i)),8&n||"object"==typeof i&&i&&(4&n&&i.__esModule||16&n&&"function"==typeof i.then))return i;var o=Object.create(null);s.r(o);var r={};e=e||[null,t({}),t([]),t(t)];for(var l=2&n&&i;("object"==typeof l||"function"==typeof l)&&!~e.indexOf(l);l=t(l))Object.getOwnPropertyNames(l).forEach(e=>{r[e]=()=>i[e]});return r.default=()=>i,s.d(o,r),o},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.e=()=>Promise.resolve(),s.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i=[],s.O=(e,t,n,o)=>{if(t){o=o||0;for(var r=i.length;r>0&&i[r-1][2]>o;r--)i[r]=i[r-1];i[r]=[t,n,o];return}for(var l=1/0,r=0;r<i.length;r++){for(var t=i[r][0],n=i[r][1],o=i[r][2],a=!0,c=0;c<t.length;c++)(!1&o||l>=o)&&Object.keys(s.O).every(e=>s.O[e](t[c]))?t.splice(c--,1):(a=!1,o<l&&(l=o));if(a){i.splice(r--,1);var u=n();void 0!==u&&(e=u)}}return e},s.rv=()=>"1.7.11",s.j="1634",n={1634:0},s.O.j=e=>0===n[e],o=(e,t)=>{var i,o,r=t[0],l=t[1],a=t[2],c=0;if(r.some(e=>0!==n[e])){for(i in l)s.o(l,i)&&(s.m[i]=l[i]);if(a)var u=a(s)}for(e&&e(t);c<r.length;c++)o=r[c],s.o(n,o)&&n[o]&&n[o][0](),n[o]=0;return s.O(u)},(r=self.webpackChunkvolvo_fe_build=self.webpackChunkvolvo_fe_build||[]).forEach(o.bind(null,0)),r.push=o.bind(null,r.push.bind(r)),s.ruid="[email protected]";var c=s.O(void 0,["8263"],()=>s(37439));c=s.O(c)})();

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.