import{b as m,c as w,i as _}from"./index-46c00744-1742362401929.js";import{J as v,a5 as y,r as h,c5 as S,q as $}from"./index-ab183db6-1742362401929.js";function f(e){var n;const o=w(e);return(n=o==null?void 0:o.$el)!=null?n:o}const j=_?window:void 0;function M(){const e=h(!1);return S()&&$(()=>{e.value=!0}),e}function P(e){const n=M();return v(()=>(n.value,!!e()))}var c=Object.getOwnPropertySymbols,R=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,z=(e,n)=>{var o={};for(var t in e)R.call(e,t)&&n.indexOf(t)<0&&(o[t]=e[t]);if(e!=null&&c)for(var t of c(e))n.indexOf(t)<0&&g.call(e,t)&&(o[t]=e[t]);return o};function x(e,n,o={}){const t=o,{window:s=j}=t,d=z(t,["window"]);let r;const i=P(()=>s&&"ResizeObserver"in s),u=()=>{r&&(r.disconnect(),r=void 0)},b=v(()=>Array.isArray(e)?e.map(a=>f(a)):[f(e)]),O=y(b,a=>{if(u(),i.value&&s){r=new ResizeObserver(n);for(const p of a)p&&r.observe(p,d)}},{immediate:!0,flush:"post",deep:!0}),l=()=>{u(),O()};return m(l),{isSupported:i,stop:l}}export{x as u};
