import{slicedToArray as r,toConsumableArray as n}from"../../_virtual/_rollupPluginBabelHelpers.js";import{useMemo as t,useState as a,useLayoutEffect as e}from"react";function o(o){var i=t((function(){return Array.isArray(o)?o:[o]}),[o]),u=a(i.map((function(r){return!!window.matchMedia(r).matches}))),c=r(u,2),f=c[0],m=c[1];return e((function(){var t=i.map((function(r){return window.matchMedia(r)})),a=t.map((function(r,t){var a=function(r){m((function(a){var e=n(a);return e[t]=r.matches,e}))};return r.addEventListener("change",a),[r,a]}));return function(){a.forEach((function(n){var t=r(n,2);t[0].removeEventListener("change",t[1])}))}}),[i,m]),f}export{o as default,o as useMediaQuery};
