PageSourceSearch

https://www.wpi.edu/themes/wpi/dist/js/wpi.js?v=11.3.17

js wpi.edu collected 2026-09-24 08:28:12 UTC 53,378 bytes, 2 lines download raw bytes

1"use strict";function accordionDetails(){const e=once("accordion_details",document.querySelectorAll(".wpi-accordion-item"));function t(e){const t=e.querySelector("summary"),n=e.querySelector(".wpi-accordion-item__title");null!==e.getAttribute("open")?(null!==t&&void 0!==t&&t.classList.add("wpi-accordion-item__header--active"),null!==n&&void 0!==n&&n.classList.add("wpi-accordion-item__title--active")):(null!==t&&void 0!==t&&t.classList.remove("wpi-accordion-item__header--active"),null!==n&&void 0!==n&&n.classList.remove("wpi-accordion-item__title--active"))}e.forEach(e=>{e.addEventListener("toggle",()=>{t(e)}),t(e)})}function accordionOpen(){const e=once("accordion_open",document.querySelectorAll('a[href^="#"]'));function o(e){const t=document.getElementById(e.slice(1));t&&"DETAILS"===t.tagName&&(t.open=!0,t.scrollIntoView({behavior:"smooth"}))}e.forEach(n=>{n.addEventListener("click",e=>{const t=n.getAttribute("href");t&&t.startsWith("#")&&o(t)})}),window.location.hash&&o(window.location.hash)}function slickMediaPane(t){if("undefined"!=typeof jQuery){let e=t.querySelectorAll(".slick--mp .slick__slider");(e=0===e.length?t.querySelectorAll(".slick__slider"):e).forEach(e=>{e=e.closest(".slick")||e.parentElement||e;{const t=e.querySelectorAll('iframe[src*="/media/oembed"]');return void t.forEach(e=>{try{const t=e.contentDocument;if(t){const n=t.querySelectorAll('iframe[src*="youtube.com/embed"]');n.forEach(e=>{var t;e.src.includes("enablejsapi=1")||(t=e.src.includes("?")?"&":"?",e.src=e.src+t+"enablejsapi=1")})}}catch(e){}})}}),Array.from(e).forEach(n=>{const e=jQuery(n);if(!e.data("slick-mp-video-pause-attached")){const t=()=>{e.hasClass("slick-initialized")?(e.data("slick-mp-video-pause-attached",!0),e.on("beforeChange",()=>{var e=n.closest(".slick")||n.parentElement||n;{const t=e.querySelectorAll("iframe");if(0!==t.length){const o=JSON.stringify({event:"command",func:"pauseVideo",args:[]});t.forEach(e=>{if(e.contentWindow){e.contentWindow.postMessage(o,"*");try{const t=e.contentDocument;if(t){const n=t.querySelectorAll("iframe");n.forEach(e=>{var t;!e.src.includes("enablejsapi=1")&&e.src.includes("youtube.com/embed")&&(t=e.src.includes("?")?"&":"?",e.src=e.src+t+"enablejsapi=1"),e.contentWindow&&e.contentWindow.postMessage(o,"*")})}}catch(e){}}})}return}})):setTimeout(t,100)};t()}})}}function studentJobsDisclosure(){const e=once("student_jobs_disclosure",document.querySelectorAll(".student-jobs__disclosure"));function t(e){const t=e.querySelectorAll(".student-jobs__disclosure-label"),n=e.querySelector(".student-jobs__disclosure-icon"),o=e.open;t.forEach((e,t)=>{e.classList.toggle("student-jobs__disclosure-label--hidden",t===(o?0:1))}),null!==n&&void 0!==n&&n.classList.toggle("student-jobs__disclosure-icon--open",o)}e.forEach(e=>{e.addEventListener("toggle",()=>t(e)),t(e)})}function usersView(){var e;const t=document.getElementById("views-exposed-form-users-users-page-interdisciplinary-research");if(void 0!==t&&null!==t){const n=document.querySelector('select[id*="edit-sdg"]');n&&(n.style.display="none",null!=(e=t.querySelector('label[for*="edit-sdg"]'))&&e.addEventListener("click",()=>{n.style.display="none"===n.style.display?"block":"none"}))}}"undefined"!=typeof Drupal&&!function(e){e.behaviors.accordion_details={attach(){accordionDetails()}},e.behaviors.accordion_open={attach(){accordionOpen()}}}(Drupal,once),"undefined"!=typeof Drupal&&(Drupal.behaviors.slickMediaPane={attach:e=>{slickMediaPane(e)}}),studentJobsDisclosure(),"undefined"!=typeof Drupal&&(Drupal.behaviors.usersView={attach:()=>{usersView()}});const menuButton=document.querySelector(".site-header__button--menu"),searchButton=document.querySelector(".site-header__button--search"),menuDropdown=document.querySelector(".mega-menu"),searchDropdown=document.querySelector(".header-search"),menuIcon=document.querySelector(".site-header__icon--menu"),searchIcon=document.querySelector(".site-header__icon--search"),searchInput=document.querySelector("#search-block-form input.form-search"),MOBILE_BP=1310,ACCORDION_BP=800;let lastInputWasPointer=!1;function isMobile(){return window.innerWidth<=MOBILE_BP}function isAccordion(){return window.innerWidth<=ACCORDION_BP}function hasMouse(){return window.matchMedia("(hover: hover) and (pointer: fine)").matches}function toggleMegaMenu(){var e;null!==searchDropdown&&void 0!==searchDropdown&&searchDropdown.classList.add("header-search--closed"),null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.toggle("mega-menu--closed"),null!==menuButton&&void 0!==menuButton&&menuButton.classList.toggle("site-header__button--active"),null!==menuIcon&&void 0!==menuIcon&&menuIcon.classList.toggle("site-header__icon--hide"),null!=(e=null===menuIcon||void 0===menuIcon?void 0:menuIcon.nextElementSibling)&&e.classList.toggle("site-header__icon--hide"),null!==searchDropdown&&void 0!==searchDropdown&&searchDropdown.classList.add("header-search--closed"),null!==searchButton&&void 0!==searchButton&&searchButton.classList.remove("site-header__button--active"),null!==searchIcon&&void 0!==searchIcon&&searchIcon.classList.remove("site-header__icon--hide"),null!=(e=null===searchIcon||void 0===searchIcon?void 0:searchIcon.nextElementSibling)&&e.classList.add("site-header__icon--hide");const t=document.querySelector(".media-banner-item__video"),n=document.querySelector(".media-banner-item__icon--pause"),o=document.querySelector(".media-banner-item__icon--play");if(t&&!t.paused&&(t.pause(),t.classList.remove("media-banner-item__video--playing"),n.classList.remove("media-banner-item__icon--visible"),o.classList.add("media-banner-item__icon--visible")),null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.contains("mega-menu--closed")||isMobile()||(e=document.querySelector(".alt-menu__link--first-level"))&&activateFirstLevelItem(e,!0),null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.contains("mega-menu--closed")){clearPendingStagger();const a=document.querySelector(".alt-menu__wrapper"),i=document.querySelector(".alt-menu
1--second-level");document.querySelectorAll(".alt-menu__link--first-level").forEach(e=>{var t;e.classList.remove("alt-menu__link--active"),e.setAttribute("aria-expanded","false");const n=e.parentNode;n.classList.remove("alt-menu__item--active","alt-menu__item--hidden-on-tablet"),null!=(t=e.querySelector(".alt-menu__link-text"))&&t.classList.remove("alt-menu__link-text--active"),null!=(t=e.querySelector(".alt-menu__link-text-arrow"))&&t.classList.remove("alt-menu__link-text-arrow--active")}),document.querySelectorAll(".alt-menu__item--staggered").forEach(e=>{e.classList.add("alt-menu__item--hidden"),e.classList.remove("alt-menu__item--staggered"),e.querySelectorAll("a, button").forEach(e=>e.setAttribute("tabindex","-1"))}),null!==a&&void 0!==a&&a.classList.remove("alt-menu__wrapper--active"),null!==i&&void 0!==i&&i.classList.remove("alt-menu--active")}}function toggleSearch(){var e;null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.add("mega-menu--closed"),null!==searchDropdown&&void 0!==searchDropdown&&searchDropdown.classList.toggle("header-search--closed"),null!==searchButton&&void 0!==searchButton&&searchButton.classList.toggle("site-header__button--active"),null!==searchIcon&&void 0!==searchIcon&&searchIcon.classList.toggle("site-header__icon--hide"),null!=(e=null===searchIcon||void 0===searchIcon?void 0:searchIcon.nextElementSibling)&&e.classList.toggle("site-header__icon--hide"),null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.add("mega-menu--closed"),null!==menuButton&&void 0!==menuButton&&menuButton.classList.remove("site-header__button--active"),null!==menuIcon&&void 0!==menuIcon&&menuIcon.classList.remove("site-header__icon--hide"),null!=(e=null===menuIcon||void 0===menuIcon?void 0:menuIcon.nextElementSibling)&&e.classList.add("site-header__icon--hide"),null!==searchButton&&void 0!==searchButton&&searchButton.classList.contains("site-header__button--active")&&null!==searchInput&&void 0!==searchInput&&searchInput.focus()}document.addEventListener("pointerdown",()=>{lastInputWasPointer=!0},!0),document.addEventListener("keydown",()=>{lastInputWasPointer=!1},!0),null!==menuButton&&menuButton.addEventListener("click",toggleMegaMenu),null!==searchButton&&searchButton.addEventListener("click",toggleSearch);const pendingStaggerTimeouts=[];function clearPendingStagger(){pendingStaggerTimeouts.forEach(e=>clearTimeout(e)),pendingStaggerTimeouts.length=0}const secondLevelMenuEl=document.querySelector(".alt-menu--second-level"),originalSecondLevelOrder=secondLevelMenuEl?Array.from(secondLevelMenuEl.children):[];function collapseAccordion(){const e=document.querySelector(".alt-menu__accordion-panel"),t=document.querySelector(".alt-menu--second-level");e&&t&&(originalSecondLevelOrder.forEach(e=>t.appendChild(e)),e.remove()),document.querySelectorAll(".alt-menu__link--first-level.alt-menu__link--active").forEach(e=>{e.classList.remove("alt-menu__link--active"),e.setAttribute("aria-expanded","false"),null!=(e=e.parentNode)&&e.classList.remove("alt-menu__item--active")})}function activateFirstLevelItemAccordion(e,t=!1){if(e.classList.contains("alt-menu__link--active")&&!t)collapseAccordion();else{collapseAccordion();t=e.getAttribute("data-id");if(t){e.classList.add("alt-menu__link--active"),e.setAttribute("aria-expanded","true");const n=e.parentNode,o=(n.classList.add("alt-menu__item--active"),document.createElement("ul"));o.className="alt-menu__accordion-panel gtm-mainmenu-items",o.setAttribute("data-parent-id",t),document.querySelectorAll(`.alt-menu__item--second-level[data-parent-id="${t}"]`).forEach(e=>{e.classList.remove("alt-menu__item--hidden"),o.appendChild(e)}),n.insertAdjacentElement("afterend",o)}}}function activateFirstLevelItem(t,n=!1){var o;if(isAccordion())activateFirstLevelItemAccordion(t,n);else{clearPendingStagger();const a=document.querySelector(".alt-menu__wrapper"),i=document.querySelectorAll(".alt-menu__link--first-level"),l=document.querySelector(".alt-menu--second-level"),r=document.querySelectorAll(".alt-menu__item--staggered");if(l.classList.add("alt-menu--active"),!n&&t.classList.contains("alt-menu__link--active"))return i.forEac
1h(e=>{const t=e.parentNode,n=e.querySelector(".alt-menu__link-text"),o=e.querySelector(".alt-menu__link-text-arrow");e.classList.remove("alt-menu__link--active"),e.setAttribute("aria-expanded","false"),t.classList.remove("alt-menu__item--active"),t.classList.remove("alt-menu__item--hidden-on-tablet"),a.classList.remove("alt-menu__wrapper--active"),l.classList.remove("alt-menu--active"),null!==n&&void 0!==n&&n.classList.remove("alt-menu__link-text--active"),null!==o&&void 0!==o&&o.classList.remove("alt-menu__link-text-arrow--active")}),void r.forEach(e=>{e.classList.add("alt-menu__item--hidden"),e.classList.remove("alt-menu__item--staggered")});i.forEach(e=>{e.classList.remove("alt-menu__link--active"),e.setAttribute("aria-expanded","false");const t=e.parentNode,n=e.querySelector(".alt-menu__link-text");t.classList.remove("alt-menu__item--active"),null!==n&&void 0!==n&&n.classList.remove("alt-menu__link-text--active"),t.classList.add("alt-menu__item--hidden-on-tablet")}),t.classList.add("alt-menu__link--active"),t.setAttribute("aria-expanded","true");const s=t.querySelector(".alt-menu__link-text"),c=t.querySelector(".alt-menu__link-text-arrow");null!==s&&void 0!==s&&s.classList.add("alt-menu__link-text--active"),null!==c&&void 0!==c&&c.classList.add("alt-menu__link-text-arrow--active");n=t.getAttribute("data-id");let e;(e=isMobile()?null!=(o=document.querySelector(`.alt-menu__item--mobile-only[data-parent-id="${n}"] a.alt-menu__link--second-level`))?o:document.querySelector(`[data-
1parent-id="${n}"] button.alt-menu__link--second-level, `+`[data-parent-id="${n}"] a.alt-menu__link--second-level[data-id]`):document.querySelector(`.alt-menu__item--second-level:not(.alt-menu__item--mobile-only)[data-parent-id="${n}"] button.alt-menu__link--second-level, `+`.alt-menu__item--second-level:not(.alt-menu__item--mobile-only)[data-parent-id="${n}"] a.alt-menu__link--second-level[data-id]`))?pendingStaggerTimeouts.push(setTimeout(()=>{selectActive(t,!1),selectActive(e,!1),hasMouse()||e.focus()},0)):pendingStaggerTimeouts.push(setTimeout(()=>{selectActive(t,!1)},0));const u=t.parentNode;u.classList.remove("alt-menu__item--hidden"),u.classList.add("alt-menu__item--active"),a.classList.add("alt-menu__wrapper--active")}}const firstLevelLinks=document.querySelectorAll(".alt-menu__link--first-level");function selectActive(o,a){var e;o.classList.contains("alt-menu__link--second-level")&&(document.querySelectorAll(".alt-menu__link--second-level").forEach(e=>{e.classList.remove("alt-menu__link--active")}),o.classList.add("alt-menu__link--active"));const i=null!=(e=o.getAttribute("data-id"))?e:"";let t=document.querySelectorAll(".alt-menu__item--second-level");var l=0;if(o.classList.contains("alt-menu__link--second-level")){if(t=document.querySelectorAll(".alt-menu__item--third-level"),a){const n=document.querySelectorAll(".alt-menu__item--second-level"),s=i.match(/^(.*?)--/);n.forEach(e=>{const t=e,n=t.getAttribute("data-parent-id");s&&null!==n&&void 0!==n&&n.includes(s[1])&&((e=t.style.transitionDelay)&&(l=parseInt(e)))})}}else document.querySelectorAll(".alt-menu__item--third-level").forEach(e=>{e.classList.add("alt-menu__item--hidden"),e.classList.remove("alt-menu__item--staggered")});let r=0;null!==t&&void 0!==t&&t.forEach(e=>{var t,n;e.getAttribute("data-parent-id")===i?(e.classList.remove("alt-menu__item--hidden"),a?pendingStaggerTimeouts.push(setTimeout(()=>{e.classList.add("alt-menu__item--staggered"),e.querySelectorAll("a, button").forEach(e=>e.removeAttribute("tabindex"))},l+50)):o.classList.contains("alt-menu__link--second-level")?(e.classList.add("alt-menu__item--staggered"),e.querySelectorAll("a, button").forEach(e=>e.removeAttribute("tabindex"))):(n=(t=e.classList.contains("alt-menu__item--mobile-only"))?0:50*r,t||r++,e.classList.remove("alt-menu__item--staggered"),pendingStaggerTimeouts.push(setTimeout(()=>{e.classList.add("alt-menu__item--staggered"),e.querySelectorAll("a, button").forEach(e=>e.removeAttribute("tabindex"))},n)))):(e.classList.add("alt-menu__item--hidden"),e.classList.remove("alt-menu__item--staggered"),e.querySelectorAll("a, button").forEach(e=>e.setAttribute("tabindex","-1")))})}null!==firstLevelLinks&&void 0!==firstLevelLinks&&firstLevelLinks.forEach(r=>{r.setAttribute("aria-expanded","false"),r.setAttribute("aria-haspopup","true"),r.addEventListener("mouseenter",function(){!isMobile()&&hasMouse()&&activateFirstLevelItem(r,!0)}),r.addEventListener("focus",function(){lastInputWasPointer||null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.contains("mega-menu--closed")||r.classList.contains("alt-menu__link--active")||activateFirstLevelItem(r,!0)}),r.addEventListener("click",function(e){!isMobile()&&hasMouse()||(e.preventDefault(),activateFirstLevelItem(r))}),r.addEventListener("keydown",function(e){const t=Array.from(document.querySelectorAll(".alt-menu__link--first-level"));var n=t.indexOf(r);switch(e.key){case"ArrowDown":{e.preventDefault();const a=t[n+1];a&&(a.focus(),activateFirstLevelItem(a,!0));break}case"ArrowUp":{e.preventDefault();const i=t[n-1];i&&(i.focus(),activateFirstLevelItem(i,!0));break}
1case"ArrowRight":case"Tab":{if("Tab"===e.key&&e.shiftKey)break;if(!r.classList.contains("alt-menu__link--active"))break;var o=r.getAttribute("data-id");const l=document.querySelector(`.alt-menu__item--second-level[data-parent-id="${o}"]:not(.alt-menu__item--mobile-only) :is(button, a).alt-menu__link--second-level`);l&&(e.preventDefault(),l.focus());break}case"Escape":e.preventDefault(),null!==menuDropdown&&void 0!==menuDropdown&&menuDropdown.classList.contains("mega-menu--closed")||(toggleMegaMenu(),null!==menuButton&&void 0!==menuButton&&menuButton.focus());break;case"Enter":case" ":!isMobile()&&hasMouse()||(e.preventDefault(),activateFirstLevelItem(r))}})}),document.querySelectorAll(":is(button, a).alt-menu__link--second-level[data-id]").forEach(c=>{c.addEventListener("mouseenter",function(){hasMouse()&&selectActive(c,!1)}),c.addEventListener("focus",function(){lastInputWasPointer||selectActive(c,!1)}),c.addEventListener("keydown",function(e){var t;const n=c.closest(".alt-menu__item--second-level");var o=null!=(t=null===n||void 0===n?void 0:n.getAttribute("data-parent-id"))?t:"";const a=Array.from(document.querySelectorAll(`.alt-menu__item--second-level[data-parent-id="${o}"].alt-menu__item--staggered button.alt-menu__link--second-level, `+`.alt-menu__item--second-level[data-parent-id="${o}"].alt-menu__item--staggered a.alt-menu__link--second-level[data-id]`));var i=a.indexOf(c);switch(e.key){case"ArrowDown":{e.preventDefault();const l=a[i+1];l&&(l.focus(),selectActive(l,!1));break}case"ArrowUp":{e.preventDefault();const r=a[i-1];r&&(r.focus(),selectActive(r,!1));break}case"ArrowLeft":case"Escape":{e.preventDefault();const s=document.querySelector(`[data-id="${o}"]`);s&&s.focus();break}}})}),document.querySelectorAll(".alt-menu__item--second-level a, .alt-menu__item--second-level button, .alt-menu__item--third-level a, .alt-menu__item--third-level button").forEach(e=>e.setAttribute("tabindex","-1"));let wasAccordion=isAccordion(),resizeTimer=null;function stickyAnchors(){window.addEventListener("load",()=>{var e;const o=document.querySelector(".anchors__links"),a=document.querySelector(".anchors"),i=document.querySelector(".anchors__nav"),t=document.querySelectorAll(".anchors__link");if(a&&o){const u=document.createElement("div"),d=(u.className="anchors__placeholder",null!=(e=a.parentNode)&&e.insertBefore(u,a.nextSibling),document.body.classList.contains("user-logged-in"));d&&o.classList.add("anchors__links--logged-in");let n=a.getBoundingClientRect().top+window.scrollY;const m=12;function l(){if(!o)return 0;var e=d?80:0;return o.offsetHeight+e+m}function r(){document.documentElement.style.setProperty("--anchors-scroll-offset",l()+"px")}function s(){var e,t;o&&a&&(e=window.scrollY>=n,t=o.classList.contains("anchors__links--sticky"),e&&!t?(u.style.height=o.offsetHeight+"px",o.classList.add("anchors__links--sticky"),null!==i&&void 0!==i&&i.classList.add("anchors__nav--sticky")):!e&&t&&(o.classList.remove("anchors__links--sticky"),null!==i&&void 0!==i&&i.classList.remove("anchors__nav--sticky"),u.style.height="0"),r())}function c(e){let t=null;try{t=document.querySelector(e)}catch(e){return}t&&(e=t.getBoundingClientRect().top+window.scrollY-l(),window.scrollTo({top:e,behavior:"smooth"}))}window.addEventListener("scroll",s),window.addEventListener("resize",()=>{n=a.getBoundingClientRect().top+window.scrollY,s()}),s(),r(),window.location.hash&&requestAnimationFrame(()=>c(window.location.hash)),t.forEach(n=>{n.addEventListener("click",t=>{if(n.hash){let e=null;try{e=document.querySelector(n.hash)}catch(e){return}e&&(t.preventDefault(),c(n.hash))}})})}})}function stickyFeaturedLinks(){var e=document.querySelector(".fl--sticky");const t=document.querySelector(".site-footer");e&&null!==t&&void 0!==t&&t.classList.add("site-footer--sticky-featured-links")}function flipBlockOverlay(){const t=document.querySelectorAll(".flip-block__item-wrapper");null!==t&&void 0!==t&&t.forEach(e=>{e.addEventListener("click",()=>{e.classList.contains("is-flipped")?e.classList.remove("is-flipped"):(t.forEach(e=>{e.classList.remove("is-flipped")}),e.classList.toggle("is-flipped"))})})}function flipBlock(){const e=document.querySelectorAll(".flip-ne-block__item");e.forEach(i=>
1{i.addEventListener("mouseover",function(){const e=i.querySelector(".flip-ne-block__link"),t=i.querySelector(".flip-ne-block__caption");var n=i.querySelector(".flip-ne-block__title"),o=i.querySelector(".flip-ne-block__subtitle");const a=i.querySelector(".flip-ne-block__fields");(e||t)&&(null!==e&&void 0!==e&&e.classList.add("flip-ne-block__link--visible"),null!==t&&void 0!==t&&t.classList.add("flip-ne-block__caption--visible")),(n||o||e||t)&&null!==a&&void 0!==a&&a.classList.add("flip-ne-block__fields--hover")}),i.addEventListener("mouseout",function(){const e=i.querySelector(".flip-ne-block__link"),t=i.querySelector(".flip-ne-block__caption"),n=i.querySelector(".flip-ne-block__fields");(e||t)&&(null!==e&&void 0!==e&&e.classList.remove("flip-ne-block__link--visible"),null!==t&&void 0!==t&&t.classList.remove("flip-ne-block__caption--visible")),null!==n&&void 0!==n&&n.classList.remove("flip-ne-block__fields--hover")})})}window.addEventListener("resize",()=>{resizeTimer&&clearTimeout(resizeTimer),resizeTimer=setTimeout(()=>{var e=isAccordion();e!==wasAccordion&&(wasAccordion=e,collapseAccordion(),document.querySelectorAll(".alt-menu__link--first-level").forEach(e=>{var t;e.classList.remove("alt-menu__link--active"),e.setAttribute("aria-expanded","false");const n=e.parentNode;null!==n&&void 0!==n&&n.classList.remove("alt-menu__item--active"),null!==n&&void 0!==n&&n.classList.remove("alt-menu__item--hidden-on-tablet"),null!=(t=e.querySelector(".alt-menu__link-text"))&&t.classList.remove("alt-menu__link-text--active"),null!=(t=e.querySelector(".alt-menu__link-text-arrow"))&&t.classList.remove("alt-menu__link-text-arrow--active")}),null!=(e=document.querySelector(".alt-menu__wrapper"))&&e.classList.remove("alt-menu__wrapper--active"),null!=(e=document.querySelector(".alt-menu--second-level"))&&e.classList.remove("alt-menu--active"),document.querySelectorAll(".alt-menu__item--staggered").forEach(e=>{e.classList.add("alt-menu__item--hidden"),e.classList.remove("alt-menu__item--staggered")}))},100)}),"undefined"!=typeof Drupal&&(Drupal.behaviors.stickyAnchors={attach:()=>stickyAnchors()}),"undefined"!=typeof Drupal&&(Drupal.behaviors.stickyFeaturedLinks={attach:()=>{stickyFeaturedLinks()}}),"undefined"!=typeof Drupal&&(Drupal.behaviors.flipBlockOverlay={attach:()=>{flipBlockOverlay()}}),"undefined"!=typeof Drupal&&(Drupal.behaviors.flipBlock={attach:()=>{flipBlock()}});const librarySearchForm=document.getElementById("ebsco-library-search"),librarySearchOptions=document.getElementById("search-options"),librarySearchInput=document.getElementById("ebscoSearchInput"),EDS_BASE="https://research.ebsco.com/c/e4qq37/results",COURSE_RESERVES_BASE="https://wpi.locate.ebsco.com/course-reserves";function buildSearchUrl(e,t){var n=encodeURIComponent(e);switch(t){case"online-only":return EDS_BASE+`?q=${n}&autocorrect=y&limiters=FT1:Y,FT:Y`;case"physical-only":return EDS_BASE+`?q=${n}&autocorrect=y&limiters=FT1:Y,cl:NkKaxi:Y`;case"course-reserves":return COURSE_RESERVES_BASE+"?search="+n;default:return EDS_BASE+`?q=${n}&autocorrect=y`}}function shareLinks(){const n=document.querySelector(".share__wrapper");if(n){const a=document.querySelector(".share"),i=document.querySelectorAll(".share__link"),l=document.querySelectorAll(".share__link--copy");function e(){null!==n&&void 0!==n&&n.classList.add("share__wrapper--sticky"),null!==a&&void 0!==a&&a.classList.add("share--sticky"),i.forEach(e=>{e.classList.add("share__link--sticky")})}function t(){null!==n&&void 0!==n&&n.classList.remove("share__wrapper--sticky"),null!==a&&void 0!==a&&a.classList.remove("share--sticky"),i.forEach(e=>{e.classList.remove("share__link--sticky")})}function o(){[".one-col--gray",".block-field-blocknodearticlefield-tags",".block-field-blocknodearticlefield-office-dept-name",".block-field-blocknodearticlefield-person-of-interest",".view-startups"].forEach(e=>{var t,e=document.querySelectorAll(e);0<e.length&&(null!=(t=null==(e=e[e.length-1])?void 0:e.parentNode)&&t.insertBefore(n,e.nextSibling))})}940<=window.innerWidth?e():(t(),o()),window.addEventListener("resize",()=>{e(),940<=window.innerWidth?e():(t(),o())}),l.forEach(n=>
1{n.addEventListener("click",e=>{var t;t=n,e.preventDefault(),navigator.clipboard.writeText(t.href).then(()=>{if(null===document.querySelector(".share__message")){const e=document.createElement("div");e.classList.add("share__message"),e.innerHTML="Link copied to clipboard",t.appendChild(e),setTimeout(()=>{e.remove()},2e3)}}).catch(()=>{const e=document.createElement("div");e.classList.add("share__message"),e.innerHTML="Error copying link to clipboard. Try again.",t.appendChild(e),setTimeout(()=>{e.remove()},2e3)})})})}}function wpiEmergencyButtons(){function l(){return window.matchMedia("(min-width: 1200px)").matches?"large-up":window.matchMedia("(min-width: 640px)").matches?"medium":window.matchMedia("(max-width: 639px)").matches?"small":void 0}function o(e){var n,o,a,i,e=function(e){if(!(e=document.querySelector(e)).getClientRects().length)return{top:0,left:0};var t=e.getBoundingClientRect(),e=e.ownerDocument.defaultView;return{top:t.top+e.scrollY,left:t.left+e.scrollX}}(e);"large-up"===l()&&(e.top-=106),n=e.top,o=400,i=window.pageYOffset,n=+n,o=+(o=null==o?500:o),window.requestAnimationFrame(function e(t){t-=a=a||t;i<n?window.scrollTo(0,(n-i)*t/o+i):window.scrollTo(0,i-(i-n)*t/o),t<o?window.requestAnimationFrame(e):window.scrollTo(0,n)})}function a(){var e=document.querySelector(".emergency-management__button--active");e&&e.classList.remove("emergency-management__button--active")}function i(){var e=document.querySelector(".emergency-management__detail-element--active");e&&e.classList.remove("emergency-management__detail-element--active")}function t(n){return function(){var e,t;t="emergency-management__button--active",-1<(" "+n.className+" ").indexOf(" "+t+" ")?(i(),n.classList.remove("emergency-management__button--active")):(i(),a(),t="emergency-management__button--active",(e=n).classList.contains(t)||e.classList.add(t),null!=(e=n.nextElementSibling)&&e.classList.add("emergency-management__detail-element--active"),o(".emergency-management__button--active"))}}function r(t,n){const o=[];for(let e=0;e<t.length;e+=n){var a=t.slice(e,e+n);o.push(a)}return o}function n(){var e=Array.from(document.querySelectorAll(".emergency-management__button")),t=Array.from(document.querySelectorAll(".emergency-management__detail-element")),n=4;switch(l()){case"small":n=2;break;case"medium":n=3}var e=r(e,n),o=r(t,n),a=1;e.forEach(function(e,t){e.forEach(function(e,t){var n=document.getElementById(e.id);"emergency-1"==e.id?n.setAttribute("style","order: 1"):n.setAttribute("style","order: "+a),a++}),o[t].forEach(function(e){document.getElementById(e.id).setAttribute("style","order: "+a),a++})})}window.addEventListener("resize",function(e){null!==document.querySelector(".emergency-management")&&(document.querySelector(".emergency-management__detail-element--active")&&(i(),a()),n())}),window.addEventListener("load",function(){null!==document.querySelector(".emergency-management")&&(document.querySelector(".emergency-management__buttons").childNodes.forEach(function(e){e.nodeType==Node.TEXT_NODE&&e.remove()}),document.querySelectorAll(".emergency-management__button").forEach(function(e){e.addEventListener("click",t(e))}),document.querySelectorAll(".emergency-management__close-button").forEach(function(e){e.addEventListener("click",function(e){i(),a()})}),n())})}librarySearchForm&&librarySearchForm.addEventListener("submit",e=>{e.preventDefault();var e=null!=(e=null===librarySearchInput||void 0===librarySearchInput?void 0:librarySearchInput.value)?e:"",e=buildSearchUrl(e,null!=(e=null===librarySearchOptions||void 0===librarySearchOptions?void 0:librarySearchOptions.value)?e:"wpi-has-it");window.open(e,"_blank")}),"undefined"!=typeof Drupal&&(Drupal.behaviors.shareLinks={attach:e=>{once("shareLinks",".share__wrapper",e).forEach(()=>{shareLinks()})}}),"undefined"!=typeof Drupal&&(Drupal.behaviors.wpiEmergencyButtons={attach:function(){wpiEmergencyButtons()}});let ranOnce=!1;function latestNews(){const e=document.querySelector(".latest-news__date"),t=new URLSearchParams(window.location.search),n=document.querySelector(".latest-news__story_type-wrapper > select"),o=document.querySelector(".latest-news__combine-wrapper > input");if(e){const l=document.querySelector(".start_date"),r=document.querySelector(".end_date");e.addEventListener("change",()=>{[l.value,r.value]=e.value.split("&")})}const a=document.querySelector(".latest-news__poi-wrapper > input"),i=document.querySelector(".latest-news__person-of-interest");i&&a&&i.addEventListener("change",()=>{a.value="All"!==i.value?i.value:""}),ranOnce||(n&&!t.get("story_type")&&(n.value="All"),o&&!t.get("combine")&&(o.value=""),e&&!t.get("date")&&(e.value="All"),a&&!t.get("poi")&&(a.value="",i.value="All"),ranOnce=!0)}function loginFormDropdown(){const e=document.querySelector(".user-login-form__drupal"),t=document.querySelector(".user-login-form");null!==e&&void 0!==e&&e.addEventListener("click",()=>{null!==t&&void 0!==t&&t.classList.toggle("user-login-form--hidden")})}function ssoButtonParameter(){window.addEventListener("DOMContentLoaded",()=>{const e=new URL(window.location.href);if(e.searchParams.has("destination")){var t=e.searchParams.get("destination");if(t){const n=document.querySelector(".user-login-form__wpi"),o=new URL((null===n||void 0===n?void 0:n.getAttribute("href"))||"",e.origin);o.searchParams.has("destination")||(o.searchParams.set("destination",t),null!==n&&void 0!==n&&n.setAttribute("href",o.toString()))}}})}if("undefined"!=typeof Drupal&&(Drupal.behaviors.latestNews={attach:()=>{latestNews()}}),"undefined"!=typeof Drupal){let e=1;Drupal.behaviors.loginFormDropdown={attach:function(){1===e&&(loginFormDropdown(),e++)}},Drupal.behaviors.ssoButtonParameter={attach:function(){ssoButtonParameter()}}}function searchPage(){const a=document.querySelector(".layout-content.search-page");function i(e,t,n){const o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),document.cookie=e+`=${t};expires=`+o.toUTCString()}function l(e){e=document.cookie.match(`(^|;) ?${e}=([^;]*)(;|$)`);return e?e[2]:null}function r(e,t,n){switch(e){case"location":n.querySelector('input[name*="searched_key"]').value=t,n.querySelector('input[id*="edit-submit-locations"]').click();break;case"pages":n.querySelector('input[name*="keys"]').value=t,n.querySelector('input[id*="edit-submit"]').click();break;case"people":n.querySelector('input[id*="edit-keys"]').value=t,n.querySelector('input[id*="edit-submit-people-search2"]').click()}}if(null!=a){const u=document.querySelector('form[block*="block-searchform-2"]');let t,n;const d=window.location.href;if(d.includes("/search/location"))t=document.querySelector('form[id*="views-exposed-form-locations-page-1"]'),n="location";else if(d.includes("/search/google"))t=document.querySelector(".search-form.google-cse"),n="pages";else{if(!d.includes("/search/people"))return;t=document.querySelector('form[id*="views-exposed-form-people-search2-people-search"]'),n="people"}if(l("searchPage_key")){let e;e=l("searchPage_key"),i(c="searchPage_key",l(c),-1),window.addEventListener("DOMContentLoaded",()=>{r(n,e,t)},!1)}{c=n;var s=t;let e;switch(c){case"location":e=s.querySelector('input[name*="searched_key"]').value;break;case"pages":e=s.querySelector('input[name*="keys"]').value;break;case"people":e=s.querySelector('input[id*="edit-keys"]').value;break;default:e=""}const m=a.querySelectorAll("#block-wpi-local-tasks ul li a")[0],v=a.querySelectorAll("#block-wpi-local-tasks ul li a")[1],_=a.querySelectorAll("#block-wpi-local-tasks ul li a")[2];m instanceof HTMLAnchorElement&&(m.href=m.href.split("?")[0]+"?searched_key="+e),v instanceof HTMLAnchorElement&&(v.href=v.href.split("?")[0]+"?searched_key="+e),_ instanceof HTMLAnchorElement&&(_.href=_.href.split("?")[0]+"?keys="+e),m.addEventListener("click",()=>{i("searchPage_key",e,1)}),v.addEventListener("click",()=>{i("searchPage_key",e,1)}),_.addEventListener("click",()=>{i("searchPage_key",e,1)})}null!=u&&u.querySelector('input[value*="Search"]').addEventListener("click",e=>{e.preventDefault();e=u.querySelector('input[name*="key"]').value;r(n,e,t)});let e,o=document.querySelector('form[block="block-searchform-2"]');switch(n){case"location":null!=(e=t.querySelector('input[name*="searched_key"]').value)&&(o.querySelector('input[name*="key"]').value=e);break;case"pages":null!=(e=t.querySelector('input[name*="keys"]').value)&&null!=o&&(o.querySelector('input[name*="key"]').value=e);break;case"people":null!=(e=t.querySelector('input[id*="edit-keys"]').value)&&(o.querySelector('input[name*="key"]').value=e)}}var c}function scroll(e,t){if(!(t<=0)){const n=(e-document.documentElement.scrollTop)/t*10;setTimeout(()=>{document.documentElement.scrollTop+=n,document.documentElement.scrollTop!==e&&scroll(e,t-10)},10)}}const btn=document.querySelector(".scrollbtn");var _a;null!=btn&&(btn.addEventListener("click",()=>{scroll(0,200)}),window.onscroll=function(){10<document.body.scrollTop||10<document.documentElement.scrollTop?btn.style.display="block":btn.style.display="none"}),"undefined"!=typeof Drupal&&(Drupal.behaviors.searchPage={attach:()=>{searchPage()}});const links=document.querySelectorAll(".breadcrumb__item--link"),arrows=document.querySelectorAll(".breadcrumb__icon--arrow-right"),moreIcon=document.querySelector(".breadcrumb__icon--more"),closeIcon=document.querySelector(".breadcrumb__icon--close"),items=document.querySelectorAll(".breadcrumb__item");function moreThanThree(){if(items){var t=items.length-3,n=t-1;if(3<items.length){null!==moreIcon&&void 0!==moreIcon&&moreIcon.classList.add("breadcrumb__icon--more-shown");for(let e=0;e<t;e++)items[e].classList.add("breadcrumb__item--before-last"),e<n&&arrows[e].classList.add("breadcrumb__icon--before-last"),arrows[e].classList.add("breadcrumb__icon--before-last")}}}const iconsBreadcrumb=document.getElementsByClassName("breadcrumb__icon breadcrumb__icon--arrow-right");if(void 0!==iconsBreadcrumb){const A2=iconsBreadcrumb[iconsBreadcrumb.length-1];void 0!==A2&&A2.classList.add("breadcrumb__icon--shown")}moreThanThree(),moreIcon&&closeIcon&&(moreIcon.addEventListener("click",()=>
1{links.forEach(e=>{e.classList.add("breadcrumb__item--shown"),e.classList.remove("breadcrumb__item--before-last")}),arrows.forEach(e=>{e.classList.add("breadcrumb__icon--shown"),e.classList.remove("breadcrumb__icon--before-last")}),closeIcon.classList.add("breadcrumb__icon--shown-on-small"),moreIcon.classList.add("breadcrumb__icon--hidden"),moreIcon.classList.remove("breadcrumb__icon--more-shown"),closeIcon.classList.add("breadcrumb__icon--close-shown")}),null!=(_a=document.querySelector(".breadcrumb__icon--close"))&&_a.addEventListener("click",()=>{moreThanThree(),links.forEach(e=>{e.classList.remove("breadcrumb__item--shown")});const t=arrows.length-1;let n=0;arrows.forEach(e=>{n<t&&e.classList.remove("breadcrumb__icon--shown"),n+=1}),closeIcon.classList.remove("breadcrumb__icon--shown-on-small"),moreIcon.classList.remove("breadcrumb__icon--hidden"),moreIcon.classList.add("breadcrumb__icon--more-shown"),closeIcon.classList.remove("breadcrumb__icon--close-shown")}));const dropdownS="mega-menu__dropdown-controller",itemS="mega-menu__item",subMenuS="mega-menu__sub-menu",dropdownToggles=document.querySelectorAll("."+dropdownS);function toggleMenu(e){const t=e,n=t.nextElementSibling;if(e.classList.contains(dropdownS+"--active"))return e.classList.toggle(dropdownS+"--active"),t.classList.toggle(itemS+"--active"),void(null!==n&&void 0!==n&&n.classList.toggle(subMenuS+"--active"));const o=document.querySelector(`.${dropdownS}--active`),a=document.querySelector(`.${itemS}--active`),i=document.querySelector(`.${subMenuS}--active`);o?(o.classList.remove(dropdownS+"--active"),null!==a&&void 0!==a&&a.classList.remove(itemS+"--active"),null!==i&&void 0!==i&&i.classList.remove(subMenuS+"--active"),e.classList.add(dropdownS+"--active"),t.classList.add(itemS+"--active"),null!==n&&void 0!==n&&n.classList.add(subMenuS+"--active")):(e.classList.toggle(dropdownS+"--active"),t.classList.toggle(itemS+"--active"),null!==n&&void 0!==n&&n.classList.toggle(subMenuS+"--active"))}function siteMenu(e){const a="site-menu__dropdown-controller",i="site-menu__sub-menu",t=once("site-menu-dropdown","."+a,e),n=once("site-menu-parent",".site-menu__parent-item",e),u=e.querySelector(".site-menu__parent-link"),d=e.querySelector(".site-menu__sidebar-toggle"),o=once("site-menu-link",".site-menu__link",e);const l=once("site-menu-toggle",".site-menu__dropdown-controller-wrapper",e);t.forEach(e=>{e.addEventListener("click",e=>{e=e.target.closest("."+a);if(void 0!==e){const t=e.nextElementSibling;if(e.classList.contains(a+"--expanded"))e.classList.remove(a+"--expanded"),t.classList.remove(i+"--expanded");else{const n=e.closest(".site-menu"),o=n.querySelectorAll(`.${a}--expanded`);o.forEach(e=>{e.classList.remove(a+"--expanded"),null!=(e=e.nextElementSibling)&&e.classList.remove(i+"--expanded")}),e.classList.add(a+"--expanded"),t.classList.add(i+"--expanded")}}})}),l.forEach(a=>{a.addEventListener("click",()=>{{var e=a;const t=document.querySelector(".site-menu__icon--chevron"),n=document.querySelector(".site-menu__mobile-wrapper"),o=document.querySelector(".site-menu__inner-wrapper");return e.classList.toggle("site-menu__inner-wrapper--expanded"),null!==t&&void 0!==t&&t.classList.toggle("site-menu__icon--expanded"),null!==n&&void 0!==n&&n.classList.toggle("site-menu__mobile-wrapper--hidden-on-mobile"),void(null!==o&&void 0!==o&&o.classList.toggle("site-menu__inner-wrapper--expanded"))}})});e=document.querySelector(".two-col--100-0");void 0!==d&&null!==d&&null!=e&&d.classList.remove("site-menu__sidebar-toggle--hidden"),n.forEach(c=>{c.addEventListener("click",e=>{const t=e.target;if(t.classList.contains("site-menu__parent-link--not-link")||!t.classList.contains("site-menu__parent-link")){if("svg"===t.tagName){const o=t.parentElement,a=t.firstElementChild;if(a.style.pointerEvents="none",o.classList.contains("site-menu__arrow--left"))return}t.classList.contains("site-menu__parent-link--not-link")&&e.preventDefault();{var e=d,n=c;const i=document.querySelector(".wpi-contact"),l=document.querySelector(".wpi-contact__social"),r=document.querySelector(".two-col__column--gutter"),s=n.nextElementSibling;e.classList.toggle("site-menu__sidebar-toggle--collapsed"),n.classList.toggle("site-menu__parent-item--collapsed"),null!==s&&void 0!==s&&s.classList.toggle("site-menu--hidden-on-desktop"),i&&i.classList.toggle("wpi-contact--hidden-on-desktop"),l&&l.classList.toggle("wpi-contact__social--hidden-on-desktop"),null!==r&&void 0!==r&&r.classList.toggle("two-col__column--collapsed"),"Menu"===u.textContent?(u.textContent=null!=(e=u.dataset.linkText)?e:"",u.classList.remove("site-menu__parent-link--not-link")):(u.textContent="Menu",u.classList.add("site-menu__parent-link--not-link"))}}})}
1),o.forEach(e=>{const t=e.nextElementSibling;e.addEventListener("mouseenter",()=>{t&&t.classList.add(a+"--hovered")}),e.addEventListener("mouseleave",()=>{t&&t.classList.remove(a+"--hovered")})})}function bannerVideo(){const e=document.querySelectorAll(".paragraph--type--media-banner-item");e&&e.forEach(t=>{const n=t.querySelector(".media-banner-item__media--video");if(n){const o=t.querySelector(".media-banner-item__icon--play"),a=t.querySelector(".media-banner-item__icon--pause"),i=n.querySelector("video");let e=!1;const l=t.querySelector(".media-banner-item__media .media-banner-item__control-container");null!==l&&void 0!==l&&l.addEventListener("click",()=>{e?(e=!1,null!==i&&void 0!==i&&i.play(),null!==i&&void 0!==i&&i.classList.add("media-banner-item__video--playing"),null!==a&&void 0!==a&&a.classList.add("media-banner-item__icon--visible"),null!==o&&void 0!==o&&o.classList.remove("media-banner-item__icon--visible")):(e=!0,null!==i&&void 0!==i&&i.pause(),null!==i&&void 0!==i&&i.classList.remove("media-banner-item__video--playing"),null!==a&&void 0!==a&&a.classList.remove("media-banner-item__icon--visible"),null!==o&&void 0!==o&&o.classList.add("media-banner-item__icon--visible"))}),null!==i&&void 0!==i&&i.addEventListener("canplaythrough",()=>{i.classList.contains("media-banner-item__video--playing")||(e=!1,i.play(),i.classList.add("media-banner-item__video--playing"),null!==o&&void 0!==o&&o.classList.remove("media-banner-item__icon--visible"),null!==a&&void 0!==a&&a.classList.add("media-banner-item__icon--visible"))})}})}function getParameterByName(e){var t=window.location.href;e=e.replace(/[[\]]/g,"\\$&");const n=new RegExp(`[?&]${e}(=([^&#]*)|&|#|$)`),o=n.exec(t);return o?o[2]?decodeURIComponent(o[2].replace(/\+/g," ")):"":null}function childEvent(){var t;const n=document.getElementsByClassName("accordion-item"),o=document.getElementsByClassName("views-field-title");var e=document.getElementsByClassName("view-display-id-events_block_child_event_list");function a(){document.querySelector('input[id*="edit-submit-event-groups"]').click()}if(null!=document.querySelector('form[id*="views-exposed-form-event-groups-events-block-child-event-list"]')){let e;null!=(t=document.querySelector('input[id*="combine"]'))&&t.addEventListener("keyup",()=>{clearTimeout(e),document.querySelector('input[id*="combine"]').value&&(e=setTimeout(a,600))})}function i(){var t,e=null==(e=this.parentElement)?void 0:e.className;for(let e=0;e<n.length;e++)n[e].className="accordion-item closed",null!=(t=n[e].querySelector(".views-field-title"))&&t.classList.remove("open");"accordion-item closed"===e&&(this.parentElement.className="accordion-item open",null!=(e=this.parentElement.querySelector(".views-field-title"))&&e.classList.add("open"))}if(null!=e)for(let e=0;e<o.length;e++)o[e].addEventListener("click",i)}dropdownToggles.forEach(e=>{e.addEventListener("click",e=>{toggleMenu(e.target.closest(".mega-menu__dropdown-controller"))})}),"undefined"!=typeof Drupal&&(Drupal.behaviors.siteMenu={attach:e=>{siteMenu(e)}}),document.addEventListener("DOMContentLoaded",function(){var e=document.querySelector(".wpi-ad__grid"),t=document.querySelector(".node__content"),n=null==t?void 0:t.firstElementChild;null!==e&&null!==t&&null!==n&&null!=(t=null==n?void 0:n.parentNode)&&t.insertBefore(e,null==n?void 0:n.nextElementSibling)}),"undefined"!=typeof Drupal&&(Drupal.behaviors.bannerVideo={attach:()=>{bannerVideo()}}),"undefined"!=typeof Drupal&&(Drupal.behaviors.graduateApplications={attach:function(t){const e=t,i=e.querySelector&&e.querySelector("#garInput")||document.getElementById("garInput");if(i&&!i.getAttribute("data-gar-processed")){i.setAttribute("data-gar-processed","true");const c=document.querySelectorAll(".gar__option"),u=document.getElementById("garSuggestionList"),d=document.getElementById("garToggle");let o=-1,e=getParameterByName("itemId");e&&""!==e&&((t=document.querySelector(`[data-tid="${e}"]`))&&(i.value=t.value,n()),e=""),i.addEventListener("input",()=>{s(),n()}),d&&d.addEventListener("click",()=>{u&&!u.hidden?a():(s(!0),i.focus())}),i.addEventListener("keydown",e=>{var t;!u||u.hidden?"ArrowDown"===e.key&&(e.preventDefault(),s(!0)):"ArrowDown"===e.key?(e.preventDefault(),l(o+1)):"ArrowUp"===e.key?(e.preventDefault(),l(o-1)):"Enter"===e.key&&-1<o?(e.preventDefault(),(t=u.querySelectorAll(".gar__suggestion")[o])&&t.textContent&&r(t.textContent)):"Escape"===e.key&&a()});const m=i.closest(".gar__combobox");function n(){if(i){const a=i.value.toLowerCase().trim(),e=document.querySelector(".gar__wrapper--empty");if(e){let o=!1;
1c.forEach(e=>{var t=e.getAttribute("data-tid");const n=document.querySelector(`[data-gar-tid="${t}"]`);n&&(""!==a&&e.value.toLowerCase()===a?(n.classList.remove("gar__wrapper--hidden"),o=!0):n.classList.add("gar__wrapper--hidden"))}),o?e.classList.add("gar__wrapper--hidden"):e.classList.remove("gar__wrapper--hidden")}}}function a(){u&&i&&(u.hidden=!0,u.innerHTML="",o=-1,i.setAttribute("aria-expanded","false"),i.removeAttribute("aria-activedescendant"))}function l(e){if(u&&i){const t=u.querySelectorAll(".gar__suggestion");if(t.length){o=(e+t.length)%t.length,t.forEach((e,t)=>{e.classList.toggle("gar__suggestion--active",t===o),e.setAttribute("aria-selected",t===o?"true":"false")});const n=t[o];i.setAttribute("aria-activedescendant",n.id),n.scrollIntoView({block:"nearest"})}}}function r(e){i&&(i.value=e,a(),n())}function s(e=!1){if(u&&i){const t=i.value.toLowerCase().trim();if(""!==t||e){const n=Array.from(c).filter(e=>e.value.toLowerCase().includes(t));n.length?(u.innerHTML="",o=-1,n.forEach((e,t)=>{const n=document.createElement("button");n.type="button",n.id="garSuggestion-"+t,n.className="gar__suggestion",n.setAttribute("role","option"),n.setAttribute("aria-selected","false"),n.textContent=e.value,n.addEventListener("click",()=>{r(e.value)}),u.appendChild(n)}),u.hidden=!1,i.setAttribute("aria-expanded","true")):a()}else a()}}document.addEventListener("click",e=>{e=e.target;m&&e&&!m.contains(e)&&a()}),document.addEventListener("focusin",e=>{e=e.target;m&&e&&!m.contains(e)&&a()})}}}),"undefined"!=typeof Drupal&&(Drupal.behaviors.child_event={attach:()=>{childEvent()}});const watchElement=document.querySelector(".views-element-container"),observer=new MutationObserver(e=>{initPagerButtons()});function initPagerButtons(){const e=Array.from(document.getElementsByClassName("pager__link"));e.forEach(e=>{e.addEventListener("click",e=>{null!=e&&e.preventDefault();const t=e.currentTarget;e=t.getAttribute("href")||"",e=new URLSearchParams(e).get("page");if(e){var n=new URL(window.location.href);const o=new URL(n);o.searchParams.set("page",e),history.pushState({},"",o)}},{once:!0})})}watchElement&&observer.observe(watchElement,{childList:!0,subtree:!0});const categories=document.getElementById("edit-field-research-category-target-id"),button=document.getElementById("patents-view-research-category-toggle"),icon=document.querySelector(".patents-view__research-category-toggle-icon");function dialogOpen(){const e=once("dialog_open",document.querySelectorAll(".timeline-read-more"));e.forEach(e=>{e.addEventListener("click",e=>{const t=e.target.nextElementSibling;"function"==typeof t.showModal&&t.showModal()})})}function oldZoomLinks(){if(document.getElementsByTagName("body")[0].classList.contains("past-event-node")){const n=document.querySelectorAll("article a");for(let e=0;e<n.length;e++){const o=n[e].getAttribute("href"),a=n[e].innerHTML;if(-1!==(null===o||void 0===o?void 0:o.indexOf("wpi.zoom.us/"))){-1!==a.indexOf("wpi.zoom.us/")&&(n[e].innerHTML="Zoom meeting has ended.");const i=n[e].parentNode;var t=n[e].firstChild;t&&(null!==i&&void 0!==i&&i.insertBefore(t,n[e]),null!==i&&void 0!==i&&i.removeChild(n[e]),null!==i&&void 0!==i&&i.normalize())}}}}function updateFooterLinkSeparators(){const e=document.querySelector(".site-footer__links-row");if(e){const t=Array.from(e.querySelectorAll(".site-footer__vertical-separator"));t.forEach(e=>{e.style.visibility="visible"}),e.offsetHeight,t.forEach(e=>{const t=e.previousElementSibling,n=e.nextElementSibling;var o;t&&n&&(o=Math.round(t.getBoundingClientRect().top)===Math.round(n.getBoundingClientRect().top),e.style.visibility=o?"visible":"hidden")})}}null!==button&&button.addEventListener("click",e=>{e.preventDefault(),null!==categories&&void 0!==categories&&categories.classList.toggle("patents-view__research-category--hidden"),null!==icon&&void 0!==icon&&icon.classList.toggle("patents-view__research-category-toggle-icon--active")}),urpsFilters();const FOCUSABLE_SELECTOR="a[href], button, input, select, textarea, [tabindex], summary, audio[controls], video[controls], iframe";function reconcileSlideFocusability(e){const n="true"===e.getAttribute("aria-hidden"),t=(n?e.setAttribute("tabindex","-1"):"-1"===e.getAttribute("tabindex")&&e.setAttribute("tabindex","0"),e.querySelectorAll(FOCUSABLE_SELECTOR));
1t.forEach(e=>{var t;n?(e.hasAttribute("data-wpi-original-tabindex")||e.setAttribute("data-wpi-original-tabindex",null!=(t=e.getAttribute("tabindex"))?t:""),e.setAttribute("tabindex","-1")):e.hasAttribute("data-wpi-original-tabindex")&&((t=e.getAttribute("data-wpi-original-tabindex")||"")?e.setAttribute("tabindex",t):e.removeAttribute("tabindex"),e.removeAttribute("data-wpi-original-tabindex"))})}function reconcileSlickSlides(e){const t=e.querySelectorAll(".slick__slide, [data-slick-index]");t.forEach(reconcileSlideFocusability)}function slickAriaHiddenFocusFix(e){const t=once("slick_aria_hidden_focus",".slick__slider, .slick-track",e);t.forEach(n=>{if(reconcileSlickSlides(n),"undefined"!=typeof jQuery){const t=jQuery(n);["init","afterChange","setPosition"].forEach(e=>{t.on(e,()=>{reconcileSlickSlides(n)})})}const e=new MutationObserver(e=>{let t=!1;e.forEach(e=>{"attributes"===e.type&&"aria-hidden"===e.attributeName&&(t=!0)}),t&&reconcileSlickSlides(n)});e.observe(n,{attributes:!0,attributeFilter:["aria-hidden"],subtree:!0})})}function uniqueSlickNavLabels(){const e=document.querySelectorAll("nav.slick__arrow[aria-label]"),o=new Map;e.forEach(e=>{var t=null!=(t=e.getAttribute("aria-label"))?t:"",n=(null!=(n=o.get(t))?n:0)+1;o.set(t,n),1<n&&e.setAttribute("aria-label",t+` (${n})`)})}const LABS_RESET_SCROLL_KEY="wpi-labs-reset-scroll";function findLabsSubmitAjaxInstance(n){if("undefined"==typeof Drupal||!Drupal.views||!Drupal.views.instances)return null;var e=Object.values(Drupal.views.instances).find(e=>{var t;return(null==(t=null==e?void 0:e.$exposed_form)?void 0:t.length)&&e.$exposed_form.get(0)===n});return(null==(e=null==e?void 0:e.exposedFormAjax)?void 0:e[0])||null}function urpsFilters(){const a=".urps form.pick select";document.addEventListener("change",e=>{const t=e.target;if(null!==t&&void 0!==t&&t.matches(a)){const n=t.closest("form.pick");if(n){const o=new URLSearchParams;n.querySelectorAll("select").forEach(e=>{e.value&&o.set(e.name,e.value)}),window.location.search=o.toString()}}}),window.addEventListener("pageshow",e=>{if(e.persisted){const n=new URLSearchParams(window.location.search);document.querySelectorAll(a).forEach(e=>{var t=e.querySelector("option[selected]");e.value=null!=(e=null!=(e=n.get(e.name))?e:null==t?void 0:t.value)?e:""})}})}function urpsSchedule(e){const t=once("urps_schedule",".urps",e);t.forEach(t=>{var n;const r=t.querySelector("[data-urps-search]"),s=t.querySelector("[data-urps-status]"),c=t.querySelector("[data-urps-nomatch]"),u=t.querySelector("[data-urps-nomatch-title]"),d=t.querySelector("[data-urps-printnote]"),m=Array.from(t.querySelectorAll("[data-urps-row]")),v=Array.from(t.querySelectorAll("[data-urps-group]"));if(t.querySelectorAll("[data-urps-notes]").forEach(e=>{const t=e.querySelector("[data-urps-notes-body]"),n=e.querySelector("[data-urps-notes-toggle]");t&&n&&(t.classList.add("board__notes-body--clamped"),t.scrollHeight<=t.clientHeight+1?t.classList.remove("board__notes-body--clamped"):(n.hidden=!1,n.addEventListener("click",()=>{var e=t.classList.toggle("board__notes-body--clamped");n.setAttribute("aria-expanded",String(!e)),n.textContent=e?Drupal.t("Show more"):Drupal.t("Show less")})))}),null!=(n=t.querySelector("form.pick"))&&n.addEventListener("keydown",e=>{var t;"Enter"===e.key&&null!=(t=e.target)&&t.matches("[data-urps-search]")&&e.preventDefault()}),r&&0!==m.length){const o=t.querySelector("[data-urps-searchwrap]");o&&(o.hidden=!1);let l;const a=e=>{const t=r.value.trim(),n=t.toLowerCase();let o=0;var a;if(m.forEach(e=>{var t=!n||-1!==(e.getAttribute("data-urps-search")||"").indexOf(n);e.hidden=!t,t&&o++}),v.forEach(e=>{e.hidden=!e.querySelector("[data-urps-row]:not([hidden])")}),c&&u&&(a=0===o,c.hidden=!a,a&&(u.textContent=Drupal.t("No presentations match “@term”.",{"@term":t}))),d&&(d.hidden=!t,d.textContent=Drupal.t("Full schedule shown — the search filter “@term” is not applied to print.",{"@term":t})),s){const i=t?Drupal.formatPlural(o,"1 of @total presentations shown for “@term”","@count of @total presentations shown for “@term”",{"@total":String(m.length),"@term":t}):Drupal.formatPlural(m.length,"1 presentation","@count presentations");window.clearTimeout(l),e?s.textContent=i:l=window.setTimeout(()=>{s.textContent=i},500)}};let e;r.addEventListener("input",()=>{window.clearTimeout(e),e=window.setTimeout(()=>a(!1),150)}),null!=(n=t.querySelector("[data-urps-clear]"))&&n.addEventListener("click",()=>
1{r.value="",r.focus(),a(!0)}),window.addEventListener("beforeprint",()=>{m.forEach(e=>{e.hidden=!1}),v.forEach(e=>{e.hidden=!1})}),window.addEventListener("afterprint",()=>a(!0))}})}function labsFilterReset(){const n=document.querySelector("#views-exposed-form-labs-block-labs");if(n){const t=once("labs_filter_reset",n.querySelectorAll('[data-drupal-selector="edit-reset"]'));t.forEach(e=>{e.addEventListener("click",e=>{const t=findLabsSubmitAjaxInstance(n);t&&"function"==typeof t.eventResponse?(e.preventDefault(),n.querySelectorAll('input[type="text"], input[type="search"], select').forEach(e=>{e instanceof HTMLSelectElement?e.selectedIndex=0:e.value=""}),t.eventResponse(t.element,{preventDefault(){},stopPropagation(){}})):sessionStorage.setItem(LABS_RESET_SCROLL_KEY,String(window.scrollY))})});var e=sessionStorage.getItem(LABS_RESET_SCROLL_KEY);null!==e&&(sessionStorage.removeItem(LABS_RESET_SCROLL_KEY),window.scrollTo(0,parseInt(e,10)))}}"undefined"!=typeof Drupal&&!function(e){e.behaviors.dialog_open={attach(){dialogOpen()}},e.behaviors.old_zoom_links={attach(){oldZoomLinks()}},e.behaviors.footer_link_separators={attach(){updateFooterLinkSeparators(),window.addEventListener("resize",updateFooterLinkSeparators)}}
1,e.behaviors.slick_aria_hidden_focus={attach(e){slickAriaHiddenFocusFix(e)}},e.behaviors.unique_slick_nav_labels={attach(){uniqueSlickNavLabels()}},e.behaviors.urps_schedule={attach(e){urpsSchedule(e)}},e.behaviors.labs_filter_reset={attach(){labsFilterReset()}}}(Drupal,once);
2//# sourceMappingURL=wpi.js.map

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.