import{n as e}from"./rolldown-runtime-BG2f4sTM.js";import{nct as t,tct as n}from"./app-initial-BHB6SClA.js";function r({axis:e,debounce:t,initialSize:r=!0,onChange:i,target:a}){if(!a||typeof ResizeObserver>`u`)return;let o=new AbortController,s=null,c=null,l=r,u=new ResizeObserver(r=>{r.forEach(r=>{let{width:a,height:u}=n(r),d=!1;if(e===`width`){let e=(l||s!=null)&&s!==a;s=a,e&&(d=!0)}else if(e===`height`){let e=(l||c!=null)&&c!==u;c=u,e&&(d=!0)}else if(e===`both`){let e=(l||s!=null)&&s!==a,t=(l||c!=null)&&c!==u;s=a,c=u,(e||t)&&(d=!0)}if(l=!1,d)if(!t)i({width:a,height:u,previousWidth:s,previousHeight:c},r);else{o.abort(),o=new AbortController;let e=o.signal;requestAnimationFrame(()=>{e.aborted||i({width:a,height:u,previousWidth:s,previousHeight:c},r)})}})});function d(){try{u.disconnect()}catch{}}return u.observe(a),d}var i=e((()=>{t()}));export{i as n,r as t};
//# sourceMappingURL=create-resize-observer-iS4TFEPa.js.map