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