1import{C as l}from"./theme-core.B2oSZRlT.js";import{B as i}from"../app.G1cgiaDo.js";function u(s,o){const t=document.createElement("div");t.classList.add("js-process--create-element"),t.innerHTML=o,s.appendChild(t)}class d extends l{constructor(o={}){super("video"),this.options={componentsWrapper:".autoplay-video-container__inner",videoSelector:"video",playButtonSelector:".video-play-button",playButtonOpenClassElement:".hero",autoplay:!0,autoplayBreakpoint:768,controls:!0,...o}}init(){this.items.forEach(t=>{const e=t.querySelector(t.videoSelector);if(!e)return;const a=n=>{n===!0?(e.setAttribute("autoplay","true"),e.setAttribute("preload","auto"),e.setAttribute("playsinline","true"),e.muted=!0):(e.removeAttribute("autoplay"),e.setAttribute("preload","metadata"))};if(t.autoplay==!0&&window.innerWidth>t.autoplayBreakpoint?(a(!0),e.play()):(a(!1),e.pause()),t.controls==!0){const n='<button class="video-play-button" data-button-open-text="Pause the video" data-button-close-text="Play the video" data-button-enable-at="769" data-button-open-class="video-paused"><span class="show-for-sr toggle-text "></span><i class="hero-play-icon"></i></button>',r=t.closest(".hero__media");if(!r)return;u(r,n)}});const o=new i({openClassElement:this.options.playButtonOpenClassElement});o.add(this.options.playButtonSelector).run(),o.on("toggle",({button:t})=>{const e=t.closest(".hero__media");if(!e)return;const a=e.querySelector("video");a&&(t.isToggled===!0?a.pause():a.play())})}}export{d as default};
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.