(()=>{"use strict";let t,e,o,n,l,s,c;function i(){const o=window.innerHeight,n=window.scrollY;(n>o/2&&!e||n<o/2&&e)&&(e=t.classList.toggle("makeiteasy-back-to-top-visible"));const l=document.documentElement.clientHeight+(document.documentElement.scrollTop||document.body.scrollTop)>=document.documentElement.scrollHeight-10;if(c){const e=n-s;if(Math.abs(e)>20||l){const o=(i=e,Math.sign(i)>=0&&!l);t.orientationDown!==o&&(t.orientationDown=o,t.classList.toggle("makeiteasy-back-to-top-down",o))}s=n}var i}function a(){t=document.querySelector("#makeiteasy-back-to-top"),c="true"===t.dataset.goToBottom,e=!1,i(),window.addEventListener("scroll",(t=>{let e=null;return(...o)=>{null===e&&(e=setTimeout((()=>{t(...o),e=null}),150))}})(i)),t.addEventListener("click",(()=>{t.orientationDown?window.scrollTo(0,document.body.scrollHeight):window.scroll(0,0)})),"true"===t.dataset.smoothScroll&&(document.documentElement.style.scrollBehavior="smooth"),"false"===t.dataset.enableOnDesktop&&(o=t.dataset.breakPointMobileDesktop,l=!0,n=new ResizeObserver(d),n.observe(document.body))}function d(e){const n=e[0].contentRect.width;n>=o&&l&&(t.style.display="none",l=!1),n<o&&!l&&(t.style.display="block",l=!0)}"complete"===document.readyState||"interactive"===document.readyState?a():document.addEventListener("DOMContentLoaded",a)})(); |