Module 104681

3,198 characters · in 25868.bd058c114912c1de.js
Dependencies
Required by (1)
Lazily required by (0)none
Requires (0)none
Lazily requires (0)none
Source Raw
function(e,t,r){"use strict";function n(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function i(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function o(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var r,n=getComputedStyle(e,null);return i(n.overflowY,t)||i(n.overflowX,t)||!!(r=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e))&&(r.clientHeight<e.scrollHeight||r.clientWidth<e.scrollWidth)}return!1}function a(e,t,r,n,i,o,a,s){return o<e&&a>t||o>e&&a<t?0:o<=e&&s<=r||a>=t&&s>=r?o-e-n:a>t&&s<r||o<e&&s>r?a-t+i:0}r.d(t,{A:()=>u});var s=function(e,t){var r=window,i=t.scrollMode,s=t.block,l=t.inline,u=t.boundary,c=t.skipOverflowHiddenElements,d="function"==typeof u?u:function(e){return e!==u};if(!n(e))throw TypeError("Invalid target");for(var f,p,h=document.scrollingElement||document.documentElement,m=[],g=e;n(g)&&d(g);){if((g=null==(p=(f=g).parentElement)?f.getRootNode().host||null:p)===h){m.push(g);break}null!=g&&g===document.body&&o(g)&&!o(document.documentElement)||null!=g&&o(g,c)&&m.push(g)}for(var v=r.visualViewport?r.visualViewport.width:innerWidth,y=r.visualViewport?r.visualViewport.height:innerHeight,b=window.scrollX||pageXOffset,_=window.scrollY||pageYOffset,w=e.getBoundingClientRect(),x=w.height,E=w.width,S=w.top,k=w.right,T=w.bottom,C=w.left,A="start"===s||"nearest"===s?S:"end"===s?T:S+x/2,P="center"===l?C+E/2:"end"===l?k:C,M=[],O=0;O<m.length;O++){var R=m[O],I=R.getBoundingClientRect(),L=I.height,D=I.width,F=I.top,N=I.right,V=I.bottom,j=I.left;if("if-needed"===i&&S>=0&&C>=0&&T<=y&&k<=v&&S>=F&&T<=V&&C>=j&&k<=N)break;var B=getComputedStyle(R),U=parseInt(B.borderLeftWidth,10),K=parseInt(B.borderTopWidth,10),$=parseInt(B.borderRightWidth,10),z=parseInt(B.borderBottomWidth,10),W=0,G=0,H="offsetWidth"in R?R.offsetWidth-R.clientWidth-U-$:0,q="offsetHeight"in R?R.offsetHeight-R.clientHeight-K-z:0,Y="offsetWidth"in R?0===R.offsetWidth?0:D/R.offsetWidth:0,X="offsetHeight"in R?0===R.offsetHeight?0:L/R.offsetHeight:0;if(h===R)W="start"===s?A:"end"===s?A-y:"nearest"===s?a(_,_+y,y,K,z,_+A,_+A+x,x):A-y/2,G="start"===l?P:"center"===l?P-v/2:"end"===l?P-v:a(b,b+v,v,U,$,b+P,b+P+E,E),W=Math.max(0,W+_),G=Math.max(0,G+b);else{W="start"===s?A-F-K:"end"===s?A-V+z+q:"nearest"===s?a(F,V,L,K,z+q,A,A+x,x):A-(F+L/2)+q/2,G="start"===l?P-j-U:"center"===l?P-(j+D/2)+H/2:"end"===l?P-N+$+H:a(j,N,D,U,$+H,P,P+E,E);var J=R.scrollLeft,Z=R.scrollTop;A+=Z-(W=Math.max(0,Math.min(Z+W/X,R.scrollHeight-L/X+q))),P+=J-(G=Math.max(0,Math.min(J+G/Y,R.scrollWidth-D/Y+H)))}M.push({el:R,top:W,left:G})}return M};function l(e){return e===Object(e)&&0!==Object.keys(e).length}let u=function(e,t){var r=e.isConnected||e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(r?s(e,t):[]);if(r){var n,i,o,a=!1===t?{block:"end",inline:"nearest"}:l(t)?t:{block:"start",inline:"nearest"};return n=s(e,a),void 0===(i=a.behavior)&&(i="auto"),o="scrollBehavior"in document.body.style,void n.forEach(function(e){var t=e.el,r=e.top,n=e.left;t.scroll&&o?t.scroll({top:r,left:n,behavior:i}):(t.scrollTop=r,t.scrollLeft=n)})}}}