import{q as x,r as p,s as l}from"./chunk-7WGMNLRJ.js";import{ga as n}from"./chunk-I3FGJX2C.js";import{d as a,n as m}from"./chunk-INB5GR2I.js";import{a as b,b as i}from"./chunk-B7YGBANW.js";var C=(()=>{let e=class e{constructor(h){this.cashboxes=h}};e.type="[Cashboxes] Set Cashboxes";let t=e;return t})(),u=(()=>{let e=class e{constructor(h){this.cashbox=h}};e.type="[Cashboxes] Set Cashbox";let t=e;return t})(),d=(()=>{let e=class e{constructor(h,r){this.cashboxId=h,this.settings=r}};e.type="[Cashboxes] Update Cashbox Settings";let t=e;return t})(),S=(()=>{let e=class e{};e.type="[Cashboxes] Clear Cashboxes";let t=e;return t})();m();var s,c=(s=class{static cashboxes(e){return e.cashboxes}static selectedCashbox(e){return e.selectedCashboxes}setCashboxes(e,o){e.setState({cashboxes:o.cashboxes,selectedCashboxes:e.getState().selectedCashboxes})}setSelectedCashbox(e,o){e.setState({selectedCashboxes:o.cashbox,cashboxes:e.getState().cashboxes})}updateCashboxSettings(e,o){let h=e.getState().cashboxes.map(r=>r.id===o.cashboxId?i(b({},r),{settings:o.settings}):r);e.patchState({cashboxes:h})}clearCashboxes(e){e.setState({cashboxes:[],selectedCashboxes:null})}},s.\u0275fac=function(o){return new(o||s)},s.\u0275prov=n({token:s,factory:s.\u0275fac}),s);a([x(C)],c.prototype,"setCashboxes",null);a([x(u)],c.prototype,"setSelectedCashbox",null);a([x(d)],c.prototype,"updateCashboxSettings",null);a([x(S)],c.prototype,"clearCashboxes",null);a([l()],c,"cashboxes",null);a([l()],c,"selectedCashbox",null);c=a([p({name:"cashboxes",defaults:{cashboxes:[],selectedCashboxes:null}})],c);export{C as a,d as b,c};
//# sourceMappingURL=chunk-J7KKTDSX.js.map
