pleroma/priv/static/packs/extra_polyfills.js
2020-01-22 16:00:23 +01:00

3 lines
No EOL
12 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{1047:function(t,e){!function(){"use strict";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,e=[];i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.USE_MUTATION_OBSERVER=!0,i.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()}},i.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},i.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]})},i.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},i.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(o(window,"resize",this._checkForIntersections,!0),o(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}))))},i.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,r(window,"resize",this._checkForIntersections,!0),r(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},i.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(i){var o=i.element,r=s(o),c=this._rootContainsTarget(o),a=i.entry,u=t&&c&&this._computeTargetAndRootIntersection(o,e),l=i.entry=new n({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:r,rootBounds:e,intersectionRect:u});a?t&&c?this._hasCrossedThreshold(a,l)&&this._queuedEntries.push(l):a&&a.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},i.prototype._computeTargetAndRootIntersection=function(e,n){if("none"!=window.getComputedStyle(e).display){for(var i,o,r,c,u,l,h,d,f=s(e),g=a(e),p=!1;!p;){var m=null,b=1==g.nodeType?window.getComputedStyle(g):{};if("none"==b.display)return;if(g==this.root||g==t?(p=!0,m=n):g!=t.body&&g!=t.documentElement&&"visible"!=b.overflow&&(m=s(g)),m&&(i=m,o=f,r=void 0,c=void 0,u=void 0,l=void 0,h=void 0,d=void 0,r=Math.max(i.top,o.top),c=Math.min(i.bottom,o.bottom),u=Math.max(i.left,o.left),l=Math.min(i.right,o.right),d=c-r,!(f=(h=l-u)>=0&&d>=0&&{top:r,bottom:c,left:u,right:l,width:h,height:d})))break;g=a(g)}return f}},i.prototype._getRootRect=function(){var e;if(this.root)e=s(this.root);else{var n=t.documentElement,i=t.body;e={top:0,left:0,right:n.clientWidth||i.clientWidth,width:n.clientWidth||i.clientWidth,bottom:n.clientHeight||i.clientHeight,height:n.clientHeight||i.clientHeight}}return this._expandRectByRootMargin(e)},i.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},i.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,i=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==i)for(var o=0;o<this.thresholds.length;o++){var r=this.thresholds[o];if(r==n||r==i||r<n!=r<i)return!0}},i.prototype._rootIsInDom=function(){return!this.root||c(t,this.root)},i.prototype._rootContainsTarget=function(e){return c(this.root||t,e)},i.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},i.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=i,window.IntersectionObserverEntry=n}function n(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,i=this.intersectionRect,o=i.width*i.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function i(t,e){var n,i,o,r=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(r.root&&1!=r.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),i=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout(function(){n(),o=null},i))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(r.rootMargin),this.thresholds=this._initThresholds(r.threshold),this.root=r.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function o(t,e,n,i){"function"==typeof t.addEventListener?t.addEventListener(e,n,i||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function r(t,e,n,i){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,i||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function s(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 c(t,e){for(var n=e;n;){if(n==t)return!0;n=a(n)}return!1}function a(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e&&e.assignedSlot?e.assignedSlot.parentNode:e}}()},1048:function(t,e,n){(function(n){var i,o,r;o=[],void 0===(r="function"==typeof(i=function(){"use strict";var t,e,i,o,r,s,c,a,u="undefined"!=typeof window?window:null!=typeof n?n:this||{},l=u.cancelRequestAnimationFrame&&u.requestAnimationFrame||setTimeout,h=u.cancelRequestAnimationFrame||clearTimeout,d=[],f=0,g=!1,p=7,m=35,b=125,v=0,w=0,y=0,_={get didTimeout(){return!1},timeRemaining:function(){var t=p-(Date.now()-w);return t<0?0:t}},I=(r=function(){p=22,b=66,m=0},a=function t(){var e=Date.now()-c;e<99?s=setTimeout(t,99-e):(s=null,r())},function(){c=Date.now(),s||(s=setTimeout(a,99))});function E(){125!=b&&(p=7,b=125,m=35,g&&(g&&(o&&h(o),i&&clearTimeout(i),g=!1),R())),I()}function T(){o=null,i=setTimeout(O,0)}function k(){i=null,l(T)}function R(){g||(e=b-(Date.now()-w),t=Date.now(),g=!0,m&&e<m&&(e=m),e>9?i=setTimeout(k,e):(e=0,k()))}function O(){var n,o,r,s=p>9?9:1;if(w=Date.now(),g=!1,i=null,f>2||w-e-50<t)for(o=0,r=d.length;o<r&&_.timeRemaining()>s;o++)n=d.shift(),y++,n&&n(_);d.length?R():f=0}function L(t){return v++,d.push(t),R(),v}function M(t){var e=t-1-y;d[e]&&(d[e]=null)}if(u.requestIdleCallback&&u.cancelIdleCallback)try{u.requestIdleCallback(function(){},{timeout:0})}catch(t){!function(t){var e,n;if(u.requestIdleCallback=function(e,n){return n&&"number"==typeof n.timeout?t(e,n.timeout):t(e)},u.IdleCallbackDeadline&&(e=IdleCallbackDeadline.prototype)){if(!(n=Object.getOwnPropertyDescriptor(e,"timeRemaining"))||!n.configurable||!n.get)return;Object.defineProperty(e,"timeRemaining",{value:function(){return n.get.call(this)},enumerable:!0,configurable:!0})}}(u.requestIdleCallback)}else u.requestIdleCallback=L,u.cancelIdleCallback=M,u.document&&document.addEventListener&&(u.addEventListener("scroll",E,!0),u.addEventListener("resize",E),document.addEventListener("focus",E,!0),document.addEventListener("mouseover",E,!0),["click","keypress","touchstart","mousedown"].forEach(function(t){document.addEventListener(t,E,{capture:!0,passive:!0})}),u.MutationObserver&&new MutationObserver(E).observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}));return{request:L,cancel:M}})?i.apply(e,o):i)||(t.exports=r)}).call(this,n(50))},1049:function(t,e,n){"use strict";
/*! npm.im/object-fit-images 3.2.4 */var i="bfred-it:object-fit-images",o=/(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g,r="undefined"==typeof Image?{style:{"object-position":1}}:new Image,s="object-fit"in r.style,c="object-position"in r.style,a="background-size"in r.style,u="string"==typeof r.currentSrc,l=r.getAttribute,h=r.setAttribute,d=!1;function f(t,e,n){var i="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+(e||1)+"' height='"+(n||0)+"'%3E%3C/svg%3E";l.call(t,"src")!==i&&h.call(t,"src",i)}function g(t,e){t.naturalWidth?e(t):setTimeout(g,100,t,e)}function p(t){var e=function(t){for(var e,n=getComputedStyle(t).fontFamily,i={};null!==(e=o.exec(n));)i[e[1]]=e[2];return i}(t),n=t[i];if(e["object-fit"]=e["object-fit"]||"fill",!n.img){if("fill"===e["object-fit"])return;if(!n.skipTest&&s&&!e["object-position"])return}if(!n.img){n.img=new Image(t.width,t.height),n.img.srcset=l.call(t,"data-ofi-srcset")||t.srcset,n.img.src=l.call(t,"data-ofi-src")||t.src,h.call(t,"data-ofi-src",t.src),t.srcset&&h.call(t,"data-ofi-srcset",t.srcset),f(t,t.naturalWidth||t.width,t.naturalHeight||t.height),t.srcset&&(t.srcset="");try{!function(t){var e={get:function(e){return t[i].img[e||"src"]},set:function(e,n){return t[i].img[n||"src"]=e,h.call(t,"data-ofi-"+n,e),p(t),e}};Object.defineProperty(t,"src",e),Object.defineProperty(t,"currentSrc",{get:function(){return e.get("currentSrc")}}),Object.defineProperty(t,"srcset",{get:function(){return e.get("srcset")},set:function(t){return e.set(t,"srcset")}})}(t)}catch(t){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}!function(t){if(t.srcset&&!u&&window.picturefill){var e=window.picturefill._;t[e.ns]&&t[e.ns].evaled||e.fillImg(t,{reselect:!0}),t[e.ns].curSrc||(t[e.ns].supported=!1,e.fillImg(t,{reselect:!0})),t.currentSrc=t[e.ns].curSrc||t.src}}(n.img),t.style.backgroundImage='url("'+(n.img.currentSrc||n.img.src).replace(/"/g,'\\"')+'")',t.style.backgroundPosition=e["object-position"]||"center",t.style.backgroundRepeat="no-repeat",t.style.backgroundOrigin="content-box",/scale-down/.test(e["object-fit"])?g(n.img,function(){n.img.naturalWidth>t.width||n.img.naturalHeight>t.height?t.style.backgroundSize="contain":t.style.backgroundSize="auto"}):t.style.backgroundSize=e["object-fit"].replace("none","auto").replace("fill","100% 100%"),g(n.img,function(e){f(t,e.naturalWidth,e.naturalHeight)})}function m(t,e){var n=!d&&!t;if(e=e||{},t=t||"img",c&&!e.skipTest||!a)return!1;"img"===t?t=document.getElementsByTagName("img"):"string"==typeof t?t=document.querySelectorAll(t):"length"in t||(t=[t]);for(var o=0;o<t.length;o++)t[o][i]=t[o][i]||{skipTest:e.skipTest},p(t[o]);n&&(document.body.addEventListener("load",function(t){"IMG"===t.target.tagName&&m(t.target,{skipTest:e.skipTest})},!0),d=!0,t="img"),e.watchMQ&&window.addEventListener("resize",m.bind(null,t,{skipTest:e.skipTest}))}m.supportsObjectFit=s,m.supportsObjectPosition=c,function(){function t(t,e){return t[i]&&t[i].img&&("src"===e||"srcset"===e)?t[i].img:t}c||(HTMLImageElement.prototype.getAttribute=function(e){return l.call(t(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,n){return h.call(t(this,e),e,String(n))})}(),t.exports=m},455:function(t,e,n){"use strict";n.r(e);n(1047),n(1048);var i=n(1049);n.n(i)()()},457:function(t,e,n){"use strict";n.r(e);n(1047),n(1048);var i=n(1049);n.n(i)()()}}]);
//# sourceMappingURL=extra_polyfills.js.map