1 line
1.2 KiB
JavaScript
1 line
1.2 KiB
JavaScript
"use strict";(self.blocksyJsonP=self.blocksyJsonP||[]).push([[559],{5559:function(t,e,n){n.r(e),n.d(e,{mount:function(){return o}});var i=n(2248);const r=function(t){if(!t.nextElementSibling)return;if(t.nextElementSibling.popperMounted)return;t.nextElementSibling.popperMounted=!0;const e=t.nextElementSibling,n=t.getBoundingClientRect(),i=e.getBoundingClientRect();let o=n.left>innerWidth/2?"left":"right",l=o;const s=parseFloat(getComputedStyle(e).getPropertyValue("--theme-submenu-inline-offset")||-20);if(i.width>innerWidth-n.left+s&&(l="left"),n.right-s-i.width<0&&(l="right"),n.left+i.width>innerWidth&&n.right-i.width<0){l=o;let t=0,i=20;"left"===l&&(t=innerWidth-n.right-i),"right"===l&&(t=n.left-i),t=Math.round(t),e.style.setProperty("--theme-submenu-inline-offset",-1*t+"px")}e.dataset.placement=l;const u=new MutationObserver((function(n){n.find((function(t){return"childList"===t.type&&[...t.removedNodes].find((function(t){return t===e}))}))&&(u.disconnect(),r(t))}));u.observe(e.parentNode,{childList:!0})},o=function(t){Promise.all(ct_localizations.dynamic_styles_selectors.filter((function(e){return!!t.closest(e.selector)})).map((function(t){let{url:e}=t;return(0,i.Xr)(e)}))).then((function(){return r(t)}))}}}]); |