import{r as u,j as m}from"./chunk-CQIL0Xd9.js";import{k as p}from"./chunk-CcVTpo0V.js";import{t as d}from"./chunk-BPjIPZ-5.js";import"./chunk-D7HrI6pR.js";function k({_ref:f,_key:a,src:s,...c}){const l=u.useRef(null),t=f||l,n=d(({scene:e})=>e),[r,i]=u.useState(null);return u.useEffect(()=>{if(!s)return;const e=new p({url:s});i(e)},[s]),u.useEffect(()=>{var e;if(t.current&&r)return n.add(r),n.remove(r),(e=t.current)==null||e.add(r),()=>{var o;r&&((o=t.current)==null||o.remove(r),r==null||r.dispose())}},[t.current,r]),m.jsx("group",{ref:t,...c},a)}export{k as default};
//# sourceMappingURL=chunk-CyJGVc6_.js.map
