import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{getAppStorage as n}from"../../../../clients/jsonApi/index.js";function a(e){return o.apply(this,arguments)}function o(){return(o=r(t.mark((function e(r){var a,o,s,c;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=r.wellId,o=r.stageNumber,s={},e.prev=2,e.next=5,n("corva","completion.predictions",a,{query:"{stage_number#eq#".concat(o,"}"),sort:"{timestamp: -1}",limit:1});case 5:c=e.sent,s=c[0].data,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),console.error(e.t0);case 12:return e.abrupt("return",s);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function s(e){return c.apply(this,arguments)}function c(){return(c=r(t.mark((function r(a){var o,s,c,i,u;return t.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=a.wellId,s=a.stageNumber,c={},r.prev=2,r.next=5,n("corva","completion.data.stages",o,{query:"{data.stage_number#eq#".concat(s,"}"),sort:"{timestamp: -1}",limit:1});case 5:i=r.sent,u=e(i,1),c=u[0],r.next=13;break;case 10:r.prev=10,r.t0=r.catch(2),console.error(r.t0);case 13:return r.abrupt("return",c);case 14:case"end":return r.stop()}}),r,null,[[2,10]])})))).apply(this,arguments)}export{a as fetchPredictionsData,s as fetchStagesData};
