import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/regenerator";import{keyToTile as t,tileToBounds as n}from"../../utils/tile-math.js";import{getAssetsByBounds as a}from"../../api/shared/fetchers/getAssetsByBounds.js";var s=function(){var s=e(r.mark((function e(s){var i,o,l,c,u,p,m,f,d,h,b,g;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.tileKey,o=s.companyIds,l=s.drillingWells,c=s.addWellsUsabilityInfo,u=s.setCachedTile,p=s.addWellsToTile,m=s.setTileStatus,e.prev=1,m(i,"loading"),f=t(i),d=n(f),e.next=7,a(d,o,{drillingWells:l});case 7:if(!((h=e.sent).length>0)){e.next=14;break}return e.next=11,c(h);case 11:e.t0=e.sent,e.next=15;break;case 14:e.t0=[];case 15:b=e.t0,u(i,b.map((function(e){return e.id}))),p(i,b),e.next=24;break;case 20:e.prev=20,e.t1=e.catch(1),g=e.t1 instanceof Error?e.t1.message:"Unknown error",m(i,"error",g);case 24:case"end":return e.stop()}}),e,null,[[1,20]])})));return function(e){return s.apply(this,arguments)}}();export{s as fetchTile};
//# sourceMappingURL=fetchTile.js.map
