PageSourceSearch

https://www.dopple.io/hubfs/hub_generated/module_assets/1/136771205726/1742021177353/module_navigation.min.js

js dopple.io collected 2026-09-26 03:55:05 UTC 9,114 bytes, 1 lines download raw bytes

1var module_136771205726=function(){const toggleAriaExpanded=element=>{const newAria=!("true"===element.getAttribute("aria-expanded").toLowerCase());element.setAttribute("aria-expanded",newAria)},closeMobileNavigation=navigation=>{if(navigation.classList.contains("navigation--open")){const navControls=navigation.querySelector(".navigation__controls");toggleAriaExpanded(navControls),navigation.classList.remove("navigation--open")}},toggleMobileNavigation=e=>{toggleAriaExpanded(e.currentTarget);e.target.closest(".navigation__mobile").classList.toggle("navigation--open"),document.body.classList.toggle("navigation--open")},closeAllDropdowns=()=>{[...document.querySelectorAll(".navigation-dropdown--open")].forEach((dropdown=>{dropdown.classList.remove("navigation-dropdown--open");const dropdownButton=dropdown.querySelector(".navigation__mobile--parent");toggleAriaExpanded(dropdownButton)}))},toggleMenuDropdown=e=>{const currentDropdown=e.currentTarget,currentMenuList=e.currentTarget.closest(".navigation__mobile--item");currentMenuList.classList.contains("navigation-dropdown--open")?closeAllDropdowns():(closeAllDropdowns(),toggleAriaExpanded(currentDropdown),currentMenuList.classList.add("navigation-dropdown--open"))},setUpMobileNavigation=navElement=>{navElement.querySelector(".navigation__controls").addEventListener("click",toggleMobileNavigation),document.addEventListener("click",(event=>{return e=event,void((navigation=navElement).contains(e.target)||closeMobileNavigation(navigation));var e,navigation}));navElement.querySelectorAll(".navigation__mobile--parent").forEach((dropdown=>dropdown.addEventListener("click",toggleMenuDropdown)))};window.addEventListener("DOMContentLoaded",(()=>{const mobileNavigation=document.querySelector(".navigation__mobile");setUpMobileNavigation(mobileNavigation);(navElement=>{function checkPosition(){window.scrollY<30?navElement.classList.remove("navigation--sticky"):navElement.classList.add("navigation--sticky")}checkPosition(),window.addEventListener("scroll",checkPosition)})(document.querySelector(".navigation"))}));const DEFAULT_MODULE_CONFIG=Object.freeze({autosuggest_results_message:"Results for “[[search_term]]”",sr_autosuggest_results_message:"There are currently [[number_of_results]] auto-suggested results for [[search_term]].",sr_search_field_aria_label:"This is a search field with an auto-suggest feature attached.",sr_search_button_aria_label:"Search"});let srAnnounceTimeout;const moduleConfig=(moduleName=>{const configJSONScript=document.querySelector(`[data-${moduleName}-config]`);return configJSONScript?JSON.parse(configJSONScript.textContent):DEFAULT_MODULE_CONFIG})("search_input"),KEYS=Object.freeze({TAB:"Tab",ESC:"Esc",ESCAPE:"Escape",UP:"Up",ARROW_UP:"ArrowUp",DOWN:"Down",ARROW_DOWN:"ArrowDown"}),debounce=(func,wait)=>{let timer;return(...args)=>{clearTimeout(timer),timer=setTimeout((()=>{func.apply(this,args)}),wait)}},emptySearchSuggestions=(suggestionsResponse,searchInputElements)=>{const{searchForm:searchForm,searchSuggestions:searchSuggestions,searchInput:searchInput,srMessageContainer:srMessageContainer}=searchInputElements,{searchTerm:searchTerm}=suggestionsResponse,noSearchResultsMessage=searchTerm?moduleConfig.autosuggest_no_results_message.replace("[[search_term]]",searchTerm):moduleConfig.sr_empty_search_field_message,emptyResultsItem=`<li role="option"\n    tabindex="-1"\n    aria-posinset="1"\n    aria-setsize="0"\n    class="results-for ${searchTerm?"":"show-for-sr"}">${noSearchResultsMessage}</li>`;searchSuggestions.innerHTML=emptyResultsItem,srMessageContainer.innerHTML=noSearchResultsMessage,searchInput.focus(),searchForm.classList.remove("hs-search-field--open")},trapFocus=searchInputElements=>{const{searchInput:searchInput,searchSuggestions:searchSuggestions,searchInputContainer:searchInputContainer}=searchInputElements,tabbable=[];tabbable.push(searchInput);searchSuggestions.querySelectorAll("a").forEach((suggestion=>tabbable.push(suggestion)));const firstTabbable=tabbable[0],lastTabbable=tabbable[tabbable.length-1];searchInputContainer.removeEventListener("keydown",window.captureKeyDown),window.captureKeyDown=e=>{switch(e.key){case KEYS.TAB:(e=>{e.target!==lastTabbable||e.shiftKey?e.target===firstTabbable&&e.shiftKey&&(e.preventDefault(),lastTabbable.focus()):(e.preventDefault(),firstTabbable.focus())})(e);break;case KEYS.ESC:case KEYS.ESCAPE:emptySearchSuggestions({},searchInputElements);break;case KEYS.UP:case KEYS.ARROW_UP:(e=>{e.preventDefault(),e.target===firstTabbable?lastTabbable.focus():tabbable.forEach((el=>{el===e.target&&tabbable[tabbable.indexOf(el)-1].focus()}))})(e);break;case KEYS.DOWN:case KEYS.ARROW_DOWN:(e=>{e.preventDefault(),e.target===lastTabbable?firstTabbable.focus():tabbable.forEach((el=>{el===e.target&&tabbable[tabbable.indexOf(el)+1].focus()}))})(e)}},searchInputContainer.addEventListener("keydown",window.captureKeyDown)},renderSearchSuggestions=(suggestionsResponse,searchInputElements)=>{const{searchSuggestions:searchSuggestions,srMessageContainer:srMessageContainer,searchInputContainer:searchInputContainer}=searchInputElements,{results:results,searchTerm:searchTerm}=suggestionsResponse,searchResultsMessage=moduleConfig.autosuggest_results_message.replace("[[search_term]]",searchTerm),items=[`<li role="option"\n      tabindex="-1"\n      aria-posinset="1"\n      aria-setsize="${results.length}"\n      class="results-for">${searchResultsMessage}</li>`,...results.map(((result,index)=>`<li role="option"\n          aria-posinset="${index+2}"\n          tabindex="${index+1}"><a href="${result.url}">${result.title}</a></li>`))];console.log("--- 1 ---"),console.log(searchSuggestions),emptySearchSuggestions({},searchInputElements),searchSuggestions.innerHTML=items.join(""),searchInputContainer.classList.add("hs-search-field--open"),srAnnounceTimeout=setTimeout((()=>{((suggestionsResponse,srMessageContainer)=>{const{results:results,searchTerm:searchTerm}=suggestionsResponse;
1srMessageContainer&&(srMessageContainer.innerHTML=`${moduleConfig.sr_autosuggest_results_message.replace("[[number_of_results]]",results.length).replace("[[search_term]]",searchTerm)}`)})(suggestionsResponse,srMessageContainer)}),1500)},initializeSearchInput=searchInputContainer=>{let searchTerm="";if(searchInputContainer.classList.contains("hs-search-field--initialized"))return;searchInputContainer.classList.add("hs-search-field--initialized");const searchForm=searchInputContainer.querySelector("form"),searchInput=searchForm.querySelector(".hs-search-field__input"),searchSuggestions=searchInputContainer.querySelector(".hs-search-field__suggestions"),srMessageContainer=searchInputContainer.querySelector(".hs-search-sr-message-container"),searchInputElements={searchInputContainer:searchInputContainer,searchForm:searchForm,searchSuggestions:searchSuggestions,srMessageContainer:srMessageContainer,searchInput:searchInput},isSearchTermPresent=debounce((()=>{searchTerm=searchInput.value,searchTerm.length>2?(searchInputElements=>{const{searchForm:searchForm}=searchInputElements,data=new FormData(searchForm);data.set("limit",3),data.set("autocomplete",!0),data.set("analytics",!0);const searchUrl=`/_hcms/v3/site-search/search?${new URLSearchParams(data).toString()}`,request=new XMLHttpRequest;request.open("GET",searchUrl,!0),request.onload=function(){if(request.status>=200&&request.status<400){const resultData=JSON.parse(request.responseText);srAnnounceTimeout&&clearTimeout(srAnnounceTimeout),resultData.results.length>0?(renderSearchSuggestions(resultData,searchInputElements),trapFocus(searchInputElements)):emptySearchSuggestions(resultData,searchInputElements)}else console.error("Server reached, error retrieving results.")},request.onerror=function(){console.error("Could not reach the server.")},request.send()})(searchInputElements):0===searchTerm.length&&emptySearchSuggestions({},searchInputElements)}),250);searchInput.addEventListener("input",(()=>{searchTerm!==searchInput.value&&isSearchTermPresent()}))};document.addEventListener("DOMContentLoaded",(function(){const searchInputContainers=document.querySelectorAll(".search-input-nav__form-container");searchInputContainers.length>0&&searchInputContainers.forEach((searchInputContainer=>{initializeSearchInput(searchInputContainer)}));const formContainer=document.querySelector(".search-input-nav__form-container"),searchForm=document.querySelector(".search-input-nav__form");function setSearchIsInactive(){formContainer.setAttribute("aria-hidden","true")}document.querySelector(".search-input-nav__trigger-button").addEventListener("click",(function(){"true"===formContainer.getAttribute("aria-hidden")?(formContainer.removeAttribute("aria-hidden"),formContainer.querySelector(".hs-search-field__input").focus()):setSearchIsInactive()}
1)),document.addEventListener("keydown",(function(event){"Escape"!==event.key&&"Esc"!==event.key||setSearchIsInactive()})),formContainer.addEventListener("click",(function(event){searchForm.contains(event.target)||setSearchIsInactive()})),searchForm.addEventListener("click",(function(event){event.stopPropagation()}))}))}();

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.