import{b}from"./chunk-FVVYD7H6.js";import{a as C}from"./chunk-KZKY3ROD.js";import{m as $,p as N,x as o}from"./chunk-ZTKV4AIV.js";import{b as a}from"./chunk-5JDCLYZA.js";import{h as g}from"./chunk-73IMXZSJ.js";import{E as f,G as d,K as m,aa as u,bb as c,cb as S,ha as I,i as l,na as r,p as h,u as i,v as p}from"./chunk-FWZCAEAJ.js";var v="seId",D=(()=>{let t=class t{constructor(){this.httpClient=r(g),this.selectedOrganisationService=r(b),this.selectedIdChange=new l($(v)),this.selectedLoaded$=this.selectedIdChange.pipe(d(o),u(e=>p([this.selectedOrganisationService.selectedId$,this.httpClient.get(`/config/event/${e}`)])),i(([e,s])=>{if(e&&s.organisationId===e)return s;this.setSelected(void 0)}),m(()=>h(void 0))),this.selectedState=S({status:"UNSET"}),this.status=c(()=>this.selectedState().status),this.selectedId=c(()=>this.selectedState().selectedId),this.selected=c(()=>this.selectedState().selected),this.selectedId$=a(this.selectedId),this.selectedIdNotNull$=this.selectedId$.pipe(d(o)),this.selected$=a(this.selected),this.selectedNotNull$=this.selected$.pipe(d(o)),C(this.selectedState,f(this.selectedIdChange.pipe(i(e=>({selectedId:e,selected:void 0,status:e?"LOADING":"UNSET"}))),this.selectedLoaded$.pipe(i(e=>({selected:e,status:e?"LOADED":"UNSET"})))))}setSelected(e){N(v,e),this.selectedIdChange.next(e)}};t.\u0275fac=function(s){return new(s||t)},t.\u0275prov=I({token:t,factory:t.\u0275fac,providedIn:"root"});let n=t;return n})();export{v as a,D as b};
