"use strict";var e=require("@babel/runtime/helpers/defineProperty"),t=require("lodash"),r=require("prop-types"),l=require("../../PadModeSelect/PadModeSelect.js"),n=require("../../../constants/completion.js"),a=require("../../../utils/completion.js"),i=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),c=o(r);function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,l)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){s.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var d=function(e){var r,o=e.fracFleet,c=e.wells,p=e.well,d=e.onSettingChange,f=e.appSettings,b=e.completionAppType,g=e.disableActiveWellsInPadSelect,y=e.enableSimulFracInPadSelect;if(p||t.isEmpty(c)||!o)return null;var P=f.padId,S=b||n.COMPLETION_APP_TYPES.fracMultiWellApp,O=a.getAssetKey(o,p,P),m=t.get(f,["settingsByAsset",O]),v=t.isEmpty(m)?a.getDefaultPadModeSetting(o,p,S,y):m,j=(null===(r=o.pad_frac_fleets.find((function(e){return e.current})))||void 0===r?void 0:r.frac_fleet_lines)||[];return i.jsx(l,{assets:c,completionAppType:S,disableActiveWellsInPadSelect:g,enableSimulFracInPadSelect:y,padModeSetting:v,fracFleetLines:j,onChange:function(e){return d("settingsByAsset",u(u({},t.get(f,"settingsByAsset",{})),{},s.default({},O,e)))}})};d.propTypes={appSettings:c.default.shape({padId:c.default.number}),completionAppType:c.default.string,fracFleet:c.default.shape({}),onSettingChange:c.default.func,well:c.default.shape({}),wells:c.default.arrayOf(c.default.shape()),disableActiveWellsInPadSelect:c.default.bool,enableSimulFracInPadSelect:c.default.bool},d.defaultProps={appSettings:{},completionAppType:void 0,fracFleet:void 0,onSettingChange:t.noop,well:void 0,wells:void 0,disableActiveWellsInPadSelect:!1,enableSimulFracInPadSelect:!1},module.exports=d;
