Files
gitlab-instance-0a899031_ro…/dist/chunk/217.js
hackrobot 0b645c5f5f 'dd'
2024-10-04 19:38:35 +08:00

1 line
7.7 KiB
JavaScript

(self.webpackJsonp=self.webpackJsonp||[]).push([[217],{"5217":function(){!function(){if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{"get":function(){return this.intersectionRatio>0}});else{var t=window.document;IntersectionObserver.prototype.THROTTLE_TIMEOUT=100,IntersectionObserver.prototype.POLL_INTERVAL=null,IntersectionObserver.prototype.USE_MUTATION_OBSERVER=!0,IntersectionObserver.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({"element":t,"entry":null}),this._monitorIntersections(),this._checkForIntersections()}},IntersectionObserver.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},IntersectionObserver.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},IntersectionObserver.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},IntersectionObserver.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},IntersectionObserver.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{"value":parseFloat(e[1]),"unit":e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},IntersectionObserver.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(addEvent(window,"resize",this._checkForIntersections,!0),addEvent(t,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(t,{"attributes":!0,"childList":!0,"characterData":!0,"subtree":!0}))))},IntersectionObserver.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,removeEvent(window,"resize",this._checkForIntersections,!0),removeEvent(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},IntersectionObserver.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),e=t?this._getRootRect():{"top":0,"bottom":0,"left":0,"right":0,"width":0,"height":0};this._observationTargets.forEach((function(n){var r=n.element,o=getBoundingClientRect(r),i=this._rootContainsTarget(r),s=n.entry,c=t&&i&&this._computeTargetAndRootIntersection(r,e),h=n.entry=new IntersectionObserverEntry({"time":window.performance&&performance.now&&performance.now(),"target":r,"boundingClientRect":o,"rootBounds":e,"intersectionRect":c});s?t&&i?this._hasCrossedThreshold(s,h)&&this._queuedEntries.push(h):s&&s.isIntersecting&&this._queuedEntries.push(h):this._queuedEntries.push(h)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},IntersectionObserver.prototype._computeTargetAndRootIntersection=function(e,n){if("none"!=window.getComputedStyle(e).display){for(var r,o,i,s,c,h,a,u,d=getBoundingClientRect(e),l=getParentNode(e),p=!1;!p;){var v=null,g=1==l.nodeType?window.getComputedStyle(l):{};if("none"==g.display)return;if(l==this.root||l==t?(p=!0,v=n):l!=t.body&&l!=t.documentElement&&"visible"!=g.overflow&&(v=getBoundingClientRect(l)),v&&(r=v,o=d,i=void 0,s=void 0,c=void 0,h=void 0,a=void 0,u=void 0,i=Math.max(r.top,o.top),s=Math.min(r.bottom,o.bottom),c=Math.max(r.left,o.left),h=Math.min(r.right,o.right),u=s-i,!(d=(a=h-c)>=0&&u>=0&&{"top":i,"bottom":s,"left":c,"right":h,"width":a,"height":u})))break;l=getParentNode(l)}return d}},IntersectionObserver.prototype._getRootRect=function(){var e;if(this.root)e=getBoundingClientRect(this.root);else{var n=t.documentElement,r=t.body;e={"top":0,"left":0,"right":n.clientWidth||r.clientWidth,"width":n.clientWidth||r.clientWidth,"bottom":n.clientHeight||r.clientHeight,"height":n.clientHeight||r.clientHeight}}return this._expandRectByRootMargin(e)},IntersectionObserver.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={"top":t.top-e[0],"right":t.right+e[1],"bottom":t.bottom+e[2],"left":t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},IntersectionObserver.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},IntersectionObserver.prototype._rootIsInDom=function(){return!this.root||containsDeep(t,this.root)},IntersectionObserver.prototype._rootContainsTarget=function(e){return containsDeep(this.root||t,e)},IntersectionObserver.prototype._registerInstance=function(){},IntersectionObserver.prototype._unregisterInstance=function(){},window.IntersectionObserver=IntersectionObserver,window.IntersectionObserverEntry=IntersectionObserverEntry}function IntersectionObserverEntry(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||{"top":0,"bottom":0,"left":0,"right":0,"width":0,"height":0},this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function IntersectionObserver(t,e){var n=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(n.root&&1!=n.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=function throttle(t,e){var n=null;return function(){n||(n=setTimeout((function(){t(),n=null}),e))}}(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(n.rootMargin),this.thresholds=this._initThresholds(n.threshold),this.root=n.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" ")}function addEvent(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function removeEvent(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function getBoundingClientRect(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={"top":e.top,"right":e.right,"bottom":e.bottom,"left":e.left,"width":e.right-e.left,"height":e.bottom-e.top}),e):{"top":0,"bottom":0,"left":0,"right":0,"width":0,"height":0}}function containsDeep(t,e){for(var n=e;n;){if(n==t)return!0;n=getParentNode(n)}return!1}function getParentNode(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e&&e.assignedSlot?e.assignedSlot.parentNode:e}}()}}]);