mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
|
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.ResizeObserver=factory()}(this,function(){"use strict";function toFloat(value){return parseFloat(value)||0}function getBordersSize(styles){var positions=Array.prototype.slice.call(arguments,1);return positions.reduce(function(size,position){var value=styles["border-"+position+"-width"];return size+toFloat(value)},0)}function getPaddings(styles){for(var positions=["top","right","bottom","left"],paddings={},i=0,list=positions;i<list.length;i+=1){var position=list[i],value=styles["padding-"+position];paddings[position]=toFloat(value)}return paddings}function getSVGContentRect(target){var bbox=target.getBBox();return createRectInit(0,0,bbox.width,bbox.height)}function getHTMLElementContentRect(target){var clientWidth=target.clientWidth,clientHeight=target.clientHeight;if(!clientWidth&&!clientHeight)return emptyRect;var styles=getComputedStyle(target),paddings=getPaddings(styles),horizPad=paddings.left+paddings.right,vertPad=paddings.top+paddings.bottom,width=toFloat(styles.width),height=toFloat(styles.height);if("border-box"===styles.boxSizing&&(Math.round(width+horizPad)!==clientWidth&&(width-=getBordersSize(styles,"left","right")+horizPad),Math.round(height+vertPad)!==clientHeight&&(height-=getBordersSize(styles,"top","bottom")+vertPad)),!isDocumentElement(target)){var vertScrollbar=Math.round(width+horizPad)-clientWidth,horizScrollbar=Math.round(height+vertPad)-clientHeight;1!==Math.abs(vertScrollbar)&&(width-=vertScrollbar),1!==Math.abs(horizScrollbar)&&(height-=horizScrollbar)}return createRectInit(paddings.left,paddings.top,width,height)}function isDocumentElement(target){return target===document.documentElement}function getContentRect(target){return isBrowser?isSVGGraphicsElement(target)?getSVGContentRect(target):getHTMLElementContentRect(target):emptyRect}function createReadOnlyRect(ref){var x=ref.x,y=ref.y,width=ref.width,height=ref.height,Constr="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,rect=Object.create(Constr.prototype);return defineConfigurable(rect,{x:x,y:y,width:width,height:height,top:y,right:x+width,bottom:height+y,left:x}),rect}function createRectInit(x,y,width,height){return{x:x,y:y,width:width,height:height}}var MapShim=function(){function getIndex(arr,key){var result=-1;return arr.some(function(entry,index){return entry[0]===key&&(result=index,!0)}),result}return"undefined"!=typeof Map?Map:function(){function anonymous(){this.__entries__=[]}var prototypeAccessors={size:{}};return prototypeAccessors.size.get=function(){return this.__entries__.length},anonymous.prototype.get=function(key){var index=getIndex(this.__entries__,key),entry=this.__entries__[index];return entry&&entry[1]},anonymous.prototype.set=function(key,value){var index=getIndex(this.__entries__,key);~index?this.__entries__[index][1]=value:this.__entries__.push([key,value])},anonymous.prototype.delete=function(key){var entries=this.__entries__,index=getIndex(entries,key);~index&&entries.splice(index,1)},anonymous.prototype.has=function(key){return!!~getIndex(this.__entries__,key)},anonymous.prototype.clear=function(){this.__entries__.splice(0)},anonymous.prototype.forEach=function(callback,ctx){void 0===ctx&&(ctx=null);for(var i=0,list=this.__entries__;i<list.length;i+=1){var entry=list[i];callback.call(ctx,entry[1],entry[0])}},Object.defineProperties(anonymous.prototype,prototypeAccessors),anonymous}()}(),isBrowser="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,requestAnimationFrame$1=function(){return"function"==typeof requestAnimationFrame?requestAnimationFrame:function(callback){return setTimeout(function(){return callback(Date.now())},1e3/60)}}(),trailingTimeout=2,throttle=function(callback,delay){function resolvePending(){leadingCall&&(leadingCall=!1,callback()),trailingCall&&proxy()}function timeoutCallback(){requestAnimationFrame$1(resolvePending)}function proxy(){var timeStamp=Date.now();if(leadingCall){if(timeStam
|