import r from"@babel/runtime/helpers/slicedToArray";import e from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/regenerator";import{groupBy as i}from"lodash";import{fetchWellsByIds as s}from"../../../../api/wells/fetchWellsByIds.js";import"@babel/runtime/helpers/toConsumableArray";import"uuid";import"lodash/set";import"lodash/get";import"lodash/unset";import"moment";import"../../../../../../clients/jsonApi/index.js";import"../../../../../../clients/subscriptions/constants.js";import"../../../../../../clients/subscriptions.v1.js";import"../../../../../../clients/subscriptions/subscriptions-client.factory.js";import"../../../../../../clients/api/apiCore.js";import"../../../../../../clients/constants.js";import"../../../../../../clients/sso/auth0.js";import"../../../../../../clients/sso/oauth2.js";import"../../../../../../clients/api/rateLimiter.js";import{fetchWellsByRigIds as o}from"../../../../api/wells/fetchWellsByRigIds.js";import"../../../../constants.js";import"../../../../api/shared/dataFormatter.js";import{WELL_PROPERTY_FILTER_KEYS as u}from"../../../../utils/doesWellPassFilters.js";export{EXCLUDE_RIG_NAME_FILTER,doesWellPassFilters}from"../../../../utils/doesWellPassFilters.js";function a(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function c(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){e(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}var p=5,l=function(r){return Number.isFinite(Number(r))},m=function(r){return Object.entries(i(r,"type"))},f=function(r){return!!r&&(!!u.some((function(e){var t=r[e];return Array.isArray(t)&&t.length>0}))||(!!r.sideTracks||(!!r.drillingWells||(!(!r.period||"all"===r.period)||(Number.isFinite(r.timeRangeFrom)||Number.isFinite(r.timeRangeTo))))))},b=function(){var r=t(n.mark((function r(e,t){var s,u;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==e.length){r.next=2;break}return r.abrupt("return",new Map);case 2:return r.next=4,o(e,t);case 4:return s=r.sent,u=i(s.filter((function(r){return l(null==r?void 0:r.rigId)})),(function(r){return Number(r.rigId)})),r.abrupt("return",new Map(e.map((function(r){return[r,u[r]||[]]}))));case 7:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),d=function(){var r=t(n.mark((function r(e){var t;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==e.length){r.next=2;break}return r.abrupt("return",new Map);case 2:return r.next=4,s(e);case 4:return t=r.sent,r.abrupt("return",new Map(t.filter((function(r){return l(null==r?void 0:r.id)})).map((function(r){return[Number(r.id),r]}))));case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),h=function(r,e,t){if(0===e.length)return c(c({},r),{},{checked:!1,disabledReason:"This rig has no wells"});var n=e.filter((function(r){return t.includes(r.id)})).length,i=n===e.length,s=n>0;return c(c({},r),{},{checked:s,indeterminate:s&&!i})},j=function(e){return e.reduce((function(e,t){return e+r(t,2)[1].length}),0)};export{p as MAX_EMPTY_PAGES,h as computeRigCheckedState,j as countFilteredItems,b as fetchRigWellsMap,d as fetchWellDataMap,m as groupByType,f as hasActiveWellFilters,l as isFiniteNumber};
//# sourceMappingURL=useAssetsData.utils.js.map
