import{a as f}from"./chunk-P5XIDEFS.js";import{a as d}from"./chunk-PDYJ5OYY.js";import{i as m}from"./chunk-CO3WTSA4.js";import{I as n,ea as c,ja as s,q as o}from"./chunk-DYUFV4HF.js";import{a as u}from"./chunk-B7YGBANW.js";var h=(()=>{let r=class r{constructor(t){this._http=t}createNewDraftDocument(t,e=!1){if(e){let i=f.append(d.SkipTimeout,"skipTimeout");return this._http.post("/api/draft-document",u({},t),{headers:i})}return this._http.post("/api/draft-document",u({},t))}getDraftDocumentById(t){return this._http.get(`/api/draft-document/${t}`).pipe(o(e=>(e.body=JSON.parse(e.jsonBody),e)))}editDraftDocument(t,e,i=!1){if(i){let p=f.append(d.SkipTimeout,"skipTimeout");return this._http.put(`/api/draft-document/${t}`,e,{headers:p})}return this._http.put(`/api/draft-document/${t}`,e)}deleteDraftDocument(t){return this._http.delete(`/api/draft-document/${t}`)}getAllDraftDocuments(t,e){return this._http.post(`/api/draft-document/all?documentType=${t.documentType}&warehouseId=${t.warehouseId}`,e,{headers:f})}};r.\u0275fac=function(e){return new(e||r)(s(m))},r.\u0275prov=c({token:r,factory:r.\u0275fac});let a=r;return a})();var b=(()=>{let r=class r{constructor(t){this._draftServiceApi=t}getDrafts(t,e){return this._draftServiceApi.getAllDraftDocuments(t,e).pipe(o(i=>(i.data.forEach(p=>p.body=JSON.parse(p.jsonBody)),i)),n(1))}createDraft(t,e=!1){return this._draftServiceApi.createNewDraftDocument(t,e)}getDraftById(t){return this._draftServiceApi.getDraftDocumentById(t).pipe(o(e=>(e.body=JSON.parse(e.jsonBody),e)),n(1))}editDraft(t,e,i=!1){return this._draftServiceApi.editDraftDocument(t,e,i).pipe(n(1))}deleteDraft(t){return this._draftServiceApi.deleteDraftDocument(t).pipe(n(1))}};r.\u0275fac=function(e){return new(e||r)(s(h))},r.\u0275prov=c({token:r,factory:r.\u0275fac});let a=r;return a})();export{h as a,b};
//# sourceMappingURL=chunk-3RIFUK73.js.map
