import r from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/regenerator";import{ID_CHUNK_SIZE as t,ASSET_FIELDS as n,CHUNK_SIZE as a}from"../constants.js";import{transformAssetToOffsetWell as s}from"../transformers/transformAssetToOffsetWell.js";import{fetchDataByChunks as o}from"./fetchDataByChunks.js";import{assetsFetcher as u}from"./assetsFetcher.js";var i=function(){var i=r(e.mark((function r(i,p){var c,f,m,l;return e.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==i.length){r.next=2;break}return r.abrupt("return",[]);case 2:for(r.prev=2,c=[],f=0;f<i.length;f+=t)c.push(i.slice(f,f+t));return r.next=7,Promise.all(c.map((function(r){return o({path:"/v2/assets",queryParams:{ids:r,types:["well"],company_id:p&&p.length>0?p:void 0,fields:n,sort:"name"},chunkSize:a,paginationStyle:"page",fetcher:u})})));case 7:return m=r.sent,l=m.flat(),r.abrupt("return",l.map((function(r){return s(r)})));case 12:return r.prev=12,r.t0=r.catch(2),console.error(r.t0),r.abrupt("return",[]);case 16:case"end":return r.stop()}}),r,null,[[2,12]])})));return function(r,e){return i.apply(this,arguments)}}();export{i as getAssetsByIds};
//# sourceMappingURL=getAssetsByIds.js.map
