(()=>{const t="[data-axb-video-play]",e=t=>{const e=t.closest(".axcelersblocks-video--has-play-overlay");if(!e)return;const a=e.querySelector("video"),o=e.querySelector("iframe");if(e.classList.add("is-playing"),a){((t,e)=>{e.dataset.axbPlayOverlayReady||(e.dataset.axbPlayOverlayReady="1",e.addEventListener("ended",()=>{e.loop||(t.classList.remove("is-playing"),"1"===t.dataset.axbShowControlsOnPlay&&(e.controls=!1))}))})(e,a),"1"===e.dataset.axbShowControlsOnPlay&&(a.controls=!0);const t=a.play();return void(t&&"function"==typeof t.catch&&t.catch(()=>{e.classList.remove("is-playing")}))}o&&(t=>{const e=t.getAttribute("src");if(e)try{const a=new URL(e,window.location.href);a.searchParams.set("autoplay","1"),t.setAttribute("src",a.toString())}catch(a){const o=e.includes("?")?"&":"?";t.setAttribute("src",`${e}${o}autoplay=1`)}})(o)};document.addEventListener("click",a=>{if(!a.target||"function"!=typeof a.target.closest)return;const o=a.target.closest(t);o&&(a.preventDefault(),a.stopPropagation(),e(o))}),document.addEventListener("keydown",a=>{if("Enter"!==a.key&&" "!==a.key)return;if(!a.target||"function"!=typeof a.target.closest)return;const o=a.target.closest(t);o&&(a.preventDefault(),a.stopPropagation(),e(o))})})();