import{d as $,l as k,m as U,q as V,s as h}from"./chunk-QZAKNZ5J.js";import{Ga as D,J as b,La as E,O as l,Oa as i,Q as v,Qa as a,Ra as f,Va as _,Y as m,Z as p,a as d,ab as N,ba as y,ca as F,fa as O,ga as C,ja as A,ma as w,ob as P,p as M,pa as S,s as j,sa as x}from"./chunk-WNE7PXNE.js";function X(t){return F(e=>{let r=t(e),n=Array.isArray(r)?r:[r];return b(e).pipe(D(...n))})}var Z={dispatch:!0,functional:!1,useEffectsErrorHandler:!0},g="__@ngrx/effects_create__";function zt(t,e={}){let r=e.functional?t:t(),n=d(d({},Z),e);return Object.defineProperty(r,g,{value:n}),r}function q(t){return Object.getOwnPropertyNames(t).filter(n=>t[n]&&t[n].hasOwnProperty(g)?t[n][g].hasOwnProperty("dispatch"):!1).map(n=>{let o=t[n][g];return d({propertyName:n},o)})}function Q(t){return q(t)}function z(t){return Object.getPrototypeOf(t)}function W(t){return!!t.constructor&&t.constructor.name!=="Object"&&t.constructor.name!=="Function"}function G(t){return typeof t=="function"}function tt(t){return t.filter(G)}function et(t,e,r){let n=z(t),u=!!n&&n.constructor.name!=="Object"?n.constructor.name:null,s=Q(t).map(({propertyName:c,dispatch:L,useEffectsErrorHandler:K})=>{let R=typeof t[c]=="function"?t[c]():t[c],T=K?r(R,e):R;return L===!1?T.pipe(C()):T.pipe(x()).pipe(l(Y=>({effect:t[c],notification:Y,propertyName:c,sourceName:u,sourceInstance:t})))});return m(...s)}var nt=10;function H(t,e,r=nt){return t.pipe(y(n=>(e&&e.handleError(n),r<=1?t:H(t,e,r-1))))}var Gt=(()=>{let e=class e extends M{constructor(n){super(),n&&(this.source=n)}lift(n){let o=new e;return o.source=this,o.operator=n,o}};e.\u0275fac=function(o){return new(o||e)(a(V))},e.\u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Ht(...t){return p(e=>t.some(r=>typeof r=="string"?r===e.type:r.type===e.type))}var Bt=new i("@ngrx/effects Internal Root Guard"),Lt=new i("@ngrx/effects User Provided Effects"),Kt=new i("@ngrx/effects Internal Root Effects"),Yt=new i("@ngrx/effects Internal Root Effects Instances"),Jt=new i("@ngrx/effects Internal Feature Effects"),Xt=new i("@ngrx/effects Internal Feature Effects Instance Groups"),rt=new i("@ngrx/effects Effects Error Handler",{providedIn:"root",factory:()=>H}),ot="@ngrx/effects/init",st=$(ot);function it(t,e){if(t.notification.kind==="N"){let r=t.notification.value;!ct(r)&&e.handleError(new Error(`Effect ${ft(t)} dispatched an invalid action: ${ut(r)}`))}}function ct(t){return typeof t!="function"&&t&&t.type&&typeof t.type=="string"}function ft({propertyName:t,sourceInstance:e,sourceName:r}){let n=typeof e[t]=="function";return!!r?`"${r}.${String(t)}${n?"()":""}"`:`"${String(t)}()"`}function ut(t){try{return JSON.stringify(t)}catch{return t}}var at="ngrxOnIdentifyEffects";function dt(t){return I(t,at)}var lt="ngrxOnRunEffects";function pt(t){return I(t,lt)}var Et="ngrxOnInitEffects";function ht(t){return I(t,Et)}function I(t,e){return t&&e in t&&typeof t[e]=="function"}var B=(()=>{let e=class e extends j{constructor(n,o){super(),this.errorHandler=n,this.effectsErrorHandler=o}addEffects(n){this.next(n)}toActions(){return this.pipe(S(n=>W(n)?z(n):n),v(n=>n.pipe(S(gt))),v(n=>{let o=n.pipe(w(s=>vt(this.errorHandler,this.effectsErrorHandler)(s)),l(s=>(it(s,this.errorHandler),s.notification)),p(s=>s.kind==="N"&&s.value!=null),A()),u=n.pipe(O(1),p(ht),l(s=>s.ngrxOnInitEffects()));return m(o,u)}))}};e.\u0275fac=function(o){return new(o||e)(a(P),a(rt))},e.\u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function gt(t){return dt(t)?t.ngrxOnIdentifyEffects():""}function vt(t,e){return r=>{let n=et(r,t,e);return pt(r)?r.ngrxOnRunEffects(n):n}}var mt=(()=>{let e=class e{get isStarted(){return!!this.effectsSubscription}constructor(n,o){this.effectSources=n,this.store=o,this.effectsSubscription=null}start(){this.effectsSubscription||(this.effectsSubscription=this.effectSources.toActions().subscribe(this.store))}ngOnDestroy(){this.effectsSubscription&&(this.effectsSubscription.unsubscribe(),this.effectsSubscription=null)}};e.\u0275fac=function(o){return new(o||e)(a(B),a(h))},e.\u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"});let t=e;return t})();function Zt(...t){let e=t.flat(),r=tt(e);return N([r,{provide:_,multi:!0,useValue:()=>{f(k),f(U,{optional:!0});let n=f(mt),o=f(B),u=!n.isStarted;u&&n.start();for(let s of e){let c=G(s)?f(s):s;o.addEffects(c)}u&&f(h).dispatch(st())}}])}export{X as a,zt as b,Gt as c,Ht as d,Zt as e};