import{ca as i,k as a,l}from"./chunk-BXH3QC5E.js";var g=(()=>{class s{soilItemScannedSubject=new a;soilItemScanned$=this.soilItemScannedSubject.asObservable();existingFlagsSubject=new l([]);existingFlags$=this.existingFlagsSubject.asObservable();newlyAddedFlagsSubject=new l([]);newlyAddedFlags$=this.newlyAddedFlagsSubject.asObservable();newFlagAddedSubject=new a;newFlagAdded$=this.newFlagAddedSubject.asObservable();handleFlagsSubject=new a;handleFlags$=this.handleFlagsSubject.asObservable();scanningWorkCollectedTodaySubject=new l(!1);scanningWorkCollectedToday$=this.scanningWorkCollectedTodaySubject.asObservable();variableChargesUpdatedSubject=new a;variableChargesUpdated$=this.variableChargesUpdatedSubject.asObservable();variableChargesRemovedSubject=new a;variableChargesRemoved$=this.variableChargesRemovedSubject.asObservable();soilScannedItem;previousAcceptedScannedItem;lastCustomerID;customerChanged;screenWidgetsList=[];setSoilScannedItem(e){if(e)if(e.customerID){let t=e.customerID;this.customerChanged=this.lastCustomerID!==t,this.customerChanged&&(this.lastCustomerID=t)}else this.customerChanged=!1,this.lastCustomerID=-1;else this.customerChanged=!1;this.soilScannedItem=e,this.soilItemScannedSubject.next()}getSoilScannedItem(){return this.soilScannedItem}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(d=>!this.isSameFlag(d.uniqueItemFlag,e));this.newlyAddedFlagsSubject.next(n)}removeNewlyAddedFlags(){this.newlyAddedFlagsSubject.next([])}removeExistingFlag(e){let n=this.existingFlagsSubject.getValue().filter(d=>!this.isSameFlag(d.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)}setWorkCollectedToday(e){this.scanningWorkCollectedTodaySubject.next(e)}isWorkCollectedToday(){return this.scanningWorkCollectedTodaySubject.getValue()}variableChargesUpdated(){this.variableChargesUpdatedSubject.next()}hasCustomerChanged(){return this.customerChanged}variableChargesRemoved(){this.variableChargesRemovedSubject.next()}static \u0275fac=function(t){return new(t||s)};static \u0275prov=i({token:s,factory:s.\u0275fac})}return s})();export{g as a};
