"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("@babel/runtime/helpers/asyncToGenerator"),r=require("@babel/runtime/regenerator"),a=require("../../../../clients/jsonApi/index.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=n(e),s=n(t),c=n(r);function o(){return(o=s.default(c.default.mark((function e(t){var r,n,u,s;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.wellId,n=t.stageNumber,u={},e.prev=2,e.next=5,a.getAppStorage("corva","completion.predictions",r,{query:"{stage_number#eq#".concat(n,"}"),sort:"{timestamp: -1}",limit:1});case 5:s=e.sent,u=s[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",u);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function i(){return(i=s.default(c.default.mark((function e(t){var r,n,s,o,i;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.wellId,n=t.stageNumber,s={},e.prev=2,e.next=5,a.getAppStorage("corva","completion.data.stages",r,{query:"{data.stage_number#eq#".concat(n,"}"),sort:"{timestamp: -1}",limit:1});case 5:o=e.sent,i=u.default(o,1),s=i[0],e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),console.error(e.t0);case 13:return e.abrupt("return",s);case 14:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}exports.fetchPredictionsData=function(e){return o.apply(this,arguments)},exports.fetchStagesData=function(e){return i.apply(this,arguments)};
//# sourceMappingURL=api.js.map
