IW4M-Admin/WebfrontCore/wwwroot/lib/popper.js/dist/popper-utils.min.js
2018-02-21 19:29:23 -06:00

6 lines
9.1 KiB
JavaScript

/*
Copyright (C) Federico Zivolo 2017
Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT).
*/function a(a,b){if(1!==a.nodeType)return[];const c=getComputedStyle(a,null);return b?c[b]:c}function b(a){return'HTML'===a.nodeName?a:a.parentNode||a.host}function c(d){if(!d)return document.body;switch(d.nodeName){case'HTML':case'BODY':return d.ownerDocument.body;case'#document':return d.body;}const{overflow:e,overflowX:f,overflowY:g}=a(d);return /(auto|scroll)/.test(e+g+f)?d:c(b(d))}function d(b){const c=b&&b.offsetParent,e=c&&c.nodeName;return e&&'BODY'!==e&&'HTML'!==e?-1!==['TD','TABLE'].indexOf(c.nodeName)&&'static'===a(c,'position')?d(c):c:b?b.ownerDocument.documentElement:document.documentElement}function e(a){const{nodeName:b}=a;return'BODY'!==b&&('HTML'===b||d(a.firstElementChild)===a)}function f(a){return null===a.parentNode?a:f(a.parentNode)}function g(a,b){if(!a||!a.nodeType||!b||!b.nodeType)return document.documentElement;const c=a.compareDocumentPosition(b)&Node.DOCUMENT_POSITION_FOLLOWING,h=c?a:b,i=c?b:a,j=document.createRange();j.setStart(h,0),j.setEnd(i,0);const{commonAncestorContainer:k}=j;if(a!==k&&b!==k||h.contains(i))return e(k)?k:d(k);const l=f(a);return l.host?g(l.host,b):g(a,f(b).host)}function h(a,b='top'){const c='top'===b?'scrollTop':'scrollLeft',d=a.nodeName;if('BODY'===d||'HTML'===d){const b=a.ownerDocument.documentElement,d=a.ownerDocument.scrollingElement||b;return d[c]}return a[c]}function i(a,b,c=!1){const d=h(b,'top'),e=h(b,'left'),f=c?-1:1;return a.top+=d*f,a.bottom+=d*f,a.left+=e*f,a.right+=e*f,a}function j(a,b){const c='x'===b?'Left':'Top',d='Left'==c?'Right':'Bottom';return parseFloat(a[`border${c}Width`],10)+parseFloat(a[`border${d}Width`],10)}let k;var l=function(){return void 0==k&&(k=-1!==navigator.appVersion.indexOf('MSIE 10')),k};function m(a,b,c,d){return Math.max(b[`offset${a}`],b[`scroll${a}`],c[`client${a}`],c[`offset${a}`],c[`scroll${a}`],l()?c[`offset${a}`]+d[`margin${'Height'===a?'Top':'Left'}`]+d[`margin${'Height'===a?'Bottom':'Right'}`]:0)}function n(){const a=document.body,b=document.documentElement,c=l()&&getComputedStyle(b);return{height:m('Height',a,b,c),width:m('Width',a,b,c)}}var o=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++)for(var d in b=arguments[c],b)Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]);return a};function p(a){return o({},a,{right:a.left+a.width,bottom:a.top+a.height})}function q(b){let c={};if(l())try{c=b.getBoundingClientRect();const a=h(b,'top'),d=h(b,'left');c.top+=a,c.left+=d,c.bottom+=a,c.right+=d}catch(a){}else c=b.getBoundingClientRect();const d={left:c.left,top:c.top,width:c.right-c.left,height:c.bottom-c.top},e='HTML'===b.nodeName?n():{},f=e.width||b.clientWidth||d.right-d.left,g=e.height||b.clientHeight||d.bottom-d.top;let i=b.offsetWidth-f,k=b.offsetHeight-g;if(i||k){const c=a(b);i-=j(c,'x'),k-=j(c,'y'),d.width-=i,d.height-=k}return p(d)}function r(b,d){const e=l(),f='HTML'===d.nodeName,g=q(b),h=q(d),j=c(b),k=a(d),m=parseFloat(k.borderTopWidth,10),n=parseFloat(k.borderLeftWidth,10);let o=p({top:g.top-h.top-m,left:g.left-h.left-n,width:g.width,height:g.height});if(o.marginTop=0,o.marginLeft=0,!e&&f){const a=parseFloat(k.marginTop,10),b=parseFloat(k.marginLeft,10);o.top-=m-a,o.bottom-=m-a,o.left-=n-b,o.right-=n-b,o.marginTop=a,o.marginLeft=b}return(e?d.contains(j):d===j&&'BODY'!==j.nodeName)&&(o=i(o,d)),o}function s(a){var b=Math.max;const c=a.ownerDocument.documentElement,d=r(a,c),e=b(c.clientWidth,window.innerWidth||0),f=b(c.clientHeight,window.innerHeight||0),g=h(c),i=h(c,'left'),j={top:g-d.top+d.marginTop,left:i-d.left+d.marginLeft,width:e,height:f};return p(j)}function t(c){const d=c.nodeName;return'BODY'===d||'HTML'===d?!1:!('fixed'!==a(c,'position'))||t(b(c))}function u(a,d,e,f){let h={top:0,left:0};const i=g(a,d);if('viewport'===f)h=s(i);else{let e;'scrollParent'===f?(e=c(b(d)),'BODY'===e.nodeName&&(e=a.ownerDocument.documentElement)):'window'===f?e=a.ownerDocument.documentElement:e=f;const g=r(e,i);if('HTML'===e.nodeName&&!t(i)){const{height:a,width:b}=n();h.top+=g.top-g.marginTop,h.bottom=a+g.top,h.left+=g.left-g.marginLeft,h.right=b+g.left}else h=g}return h.left+=e,h.top+=e,h.right-=e,h.bottom-=e,h}function v({width:a,height:b}){return a*b}function w(a,b,c,d,e,f=0){if(-1===a.indexOf('auto'))return a;const g=u(c,d,f,e),h={top:{width:g.width,height:b.top-g.top},right:{width:g.right-b.right,height:g.height},bottom:{width:g.width,height:g.bottom-b.bottom},left:{width:b.left-g.left,height:g.height}},i=Object.keys(h).map((a)=>o({key:a},h[a],{area:v(h[a])})).sort((c,a)=>a.area-c.area),j=i.filter(({width:a,height:b})=>a>=c.clientWidth&&b>=c.clientHeight),k=0<j.length?j[0].key:i[0].key,l=a.split('-')[1];return k+(l?`-${l}`:'')}const x='undefined'!=typeof window&&'undefined'!=typeof document,y=['Edge','Trident','Firefox'];let z=0;for(let a=0;a<y.length;a+=1)if(x&&0<=navigator.userAgent.indexOf(y[a])){z=1;break}function A(a){let b=!1;return()=>{b||(b=!0,window.Promise.resolve().then(()=>{b=!1,a()}))}}function B(a){let b=!1;return()=>{b||(b=!0,setTimeout(()=>{b=!1,a()},z))}}const C=x&&window.Promise;var D=C?A:B;function E(a,b){return Array.prototype.find?a.find(b):a.filter(b)[0]}function F(a,b,c){if(Array.prototype.findIndex)return a.findIndex((a)=>a[b]===c);const d=E(a,(a)=>a[b]===c);return a.indexOf(d)}function G(a){let b;if('HTML'===a.nodeName){const{width:a,height:c}=n();b={width:a,height:c,left:0,top:0}}else b={width:a.offsetWidth,height:a.offsetHeight,left:a.offsetLeft,top:a.offsetTop};return p(b)}function H(a){const b=getComputedStyle(a),c=parseFloat(b.marginTop)+parseFloat(b.marginBottom),d=parseFloat(b.marginLeft)+parseFloat(b.marginRight),e={width:a.offsetWidth+d,height:a.offsetHeight+c};return e}function I(a){const b={left:'right',right:'left',bottom:'top',top:'bottom'};return a.replace(/left|right|bottom|top/g,(a)=>b[a])}function J(a,b,c){c=c.split('-')[0];const d=H(a),e={width:d.width,height:d.height},f=-1!==['right','left'].indexOf(c),g=f?'top':'left',h=f?'left':'top',i=f?'height':'width',j=f?'width':'height';return e[g]=b[g]+b[i]/2-d[i]/2,e[h]=c===h?b[h]-d[j]:b[I(h)],e}function K(a,b,c){const d=g(b,c);return r(c,d)}function L(a){const b=[!1,'ms','Webkit','Moz','O'],c=a.charAt(0).toUpperCase()+a.slice(1);for(let d=0;d<b.length-1;d++){const e=b[d],f=e?`${e}${c}`:a;if('undefined'!=typeof document.body.style[f])return f}return null}function M(a){return a&&'[object Function]'==={}.toString.call(a)}function N(a,b){return a.some(({name:a,enabled:c})=>c&&a===b)}function O(a,b,c){const d=E(a,({name:a})=>a===b),e=!!d&&a.some((a)=>a.name===c&&a.enabled&&a.order<d.order);if(!e){const a=`\`${b}\``,d=`\`${c}\``;console.warn(`${d} modifier is required by ${a} modifier in order to work, be sure to include it before ${a}!`)}return e}function P(a){return''!==a&&!isNaN(parseFloat(a))&&isFinite(a)}function Q(a){const b=a.ownerDocument;return b?b.defaultView:window}function R(a,b){return Q(a).removeEventListener('resize',b.updateBound),b.scrollParents.forEach((a)=>{a.removeEventListener('scroll',b.updateBound)}),b.updateBound=null,b.scrollParents=[],b.scrollElement=null,b.eventsEnabled=!1,b}function S(a,b,c){const d=void 0===c?a:a.slice(0,F(a,'name',c));return d.forEach((a)=>{a['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');const c=a['function']||a.fn;a.enabled&&M(c)&&(b.offsets.popper=p(b.offsets.popper),b.offsets.reference=p(b.offsets.reference),b=c(b,a))}),b}function T(a,b){Object.keys(b).forEach(function(c){const d=b[c];!1===d?a.removeAttribute(c):a.setAttribute(c,b[c])})}function U(a,b){Object.keys(b).forEach((c)=>{let d='';-1!==['width','height','top','right','bottom','left'].indexOf(c)&&P(b[c])&&(d='px'),a.style[c]=b[c]+d})}function V(a,b,d,e){const f='BODY'===a.nodeName,g=f?a.ownerDocument.defaultView:a;g.addEventListener(b,d,{passive:!0}),f||V(c(g.parentNode),b,d,e),e.push(g)}function W(a,b,d,e){d.updateBound=e,Q(a).addEventListener('resize',d.updateBound,{passive:!0});const f=c(a);return V(f,'scroll',d.updateBound,d.scrollParents),d.scrollElement=f,d.eventsEnabled=!0,d}var X={computeAutoPlacement:w,debounce:D,findIndex:F,getBordersSize:j,getBoundaries:u,getBoundingClientRect:q,getClientRect:p,getOffsetParent:d,getOffsetRect:G,getOffsetRectRelativeToArbitraryNode:r,getOuterSizes:H,getParentNode:b,getPopperOffsets:J,getReferenceOffsets:K,getScroll:h,getScrollParent:c,getStyleComputedProperty:a,getSupportedPropertyName:L,getWindowSizes:n,isFixed:t,isFunction:M,isModifierEnabled:N,isModifierRequired:O,isNumeric:P,removeEventListeners:R,runModifiers:S,setAttributes:T,setStyles:U,setupEventListeners:W};export{w as computeAutoPlacement,D as debounce,F as findIndex,j as getBordersSize,u as getBoundaries,q as getBoundingClientRect,p as getClientRect,d as getOffsetParent,G as getOffsetRect,r as getOffsetRectRelativeToArbitraryNode,H as getOuterSizes,b as getParentNode,J as getPopperOffsets,K as getReferenceOffsets,h as getScroll,c as getScrollParent,a as getStyleComputedProperty,L as getSupportedPropertyName,n as getWindowSizes,t as isFixed,M as isFunction,N as isModifierEnabled,O as isModifierRequired,P as isNumeric,R as removeEventListeners,S as runModifiers,T as setAttributes,U as setStyles,W as setupEventListeners};export default X;
//# sourceMappingURL=popper-utils.min.js.map