"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("lodash"),e=require("../constants/completion.js"),a=require("../constants/streamSourceType.js");exports.getAssetKey=function(t,e,a){return a?"pad--".concat(a):t?"pad--".concat(t.current_pad_id||a):e?"well--".concat(e.id):"common"},exports.getDefaultPadModeSetting=function(t,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.COMPLETION_APP_TYPES.fracMultiWellApp,s={};return t?s={mode:e.COMPLETION_APPTYPE_MODES_DICT[r][0],selectedLine:void 0}:a&&(s={mode:"custom",selectedAssets:[a.id]}),s},exports.resolveActiveFracAsset=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.reduce((function(e,s){var n=(s.app_streams||[]).find((function(t){return t.source_type===a.STREAM_SOURCE_TYPES.FRAC&&(r||t.status===a.STREAM_STATUS.ACTIVE)}));return!n||!n.last_active_at||e&&e.last_frac_at>n.last_active_at?e:t.set(s,"last_frac_at",n.last_active_at)}),null)},exports.resolveActivePumpdownAsset=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.reduce((function(e,s){var n=(s.app_streams||[]).find((function(t){return t.source_type===a.STREAM_SOURCE_TYPES.PUMPDOWN&&(r||t.status===a.STREAM_STATUS.ACTIVE)}));return!n||e&&e.last_pumpdown_at>n.last_active_at?e:t.set(s,"last_pumpdown_at",n.last_active_at)}),null)},exports.resolveActiveWirelineAsset=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.reduce((function(e,s){var n=(s.app_streams||[]).find((function(t){return t.source_type===a.STREAM_SOURCE_TYPES.WIRELINE&&(r||t.status===a.STREAM_STATUS.ACTIVE)}));return!n||!n.last_active_at||e&&e.last_wireline_at>n.last_active_at?e:t.set(s,"last_wireline_at",n.last_active_at)}),null)};
//# sourceMappingURL=completion.js.map
