PageSourceSearch

https://www.landrover.it/etc.clientlibs/jlr/clientlibs/clientlib-d…-navigation_Util_js.0f037f286a0756ee4317.js

js landrover.it collected 2026-09-29 14:35:32 UTC 12,439 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([["src_main_webpack_site_js_primary-navigation_Util_js"],{83020:function(e,t,n){n.d(t,{Ay:function(){return c},sg:function(){return d}});var i=void 0;function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,i=[{key:"getElementsByClassName",value:function(e,t){return o((t=t||document).getElementsByClassName(e))}},{key:"getElementByClassName",value:function(t,n){return e.getElementsByClassName(t,n)[0]}},{key:"querySelectorAll",value:function(e,t){return o((t=t||document).querySelectorAll(e))}},{key:"addClass",value:function(t,n){if(void 0!==t){var i,r=e.getClasses(t),o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){l=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(l)throw o}}}}(n.split(" "));try{for(o.s();!(i=o.n()).done;){var u=i.value;u&&-1===r.indexOf(u)&&r.push(u)}}catch(e){o.e(e)}finally{o.f()}t&&t.setAttribute("class",r.join(" "))}}},{key:"removeClass",value:function(t,n){if(void 0!==t&&void 0!==n){var i=e.getClasses(t),r=n.split(" ");t.setAttribute("class",i.filter(function(e){return-1===r.indexOf(e)}).join(" "))}}},{key:"hasClass",value:function(t,n){return-1!==e.getClasses(t).indexOf(n)}},{key:"getClasses",value:function(e){if(void 0!==e&&e){var t=e.getAttribute("class");return t?t.split(" "):[]}}},{key:"hide",value:function(t,n){e.removeClass(t,"dxnav-active"),n?t.style.display="none":setTimeout(function(){t.style.display="none"},350)}},{key:"notVisible",value:function(e,t){t?e.style.visibility="hidden":setTimeout(function(){e.style.visibility="hidden"},350)}},{key:"show",value:function(t){t.style.display="flex",setTimeout(function(){e.addClass(t,"dxnav-active")},0)}},{key:"visible",value:function(e){e.style.visibility="visible"}},{key:"viewport",value:function(){return window.matchMedia("(min-width:1021px)").matches?"desktop":"mobile"}},{key:"navigationItemsOverflow",value:function(){var t=function(t,n){return Array.from(e.querySelectorAll(t)).reduce(function(e,t){return e+t.getBoundingClientRect().width},n)},n=e.getElementsByClassName("dxnav__primary")[0],i=t(".dxnav__primary-items li span",140),r=t(".dxnav__secondary-items li svg, .dxnav__secondary-items li span",200),o=e.getElementsByClassName("dxnav__logo-container")[0].getBoundingClientRect().width,a=n.dataset&&"true"===n.dataset.centeredLayout;return function(e,t,n,i){return e&&(t/2+n>=window.innerWidth/2||t/2+i>=window.innerWidth/2)}(a,o,i,r)||function(e,t){return!e&&window.innerWidth-t<=240}(a,o+i+r)}},{key:"findParent",value:function(t,n){for(;(t=t.parentElement)&&!e.hasClass(t,n););return t}},{key:"removeHtml",value:function(e){return e.toString().replace(/[<>=;]/g,"")}},{key:"debounce",value:function(e,t){var n=arguments,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=null;return function(){var a=null!==r?r:i,u=n;clearTimeout(o),o=setTimeout(function(){return e.apply(a,u)},t)}}},{key:"toggleItem",value:function(e,t){var n=this;o(e).forEach(function(i){i.addEventListener("click",function(r){r.preventDefault(),o(e).forEach(function(e){i!==e||n.hasClass(i,t)?n.removeClass(e,t):n.addClass(i,t)})})})}},{key:"detectBrowsers",value:function(){var e=navigator.userAgent,t={isChrome:e.indexOf("Chrome")>-1,isMsEdge:e.indexOf("Edge")>-1,isExplorer:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,isFirefox:e.indexOf("Firefox")>-1,isSafari:e.indexOf("Safari")>-1,isOpera:e.toLowerCase().indexOf("op")>-1};return t.isChrome&&t.isSafari&&(t.isSafari=!1),t.isChrome&&t.isOpera&&(t.isChrome=!1),t}},{key:"detectMobile",value:function(){var e=navigator.userAgent;return{isAndroid:e.match(/Android/i),isBlackBerry:e.match(/BlackBerry/i),isiOS:e.match(/iPhone|iPad|iPod/i),isOpera:e.match(/Opera Mini/i),isWindows:e.match(/IEMobile/i)}}},{key:"isInViewport",value:function(e){var t=e.getBoundingClientRect(),n=document.documentElement;return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||n.clientHeight)&&t.right<=(window.innerWidth||n.clientWidth)}},{key:"readCookie",value:function(e){var t=document.cookie.split(";");if(t.length<1)return null;for(var n=0;n<t.length;n++){var i=t[n].split("=");if(i[0].replace(/\s/g,"")===e)return i[1]}return null}},{key:"isTouchScreen",value:function(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"injectScript",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;new Promise(function(t,n){var i=document.createElement("script");document.body.appendChild(i),i.onload=t,i.onerror=n,i.async=!0,i.src=e}).then(function(){return t&&t()}).catch(function(e){return n&&n(e)})}},{key:"getTabbable",value:function(e){var t=e.querySelectorAll(["input:not([disabled]):not([hidden])","select","a[href]","textarea",'button:not([disabled]):not([tabindex^="-"])','[tabindex]:not
1([tabindex^="-"])'].join(","));return t=(t=Array.from(t)).filter(function(e){var t=!0;return e.offsetParent&&0!==e.offsetWidth&&0!==e.offsetHeight||(t=!1),function e(n){"hidden"===n.style.visibility||"none"===n.style.display?t=!1:n.parentNode&&n.parentNode!==document.body&&e(n.parentNode)}(e),!!t&&e})}},{key:"lockTabbables",value:function(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&setTimeout(function(){e[0].focus()},150),e.forEach(function(n,i){n.addEventListener("keydown",function(n){n.keyCode===f.TAB&&(n.preventDefault(),0===i?1===e.length?e[0].focus():n.shiftKey?e[e.length-1].focus():e[i+1].focus():i!==e.length-1||n.shiftKey?n.shiftKey?e[i-1].focus():e[i+1].focus():e[0].focus()),t&&(n.keyCode===f.DOWN?(n.preventDefault(),0===i?1===e.length?e[0].focus():e[i+1].focus():i!==e.length-1||n.shiftKey?e[i+1].focus():e[0].focus()):n.keyCode===f.UP&&(n.preventDefault(),0===i?1===e.length?e[0].focus():e[e.length-1].focus():e[i-1].focus()))})})}},{key:"hideAllForScreenReaders",value:function(t){for(var n=e.querySelectorAll("body > *:not(".concat(t.id,")")),i=t.hasAttribute("aria-modal"),r=0;r<n.length;r++)i&&(n[r].hasAttribute("aria-hidden")&&n[r].setAttribute("data-keep-hidden",n[r].getAttribute("aria-hidden")),n[r].setAttribute("aria-hidden","true")),n[r].getAttribute("inert")?n[r].setAttribute("data-keep-inert",""):n[r].setAttribute("inert","true")}},{key:"showAllForScreenReaders",value:function(t){for(var n=e.querySelectorAll("body > *:not(".concat(t.id,")")),i=0;i<n.length;i++)n[i].hasAttribute("data-keep-inert")||n[i].removeAttribute("inert"),n[i].removeAttribute("data-keep-inert"),n[i].getAttribute("data-keep-hidden")?n[i].setAttribute("aria-hidden",n[i].getAttribute("data-keep-hidden")):n[i].removeAttribute("aria-hidden"),n[i].removeAttribute("data-keep-hidden")}},{key:"isElementVerticallyScrollable",value:function(e){return e&&e.scrollHeight>e.offsetHeight}},{key:"hamburgerTabbables",value:function(t,n){var i=this,r=document.getElementById("dxnav-unique-nav");t.addEventListener("keydown",function(n){n.keyCode===f.ESC&&e.hasClass(r,"dxnav-active")&&(n.preventDefault(),i.closeMobileNav(),requestAnimationFrame(function(){t.focus()}))}),t.addEventListener("keydown",function(t){t.keyCode===f.TAB&&e.hasClass(r,"dxnav-active")&&(t.preventDefault(),requestAnimationFrame(function(){n[0].focus()}))}),t.addEventListener("keydown",function(t){t.shiftKey&&t.keyCode===f.TAB&&e.hasClass(r,"dxnav-active")&&(t.preventDefault(),requestAnimationFrame(function(){n[n.length-1].focus()}))}),0!==n.length&&(n[0].addEventListener("keydown",function(n){n.shiftKey&&n.keyCode===f.TAB&&e.hasClass(r,"dxnav-active")&&(n.preventDefault(),requestAnimationFrame(function(){t.focus()}))}),n[n.length-1].addEventListener("keydown",function(n){n.shiftKey||n.keyCode!==f.TAB||e.hasClass(r,"dxnav-active")&&(n.preventDefault(),requestAnimationFrame(function(){t.focus()}))}))}},{key:"customEvents",value:function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}},{key:"triggerGlobalEvent",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"function"!=typeof window.CustomEvent&&e.customEvents();var i=document.getElementById("dxnav-unique-nav"),r=new CustomEvent(t,{detail:n});i&&i.dispatchEvent&&i.dispatchEvent(r)}},{key:"createPaginationRange",value:function(e,t){var n=[];if(1===t)n.push(1);else if(t<=7)for(var i=0;i<t;i++)n.push(i+1);else{var r;r=e<=4?4-e+1:t-e<4?e-t+4:1;for(var o=Math.max(2,e-r);o<=Math.min(t-1,e+r);o++)n.push(o);e-r>2&&n.unshift("…"),e+r<t-1&&n.push("…"),n.unshift(1),n.push(t)}return n}},{key:"setAttributes",value:function(e,t){for(var n in t)e.setAttribute(n,t[n])}},{key:"replacePlaceholderText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.replace(/[[]]/g,t)}},{key:"retrieveSessionStorageItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=sessionStorage.getItem(e);if(null===n)return t;try{return JSON.parse(n)}catch(e){return t}}},{key:"clearSessionStorageItem",value:function(e){sessionStorage.removeItem(e)}},{key:"storeSessionStorageItem",value:function(e,t){var n="object"===r(t)?JSON.stringify(t):t;sessionStorage.setItem(e,n)}},{key:"cacheBuildCounts",value:function(e,t){if(e&&t&&(arguments.length>2&&void 0!==arguments[2]&&arguments[2]||!this.retrieveSessionStorageItem(t))){var n=Object.keys(e).reduce(function(t,n){var i,r;if(null!==(i=e[n])&&void 0!==i&&null!==(i=i.configurations)&&void 0!==i&&i.length)t[n]=e[n].configurations.length;else if(null!==(r=e[n])&&void 0!==r&&r.numberOfBuilds){var o;t[n]=null===(o=e[n])||void 0===o?void 0:o.numberOfBuilds}return t},{});return this.storeSessionStorageItem(t,n),n}}}],(n=null)&&l(t.prototype,n),i&&l(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}(),f={TAB:9,RETURN:13,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},d=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var o=arguments.length,a=new Array(o),u=0;u<o;u++)a[u]=arguments[u];var l=e.bind.apply(e,[i].concat(a));clearTimeout(t),r&&!t&&l();var s=r?function(){t=null}:l;t=setTimeout(s,n)}}}}]);

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.