import{g as r,ga as o}from"./chunk-NW2U37DI.js";import{a as s,b as c}from"./chunk-TWZW5B45.js";var b=(()=>{class a{constructor(){this.dynamicListSubject=new r(void 0),this.updateData=new r(null)}triggerSidemenuUpdate(){this.updateData.next("true")}getUpdatedState(){return this.updateData.asObservable()}setDynamicList(t){this.dynamicListSubject.next(t)}getDynamicListObservable(){return this.dynamicListSubject.asObservable()}formatTime(t){let i=new Date(t),e=i.getHours(),n=i.getMinutes(),u=e>=12?" PM":" AM",d=e%12===0?12:e%12,l=n<10?"0"+n:n;return`${d}:${l}${u}`}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();var S=(()=>{class a{constructor(){this.dataSubject=new r({dataUpdate:null,typing:null,conversationUpdate:null,writing:[]}),this.data$=this.dataSubject.asObservable()}sidemenuUpdate(t){}updateWriting(t){let i=this.dataSubject.value,e=this.dataSubject.value?.writing,n=e.findIndex(u=>u.userId===t.userId);n!==-1?e[n]=t:e.push(t),this.dataSubject.next(c(s({},i),{conversationUpdate:{livechatdata:{}},writing:e}))}removeWriting(t){let i=this.dataSubject.value,e=this.dataSubject.value?.writing;e=e.filter(n=>n.userId!=t),this.dataSubject.next(c(s({},i),{conversationUpdate:{livechatdata:{}},writing:e}))}clearWriting(){let t=this.dataSubject.value;this.dataSubject.next(c(s({},t),{conversationUpdate:{livechatdata:{}},writing:[]}))}static{this.\u0275fac=function(i){return new(i||a)}}static{this.\u0275prov=o({token:a,factory:a.\u0275fac,providedIn:"root"})}}return a})();export{b as a,S as b};
