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