function xBackToTop(){document.querySelector("body > .brx-body.iframe"),document.querySelectorAll(".x-back-to-top").forEach(t=>{let e=t.querySelector(".x-back-to-top_progress-line"),o,r=!1;e&&(o=e.getTotalLength(),r=!0,e.style.strokeDasharray=o,e.style.strokeDashoffset=o);let a=!!t.getAttribute("data-x-backtotop")&&t.getAttribute("data-x-backtotop"),s=!function t(e){try{return JSON.parse(e)&&!!e}catch(o){return!1}}(a)?{}:JSON.parse(a),n=0,i=0,c=!1;document.addEventListener("scroll",a=>{n=window.scrollY,c||(window.requestAnimationFrame(()=>{if(r){var a;let l,d,b,y,p,u,f;a=n,d=(l=document.body.offsetTop)+document.body.offsetHeight,b=window.innerHeight,y=l,p=d-b,f=a>=y?(u=(a-y)/(p-y))<=1?o-u*o:0:o,e.style.strokeDashoffset=f}document.querySelector("body > .brx-body.iframe")||function e(o,r){function a(){t.setAttribute("aria-hidden",!1),t.removeAttribute("disabled"),t.style.opacity="1",t.style.transform="none",t.dispatchEvent(new Event("x_back_to_top:show"))}function n(){t.setAttribute("aria-hidden",!0),t.setAttribute("disabled",""),t.style.removeProperty("opacity"),t.style.removeProperty("transform"),t.dispatchEvent(new Event("x_back_to_top:hide"))}o>=s.scrollDistance?s.scrollUp?r-o>=0?a():n():a():n()}(n,i),i=n,c=!1}),c=!0)}),t.addEventListener("click",e=>{window.scrollTo({top:0,behavior:"smooth"}),document.body.setAttribute("tabindex","-1"),document.body.focus({preventScroll:!0}),document.body.removeAttribute("tabindex"),t.dispatchEvent(new Event("x_back_to_top:scroll"))})})}document.addEventListener("DOMContentLoaded",function(t){bricksIsFrontend&&xBackToTop()});