(()=>{document.querySelectorAll('[data-video-src]').forEach(container=>container.querySelector('button')?.addEventListener('click',()=>{const frame=document.createElement('iframe');frame.src=container.dataset.videoSrc;frame.title=document.title;frame.loading='lazy';frame.referrerPolicy='strict-origin-when-cross-origin';frame.allow='fullscreen; encrypted-media; picture-in-picture';frame.allowFullscreen=true;container.replaceChildren(frame);window.examfitTrack?.('video_start',1,location.pathname)}));document.querySelector('[data-theater]')?.addEventListener('click',event=>{const section=event.currentTarget.closest('.video-study');section?.classList.toggle('theater-mode');event.currentTarget.textContent=section?.classList.contains('theater-mode')?'Exit theater mode':'Theater mode';window.examfitTrack?.('video_theater')})})();
