PageSourceSearch

https://readingoutpost.com/wp-content/plugins/easy-optimizer/assets/easyopt-delay.min.js

js readingoutpost.com collected 2026-09-24 10:36:43 UTC 9,958 bytes, 12 lines download raw bytes

1/**
2 * Easy Optimizer — Deferred Script Executor
3 *
4 * Holds all <script type="easyoptscript"> tags until the visitor
5 * interacts (pointer, keyboard, touch, scroll) then loads them in
6 * the correct order: normal → defer → async, firing synthetic
7 * DOMContentLoaded / load events so frameworks initialise cleanly.
8 *
9 * @version 2.0.0
10 * @license GPL-2.0-or-later
11 */
12!function(){"use strict";var e,t=!1,n=!1,o=!1,r=!1,i=sessionStorage.getItem("eo_csp_issue"),a=!1,d=[],c=[],s=[],u=[],v=0,p={normal:[],defer:[],async:[]},f=["keydown","mousemove","mousedown","touchstart","touchmove","touchend","wheel","scroll"];function m(e){"HTML"!==e.target.tagName&&(window.addEventListener("touchend",h),window.addEventListener("mouseup",h),window.addEventListener("touchmove",w,{passive:!0}),window.addEventListener("mousemove",w),e.target.addEventListener("click",l),y(e.target,!0),E(e.target,"onclick","eo-saved-onclick"),a=!0)}function w(e){window.removeEventListener("touchend",h),window.removeEventListener("mouseup",h),window.removeEventListener("touchmove",w,{passive:!0}),window.removeEventListener("mousemove",w),e.target.removeEventListener("click",l),y(e.target,!1),E(e.target,"eo-saved-onclick","onclick"),a=!1}function h(){window.removeEventListener("touchend",h),window.removeEventListener("mouseup",h),window.removeEventListener("touchmove",w,{passive:!0}),window.removeEventListener("mousemove",w)}function l(e){e.target.removeEventListener("click",l),y(e.target,!1),E(e.target,"eo-saved-onclick","onclick"),d.push(e),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),a=!1}function y(e,t){c.forEach(function(n){n.target===e&&(t?e.removeEventListener("click",n.fn,n.opts):e.addEventListener("click",n.fn,n.opts))}),e.parentNode&&e.parentNode!==document.documentElement&&y(e.parentNode,t)}function g(){window.removeEventListener("touchstart",m,{passive:!0}),window.removeEventListener("mousedown",m),d.forEach(function(e){e.target.dispatchEvent(new MouseEvent("click",{view:e.view,bubbles:!0,cancelable:!0}))})}function E(e,t,n){e.hasAttribute&&e.hasAttribute(t)&&(e.setAttribute(n,e.getAttribute(t)),e.removeAttribute(t))}function L(e){return A().then(function(){return new Promise(function(t){var n;function o(){(n||e).setAttribute("data-eo-status","ok"),t()}function r(){(n||e).setAttribute("data-eo-status","error"),t()}try{if(/Firefox\//.test(navigator.userAgent)||""===navigator.vendor||i)n=document.createElement("script"),Array.prototype.forEach.call(e.attributes,function(e){var t=e.nodeName;"type"!==t&&("data-easyopt-type"===t&&(t="type"),"data-easyopt-src"===t&&(t="src"),n.setAttribute(t,e.nodeValue))}),e.text&&(n.text=e.text),n.hasAttribute("src")?(n.addEventListener("load",o),n.addEventListener("error",r),setTimeout(function(){n.isConnected||t()},1)):(n.text=e.text,o()),e.parentNode.replaceChild(n,e);else{var a=e.getAttribute("data-easyopt-type"),d=e.getAttribute("data-easyopt-src");a?(e.type=a,e.removeAttribute("data-easyopt-type")):e.removeAttribute("type"),e.addEventListener("load",o),e.addEventListener("error",function(n){i&&n.target.src&&0===n.target.src.indexOf("data:")?(e.removeAttribute("src"),L(e).then(t)):r()}),d?(e.removeAttribute("data-easyopt-src"),e.src=d):e.src="data:text/javascript;base64,"+btoa(unescape(encodeURIComponent(e.text)))}}catch(e){r()}})})}function b(e){var t=e.shift();return t&&t.isConnected?L(t).then(function(){return b(e)}):Promise.resolve()}function A(){return Date.now()-v>45?O().then(function(){v=Date.now()}):Promise.resolve()}function O(){return document.hidden?new Promise(function(e){setTimeout(e)}):new Promise(function(e){requestAnimationFrame(e)})}function k(){var e=document.querySelector("script[data-webpack]");return e?new Promise(function(t){e.addEventListener("load",t),e.addEventListener("error",t)}).then(function(){return O()}).then(k):Promise.resolve()}function x(){n=!0;try{document.readyState="interactive"}catch(e){}return A().then(function(){return document.dispatchEvent(new Event("eo-readystatechange")),A()}).then(function(){return document.eoonreadystatechange&&document.eoonreadystatechange(),A()}).then(function(){return document.dispatchEvent(new Event("eo-DOMContentLoaded")),A()}).then(function(){window.dispatchEvent(new Event("eo-DOMContentLoaded"))})}function C(){try{document.readyState="complete"}catch(e){}return A().then(function(){return document.dispatchEvent(new Event("eo-readystatechange")),A()}).then(function(){return document.eoonreadystatechange&&document.eoonreadystatechange(),A()}).then(function(){return window.dispatchEvent(new Event("eo-load")),A()}).then(function(){return window.eoonload&&window.eoonload(),A()}
12).then(function(){return s.forEach(function(e){e(window).trigger("eo-jquery-load")}),A()}).then(function(){var e=new Event("eo-pageshow");return e.persisted=r,window.dispatchEvent(e),A()}).then(function(){window.eoonpageshow&&window.eoonpageshow({persisted:r})})}function D(){t||(t=!0,f.forEach(function(e){window.removeEventListener(e,D,{passive:!0})}),document.removeEventListener("visibilitychange",D),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",S):S())}function S(){var e,t;v=Date.now(),function(){var e={};function t(t,n){return e[n]&&e[n].delayed.indexOf(t)>=0&&!o?"eo-"+t:t}function n(n,o){e[n]||(e[n]={origAdd:n.addEventListener,origRemove:n.removeEventListener,delayed:[]},n.addEventListener=function(){arguments[0]=t(arguments[0],n),e[n].origAdd.apply(n,arguments)},n.removeEventListener=function(){arguments[0]=t(arguments[0],n),e[n].origRemove.apply(n,arguments)}),e[n].delayed.push(o)}function r(e,t){var n=e[t];e[t]=null,Object.defineProperty(e,t,{get:function(){return n||function(){}},set:function(r){o?n=r:e["eo"+t]=n=r}})}n(document,"DOMContentLoaded"),n(window,"DOMContentLoaded"),n(window,"load"),n(window,"pageshow"),n(document,"readystatechange"),r(document,"onreadystatechange"),r(window,"onload"),r(window,"onpageshow");try{var i="loading";Object.defineProperty(document,"readyState",{get:function(){return i},set:function(e){i=e},configurable:!0}),document.readyState="loading"}catch(e){}}(),function(){var e;function t(t){function o(e){var n=t.fn[e];t.fn[e]=t.fn.init.prototype[e]=function(){return this[0]===window&&("string"==typeof arguments[0]?arguments[0]=arguments[0].split(" ").map(function(e){return"load"===e||0===e.indexOf("load.")?"eo-jquery-load":e}).join(" "):"object"==typeof arguments[0]&&Object.keys(arguments[0]).forEach(function(e){var t="load"===e||0===e.indexOf("load.")?"eo-jquery-load":e;t!==e&&(arguments[0][t]=arguments[0][e],delete arguments[0][e])})),n.apply(this,arguments),this}}!t||!t.fn||s.indexOf(t)>=0||(t.fn.ready=t.fn.init.prototype.ready=function(e){return n?e.bind(document)(t):document.addEventListener("eo-DOMContentLoaded",function(){e.bind(document)(t)}),t([])},o("on"),o("one"),s.push(t),e=t)}t(window.jQuery),Object.defineProperty(window,"jQuery",{get:function(){return e},set:function(e){t(e)}})}(),e=new Map,document.write=document.writeln=function(t){var n=document.currentScript;if(n){var o=n.parentElement,r=e.get(n);void 0===r&&(r=n.nextSibling,e.set(n,r));var i=document.createRange(),a=document.createDocumentFragment();i.setStart(a,0),a.appendChild(i.createContextualFragment(t)),o.insertBefore(a,r)}},document.querySelectorAll("script[type=easyoptscript]").forEach(function(e){e.hasAttribute("data-easyopt-src")?e.hasAttribute("async")&&!1!==e.async?p.async.push(e):e.hasAttribute("defer")&&!1!==e.defer||"module"===e.getAttribute("data-easyopt-type")?p.defer.push(e):p.normal.push(e):p.normal.push(e)}),t=document.createDocumentFragment(),[].concat(p.normal,p.defer,p.async).forEach(function(e){var n=e.getAttribute&&e.getAttribute("data-easyopt-src")||e.src;if(n&&0!==n.indexOf("data:")){var o=document.createElement("link");o.href=n,o.rel="preload",o.as="script",e.getAttribute&&"module"===e.getAttribute("data-easyopt-type")&&(o.crossOrigin="anonymous"),e.crossOrigin&&(o.crossOrigin=e.crossOrigin),e.integrity&&(o.integrity=e.integrity),t.appendChild(o),u.push(o)}}),document.head.appendChild(t),b(p.normal).then(function(){return b(p.defer)}).then(function(){return b(p.async)}).then(x).then(k).then(C).then(function(){if(window.dispatchEvent(new Event("easyopt-allScriptsLoaded")),o=!0,a)var e=setInterval(function(){a||(clearInterval(e),g())},50);else g();u.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}).catch(function(e){console.error("EasyOpt DJE:",e)})}!1===/x86|power|10_15_7|tmetr|ptst/i.test(navigator.userAgent)&&f.push("load"),document.addEventListener("securitypolicyviolation",function(e){if(!i&&"script-src-elem"===e.violatedDirective&&"data"===e.blockedURI){i=!0;try{sessionStorage.setItem("eo_csp_issue","1")}catch(e){}}}),window.addEventListener("pageshow",function(e){r=e.persisted,o&&function(){document.onreadystatechange&&document.onreadystatechange();window.onload&&window.onload();window.onpageshow&&window.onpageshow({persisted:r})}()}),document.addEventListener("DOMContentLoaded",function(){var e={};document.querySelectorAll("script[type=easyoptscript][data-easyopt-src]").forEach(function(t){var n=t.getAttribute("data-easyopt-src");if(n&&0!==n.indexOf("data:")){0===n.indexOf("//")&&(n=location.protocol+n);try{var o=new URL(n).origin;if(o!==location.origin&&!e[o]){e[o]=!0;var r=document.createElement("link");
12r.rel="preconnect",r.href=o,(t.crossOrigin||"module"===t.getAttribute("data-easyopt-type"))&&(r.crossOrigin="anonymous"),document.head.appendChild(r),u.push(r)}}catch(e){}}})}),e=EventTarget.prototype.addEventListener,EventTarget.prototype._eoOrigAdd=e,EventTarget.prototype.addEventListener=function(t,n,r){"click"!==t||o||n===l||c.push({target:this,fn:n,opts:r}),e.call(this||window,t,n,r)},document.hidden?D():(f.forEach(function(e){window.addEventListener(e,D,{passive:!0})}),document.addEventListener("visibilitychange",D),window.addEventListener("touchstart",m,{passive:!0}),window.addEventListener("mousedown",m))}();

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.