// source --> https://medcell.co/wp-content/themes/Total/assets/js/frontend/sticky/main-nav.min.js?ver=6.1 
!function(t){const e=document.querySelector("#site-navigation-wrap.fixed-nav");if(!e)return;let n=!1,i=!1,s=!1;const o=()=>{let t=window.scrollY||0;return t<0&&(t=0),t},c=t=>!!t&&!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),d=t=>{const e=t.getBoundingClientRect();return{top:e.top+o(),left:e.left+o(),bottom:e.bottom+o()}},r=()=>{let e=0;return document.querySelectorAll(".wpex-sticky-el-offset,#wpadminbar,.wpex-top-bar-sticky").forEach((t=>{const n=window.getComputedStyle(t).position;c(t)&&((t,e)=>{if("wpadminbar"===t.id)return!0;if(!t||!e)return;return 4===t.compareDocumentPosition(e)})(t,s)&&(t.closest(".wpex-can-sticky")||"fixed"===n||"sticky"===n)&&(e+=t.getBoundingClientRect().height)})),t.offset&&(e+=parseInt(t.offset)),e},a=()=>{let t=e.getBoundingClientRect().height;return Math.round(t)!==t&&(t=t.toFixed(2)),t},l=()=>{if(n)return;const t=a();s.style.height=`${t}px`,s.classList.remove("not-sticky"),s.classList.add("is-sticky"),e.style.top=r()+"px",e.style.width=s.getBoundingClientRect().width+"px";const i=document.querySelector("#site-header");i&&i.classList.remove("dyn-styles"),n=!0},p=()=>{if(!n)return;s.style.height="",s.classList.remove("is-sticky"),s.classList.add("not-sticky"),e.style.top="",e.style.width="";const t=document.querySelector("#site-header");t&&t.classList.add("dyn-styles"),n=!1},y=()=>{if(!c(e)||(()=>{let t="inner",e=window;return"innerWidth"in window||(t="client",e=document.documentElement||document.body),e[t+"Width"]})()<=t.breakpoint)return s.classList.contains("wpex-can-sticky")&&(s.classList.remove("wpex-can-sticky"),document.body.style.removeProperty("--wpex-sticky-main-nav-height")),p();s.classList.add("wpex-can-sticky");const y=a();let w=!1;if(i!==y&&(w=!0,i=y),!w&&document.body.style.getPropertyValue("--wpex-sticky-main-nav-height")||document.body.style.setProperty("--wpex-sticky-main-nav-height",`${i}px`),n)w&&(s.style.height=`${i}px`),e.style.top=r()+"px",e.style.width=s.getBoundingClientRect().width+"px";else{const t=o();0!==t&&t>=d(s).top-r()?l():p()}},w=()=>{if(!s.classList.contains("wpex-can-sticky"))return;const t=o();0!==t&&t>=d(s).top-r()?l():p()},u=()=>{p(),y()},h=()=>{s=document.createElement("div"),s.id="site-navigation-sticky-wrapper",s.className="wpex-sticky-navigation-holder not-sticky",e.childNodes||(e=[e]),e.nextSibling?e.parentNode.insertBefore(s,e.nextSibling):e.parentNode.appendChild(s),s.appendChild(e),y(),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",y),window.addEventListener("orientationchange",u),s.classList.contains("wpex-can-sticky")&&window.addEventListener("load",(()=>{setTimeout((()=>{const t=a();i!==t&&(i=t,document.body.style.setProperty("--wpex-sticky-main-nav-height",`${i}px`),s.style.height=`${i}px`)}),0)}))};t.runOnWindowLoad?window.addEventListener("load",(()=>{h()})):h()}(wpex_sticky_main_nav_params);