You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
1 year ago
|
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1247],{1247:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var o=n(93196),r=n.n(o),i=n(67294),s=(n(45697),n(91033)),a=null;"undefined"!==typeof CSS&&CSS.supports&&(CSS.supports("position","sticky")?a="sticky":CSS.supports("position","-webkit-sticky")&&(a="-webkit-sticky"));var c=!1;try{var l=Object.defineProperty({},"passive",{get:function(){c={passive:!0}}});window.addEventListener("testPassive",null,l),window.removeEventListener("testPassive",null,l)}catch(f){}var h=function(e){function t(t){var n=e.call(this,t)||this;return n.registerContainerRef=function(e){a&&(n.node=e,e?(n.scrollPane=function(e){for(var t=e;t=t.parentElement;){var n=getComputedStyle(t,null).getPropertyValue("overflow-y");if(t===document.body)return window;if("auto"===n||"scroll"===n)return t}return window}(n.node),n.latestScrollY=n.scrollPane===window?window.scrollY:n.scrollPane.scrollTop,n.scrollPane.addEventListener("scroll",n.handleScroll,c),n.scrollPane.addEventListener("mousewheel",n.handleScroll,c),n.scrollPane===window?(window.addEventListener("resize",n.handleWindowResize),n.handleWindowResize()):(n.rosp=new s.default(n.handleScrollPaneResize),n.rosp.observe(n.scrollPane),n.handleScrollPaneResize()),n.ropn=new s.default(n.handleParentNodeResize),n.ropn.observe(n.node.parentNode),n.handleParentNodeResize(),n.ron=new s.default(n.handleNodeResize),n.ron.observe(n.node),n.handleNodeResize({initial:!0}),n.initial()):(n.scrollPane.removeEventListener("mousewheel",n.handleScroll,c),n.scrollPane.removeEventListener("scroll",n.handleScroll,c),n.scrollPane===window?window.removeEventListener("resize",n.getMeasurements):n.rosp.disconnect(),n.ropn.disconnect(),n.ron.disconnect(),n.scrollPane=null))},n.getCurrentOffset=function(){if("relative"===n.mode)return n.offset;var e=n.props,t=e.offsetTop,o=e.offsetBottom;return"stickyTop"===n.mode?Math.max(0,n.scrollPaneOffset+n.latestScrollY-n.naturalTop+t):"stickyBottom"===n.mode?Math.max(0,n.scrollPaneOffset+n.latestScrollY+n.viewPortHeight-(n.naturalTop+n.nodeHeight+o)):void 0},n.handleWindowResize=function(){n.viewPortHeight=window.innerHeight,n.scrollPaneOffset=0},n.handleScrollPaneResize=function(){n.viewPortHeight=n.scrollPane.offsetHeight,n.scrollPane.firstChild.offsetParent===n.scrollPane?n.scrollPaneOffset=n.scrollPane.getBoundingClientRect().top:n.scrollPaneOffset=0},n.handleParentNodeResize=function(){var e=n.node.parentNode,t=getComputedStyle(e,null),o=parseInt(t.getPropertyValue("padding-top"),10),r=parseInt(t.getPropertyValue("padding-bottom"),10);n.naturalTop=function(e,t){var n=e,o=0;t.firstChild&&t.firstChild.offsetParent!==t&&(o+=e.offsetTop-t.offsetTop,t=e.offsetParent,o+=-e.offsetTop);do{o+=n.offsetTop,n=n.offsetParent}while(n&&n!==t);return o}(e,n.scrollPane)+o+n.scrollPaneOffset;var i=n.parentHeight;n.parentHeight=e.getBoundingClientRect().height-(o+r),"relative"===n.mode&&i>n.parentHeight&&n.changeToStickyBottomIfBoxTooLow(n.latestScrollY),i!==n.parentHeight&&"relative"===n.mode&&(n.latestScrollY=Number.POSITIVE_INFINITY,n.handleScroll())},n.handleNodeResize=function(e){var t=(void 0===e?{}:e).initial,o=n.nodeHeight;if(n.nodeHeight=n.node.getBoundingClientRect().height,!t&&o!==n.nodeHeight){var r=n.props,i=r.offsetTop,s=r.offsetBottom;if(n.nodeHeight+i+s<=n.viewPortHeight)n.mode=void 0,n.initial();else{var a=n.parentHeight-n.nodeHeight;n.offset=Math.max(0,Math.min(a,n.getCurrentOffset())),n.changeMode("relative")}}},n.handleScroll=function(){var e=n.props,t=e.offsetTop,o=e.offsetBottom,r=n.scrollPane===window?window.scrollY:n.scrollPane.scrollTop;if(r!==n.latestScrollY){if(n.nodeHeight+t+o<=n.viewPortHeight)return n.initial(),void(n.latestScrollY=r);var i=r-n.latestScrollY;n.offset=n.getCurrentOffset(),i>0?"stickyTop"===n.mode?r+n.scrollPaneOffset+t>n.naturalTop&&(r+n.scrollPaneOffset+n.viewPortHeight<=n.naturalTop+n.nodeHeight+n.offset+o?n.changeMode("relative"):n.changeMode("stickyBottom")):"relative"===n.mode&&n.changeToStickyBottomIfBoxTooLow(r):"stickyBottom"===n.mode?n.scrollPaneOffset+r+n.viewPortHeight<n.natu
|
||
|
//# sourceMappingURL=1247-d555090fc7792ba1.js.map
|