import{b as I,h as _,a as N,E as R,r as x,H as D,g as F,i as S,j as p,c as C,d as b,e as H,U as L,s as U,k as j,p as q,f as O}from"./BLXpcXkd.js";function Y(g,E,T=!1){_&&N();var r=g,s=null,t=null,e=L,k=T?R:0,l=!1;const y=(n,a=!0)=>{l=!0,o(a,n)};var f=null;function d(){f!==null&&(f.lastChild.remove(),r.before(f),f=null);var n=e?s:t,a=e?t:s;n&&j(n),a&&q(a,()=>{e?t=null:s=null})}const o=(n,a)=>{if(e===(e=n))return;let u=!1;if(_){const A=x(r)===D;!!e===A&&(r=F(),S(r),p(!1),u=!0)}var v=U(),i=r;if(v&&(f=document.createDocumentFragment(),f.append(i=C())),e?s??=a&&b(()=>a(i)):t??=a&&b(()=>a(i)),v){var c=H,h=e?s:t,m=e?t:s;h&&c.skipped_effects.delete(h),m&&c.skipped_effects.add(m),c.add_callback(d)}else d();u&&p(!0)};I(()=>{l=!1,E(y),l||o(null,null)},k),_&&(r=O)}export{Y as i};
