import{a as m}from"./chunk-BF44ZR3M.js";import{a as h}from"./chunk-PDYJ5OYY.js";import{d as o,i as l}from"./chunk-NDLDFKR2.js";import{K as p,fa as a,ka as n}from"./chunk-PVUKHE45.js";import{a as u}from"./chunk-MZPAXKJS.js";var s=(function(e){return e[e.None=0]="None",e[e.RongtaRLS1000=1]="RongtaRLS1000",e[e.MassaK=2]="MassaK",e[e.Mertech=3]="Mertech",e[e.Shtrich=4]="Shtrich",e})(s||{}),c=(function(e){return e[e.Ethernet=0]="Ethernet",e[e.SerialPort=1]="SerialPort",e})(c||{}),S={[s.None]:"\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043C\u043E\u0434\u0435\u043B\u044C",[s.MassaK]:"\u041C\u0430\u0441\u0441\u0430-\u041A",[s.RongtaRLS1000]:"Rongta RLS1000",[s.Mertech]:"Mertech (CAS-M)",[s.Shtrich]:"\u0428\u0422\u0420\u0418\u0425-\u041F\u0420\u0418\u041D\u0422"};var d=(()=>{let r=class r{constructor(t){this._http=t,this.apiUrl=m.apiURL}getAll(){let t=new o().append(h.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales`,{headers:t})}add(t){return this._http.post(`${this.apiUrl}/api/scales`,t)}edit(t,i){return this._http.put(`${this.apiUrl}/api/scales/${t}`,i)}delete(t){return this._http.delete(`${this.apiUrl}/api/scales/${t}`)}getById(t){let i=new o().append(h.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales/${t}`,{headers:i})}getWeightScale(t){let i=new o().append(h.SkipError,"skipError");return this._http.get(`${this.apiUrl}/api/scales/${t}/weight`,{headers:i})}uploadPLU(t,i){return this._http.post(`${this.apiUrl}/api/scales/${t}/upload-plu`,u({},i))}};r.\u0275fac=function(i){return new(i||r)(n(l))},r.\u0275prov=a({token:r,factory:r.\u0275fac});let e=r;return e})();var y=(()=>{let r=class r{constructor(t){this._scalesServiceApi=t}getScales(){return this._scalesServiceApi.getAll().pipe(p(1))}uploadPlu(t,i){return this._scalesServiceApi.uploadPLU(t,i).pipe(p(1))}add(t){return this._scalesServiceApi.add(t).pipe(p(1))}edit(t,i){return this._scalesServiceApi.edit(t,i).pipe(p(1))}delete(t){return this._scalesServiceApi.delete(t).pipe(p(1))}getById(t){return this._scalesServiceApi.getById(t).pipe(p(1))}getWeightScale(t){return this._scalesServiceApi.getWeightScale(t).pipe(p(1))}convertScaleFormToScaleRequest(t){return{name:t.name,model:t.model,type:t.type,ethernetScale:t.type===c.Ethernet?{ipAddress:t.ipAddress,port:t.port}:null,serialPortScale:t.type===c.SerialPort?{portName:t.portName,baudRate:t.baudRate}:null}}};r.\u0275fac=function(i){return new(i||r)(n(d))},r.\u0275prov=a({token:r,factory:r.\u0275fac});let e=r;return e})();export{s as a,c as b,S as c,d,y as e};
//# sourceMappingURL=chunk-L7O7AEGM.js.map
