const n=o=>{if(o===null){return null}if(o.classList.contains("element_scrolled")||(o===null||o===void 0?void 0:o.tagName)==="BODY"){return o}else{return n(o.offsetParent)}};function o({actionElement:n,changedElement:o,intoView:t}){const i=t?t:document.body;const l=i.offsetParent;const e=!!i.classList.contains("element_scrolled");const d=e?n.offsetTop-i.scrollTop+l.offsetTop:n.offsetTop-window.scrollY;const c=e?n.offsetLeft+l.offsetLeft:n.offsetLeft;const s=(o===null||o===void 0?void 0:o.offsetHeight)>window.innerHeight-d?d-(o===null||o===void 0?void 0:o.offsetHeight)-16:d+(n===null||n===void 0?void 0:n.offsetHeight)+16;const u=(o===null||o===void 0?void 0:o.offsetWidth)>window.innerWidth-c?c+(n===null||n===void 0?void 0:n.offsetWidth)-(o===null||o===void 0?void 0:o.offsetWidth):c;const v=window.innerHeight-(o===null||o===void 0?void 0:o.offsetHeight);const w=window.innerWidth-(o===null||o===void 0?void 0:o.offsetWidth);const r={top:s<8?8:s>v?v-8:s,left:u<0?0:u>w?w:u};return r}function t({actionElement:n,changedElement:o,intoView:t}){const i=t?t:document.body;const l=i.offsetHeight<o.offsetHeight?window.screen.height:i.offsetHeight;const e=i.offsetWidth<o.offsetWidth?window.screen.width:i.offsetWidth;const d=l-n.offsetTop;const c=e-n.offsetLeft;const s={y:d<o.offsetHeight+n.offsetHeight?"top":"bottom",x:c<o.offsetWidth?"right":"left"};return s}export{o as a,n as g,t as p};
//# sourceMappingURL=p-1de3e07c.js.map