Skip to Content

JavaScript File

URL: https://cdn.ampproject.org/rtv/012011252111002/v0/amp-intersection-observer-polyfill-0.1.js
HTTP Status: 200 OK
MIME Type: text/javascript
Last Modified: Mon, 01 Jan 1601 00:00:00 GMT
Download Time: Less than a second
Cookies: None
Size: 13 KB
HTTP Headers:  12 headers
Links In:  1 pages
  
OK Issues: No issues found

1(self.AMP=self.AMP||[]).push({n:"amp-intersection-observer-polyfill",v:"2011252111002",f:(function(AMP,_){

2'use strict';function A(c){for(var f=["object"==typeof globalThis&&globalThis,c,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global],e=0;e<f.length;++e){var l=f[e];if(l&&l.Math==Math)return}

3(function(){throw Error("Cannot find global object");}

4)()}

5A(this);

6function E(){(function(){function c(a){try{return a.defaultView&&a.defaultView.frameElement||null}

7catch(b){return null}

8}

9function f(a){this.time=a.time;this.target=a.target;this.rootBounds=D(a.rootBounds);this.boundingClientRect=D(a.boundingClientRect);this.intersectionRect=D(a.intersectionRect||B());this.isIntersecting=!!a.intersectionRect;var b=this.boundingClientRect,d=b.width*b.height,g=this.intersectionRect,h=g.width*g.height;this.intersectionRatio=d?Number((h/d).toFixed(4)):this.isIntersecting?

101:0}

11function e(a,b){b=b||{}

12;if("function"!=typeof a)throw Error("callback must be a function");if(b.root&&1!=b.root.nodeType)throw Error("root must be an Element");this._checkForIntersections=k(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT);this._callback=a;this._observationTargets=[];this._queuedEntries=[];this._rootMarginValues=this._parseRootMargin(b.rootMargin);this.thresholds=this._initThresholds(b.threshold);this.root=b.root||null;this.rootMargin=this._rootMarginValues.map(function(d){return d.value+

13d.unit}

14).join(" ");this._monitoringDocuments=[];this._monitoringUnsubscribes=[]}

15function l(){return window.performance&&performance.now&&performance.now()}

16function k(a,b){var d=null;return function(){d||(d=setTimeout(function(){a();d=null}

17,b))}

18}

19function q(a,b,d,g){"function"==typeof a.addEventListener?a.addEventListener(b,d,g||!1):"function"==typeof a.attachEvent&&a.attachEvent("on"+b,d)}

20function p(a,b,d,g){"function"==typeof a.removeEventListener?a.removeEventListener(b,d,g||!1):"function"==typeof a.detatchEvent&&

21a.detatchEvent("on"+b,d)}

22function t(a,b){var d=Math.max(a.top,b.top),g=Math.min(a.bottom,b.bottom),h=Math.max(a.left,b.left),m=Math.min(a.right,b.right),n=m-h,u=g-d;return 0<=n&&0<=u&&{top:d,bottom:g,left:h,right:m,width:n,height:u}

23||null}

24function v(a){try{var b=a.getBoundingClientRect()}

25catch(d){}

26if(!b)return B();b.width&&b.height||(b={top:b.top,right:b.right,bottom:b.bottom,left:b.left,width:b.right-b.left,height:b.bottom-b.top}

27);return b}

28function B(){return{top:0,bottom:0,left:0,right:0,width:0,

29height:0}

30}

31function D(a){return!a||"x"in a?a:{top:a.top,y:a.top,bottom:a.bottom,left:a.left,x:a.left,right:a.right,width:a.width,height:a.height}

32}

33function H(a,b){var d=b.top-a.top,g=b.left-a.left;return{top:d,left:g,height:b.height,width:b.width,bottom:d+b.height,right:g+b.width}

34}

35function I(a,b){for(var d=b;d;){if(d==a)return!0;d=C(d)}

36return!1}

37function C(a){var b=a.parentNode;return 9==a.nodeType&&a!=r?c(a):b&&11==b.nodeType&&b.host?b.host:b&&b.assignedSlot?b.assignedSlot.parentNode:b}

38if("object"===

39typeof 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 0<this.intersectionRatio}

40}

...

</html>