import r from"@babel/runtime/helpers/toConsumableArray";import e from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/regenerator";import{MAX_WELL_NUMBER as n}from"../shared/constants.js";import{fetchByIdChunks as a}from"../shared/fetchers/fetchByIdChunks.js";import{buildMetricsQueryParams as s,fetchMetricsAggregate as o}from"./fetchMetricsAggregate.js";import{buildMudQueryParams as c,fetchMudAggregate as u}from"./fetchMudAggregate.js";var p=function(){var p=e(t.mark((function p(i,f,m,h){var l,b=arguments;return t.wrap((function(p){for(;;)switch(p.prev=p.next){case 0:return l=b.length>4&&void 0!==b[4]?b[4]:"corva/metrics",p.abrupt("return",a({ids:f,chunkSize:n,signal:h,fetcher:function(){var n=e(t.mark((function e(n,a){var p,f,h,b,v,d;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p=[],!((f=m.filter((function(r){return"mud_type"!==r}))).length>0)){e.next=14;break}return e.prev=3,h=s(i,n,f),e.next=7,o(h,a,l);case 7:b=e.sent,p.push.apply(p,r(b)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(3),console.error(e.t0);case 14:if(!m.includes("mud_type")){e.next=26;break}return e.prev=15,v=c(i,n),e.next=19,u(v,a);case 19:d=e.sent,p.push.apply(p,r(d)),e.next=26;break;case 23:e.prev=23,e.t1=e.catch(15),console.error(e.t1);case 26:return e.abrupt("return",p);case 27:case"end":return e.stop()}}),e,null,[[3,11],[15,23]])})));return function(r,e){return n.apply(this,arguments)}}()}));case 2:case"end":return p.stop()}}),p)})));return function(r,e,t,n){return p.apply(this,arguments)}}();export{p as fetchMetricsData};
//# sourceMappingURL=fetchMetricsData.js.map
