const e=require("./unrefElement.js"),t=require("./_configurable.js"),n=require("./tryOnScopeDispose.js"),r=require("./useSupported.js");let i=require("vue");function a(a,o,s={}){let{window:c=t.defaultWindow,...l}=s,u,d=r.useSupported(()=>c&&`ResizeObserver`in c),f=()=>{u&&(u.disconnect(),u=void 0)},p=(0,i.watch)(()=>e.unrefElement(a),e=>{f(),d.value&&c&&e&&(u=new ResizeObserver(o),u.observe(e,l))},{immediate:!0,flush:`post`}),m=()=>{f(),p()};return n.tryOnScopeDispose(m),{isSupported:d,stop:m}}exports.useResizeObserver=a;