import{o as e}from"./chunk.DuxOD-Sk.js";import{r as t}from"./emotion-is-prop-valid.esm.DV_OErv-.js";import{t as n}from"./useRequiredContext.DPvSYqB2.js";var r=e(t(),1),i=(e,t=[])=>{let n=(0,r.useRef)(null),[i,a]=(0,r.useState)([]),o=(0,r.useCallback)(()=>{if(!n.current)return[];let t=n.current.getBoundingClientRect();return e.map(e=>t[e])},[e]);return(0,r.useEffect)(()=>{if(!n.current)return;a(o());let e,t=new ResizeObserver(()=>{e=window.requestAnimationFrame(()=>{a(o())})});return t.observe(n.current),()=>{t.disconnect(),e&&cancelAnimationFrame(e)}},[e,o,...t]),{values:i,elementRef:n}},a=(e=[],t=-1)=>{let{values:[n,a],elementRef:o}=i((0,r.useMemo)(()=>[`width`,`height`],[]),e);return{width:n||t,height:a||t,elementRef:o}},o=(0,r.createContext)({isFullScreen:!1,setFullScreen:()=>{}});o.displayName=`ViewStateContext`;var s=(0,r.createContext)(null);s.displayName=`WindowDimensionsContext`;var c=()=>n(s);export{a as i,s as n,o as r,c as t};