Module 518665

1,756 characters · in 68925.4de164704c201108.js
Dependencies
Lazily required by (0)none
Requires (2)
Lazily requires (0)none
Source Raw
function(e,t,r){"use strict";r.d(t,{R:()=>o,o:()=>s});var n=r(435987),i=r(408713);function o(e,t){let r=a(e,t,"left"),n=a(e,t,"top"),i=t.offsetWidth,o=t.offsetHeight,s=e.scrollLeft,l=e.scrollTop,{borderTopWidth:u,borderLeftWidth:c,scrollPaddingTop:f,scrollPaddingRight:d,scrollPaddingBottom:p,scrollPaddingLeft:h}=getComputedStyle(e),{scrollMarginTop:m,scrollMarginRight:g,scrollMarginBottom:v,scrollMarginLeft:y}=getComputedStyle(t),b=s+parseInt(c,10),w=l+parseInt(u,10),_=b+e.clientWidth,x=w+e.clientHeight,E=parseInt(f,10)||0,S=parseInt(p,10)||0,k=parseInt(d,10)||0,T=parseInt(h,10)||0,C=parseInt(m,10)||0,P=parseInt(v,10)||0,A=parseInt(g,10)||0,O=r-(parseInt(y,10)||0),M=r+i+A,I=n-C,R=n+o+P,D=s+parseInt(c,10)+T,L=l+parseInt(u,10)+E;(O>D||M<_-k)&&(O<=s+T?s=O-parseInt(c,10)-T:M>_-k&&(s+=M-_+k)),(I>L||R<x-S)&&(I<=w+E?l=I-parseInt(u,10)-E:R>x-S&&(l+=R-x+S)),e.scrollTo({left:s,top:l})}function a(e,t,r){let n="left"===r?"offsetLeft":"offsetTop",i=0;for(;t.offsetParent&&(i+=t[n],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[n];break}t=t.offsetParent}return i}function s(e,t){if(e&&document.contains(e)){let u=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(u).overflow||(0,i.H8)())for(let t of function(e){let t=[];for(;e&&e!==document.documentElement;)(0,n.o)(e,void 0)&&t.push(e),e=e.parentElement;return t}(e))o(t,e);else{var r,a,s,l;let{left:n,top:i}=e.getBoundingClientRect();null==e||null==(r=e.scrollIntoView)||r.call(e,{block:"nearest"});let{left:o,top:u}=e.getBoundingClientRect();(Math.abs(n-o)>1||Math.abs(i-u)>1)&&(null==t||null==(s=t.containingElement)||null==(a=s.scrollIntoView)||a.call(s,{block:"center",inline:"center"}),null==(l=e.scrollIntoView)||l.call(e,{block:"nearest"}))}}}}