import{__awaiter as e,__generator as t}from'./../ext-esm/tslib/tslib.es6.js';import{useState as r,useEffect as s}from"react";import{getAsset as i}from"../clients/jsonApi/index.js";function n(r){return e(this,void 0,void 0,(function(){var e,s,n,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,i(r,{fields:["asset.custom_properties"]})];case 1:return e=t.sent(),[2,(null===(o=null===(n=e.data.attributes)||void 0===n?void 0:n.custom_properties)||void 0===o?void 0:o.is_asset_viewer)||!1];case 2:return s=t.sent(),console.error(s),[2,!1];case 3:return[2]}}))}))}var o=function(i){var o=i.well,u=i.wells,a=r(null),l=a[0],c=a[1];return s((function(){!function(){e(this,void 0,void 0,(function(){var e,r;return t(this,(function(t){switch(t.label){case 0:return e=c,o?[4,n(o.asset_id)]:[3,2];case 1:return r=t.sent(),[3,3];case 2:r=u.some((function(e){var t;return null===(t=e.custom_properties)||void 0===t?void 0:t.is_asset_viewer})),t.label=3;case 3:return e.apply(void 0,[r]),[2]}}))}))}()}),[o,u]),l};export{o as default};
