import{Cb as P,Ib as p,Ja as D,Jc as L,Pa as $,Pb as I,R as d,a as C,ad as O,b as g,c as h,h as b,ha as V,hd as v,ka as S,l as R,ld as k,na as H,o as f,pb as j,qa as a,sb as o,u as M,ua as c,ub as E,va as l}from"./chunk-JTR2KOIV.js";import{a as m,b as y,e as F}from"./chunk-ECZWGI5G.js";function A(e){return e instanceof p}function q(e){return n=>e[n.type]?.(n)}function z(e){return f(e)?e:N(e)?M(B(e)):G(e)?R(e):new h(n=>{n.next(e)})}function G(e){return typeof e?.then=="function"}function N(e){return U(e)&&Object.keys(e).length>0&&Object.values(e).every(f)}function U(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function B(e){return Object.keys(e).reduce((n,t)=>y(m({},n),{[t]:e[t].pipe(d())}),{})}function J(e){let n=q(e),t=new b(1);return{nextPotentialObservable(i){t.next(i)},handlePotentialObservableChanges(){return t.pipe(d(),K(),d(Q),S(n))}}}function K(){return g(V(e=>{let n=z(e),t=!0,i=!0;return new h(s=>{let u=O(()=>n.subscribe({next(r){s.next({type:"next",value:r,reset:t,synchronous:i}),t=!1},error(r){s.next({type:"error",error:r,reset:t,synchronous:i}),t=!1},complete(){s.next({type:"complete",reset:t,synchronous:i}),t=!1}}));return t&&(s.next({type:"suspense",reset:t,synchronous:!0}),t=!1),i=!1,u})}))}function Q(e,n){return e.type!==n.type||e.reset!==n.reset?!1:n.type==="next"?e.value===n.value:n.type==="error"?e.error===n.error:!0}var x,Z,w,T,oe,W=F(()=>{"use strict";k();k();H();$();x=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=a({token:e,factory:()=>(()=>{let t=l(p);return A(t)?new w:l(Z)})(),providedIn:"root"})}}return e})(),Z=(()=>{class e extends x{constructor(t){super(),this.appRef=t,this.isScheduled=!1}schedule(){this.isScheduled||(this.isScheduled=!0,requestAnimationFrame(()=>{this.appRef.tick(),this.isScheduled=!1}))}static{this.\u0275fac=function(i){return new(i||e)(c(I))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})(),w=class extends x{schedule(){}},T=(()=>{class e{constructor(t,i){this.cdRef=t,this.tickScheduler=i}schedule(){this.cdRef.markForCheck(),this.tickScheduler.schedule()}static{this.\u0275fac=function(i){return new(i||e)(c(v),c(x))}}static{this.\u0275prov=a({token:e,factory:e.\u0275fac})}}return e})();oe=(()=>{class e{set ngrxLet(t){this.renderEventManager.nextPotentialObservable(t)}constructor(t,i,s,u){this.mainTemplateRef=t,this.viewContainerRef=i,this.errorHandler=s,this.renderScheduler=u,this.isMainViewCreated=!1,this.isSuspenseViewCreated=!1,this.viewContext={$implicit:void 0,ngrxLet:void 0,error:void 0,complete:!1},this.renderEventManager=J({suspense:()=>{this.viewContext.$implicit=void 0,this.viewContext.ngrxLet=void 0,this.viewContext.error=void 0,this.viewContext.complete=!1,this.renderSuspenseView()},next:r=>{this.viewContext.$implicit=r.value,this.viewContext.ngrxLet=r.value,r.reset&&(this.viewContext.error=void 0,this.viewContext.complete=!1),this.renderMainView(r.synchronous)},error:r=>{this.viewContext.error=r.error,r.reset&&(this.viewContext.$implicit=void 0,this.viewContext.ngrxLet=void 0,this.viewContext.complete=!1),this.renderMainView(r.synchronous),this.errorHandler.handleError(r.error)},complete:r=>{this.viewContext.complete=!0,r.reset&&(this.viewContext.$implicit=void 0,this.viewContext.ngrxLet=void 0,this.viewContext.error=void 0),this.renderMainView(r.synchronous)}}),this.subscription=new C}static ngTemplateContextGuard(t,i){return!0}ngOnInit(){this.subscription.add(this.renderEventManager.handlePotentialObservableChanges().subscribe())}ngOnDestroy(){this.subscription.unsubscribe()}renderMainView(t){this.isSuspenseViewCreated&&(this.isSuspenseViewCreated=!1,this.viewContainerRef.clear()),this.isMainViewCreated||(this.isMainViewCreated=!0,this.viewContainerRef.createEmbeddedView(this.mainTemplateRef,this.viewContext)),t||this.renderScheduler.schedule()}renderSuspenseView(){this.isMainViewCreated&&(this.isMainViewCreated=!1,this.viewContainerRef.clear()),this.suspenseTemplateRef&&!this.isSuspenseViewCreated&&(this.isSuspenseViewCreated=!0,this.viewContainerRef.createEmbeddedView(this.suspenseTemplateRef))}static{this.\u0275fac=function(i){return new(i||e)(o(j),o(E),o(D),o(T))}}static{this.\u0275dir=P({type:e,selectors:[["","ngrxLet",""]],inputs:{ngrxLet:"ngrxLet",suspenseTemplateRef:[0,"ngrxLetSuspenseTpl","suspenseTemplateRef"]},features:[L([T])]})}}return e})()});export{oe as a,W as b};
//# sourceMappingURL=chunk-E56FHLIJ.js.map
