import{a as h}from"./chunk-IFY4UZPR.js";import{p}from"./chunk-JBWPPKX4.js";import{a as f}from"./chunk-7N232KV6.js";import{i as m}from"./chunk-NDLDFKR2.js";import{$ as c,K as a,fa as o,ka as s}from"./chunk-PVUKHE45.js";import{a as n}from"./chunk-MZPAXKJS.js";var u=(()=>{let i=class i{constructor(t,e){this._http=t,this._store=e}get(){return this._http.post("/api/characteristic/all",{},{headers:f}).pipe(c(t=>{this._store.dispatch(new h({characteristics:[...t]}))}))}getById(t){return this._http.get(`/api/characteristic/${t}`)}create(t){return this._http.post("/api/characteristic",n({},t))}edit(t,e){return this._http.put(`/api/characteristic/${e}`,n({},t))}delete(t){return this._http.delete(`/api/characteristic/${t}`)}};i.\u0275fac=function(e){return new(e||i)(s(m),s(p))},i.\u0275prov=o({token:i,factory:i.\u0275fac});let r=i;return r})();var k=(()=>{let i=class i{constructor(t,e){this._characteristicService=t,this._store=e}get(){return this._characteristicService.get().pipe(a(1),c(t=>{this._store.dispatch(new h({characteristics:[...t.sort((e,d)=>d.id-e.id)]}))}))}create(t){return this._characteristicService.create(t).pipe(c(()=>this.get().subscribe()),a(1))}edit(t,e){return this._characteristicService.edit(t,e).pipe(c(()=>this.get().subscribe()),a(1))}delete(t){return this._characteristicService.delete(t).pipe(c(()=>this.get().subscribe()),a(1))}};i.\u0275fac=function(e){return new(e||i)(s(u),s(p))},i.\u0275prov=o({token:i,factory:i.\u0275fac});let r=i;return r})();export{u as a,k as b};
//# sourceMappingURL=chunk-BWK7J3OT.js.map
