import{a as S}from"./chunk-7ZFHDZI4.js";import{b as y,c as m}from"./chunk-5JDCLYZA.js";import{$ as h,R as c,ab as b,c as u,db as j,o as f,r as d,v as l}from"./chunk-FWZCAEAJ.js";function w(...e){let{normalizedSources:i,hasInitValue:r,operator:n,options:t}=z(e),p=S(w,t?.injector);return r?m(l(i).pipe(n),{initialValue:t.initialValue,injector:p}):m(l(i).pipe(n),{injector:p,requireSync:!0})}function z(e){if(!e||!e.length||typeof e[0]!="object")throw new TypeError("computedFrom needs sources");let i=typeof e[1]=="function";if(e.length==3&&!i)throw new TypeError("computedFrom needs pipeable operator as a second argument");i||e.splice(1,0,u);let[r,n,t]=e,p=t?.initialValue!==void 0;return{normalizedSources:Object.entries(r).reduce((s,[a,o])=>(b(o)?s[a]=y(o,{injector:t?.injector}).pipe(h(j(o))):d(o)?s[a]=o.pipe(c()):s[a]=f(o).pipe(c()),s),Array.isArray(r)?[]:{}),operator:n,hasInitValue:p,options:t}}export{w as a};
