import{k as n,o as x,q as A,v as B,w as E,H as D,x as g,y as H,z as c,A as S,B as v,C as N,m as k,D as q,E as G,F as L,G as R,I as U,U as z}from"./4Xd67fio.mjs";import{B as C}from"./B7xFKswI.mjs";const T=0,_=1;function O(m,b,y,r,l){n&&x();var h=A(),t=z,i=h?N(t):k(t,!1,!1),o=h?N(t):k(t,!1,!1),s=new C(m);B(()=>{var u=b(),I=!1;let d=n&&E(u)===(m.data===D);if(d&&(g(H()),c(!1)),E(u)){var w=q(),p=!1;const a=e=>{if(!I){p=!0,w(!1),G.ensure(),n&&c(!1);try{e()}finally{L(),R||U()}}};u.then(e=>{a(()=>{v(i,e),s.ensure(_,r&&(f=>r(f,i)))})},e=>{a(()=>{if(v(o,e),s.ensure(_,l&&(f=>l(f,o))),!l)throw o.v})}),n?s.ensure(T,y):S(()=>{p||a(()=>{s.ensure(T,y)})})}else v(i,u),s.ensure(_,r&&(a=>r(a,i)));return d&&c(!0),()=>{I=!0}})}export{O as a};
