import{Ha as d,Md as f,Nd as p,Od as h,Pa as g,Qa as u,Rd as j,Za as b,d as v,i as y,ia as m,ma as k,na as x,oa as l,ya as a}from"./chunk-4HFZZ7HS.js";import{e as w}from"./chunk-SZAW6ZBW.js";function D(n){n||(d(D),n=a(u));let e=new v(t=>n.onDestroy(t.next.bind(t)));return t=>t.pipe(m(e))}function S(n,e){!e?.injector&&d(S);let t=e?.injector??a(g),s=new y(1),c=h(()=>{let r;try{r=n()}catch(i){f(()=>s.error(i));return}f(()=>s.next(r))},{injector:t,manualCleanup:!0});return t.get(u).onDestroy(()=>{c.destroy(),s.complete()}),s.asObservable()}function O(n,e){let t=!e?.manualCleanup;t&&!e?.injector&&d(O);let s=t?e?.injector?.get(u)??a(u):null,c=R(e?.equal),r;e?.requireSync?r=b({kind:0},{equal:c}):r=b({kind:1,value:e?.initialValue},{equal:c});let i=n.subscribe({next:o=>r.set({kind:1,value:o}),error:o=>{if(e?.rejectErrors)throw o;r.set({kind:2,error:o})}});if(e?.requireSync&&r().kind===0)throw new l(601,!1);return s?.onDestroy(i.unsubscribe.bind(i)),p(()=>{let o=r();switch(o.kind){case 1:return o.value;case 2:throw o.error;case 0:throw new l(601,!1)}},{equal:e?.equal})}function R(n=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&n(e.value,t.value)}var q=w(()=>{j();k();x();});export{D as a,S as b,O as c,q as d};
