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