-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchunk-KFOOQGOY.js
1 lines (1 loc) · 1020 Bytes
/
chunk-KFOOQGOY.js
1
import{Ac as d,Bc as v,Ca as f,Ea as u,Y as h,_ as p,ga as c,h as b,hb as l,m as y,ua as a,zc as g}from"./chunk-DXS2GHCC.js";function m(r){r||(a(m),r=c(u));let e=new b(t=>r.onDestroy(t.next.bind(t)));return t=>t.pipe(h(e))}function w(r,e){!e?.injector&&a(w);let t=e?.injector??c(f),s=new y(1),o=v(()=>{let i;try{i=r()}catch(n){d(()=>s.error(n));return}d(()=>s.next(i))},{injector:t,manualCleanup:!0});return t.get(u).onDestroy(()=>{o.destroy(),s.complete()}),s.asObservable()}function j(r,e){let t=!e?.manualCleanup;t&&!e?.injector&&a(j);let s=t?e?.injector?.get(u)??c(u):null,o;e?.requireSync?o=l({kind:0}):o=l({kind:1,value:e?.initialValue});let i=r.subscribe({next:n=>o.set({kind:1,value:n}),error:n=>{if(e?.rejectErrors)throw n;o.set({kind:2,error:n})}});return s?.onDestroy(i.unsubscribe.bind(i)),g(()=>{let n=o();switch(n.kind){case 1:return n.value;case 2:throw n.error;case 0:throw new p(601,"`toSignal()` called with `requireSync` but `Observable` did not emit synchronously.")}})}export{m as a,w as b,j as c};