let supportsPassive = false ; try { let opts = Object . defineProperty ( { } , 'passive' , { get : function ( ) { supportsPassive = true ; } , } ) ; let emptyFn = ( ) => { } ; window . addEventListener ( 'test' , emptyFn , opts ) ; window . removeEventListener ( 'test' , emptyFn , opts ) ; } catch ( ignore ) { } export const SUPPORTS_PASSIVE_EVENTS = supportsPassive ; export const SUPPORTS_IMG_LOADING = 'loading' in HTMLImageElement . prototype ; export const SUPPORTS_INTERSECTION_OBSERVER = 'IntersectionObserver' in window ; export const SUPPORTS_RESIZE_OBSERVER = 'ResizeObserver' in window ; export function supportsMediaQuery ( query ) { return window . matchMedia ( `(${ query })` ) . media != 'not all' ; }