import{ca as d,k as a,l}from"./chunk-LVXYIJUI.js";var r=(()=>{class s{constructor(){this.cleanScannedItemSubject=new a,this.cleanScannedItem$=this.cleanScannedItemSubject.asObservable(),this.existingFlagsSubject=new l([]),this.existingFlags$=this.existingFlagsSubject.asObservable(),this.newlyAddedFlagsSubject=new l([]),this.newlyAddedFlags$=this.newlyAddedFlagsSubject.asObservable(),this.newFlagAddedSubject=new a,this.newFlagAdded$=this.newFlagAddedSubject.asObservable(),this.handleFlagsSubject=new a,this.handleFlags$=this.handleFlagsSubject.asObservable(),this.variableChargesAddedSubject=new a,this.variableChargesAdded$=this.variableChargesAddedSubject.asObservable(),this.screenWidgetsList=[]}setCleanScannedItem(e){if(e){let t=e?.customerID;this.customerChanged=this.lastCustomerID!==t,this.customerChanged&&(this.lastCustomerID=t)}this.cleanScannedItem=e,this.cleanScannedItemSubject.next()}getCleanScannedItem(){return this.cleanScannedItem}setExistingFlags(e){this.existingFlagsSubject.next([...e])}addNewFlag(e){let t=this.newlyAddedFlagsSubject.getValue();this.newlyAddedFlagsSubject.next([...t,e])}removeNewlyAddedFlag(e){let n=this.newlyAddedFlagsSubject.getValue().filter(i=>!this.isSameFlag(i.uniqueItemFlag,e));this.newlyAddedFlagsSubject.next(n)}removeNewlyAddedFlags(){this.newlyAddedFlagsSubject.next([])}removeExistingFlag(e){let n=this.existingFlagsSubject.getValue().filter(i=>!this.isSameFlag(i.uniqueItemFlag,e));this.existingFlagsSubject.next(n)}isSameFlag(e,t){return e.flag.id===t.flag.id}newFlagAdded(){this.newFlagAddedSubject.next()}handleFlags(e){this.handleFlagsSubject.next(e)}variableChargesAdded(){this.variableChargesAddedSubject.next()}hasCustomerChanged(){return this.customerChanged}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=d({token:s,factory:s.\u0275fac})}}return s})();export{r as a};
