var umpGlobal = umpGlobal || {}; (function () { "use strict"; // check if a JS file is already loaded if (umpGlobal.firstLoad !== undefined) return; umpGlobal.firstLoad = false; const hasAnimationToggle = document.body.classList.contains("animation-toggle") && (document.body.classList.contains("animation-on") || document.body.classList.contains("animation-off")); const setInitialAutoplay = () => { // Determine the initial state of animation toggle based on animationtoggle.js // https://microsoftit.visualstudio.com/OneITVSO/_git/CE-SITES-aemfnd-MT-AEM?path=%2Fui.apps%2Fsrc%2Fmain%2Fcontent%2Fjcr_root%2Fapps%2Fmicrosoft%2Fcomponents%2Fcontent%2Fanimationtoggle%2Fv1%2Fanimationtoggle%2Fclientlibs%2Fsite%2Fjs%2Fanimationtoggle.js&_a=contents&version=GBmain if (window.ump && hasAnimationToggle) { // animation-on class is added to body when animation is enabled and removed when disabled, toggle adheres to OS default behavior. // ump.allowAutoplay: true to enable autoplay, false to disable autoplay, null to use OS default animation behavior window.ump.allowAutoplay = document.body.classList.contains("animation-on"); } }; document.addEventListener('AEM_ANIMATION_ENABLED', (event) => { if (window.ump && hasAnimationToggle) { // true to enable autoplay, false to disable autoplay, null to use OS default animation behavior // user invoked event to enable autoplay or disable autoplay window.ump.allowAutoplay = event.detail === true; } }); document.addEventListener('DOMContentLoaded',setInitialAutoplay); })();