1/** 2 * DOMContentLoaded Event Deferral Helper 3 * 4 * Intercepts DOMContentLoaded event listeners and automatically wraps their 5 * callbacks with requestAnimationFrame to prevent forced synchronous layouts 6 * (reflows) that negatively impact page performance metrics. 7 * 8 * This approach maintains full backward compatibility while deferring layout- 9 * triggering operations (offsetHeight, getComputedStyle, etc.) until the next 10 * animation frame, allowing the browser to optimize rendering. 11 * 12 * @see https://web.dev/avoid-large-complex-layouts-and-layout-thrashing/ 13 */ 14(function() { 15 'use strict'; 16 17 var originalAddEventListener = document.addEventListener; 18 var isDOMReady = document.readyState === 'complete' || document.readyState === 'interactive'; 19 20 /** 21 * Intercept document.addEventListener to defer DOMContentLoaded callbacks 22 * 23 * @param {string} event - Event name 24 * @param {Function} callback - Event callback 25 * @param {Object|boolean} options - Event listener options 26 */ 27 document.addEventListener = function(event, callback, options) { 28 if (event === 'DOMContentLoaded' && typeof callback === 'function') { 29 var deferredCallback = function(e) { 30 requestAnimationFrame(function() { 31 callback.call(this, e); 32 }.bind(this)); 33 }; 34 35 if (isDOMReady) { 36 // DOM already loaded, execute immediately but deferred 37 requestAnimationFrame(function() { 38 callback.call(document, new Event('DOMContentLoaded')); 39 }); 40 } else { 41 originalAddEventListener.call(document, event, deferredCallback, options); 42 } 43 } else { 44 originalAddEventListener.call(document, event, callback, options); 45 } 46 }; 47 48 // Track when DOM becomes ready 49 if (!isDOMReady) { 50 originalAddEventListener.call(document, 'DOMContentLoaded', function() { 51 isDOMReady = true; 52 }); 53 } 54})(); 55document.addEventListener("DOMContentLoaded",function(){var e=document.querySelectorAll('[data-op3-element-type="video"] .op3-video-magic-overlay .op3-video-magic-overlay-image');if(e.length>0)for(var t=0;t<e.length;t++){var o=(e[t].currentStyle||window.getComputedStyle(e[t],!1)).backgroundImage.slice(4,-1).replace(/"/g,""),n=new Image;n.src=o,function(t,o){o.onload=function(){e[t].style.maxWidth=o.width+"px",e[t].style.maxHeight=o.height+"px"}}(t,n)}});!function(){var e=window,o=document,r=["keydown","mousemove","pointerover","click","scroll","wheel","resize"],n=-1,t=0,i=2,a=Array.prototype.slice.call(o.querySelectorAll("head link.op3-viewport-progressive-image-preload")).filter(function(e){return!e.media||window.matchMedia(e.media).matches}),c=function(){i||o.documentElement.removeAttribute("data-op3-viewport-progressive-image")},l=function(){++t===a.length&&i--,c()},m=function(){clearInterval(n),r.forEach(function(o){e.removeEventListener(o,m)}),i--,c()};a.length?a.forEach(function(e){var o=new Image;o.onload=l,o.onerror=l,o.src=e.href}):i--,r.forEach(function(o){e.addEventListener(o,m)}),n=setTimeout(m,5e3)}();!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():t.OptimizeLazyLoader=e()}("undefined"!=typeof self?self:this,function(){"use strict";var t=function(e){if(!(this instanceof t))throw"OptimizeLazyLoader: OptimizeLazyLoader is a constructor.";this._init.apply(this,arguments)};return t.prototype={constructor:t,_defaultOptions:{context:document,useNative:!0,prefix:"oll",tags:"img,picture,video,audio,iframe",attrs:"src,srcset",threshold:256},_init:function(t){for(var e in this._options={},this._defaultOptions)this._options[e]=t&&e in t?t[e]:this._defaultOptions[e];this._mutationObserver=null,this._intersectionObserver=null},destroy:function(){this.stop(),delete this._intersectionObserver,delete this._mutationObserver,delete this._options},get supported(){return"IntersectionObserver"in window},get status(){return!!this._intersectionObserver},getOption:function(t){var e=this._options[t];return"function"==typeof e&&(e=e.apply(this)),e},start:function(){if(!this.status){if(!this.supported)return this.preloadAll();var t,e,i=this._getContext();"function"==typeof IntersectionObserver&&(t=this._handleIntersectionObserver.bind(this),e={root:null,rootMargin:(1*this.getOption("threshold")||0)+"px",threshold:1e-6},this._intersectionObserver=new IntersectionObserver(t,e),this._prepare(i)),"function"==typeof MutationObserver&&(t=this._handleMutationObserver.bind(this),e={attributes:!1,childList:!0,subtree:!0},this._mutationObserver=new MutationObserver(t),this._mutationObserver.observe(i,e))}},stop:function(){this.status&&(this._unprepare(this._getContext()),this._intersectionObserver&&this._intersectionObserver.disconnect(),this._mutationObserver&&this._mutationObserver.disconnect(),this._intersectionObserver=null,this._mutationObserver=null)},preload:function(t){var e=this.getOption("prefix");this._matches(t,"."+e+",."+e+"-css")&&(this._matches(t,"."+e)&&(this._getElementsWithSrcAttrs(t).forEach(function(t){this.getOption("attrs").split(",").forEach(function(i){var s=this._stringTrim(i),r="data-"+e+"-"+s,n=t.getAttribute(r);null!==n&&(t.removeAttribute(r),t.setAttribute(s,n))}.bind(this))}.bind(this)),"function"==typeof t.load&&t.load()),this._matches(t,"."+e+"-css")&&this._removeClass(t,e+"-css"),this._unprepare(t))}
55,preloadAll:function(){this.stop(),this._getElements().forEach(function(t){this.preload(t)}.bind(this))},_getContext:function(t){return t||this.getOption("context")||document},_stringTrim:function(t){return t.replace(/(^\s+|\s+$)/g,"")},_toArray:function(t){return Array.prototype.slice.call(t)},_matches:function(t,e){return(t.matches||t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector).call(t,e)},_removeClass:function(t,e){var i=(t.getAttribute("class")||"").replace(/\s+/g," ").replace(/(^\s|\s$)/g,"").split(" "),s=i.indexOf(e);-1!==s&&(i.splice(s,1),t.setAttribute("class",i.join(" ")))},_getElements:function(t){var e=[];if(!((t=this._getContext(t))instanceof Node&&"querySelectorAll"in t))return e;var i=this.getOption("tags"),s=this.getOption("prefix"),r=(i.split(",").join(".{prefix},")+".{prefix},.{prefix}-css").replace(/{prefix}/g,s);return e=t.querySelectorAll(r),e=this._toArray(e),t.nodeType===Node.ELEMENT_NODE&&this._matches(t,r)&&e.unshift(t),e},_getElementsWithSrcAttrs:function(t){var e=[];if(!((t=this._getContext(t))instanceof Node&&"querySelectorAll"in t))return e;var i=this.getOption("prefix"),s=this.getOption("attrs"),r="["+s.split(",").map(function(t){return"data-"+i+"-"+this._stringTrim(t)}.bind(this)).join("],[")+"]";return e=t.querySelectorAll(r),e=this._toArray(e),this._matches(t,"img")&&this._matches(t.parentElement,"picture")&&-1!==s.split(/\s*,\s*/).indexOf("srcset")&&(e=e.concat(this._toArray(t.parentElement.querySelectorAll("source[data-"+i+"-srcset]")))),this._matches(t,r)&&e.unshift(t),e},_prepare:function(t){var e=this.getOption("prefix"),i=this.getOption("useNative");this._getElements(t).forEach(function(t){var s=this._matches(t,"."+e),r=this._matches(t,"."+e+"-css"),n=!1;s&&(i&&"loading"in t?(t.setAttribute("loading","lazy"),this.preload(t)):n=!0),r&&(n=!0),n&&this._intersectionObserver.observe(t)}.bind(this))},_unprepare:function(t){this._getElements(t).forEach(function(t){this._intersectionObserver&&this._intersectionObserver.unobserve(t),this._removeClass(t,this.getOption("prefix"))}.bind(this))},_handleMutationObserver:function(t){this.status&&t.forEach(function(t){"childList"===t.type&&(t.addedNodes.forEach(function(t){this._prepare(t)}.bind(this)),t.removedNodes.forEach(function(t){this._unprepare(t)}.bind(this)))}.bind(this))},_handleIntersectionObserver:function(t){t.forEach(function(t){(t.intersectionRatio>0||t.isIntersecting)&&this.preload(t.target)}.bind(this))}},t});window.addEventListener("DOMContentLoaded",function(t){var e={useNative:OP3.Settings&&OP3.Settings.lazyLoadAssets&&"native+js"===OP3.Settings.lazyLoadAssets};new OptimizeLazyLoader(e).start()});!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&module.exports?module.exports=t():e.EmbedVideoFacade=t()}("undefined"!=typeof self?self:this,function(){"use strict";var e=[];function t(e,n){if(!(this instanceof t))throw"EmbedVideoFacade: EmbedVideoFacade is a constructor.";this._init.apply(this,arguments)}t.prototype={constructor:t,_defaultOptions:{srcAttr:"data-src",addPoster:"auto",posterElement:null,interactStyle:"cursor: pointer;",interactElement:null,lazyLoad:!1,lazyLoadThreshold:256,isDevice:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Windows Phone|Opera Mini/i.test(navigator.userAgent),canUseWebp:!1,canUseAvif:!1},_init:function(e,t){if(!(e instanceof HTMLElement))throw"EmbedVideoFacade: element argument must be of HTMLElement type.";if(this._element=e,this.element.classList.add("embed-video-facade"),this._setStatus("pending"),"object"!=typeof(t||{}))throw"EmbedVideoFacade: element argument must be of Object type.";for(var n in this._options={},this._defaultOptions)this._options[n]=t&&n in t?t[n]:this._defaultOptions[n];var i="["+this.getOption("srcAttr")+"]",r=this.element.querySelectorAll(i);r=Array.prototype.slice.call(r),this.element.matches(i)&&r.unshift(this.element),r.forEach(function(e){var t=e.getAttribute("src");t&&"about:blank"!==t&&e.setAttribute("src","")}),this._nodes=r,this._url=this.element.getAttribute(this.getOption("srcAttr")),this._source=null,this._poster=null,this._posterElement=null,this._interactElement=null,this._boundHandleElementLoad=this._handleElementLoad.bind(this),this._boundHandleElementPointerover=this._handleElementPointerover.bind(this),this._boundHandleElementClick=this._handleElementClick.bind(this),this._boundHandleIntersectionObserver=this._handleIntersectionObserver.bind(this),this._intersectionObserver=null,"function"==typeof IntersectionObserver&&this.getOption("lazyLoad")&&(this._intersectionObserver=new IntersectionObserver(this._boundHandleIntersectionObserver,{root:null,rootMargin:(1*this.getOption("lazyLoadThreshold")||0)+"px",threshold:0}));var s=this._iframeProps(this.element);s&&!s.crossdomain&&"complete"!==s.readyState?this._bind(this.element,"load",this._boundHandleElementLoad):this._boundHandleElementLoad()},destroy:function(){this._intersectionObserver&&this._intersectionObserver.disconnect(),this._unbind(this._interactElement,"click",this._boundHandleElementClick),this._unbind(this._interactElement,"pointerover",this._boundHandleElementPointerover),this._unbind(this.element,"load",this._boundHandleElementLoad);var e="embed-video-facade";this.getOption("interactElement").classList.remove(e+"-interact"),this._posterElement.classList.remove(e+"-poster"),this.element.classList.remove(e),this.element.removeAttribute("data-"+e+"-source"),this.element.removeAttribute("data-"+e+"-status"),delete this._boundHandleIntersectionObserver,delete this._boundHandleElementClick,delete this._boundHandleElementPointerover,delete this._boundHandleElementLoad,delete this._interactElement,delete this._posterElement,delete this._poster,delete this._source,delete this._url,delete this._nodes,delete this._options,delete this._element,this._trigger("destroy")},_call:function(e){if("function"==typeof e){var t=Array.prototype.slice.call(arguments,1
55);e.apply(this,t)}},_prepare:function(){this._prepareElement(),this._prepareSource(),this._preparePoster(),this._prepareInteract(),this._unbind(this.element,"load",this._boundHandleElementLoad),this._trigger("init");var e=this._iframeProps(this.element);!!e&&e.hasCachedContent&&this.connect()},_prepareElement:function(){this._setStatus("idle")},_prepareSource:function(){e.forEach(function(e){if(!this._source){var t=new e(this);t.test()&&(this._source=t)}}.bind(this)),this.element.setAttribute("data-embed-video-facade-source",this.source||"")},_replacePoster:function(){var e=this.getOption("posterElement");if(e.classList.contains("oll-css"))return!1;var t=this.getOption("addPoster"),n=this._computedStyle(e,"background-image");return"auto"===t&&!(n&&"none"!==n)||"auto"!==t&&t},_preparePoster:function(){var e=this.getOption("posterElement");e.classList.add("embed-video-facade-poster"),this._posterElement=e,this._source&&this._replacePoster()&&this._source.getPoster(function(e){this._poster=e,e&&this._intersectionObserver?this._applyPosterLazy(e):e&&this._applyPoster(e)}.bind(this))},_applyPoster:function(e){var t=this.getOption("posterElement"),n=this._source.posterStyle();n&&this._applyStyle(t,n),t.style.backgroundImage="url("+e+")",this._poster=e,this._loadImage(e,function(e){this._trigger(e?"posterload":"postererror")})},_applyPosterLazy:function(e){var t=this.getOption("posterElement");t.setAttribute("data-embed-video-facade-poster-src",e),this._intersectionObserver.observe(t)},_prepareInteract:function(){var e=this.getOption("interactElement");e.classList.add("embed-video-facade-interact");var t=this._iframeProps(e),n=!!t&&t.hasEmptyContent,i=!!t&&t.hasCachedContent;n&&(e=e.contentDocument);var r=this.getOption("interactStyle");this._applyStyle(n?e.documentElement:e,r),n&&(e.documentElement.style.height="100%",e.documentElement.style.background="transparent"),i||(this._bind(e,"pointerover",this._boundHandleElementPointerover),this._bind(e,"click",this._boundHandleElementClick)),this._interactElement=e},_loadImage:function(e,t){if(e instanceof Image)return e.complete&&0!==e.naturalHeight?this._call(t,e):e.complete?this._call(t,null):(e.addEventListener("load",function(e){e.target.naturalHeight?this._call(t,e.target):this._call(t,null)}.bind(this)),e.addEventListener("error",function(e){this._call(t,null)}.bind(this))),e;if("string"==typeof e){var n=new Image;return n.src=e,n.complete&&0!==n.naturalHeight?this._call(t,n):e.complete?this._call(t,null):this._loadImage(n,t),n}return null},_bind:function(e,t,n){e.addEventListener(t,n)},_unbind:function(e,t,n){e.removeEventListener(t,n)},_trigger:function(e){var t;return e="embedvideofacade"+e,"function"!=typeof Event?(t=this.document.createEvent("Event")).initEvent(e,!1,!1):t=new Event(e),this.element.dispatchEvent(t),t},_setStatus:function(e){this.element.setAttribute("data-embed-video-facade-status",e)},getOption:function(e){var t=this._options[e];return"function"==typeof t&&(t=t.apply(this)),!/Element$/.test(e)||t instanceof HTMLElement||(t=this.element),t},preconnect:function(){this._source&&"preconnected"!==this.status&&"connected"!==this.status&&(this._source.preconnect(),this._unbind(this._interactElement,"pointerover",this._boundHandleElementPointerover),this._setStatus("preconnected"),this._trigger("preconnect"))},connect:function(){if(this._source&&"connected"!==this.status){var e=this.getOption("srcAttr"),t=this._source.url();this._nodes.forEach(function(n){var i=t||n.getAttribute(e);n.removeAttribute(e),n.setAttribute("src",i)}),this._unbind(this._interactElement,"click",this._boundHandleElementClick),this._unbind(this._interactElement,"pointerover",this._boundHandleElementPointerover),this._setStatus("connected"),this._trigger("connect")}},get window(){return this.document.defaultView},get document(){return this.element.ownerDocument},get element(){return this._element},get status(){return this.element.getAttribute("data-embed-video-facade-status")},get url(){return this._url},get source(){return this._source?this._source.name:null},get videoId(){return this._source?this._source.videoId():null},get poster(){return this._poster},get width(){return this._source?this._source.width():null},get height(){return this._source?this._source.height():null},_computedStyle:function(e,t){return e.ownerDocument.defaultView.getComputedStyle(e).getPropertyValue(t)},_applyStyle:function(e,t){var n=this.document.createElement("div");n.setAttribute("style",t);for(var i=0;i<n.style.length;i++){var r=n.style[i],s=n.style.getPropertyValue(r);e.style.setProperty(r,s)}},_isDisabled:function(e){return!!e.closest(".embed-video-facade-disabled")},_iframeProps:function(e){if(!e.matches("iframe"))return null;var t=e.src,n=!t||"about:blank"===t,i=!e.contentDocument;return{hasEmptySrc:n,crossorigin:i,readyState:i?null:e.contentDocument.readyState,hasEmptyContent:n&&!i,hasCachedContent:n&&i}},_handleElementLoad:function(e){this._prepare()},_handleElementPointerover:function(e){this._isDisabled(e.target)||this.prec
55onnect()},_handleElementClick:function(e){this._isDisabled(e.target)||this.connect()},_handleIntersectionObserver:function(e){e.forEach(function(e){if(e.intersectionRatio>0||e.isIntersecting){var t=e.target,n="data-embed-video-facade-poster-src",i=t.getAttribute(n);t.removeAttribute(n),this._intersectionObserver.unobserve(t),this._intersectionObserver.disconnect(),this._intersectionObserver=null,this._applyPoster(i)}}.bind(this))}};var n=function(e){this._init.apply(this,arguments)};return n.prototype={constructor:n,_init:function(e){this._parent=e},destroy:function(){delete this._parent},get parent(){return this._parent},get name(){return"unknown"},get isDevice(){return!!this.parent.getOption("isDevice")},get canUseWebp(){return!!this.parent.getOption("canUseWebp")},get canUseAvif(){return!!this.parent.getOption("canUseAvif")},_call:function(e){this.parent._call.apply(this,arguments)},_preconnect:function(e){var t='link[rel="preconnect"][href="'+e+'"]';if(!document.head.querySelector(t)){var n=document.createElement("link");n.rel="preconnect",n.href=e,n.crossorigin=!0,document.head.appendChild(n)}},_replaceUrlParam:function(e,t,n){var i=new RegExp("([?&])("+t+")=(.*?)(&|$)"),r=e.replace(i,"$1$2="+n+"$4");return i.test(r)||(r+=(-1===r.indexOf("?")?"?":"&")+t+"="+n),r},test:function(){return!1},url:function(){return null},videoId:function(){return null},getPoster:function(e){this._call(e,null)},posterStyle:function(){return"background: none center / cover no-repeat #000"},preconnect:function(){},width:function(){return this.parent.element.getAttribute("width")||"320"},height:function(){return this.parent.element.getAttribute("height")||"240"}},t.registerSource=function(t,i){var r=function(e){n.apply(this,arguments)};for(var s in r.prototype=Object.create(n.prototype),Object.defineProperty(r.prototype,"name",{value:t,writable:!1}),i){var o=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(r.prototype,s,o)}r.prototype.constructor=r,e.push(r)},t});EmbedVideoFacade.registerSource("youtube",{test:function(){return/https?\:\/\/www\.youtube\.com\/embed\/[\w-]+/.test(this.parent.url)},url:function(){var t=this.parent.url;return t=this._replaceUrlParam(t,"autoplay","1")},videoId:function(){return this.parent.url.match(/https?\:\/\/www\.youtube\.com\/embed\/([\w-]+)/)[1]},getPoster:function(t){var e=(this.canUseWebp?"https://i.ytimg.com/vi_webp/{videoId}/hqdefault.webp":"https://i.ytimg.com/vi/{videoId}/hqdefault.jpg").replace(/{videoId}/g,this.videoId());this._call(t,e)},preconnect:function(){this._preconnect("https://www.youtube.com"),this._preconnect("https://www.youtube-nocookie.com"),this._preconnect("https://www.google.com"),this._preconnect("https://googleads.g.doubleclick.net"),this._preconnect("https://www.gstatic.com"),this._preconnect("https://static.doubleclick.net"),this._preconnect("https://i.ytimg.com"),this._preconnect("https://yt3.ggpht.com")}});window.addEventListener("DOMContentLoaded",function(e){var t=document.documentElement,a=t.matches('[data-op3-support~="webp"]'),d=t.matches('[data-op3-support~="avif"]'),o="undefined"!=typeof OP3&&OP3.Settings&&OP3.Settings.lazyLoadAssets&&("native+js"===OP3.Settings.lazyLoadAssets||"js"===OP3.Settings.lazyLoadAssets);document.querySelectorAll("[data-embed-video-facade-src]").forEach(function(e){var t=e.closest(".op3-element"),n=t?t.querySelector(".op3-video-image-overlay"):null;e._embedVideoFacade=new EmbedVideoFacade(e,{srcAttr:"data-embed-video-facade-src",lazyLoad:o,posterElement:n,interactElement:n,canUseWebp:a,canUseAvif:d})})});
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.