!function(){"use strict";function a(a,e=null){if(!a)return;const t=a.querySelector("i"),s=a.classList.contains("cta-play"),c=a.classList.contains("cta-pause"),l=null===e?s:!0===e,n=a.getAttribute("aria-label"),i=a.dataset.toggleLabel;(null===e||l&&s||!l&&c)&&(a.setAttribute("aria-label",i),a.dataset.toggleLabel=n),l?(a.classList.remove("cta-play"),a.classList.add("cta-pause"),t?.classList.add("fa-circle-pause","cta-pause-icon"),t?.classList.remove("fa-circle-play","cta-play-icon")):(a.classList.add("cta-play"),a.classList.remove("cta-pause"),t?.classList.add("fa-circle-play","cta-play-icon"),t?.classList.remove("fa-circle-pause","cta-pause-icon"))}const e=document.querySelectorAll(".purdue-home-diagonal-cta-hero");e&&e.length>0&&e.forEach(e=>{const t=e.querySelector(".cta-btnctrl"),s=e.querySelector("video");t.addEventListener("click",()=>{t.classList.contains("cta-play")?s.play():s.pause(),a(t)}),s&&s.classList.contains("no-loop")&&s.addEventListener("ended",e=>{a(t,!1)}),s&&(s.paused||s.ended)&&!s.classList.contains("no-loop")&&(s.addEventListener("play",()=>{console,a(t,!0)}),s.addEventListener("pause",()=>{console,a(t,!1)}))})}();