@corva/ui 3.83.0-8 → 3.83.0-9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/DevCenter/AppHeader/PadMode.js +1 -1
- package/cjs-bundle/components/DevCenter/AppHeader/PadMode.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/constants.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/constants.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
- package/cjs-bundle/components/DevCenter/AppsDataProvider/effects/useAppsData.js.map +1 -1
- package/cjs-bundle/components/PadModeSelect/effects/useMenuItems.js +1 -1
- package/cjs-bundle/components/PadModeSelect/effects/useMenuItems.js.map +1 -1
- package/cjs-bundle/componentsV2/AppHeader/PadMode/PadMode.js +1 -1
- package/cjs-bundle/componentsV2/AppHeader/PadMode/PadMode.js.map +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/utils/useMenuItems.js +1 -1
- package/cjs-bundle/componentsV2/PadModeSelect/utils/useMenuItems.js.map +1 -1
- package/cjs-bundle/constants/completion.js +1 -1
- package/cjs-bundle/constants/completion.js.map +1 -1
- package/components/DevCenter/AppHeader/PadMode.d.ts.map +1 -1
- package/components/DevCenter/AppHeader/PadMode.js +1 -1
- package/components/DevCenter/AppHeader/PadMode.js.map +1 -1
- package/components/DevCenter/AppHeader/__tests__/PadMode.test.d.ts +2 -0
- package/components/DevCenter/AppHeader/__tests__/PadMode.test.d.ts.map +1 -0
- package/components/DevCenter/AppsDataProvider/effects/constants.d.ts +1 -1
- package/components/DevCenter/AppsDataProvider/effects/constants.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/constants.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/constants.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/dataResolvers.js.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.d.ts.map +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.js +1 -1
- package/components/DevCenter/AppsDataProvider/effects/useAppsData.js.map +1 -1
- package/components/PadModeSelect/effects/useMenuItems.d.ts.map +1 -1
- package/components/PadModeSelect/effects/useMenuItems.js +1 -1
- package/components/PadModeSelect/effects/useMenuItems.js.map +1 -1
- package/componentsV2/AppHeader/PadMode/PadMode.d.ts.map +1 -1
- package/componentsV2/AppHeader/PadMode/PadMode.js +1 -1
- package/componentsV2/AppHeader/PadMode/PadMode.js.map +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.js +1 -1
- package/componentsV2/PadModeSelect/PadModeSelect.js.map +1 -1
- package/componentsV2/PadModeSelect/utils/__tests__/useMenuItems.test.d.ts +2 -0
- package/componentsV2/PadModeSelect/utils/__tests__/useMenuItems.test.d.ts.map +1 -0
- package/componentsV2/PadModeSelect/utils/useMenuItems.d.ts.map +1 -1
- package/componentsV2/PadModeSelect/utils/useMenuItems.js +1 -1
- package/componentsV2/PadModeSelect/utils/useMenuItems.js.map +1 -1
- package/constants/completion.d.ts +1 -0
- package/constants/completion.d.ts.map +1 -1
- package/constants/completion.js +1 -1
- package/constants/completion.js.map +1 -1
- package/mcp-server/server.mjs +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/toConsumableArray");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l,t=o(e),a=o(r);function n(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);r&&(l=l.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,l)}return o}function i(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?n(Object(o),!0).forEach((function(r){t.default(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var s=[{name:"Liquid Gel",color:"#84F4F7",key:"gel"},{name:"Acid",color:"#6ec732",key:"acid"},{name:"Liquid FR",color:"#FFA891",key:"friction_reducer"},{name:"Liquid FR Extra",color:"#91FFA8",key:"friction_reducer_extra"},{name:"Total Liquid FR",color:"#FF91A8",key:"total_friction_reducer"},{name:"Cross Linker",color:"#B0CA87",key:"cross_linker"},{name:"Liquid EB",color:"#32b8c7",key:"enzyme_breaker"},{name:"Polymer Plug",color:"#9fc732",key:"ploymer_plug"},{name:"Acid Inhibitor",color:"#AB9081",key:"acid_inhibitor"},{name:"Acid Retarder",color:"#7CC6FE",key:"acid_retarder"},{name:"Emulsifier",color:"#5DFDCB",key:"emulsifier"},{name:"Clay Stabilizer",color:"#9C6B20",key:"clay_stabilizer"},{name:"Surfactant",color:"#FFF689",key:"surfactant"},{name:"Non-Emulsifier",color:"#C0DF85",key:"non_emulsifier"},{name:"Fines Suspender",color:"#7B8E55",key:"fines_suspender"},{name:"Anti-Sludge",color:"#07393C",key:"anti_sludge"},{name:"Scale Inhibitor",color:"#C0E5CA",key:"scale_inhibitor"},{name:"Iron Control",color:"#CD5334",key:"iron_control"},{name:"Oxygen Scavenger",color:"#DFF283",key:"oxygen_scavenger"},{name:"Mutual Solvent",color:"#ad5ec7",key:"mutual_solvent"},{name:"Corrosion Inhibitor",color:"#7C2209",key:"corrosion_inhibitor"},{name:"Paraffin Control",color:"#F5A65B",key:"paraffin_control"},{name:"Biocide",color:"#E9B76A",key:"biocide"},{name:"PH Adjusting Agent",color:"#519872",key:"ph_adjusting_agent"},{name:"Accelerator",color:"#5E3023",key:"accelerator"},{name:"Instant Crosslinker",color:"#6E6E23",key:"instant_crosslinker"},{name:"Delayed Crosslinker",color:"#7E306E",key:"delayed_crosslinker"},{name:"Liquid Breaker",color:"#233023",key:"liquid_breaker"}],c=[{name:"Diverter",color:"#BB9394",key:"divertor"},{name:"Powder Breaker",color:"#c732b8",key:"powder_breaker"},{name:"Powder Gel",color:"#308E23",key:"powder_gel"},{name:"Powder FR",color:"#30239E",key:"powder_friction_reducer"},{name:"Powder EB",color:"#A32A78",key:"powder_enzyme_breaker"},{name:"Fluid Loss",color:"#c7bd32",key:"fluid_loss"}],p=[].concat(a.default(s.map((function(e){return i(i({},e),{},{unitType:"volume"})}))),a.default(c.map((function(e){return i(i({},e),{},{unitType:"mass"})})))),u={pad:"pad",activeFrac:"active_frac",activeWireline:"active_wireline",activePumpdown:"active_pumpdown",custom:"custom",padLine:"padLine"},_={padApp:"Pad Apps",fracWirelineMultiWellApp:"Frac & Wireline Multi-Well Apps",fracMultiWellApp:"Frac Multi-Well Apps",wirelineMultiWellApp:"Wireline Multi-Well Apps",pumpdownMultiWellApp:"Pumpdown Multi-Well Apps",fracSingleWellApp:"Frac Single Well Apps",wirelineSingleWellApp:"Wireline Single Well Apps",pumpdownSingleWellApp:"Pumpdown Single Well Apps"},m=(l={},t.default(l,_.padApp,[u.pad,u.custom]),t.default(l,_.fracWirelineMultiWellApp,[u.pad,u.activeFrac,u.activeWireline,u.custom]),t.default(l,_.fracMultiWellApp,[u.pad,u.activeFrac,u.custom]),t.default(l,_.fracSingleWellApp,[u.activeFrac,u.custom]),t.default(l,_.wirelineMultiWellApp,[u.pad,u.activeWireline,u.custom]),t.default(l,_.wirelineSingleWellApp,[u.activeWireline,u.custom]),t.default(l,_.pumpdownMultiWellApp,[u.pad,u.activePumpdown,u.custom]),t.default(l,_.wirelineSingleWellApp,[u.activePumpdown,u.custom]),l);exports.ACTIVITIES=[{name:"Pressure Testing",key:"pressure testing",isFlatTime:!0,color:"#FFF350"},{name:"Pump Off",key:"pump off",isFlatTime:!0,color:"#939E98"},{name:"Fracturing",key:"fracturing",isFlatTime:!1,color:"#429FF8"},{name:"Pad",key:"pad",isFlatTime:!1,color:"#FF8260"},{name:"Flush",key:"flush",isFlatTime:!1,color:"#10EAF0"}],exports.CHEMICALS_MASS_TYPES=c,exports.CHEMICALS_TYPES=p,exports.CHEMICALS_VOL_TYPES=s,exports.COMPLETION_APPTYPE_MODES_DICT=m,exports.COMPLETION_APP_TYPES=_,exports.COMPLETION_MODES=u,exports.COMPLETION_OPERATION_TYPE=[{name:"Fracturing",key:"fracturing",color:"#429FF8"},{name:"Wireline",key:"wireline",color:"#FF9C00"},{name:"Swap Over - Fracturing",key:"swap_over_fracturing",color:"#347EC5"},{name:"Swap Over - Wireline",key:"swap_over_wireline",color:"#BF7500"},{name:"Waiting on Offset Wells",key:"waiting_on_offset_wells",color:"#BDBDBD"}],exports.DEFAULT_SUPPORTED_PAD_MODES=[{key:"pad",label:"Pad Mode"}],exports.FLOW_RATE_COLORS={clean_flow_rate_in:"#7CC900",slurry_flow_rate_in:"#64B5FF",max_flow_rate:"#0085e3",ave_flow_rate:"#8BC7F2"},exports.FLUIDS_TYPES=[{name:"HVFR Low",key:"hvfr_low",unitType:"oil",color:"#1fff71"},{name:"15# Linear Gel",key:"15#_linear_gel",unitType:"oil",color:"#00E7E9"},{name:"15% HCL Acid",key:"15%_hcl_acid",unitType:"oil",color:"#6ec732"},{name:"Slickwater",key:"slickwater",unitType:"oil",color:"#7AB8ED"},{name:"15# XL Borate",key:"15#_xl_borate",unitType:"oil",color:"#ff9a4c"},{name:"Fresh Water",key:"fresh_water",unitType:"oil",color:"#4c7fff"}],exports.PRESSURE_COLORS={well_head_pressure:"#F50057",wellhead_sensor:"#A0A0A0",pipe_frictional_pressure_loss:"#D8496B",nwb_frictional_pressure_loss:"#807DFF",bottomhole_pressure:"#4DCFB3",net_pressure:"#EE752F",max_treating_pressure:"#F50258",ave_treating_pressure:"#FF6161",breakdown_pressure:"#03db5a",isip_pressure:"#7169AE",delta_pressure:"#efd34b",hydrostatic_pressure:"#E458C8",backside_pressure:"#32aa32",pumpside_pressure:"#855CF8",negative_hydrostatic_pressure:"#EF83D9",pressure_at_gauge_md:"#D43AB5",sleeve_pressure_loss:"#F9B6EB"},exports.PROPPANTS_CON_TYPES=[{name:"Total Proppant Conc",key:"total_proppant_concentration",unitType:"massConcentration",unit:"lb/gal",color:"#FF8F0B"},{name:"BHPC",key:"bottomhole_proppant_concentration",unitType:"massConcentration",unit:"lb/gal",color:"#9F4BED",precision:2}],exports.PROPPANTS_MASS_TYPES=[{name:"Total Proppant Mass",key:"total_proppant_mass",unitType:"mass",color:"#EE964B",unit:"lb"},{name:"Streamed Proppant Mass",key:"proppant_1_mass",unitType:"mass",color:"#C6C013",unit:"lb"}],exports.PROPPANTS_TYPES=[{name:"100 Mesh",key:"100_mesh",unitType:"mass",color:"#ff0000"},{name:"40/70 Brown",key:"40_70_brown",unitType:"mass",color:"#603000"},{name:"40/70 Mesh",key:"40_70_mesh",unitType:"mass",color:"#5454cc"},{name:"40/70 NWS",key:"40_70_nws",unitType:"mass",color:"#ff4242"},{name:"40/70 RBS",key:"40_70_rbs",unitType:"mass",color:"#ff42bc"},{name:"30/50 Brown",key:"30_50_brown",unitType:"mass",color:"#964B00"},{name:"30/50 Mesh",key:"30_50_mesh",unitType:"mass",color:"#9898cc"},{name:"25/50 Brown",key:"25_50_brown",unitType:"mass",color:"#B27C45"},{name:"25/50 Mesh",key:"25_50_mesh",unitType:"mass",color:"#32aa32"},{name:"20/40 Mesh",key:"20_40_mesh",unitType:"mass",color:"#ff7979"},{name:"Petroleum Coke",key:"petroleum_coke",unitType:"mass",color:"#ff7c4d"}],exports.STAGE_ACTUAL_PARAM_COLORS={top_perforation:"#0085e3",bottom_perforation:"#8BC7F2",perforated_length:"#519872",total_shots:"#9500b7",flush_volume:"#FF6161"},exports.TOTAL_CHEMICAL_TYPE={name:"Total Chemicals",key:"total_chemical_rate_in",color:"#00FF00"},exports.TOTAL_VOLUME_COLORS={total_slurry_volume_in:"#7169AE",total_clean_volume_in:"#257CFF"},exports.TRACKING_CONCENTRATION_COLORS={fr_concentration:"#D99C88",surfactant_concentration:"#FEF798",powder_breaker_concentration:"#993895"},exports.WIRELINE_ACTIVITIES=[{name:"Pull out of Hole",key:"pull out of hole",isFlatTime:!1,color:"#800080"},{name:"Plug and Perf",key:"plug and perf",isFlatTime:!1,color:"#FFA500"},{name:"Run in Hole",key:"run in hole",isFlatTime:!1,color:"#00008B"},{name:"Static",key:"static",isFlatTime:!1,color:"#D3D3D3"},{name:"Out of Hole",key:"out of hole",isFlatTime:!1,color:"#FFC0CB"}],exports.WIRELINE_BREAKDOWN_ACTIVITIES=[{name:"Pull out of Hole (VT)",key:"pull out of hole vertical",isFlatTime:!1,color:"#EB3447"},{name:"Pull out of Hole (HZ)",key:"pull out of hole horizontal",isFlatTime:!1,color:"#ED602A"},{name:"Run in Hole (VT)",key:"run in hole vertical",isFlatTime:!1,color:"#390099"},{name:"Run in Hole (HZ)",key:"run in hole horizontal",isFlatTime:!1,color:"#6150C1"},{name:"Static",key:"static",isFlatTime:!1,color:"#FFBD00"}],exports.WIRELINE_PARAMETERS=[{key:"line_speed",label:"Line Speed",unitType:"velocity",unit:"ft/min",isDefaultView:!0},{key:"line_tension",label:"Line Tension",unitType:"mass",unit:"lb",isDefaultView:!0},{key:"casing_collar_locator",label:"CCL",isDefaultView:!0},{key:"elapsed_time",label:"Elapsed Time",unitType:"time",unit:"s"},{key:"voltage",label:"Voltage",unitType:"voltage",unit:"mV"},{key:"current",label:"Current",unitType:"current",unit:"mA"},{key:"measured_depth",label:"Measured Depth",unitType:"length",unit:"ft"}];
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/toConsumableArray");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l,t=o(e),a=o(r);function n(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);r&&(l=l.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),o.push.apply(o,l)}return o}function i(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?n(Object(o),!0).forEach((function(r){t.default(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var s=[{name:"Liquid Gel",color:"#84F4F7",key:"gel"},{name:"Acid",color:"#6ec732",key:"acid"},{name:"Liquid FR",color:"#FFA891",key:"friction_reducer"},{name:"Liquid FR Extra",color:"#91FFA8",key:"friction_reducer_extra"},{name:"Total Liquid FR",color:"#FF91A8",key:"total_friction_reducer"},{name:"Cross Linker",color:"#B0CA87",key:"cross_linker"},{name:"Liquid EB",color:"#32b8c7",key:"enzyme_breaker"},{name:"Polymer Plug",color:"#9fc732",key:"ploymer_plug"},{name:"Acid Inhibitor",color:"#AB9081",key:"acid_inhibitor"},{name:"Acid Retarder",color:"#7CC6FE",key:"acid_retarder"},{name:"Emulsifier",color:"#5DFDCB",key:"emulsifier"},{name:"Clay Stabilizer",color:"#9C6B20",key:"clay_stabilizer"},{name:"Surfactant",color:"#FFF689",key:"surfactant"},{name:"Non-Emulsifier",color:"#C0DF85",key:"non_emulsifier"},{name:"Fines Suspender",color:"#7B8E55",key:"fines_suspender"},{name:"Anti-Sludge",color:"#07393C",key:"anti_sludge"},{name:"Scale Inhibitor",color:"#C0E5CA",key:"scale_inhibitor"},{name:"Iron Control",color:"#CD5334",key:"iron_control"},{name:"Oxygen Scavenger",color:"#DFF283",key:"oxygen_scavenger"},{name:"Mutual Solvent",color:"#ad5ec7",key:"mutual_solvent"},{name:"Corrosion Inhibitor",color:"#7C2209",key:"corrosion_inhibitor"},{name:"Paraffin Control",color:"#F5A65B",key:"paraffin_control"},{name:"Biocide",color:"#E9B76A",key:"biocide"},{name:"PH Adjusting Agent",color:"#519872",key:"ph_adjusting_agent"},{name:"Accelerator",color:"#5E3023",key:"accelerator"},{name:"Instant Crosslinker",color:"#6E6E23",key:"instant_crosslinker"},{name:"Delayed Crosslinker",color:"#7E306E",key:"delayed_crosslinker"},{name:"Liquid Breaker",color:"#233023",key:"liquid_breaker"}],c=[{name:"Diverter",color:"#BB9394",key:"divertor"},{name:"Powder Breaker",color:"#c732b8",key:"powder_breaker"},{name:"Powder Gel",color:"#308E23",key:"powder_gel"},{name:"Powder FR",color:"#30239E",key:"powder_friction_reducer"},{name:"Powder EB",color:"#A32A78",key:"powder_enzyme_breaker"},{name:"Fluid Loss",color:"#c7bd32",key:"fluid_loss"}],p=[].concat(a.default(s.map((function(e){return i(i({},e),{},{unitType:"volume"})}))),a.default(c.map((function(e){return i(i({},e),{},{unitType:"mass"})})))),u={pad:"pad",activeFrac:"active_frac",activeWireline:"active_wireline",activePumpdown:"active_pumpdown",custom:"custom",padLine:"padLine"},_={padApp:"Pad Apps",fracWirelineMultiWellApp:"Frac & Wireline Multi-Well Apps",fracMultiWellApp:"Frac Multi-Well Apps",wirelineMultiWellApp:"Wireline Multi-Well Apps",pumpdownMultiWellApp:"Pumpdown Multi-Well Apps",fracSingleWellApp:"Frac Single Well Apps",wirelineSingleWellApp:"Wireline Single Well Apps",pumpdownSingleWellApp:"Pumpdown Single Well Apps"},m=(l={},t.default(l,_.padApp,[u.pad,u.custom]),t.default(l,_.fracWirelineMultiWellApp,[u.pad,u.activeFrac,u.activeWireline,u.custom]),t.default(l,_.fracMultiWellApp,[u.pad,u.activeFrac,u.custom]),t.default(l,_.fracSingleWellApp,[u.activeFrac,u.custom]),t.default(l,_.wirelineMultiWellApp,[u.pad,u.activeWireline,u.custom]),t.default(l,_.wirelineSingleWellApp,[u.activeWireline,u.custom]),t.default(l,_.pumpdownMultiWellApp,[u.pad,u.activePumpdown,u.custom]),t.default(l,_.wirelineSingleWellApp,[u.activePumpdown,u.custom]),l);exports.ACTIVITIES=[{name:"Pressure Testing",key:"pressure testing",isFlatTime:!0,color:"#FFF350"},{name:"Pump Off",key:"pump off",isFlatTime:!0,color:"#939E98"},{name:"Fracturing",key:"fracturing",isFlatTime:!1,color:"#429FF8"},{name:"Pad",key:"pad",isFlatTime:!1,color:"#FF8260"},{name:"Flush",key:"flush",isFlatTime:!1,color:"#10EAF0"}],exports.CHEMICALS_MASS_TYPES=c,exports.CHEMICALS_TYPES=p,exports.CHEMICALS_VOL_TYPES=s,exports.COMPLETION_APPTYPE_MODES_DICT=m,exports.COMPLETION_APP_TYPES=_,exports.COMPLETION_MODES=u,exports.COMPLETION_OPERATION_TYPE=[{name:"Fracturing",key:"fracturing",color:"#429FF8"},{name:"Wireline",key:"wireline",color:"#FF9C00"},{name:"Swap Over - Fracturing",key:"swap_over_fracturing",color:"#347EC5"},{name:"Swap Over - Wireline",key:"swap_over_wireline",color:"#BF7500"},{name:"Waiting on Offset Wells",key:"waiting_on_offset_wells",color:"#BDBDBD"}],exports.DEFAULT_SUPPORTED_PAD_MODES=[{key:"pad",label:"Pad Mode"}],exports.EMPTY_FRAC_FLEET_LINE_LABEL_SUFFIX=" (empty)",exports.FLOW_RATE_COLORS={clean_flow_rate_in:"#7CC900",slurry_flow_rate_in:"#64B5FF",max_flow_rate:"#0085e3",ave_flow_rate:"#8BC7F2"},exports.FLUIDS_TYPES=[{name:"HVFR Low",key:"hvfr_low",unitType:"oil",color:"#1fff71"},{name:"15# Linear Gel",key:"15#_linear_gel",unitType:"oil",color:"#00E7E9"},{name:"15% HCL Acid",key:"15%_hcl_acid",unitType:"oil",color:"#6ec732"},{name:"Slickwater",key:"slickwater",unitType:"oil",color:"#7AB8ED"},{name:"15# XL Borate",key:"15#_xl_borate",unitType:"oil",color:"#ff9a4c"},{name:"Fresh Water",key:"fresh_water",unitType:"oil",color:"#4c7fff"}],exports.PRESSURE_COLORS={well_head_pressure:"#F50057",wellhead_sensor:"#A0A0A0",pipe_frictional_pressure_loss:"#D8496B",nwb_frictional_pressure_loss:"#807DFF",bottomhole_pressure:"#4DCFB3",net_pressure:"#EE752F",max_treating_pressure:"#F50258",ave_treating_pressure:"#FF6161",breakdown_pressure:"#03db5a",isip_pressure:"#7169AE",delta_pressure:"#efd34b",hydrostatic_pressure:"#E458C8",backside_pressure:"#32aa32",pumpside_pressure:"#855CF8",negative_hydrostatic_pressure:"#EF83D9",pressure_at_gauge_md:"#D43AB5",sleeve_pressure_loss:"#F9B6EB"},exports.PROPPANTS_CON_TYPES=[{name:"Total Proppant Conc",key:"total_proppant_concentration",unitType:"massConcentration",unit:"lb/gal",color:"#FF8F0B"},{name:"BHPC",key:"bottomhole_proppant_concentration",unitType:"massConcentration",unit:"lb/gal",color:"#9F4BED",precision:2}],exports.PROPPANTS_MASS_TYPES=[{name:"Total Proppant Mass",key:"total_proppant_mass",unitType:"mass",color:"#EE964B",unit:"lb"},{name:"Streamed Proppant Mass",key:"proppant_1_mass",unitType:"mass",color:"#C6C013",unit:"lb"}],exports.PROPPANTS_TYPES=[{name:"100 Mesh",key:"100_mesh",unitType:"mass",color:"#ff0000"},{name:"40/70 Brown",key:"40_70_brown",unitType:"mass",color:"#603000"},{name:"40/70 Mesh",key:"40_70_mesh",unitType:"mass",color:"#5454cc"},{name:"40/70 NWS",key:"40_70_nws",unitType:"mass",color:"#ff4242"},{name:"40/70 RBS",key:"40_70_rbs",unitType:"mass",color:"#ff42bc"},{name:"30/50 Brown",key:"30_50_brown",unitType:"mass",color:"#964B00"},{name:"30/50 Mesh",key:"30_50_mesh",unitType:"mass",color:"#9898cc"},{name:"25/50 Brown",key:"25_50_brown",unitType:"mass",color:"#B27C45"},{name:"25/50 Mesh",key:"25_50_mesh",unitType:"mass",color:"#32aa32"},{name:"20/40 Mesh",key:"20_40_mesh",unitType:"mass",color:"#ff7979"},{name:"Petroleum Coke",key:"petroleum_coke",unitType:"mass",color:"#ff7c4d"}],exports.STAGE_ACTUAL_PARAM_COLORS={top_perforation:"#0085e3",bottom_perforation:"#8BC7F2",perforated_length:"#519872",total_shots:"#9500b7",flush_volume:"#FF6161"},exports.TOTAL_CHEMICAL_TYPE={name:"Total Chemicals",key:"total_chemical_rate_in",color:"#00FF00"},exports.TOTAL_VOLUME_COLORS={total_slurry_volume_in:"#7169AE",total_clean_volume_in:"#257CFF"},exports.TRACKING_CONCENTRATION_COLORS={fr_concentration:"#D99C88",surfactant_concentration:"#FEF798",powder_breaker_concentration:"#993895"},exports.WIRELINE_ACTIVITIES=[{name:"Pull out of Hole",key:"pull out of hole",isFlatTime:!1,color:"#800080"},{name:"Plug and Perf",key:"plug and perf",isFlatTime:!1,color:"#FFA500"},{name:"Run in Hole",key:"run in hole",isFlatTime:!1,color:"#00008B"},{name:"Static",key:"static",isFlatTime:!1,color:"#D3D3D3"},{name:"Out of Hole",key:"out of hole",isFlatTime:!1,color:"#FFC0CB"}],exports.WIRELINE_BREAKDOWN_ACTIVITIES=[{name:"Pull out of Hole (VT)",key:"pull out of hole vertical",isFlatTime:!1,color:"#EB3447"},{name:"Pull out of Hole (HZ)",key:"pull out of hole horizontal",isFlatTime:!1,color:"#ED602A"},{name:"Run in Hole (VT)",key:"run in hole vertical",isFlatTime:!1,color:"#390099"},{name:"Run in Hole (HZ)",key:"run in hole horizontal",isFlatTime:!1,color:"#6150C1"},{name:"Static",key:"static",isFlatTime:!1,color:"#FFBD00"}],exports.WIRELINE_PARAMETERS=[{key:"line_speed",label:"Line Speed",unitType:"velocity",unit:"ft/min",isDefaultView:!0},{key:"line_tension",label:"Line Tension",unitType:"mass",unit:"lb",isDefaultView:!0},{key:"casing_collar_locator",label:"CCL",isDefaultView:!0},{key:"elapsed_time",label:"Elapsed Time",unitType:"time",unit:"s"},{key:"voltage",label:"Voltage",unitType:"voltage",unit:"mV"},{key:"current",label:"Current",unitType:"current",unit:"mA"},{key:"measured_depth",label:"Measured Depth",unitType:"length",unit:"ft"}];
|
|
2
2
|
//# sourceMappingURL=completion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion.js","sources":["../../../src/constants/completion.js"],"sourcesContent":["export const ACTIVITIES = [\n {\n name: 'Pressure Testing',\n key: 'pressure testing',\n isFlatTime: true,\n color: '#FFF350',\n },\n {\n name: 'Pump Off',\n key: 'pump off',\n isFlatTime: true,\n color: '#939E98',\n },\n {\n name: 'Fracturing',\n key: 'fracturing',\n isFlatTime: false,\n color: '#429FF8',\n },\n {\n name: 'Pad',\n key: 'pad',\n isFlatTime: false,\n color: '#FF8260',\n },\n {\n name: 'Flush',\n key: 'flush',\n isFlatTime: false,\n color: '#10EAF0',\n },\n];\n\nexport const WIRELINE_ACTIVITIES = [\n {\n name: 'Pull out of Hole',\n key: 'pull out of hole',\n isFlatTime: false,\n color: '#800080',\n },\n {\n name: 'Plug and Perf',\n key: 'plug and perf',\n isFlatTime: false,\n color: '#FFA500',\n },\n {\n name: 'Run in Hole',\n key: 'run in hole',\n isFlatTime: false,\n color: '#00008B',\n },\n {\n name: 'Static',\n key: 'static',\n isFlatTime: false,\n color: '#D3D3D3',\n },\n {\n name: 'Out of Hole',\n key: 'out of hole',\n isFlatTime: false,\n color: '#FFC0CB',\n },\n];\n\nexport const WIRELINE_BREAKDOWN_ACTIVITIES = [\n {\n name: 'Pull out of Hole (VT)',\n key: 'pull out of hole vertical',\n isFlatTime: false,\n color: '#EB3447',\n },\n {\n name: 'Pull out of Hole (HZ)',\n key: 'pull out of hole horizontal',\n isFlatTime: false,\n color: '#ED602A',\n },\n {\n name: 'Run in Hole (VT)',\n key: 'run in hole vertical',\n isFlatTime: false,\n color: '#390099',\n },\n {\n name: 'Run in Hole (HZ)',\n key: 'run in hole horizontal',\n isFlatTime: false,\n color: '#6150C1',\n },\n {\n name: 'Static',\n key: 'static',\n isFlatTime: false,\n color: '#FFBD00',\n },\n];\n\nexport const FLUIDS_TYPES = [\n {\n name: 'HVFR Low',\n key: 'hvfr_low',\n unitType: 'oil',\n color: '#1fff71',\n },\n {\n name: '15# Linear Gel',\n key: '15#_linear_gel',\n unitType: 'oil',\n color: '#00E7E9',\n },\n {\n name: '15% HCL Acid',\n key: '15%_hcl_acid',\n unitType: 'oil',\n color: '#6ec732',\n },\n {\n name: 'Slickwater',\n key: 'slickwater',\n unitType: 'oil',\n color: '#7AB8ED',\n },\n {\n name: '15# XL Borate',\n key: '15#_xl_borate',\n unitType: 'oil',\n color: '#ff9a4c',\n },\n {\n name: 'Fresh Water',\n key: 'fresh_water',\n unitType: 'oil',\n color: '#4c7fff',\n },\n];\n\nexport const TOTAL_CHEMICAL_TYPE = {\n name: 'Total Chemicals',\n key: 'total_chemical_rate_in',\n color: '#00FF00',\n};\n\nexport const CHEMICALS_VOL_TYPES = [\n {\n name: 'Liquid Gel',\n color: '#84F4F7',\n key: 'gel',\n },\n {\n name: 'Acid',\n color: '#6ec732',\n key: 'acid',\n },\n {\n name: 'Liquid FR',\n color: '#FFA891',\n key: 'friction_reducer',\n },\n {\n name: 'Liquid FR Extra',\n color: '#91FFA8',\n key: 'friction_reducer_extra',\n },\n {\n name: 'Total Liquid FR',\n color: '#FF91A8',\n key: 'total_friction_reducer',\n },\n {\n name: 'Cross Linker',\n color: '#B0CA87',\n key: 'cross_linker',\n },\n {\n name: 'Liquid EB',\n color: '#32b8c7',\n key: 'enzyme_breaker',\n },\n {\n name: 'Polymer Plug',\n color: '#9fc732',\n key: 'ploymer_plug',\n },\n {\n name: 'Acid Inhibitor',\n color: '#AB9081',\n key: 'acid_inhibitor',\n },\n {\n name: 'Acid Retarder',\n color: '#7CC6FE',\n key: 'acid_retarder',\n },\n {\n name: 'Emulsifier',\n color: '#5DFDCB',\n key: 'emulsifier',\n },\n {\n name: 'Clay Stabilizer',\n color: '#9C6B20',\n key: 'clay_stabilizer',\n },\n {\n name: 'Surfactant',\n color: '#FFF689',\n key: 'surfactant',\n },\n {\n name: 'Non-Emulsifier',\n color: '#C0DF85',\n key: 'non_emulsifier',\n },\n {\n name: 'Fines Suspender',\n color: '#7B8E55',\n key: 'fines_suspender',\n },\n {\n name: 'Anti-Sludge',\n color: '#07393C',\n key: 'anti_sludge',\n },\n {\n name: 'Scale Inhibitor',\n color: '#C0E5CA',\n key: 'scale_inhibitor',\n },\n {\n name: 'Iron Control',\n color: '#CD5334',\n key: 'iron_control',\n },\n {\n name: 'Oxygen Scavenger',\n color: '#DFF283',\n key: 'oxygen_scavenger',\n },\n {\n name: 'Mutual Solvent',\n color: '#ad5ec7',\n key: 'mutual_solvent',\n },\n {\n name: 'Corrosion Inhibitor',\n color: '#7C2209',\n key: 'corrosion_inhibitor',\n },\n {\n name: 'Paraffin Control',\n color: '#F5A65B',\n key: 'paraffin_control',\n },\n {\n name: 'Biocide',\n color: '#E9B76A',\n key: 'biocide',\n },\n {\n name: 'PH Adjusting Agent',\n color: '#519872',\n key: 'ph_adjusting_agent',\n },\n {\n name: 'Accelerator',\n color: '#5E3023',\n key: 'accelerator',\n },\n {\n name: 'Instant Crosslinker',\n color: '#6E6E23',\n key: 'instant_crosslinker',\n },\n {\n name: 'Delayed Crosslinker',\n color: '#7E306E',\n key: 'delayed_crosslinker',\n },\n {\n name: 'Liquid Breaker',\n color: '#233023',\n key: 'liquid_breaker',\n },\n];\n\nexport const CHEMICALS_MASS_TYPES = [\n {\n // NOTE: Incorrect spellling `divertor` was used by accident in the begnning of development.\n // Since it was used in the column mapper, the key field should be kept as is for existing assets.\n name: 'Diverter',\n color: '#BB9394',\n key: 'divertor',\n },\n\n {\n name: 'Powder Breaker',\n color: '#c732b8',\n key: 'powder_breaker',\n },\n\n {\n name: 'Powder Gel',\n color: '#308E23',\n key: 'powder_gel',\n },\n {\n name: 'Powder FR',\n color: '#30239E',\n key: 'powder_friction_reducer',\n },\n {\n name: 'Powder EB',\n color: '#A32A78',\n key: 'powder_enzyme_breaker',\n },\n {\n name: 'Fluid Loss',\n color: '#c7bd32',\n key: 'fluid_loss',\n },\n];\n\n// TODO: These checmials are shared between wits channels and settings chemicals app\n// Like proppants, we might need to separate those two usage.\nexport const CHEMICALS_TYPES = [\n ...CHEMICALS_VOL_TYPES.map(item => ({ ...item, unitType: 'volume' })),\n ...CHEMICALS_MASS_TYPES.map(item => ({ ...item, unitType: 'mass' })),\n];\n\nexport const PROPPANTS_TYPES = [\n {\n name: '100 Mesh',\n key: '100_mesh',\n unitType: 'mass',\n color: '#ff0000',\n },\n {\n name: '40/70 Brown',\n key: '40_70_brown',\n unitType: 'mass',\n color: '#603000',\n },\n {\n name: '40/70 Mesh',\n key: '40_70_mesh',\n unitType: 'mass',\n color: '#5454cc',\n },\n {\n name: '40/70 NWS',\n key: '40_70_nws',\n unitType: 'mass',\n color: '#ff4242',\n },\n {\n name: '40/70 RBS',\n key: '40_70_rbs',\n unitType: 'mass',\n color: '#ff42bc',\n },\n {\n name: '30/50 Brown',\n key: '30_50_brown',\n unitType: 'mass',\n color: '#964B00',\n },\n {\n name: '30/50 Mesh',\n key: '30_50_mesh',\n unitType: 'mass',\n color: '#9898cc',\n },\n {\n name: '25/50 Brown',\n key: '25_50_brown',\n unitType: 'mass',\n color: '#B27C45',\n },\n {\n name: '25/50 Mesh',\n key: '25_50_mesh',\n unitType: 'mass',\n color: '#32aa32',\n },\n {\n name: '20/40 Mesh',\n key: '20_40_mesh',\n unitType: 'mass',\n color: '#ff7979',\n },\n {\n name: 'Petroleum Coke',\n key: 'petroleum_coke',\n unitType: 'mass',\n color: '#ff7c4d',\n },\n];\n\nexport const PROPPANTS_CON_TYPES = [\n {\n name: 'Total Proppant Conc',\n key: 'total_proppant_concentration',\n unitType: 'massConcentration',\n unit: 'lb/gal',\n color: '#FF8F0B',\n },\n {\n name: 'BHPC',\n key: 'bottomhole_proppant_concentration',\n unitType: 'massConcentration',\n unit: 'lb/gal',\n color: '#9F4BED',\n precision: 2,\n },\n];\n\nexport const PROPPANTS_MASS_TYPES = [\n {\n name: 'Total Proppant Mass',\n key: 'total_proppant_mass',\n unitType: 'mass',\n color: '#EE964B',\n unit: 'lb',\n },\n {\n name: 'Streamed Proppant Mass',\n key: 'proppant_1_mass',\n unitType: 'mass',\n color: '#C6C013',\n unit: 'lb',\n },\n];\n\nexport const STAGE_ACTUAL_PARAM_COLORS = {\n top_perforation: '#0085e3',\n bottom_perforation: '#8BC7F2',\n perforated_length: '#519872',\n total_shots: '#9500b7',\n flush_volume: '#FF6161',\n};\n\nexport const PRESSURE_COLORS = {\n well_head_pressure: '#F50057',\n wellhead_sensor: '#A0A0A0',\n pipe_frictional_pressure_loss: '#D8496B',\n nwb_frictional_pressure_loss: '#807DFF',\n bottomhole_pressure: '#4DCFB3',\n net_pressure: '#EE752F',\n max_treating_pressure: '#F50258',\n ave_treating_pressure: '#FF6161',\n breakdown_pressure: '#03db5a',\n isip_pressure: '#7169AE',\n delta_pressure: '#efd34b',\n hydrostatic_pressure: '#E458C8',\n backside_pressure: '#32aa32',\n pumpside_pressure: '#855CF8',\n negative_hydrostatic_pressure: '#EF83D9',\n pressure_at_gauge_md: '#D43AB5',\n sleeve_pressure_loss: '#F9B6EB',\n};\n\nexport const TRACKING_CONCENTRATION_COLORS = {\n fr_concentration: '#D99C88',\n surfactant_concentration: '#FEF798',\n powder_breaker_concentration: '#993895',\n};\n\nexport const FLOW_RATE_COLORS = {\n clean_flow_rate_in: '#7CC900',\n slurry_flow_rate_in: '#64B5FF',\n max_flow_rate: '#0085e3',\n ave_flow_rate: '#8BC7F2',\n};\n\nexport const TOTAL_VOLUME_COLORS = {\n total_slurry_volume_in: '#7169AE',\n total_clean_volume_in: '#257CFF',\n};\n\nexport const COMPLETION_OPERATION_TYPE = [\n {\n name: 'Fracturing',\n key: 'fracturing',\n color: '#429FF8',\n },\n {\n name: 'Wireline',\n key: 'wireline',\n color: '#FF9C00',\n },\n {\n name: 'Swap Over - Fracturing',\n key: 'swap_over_fracturing',\n color: '#347EC5',\n },\n {\n name: 'Swap Over - Wireline',\n key: 'swap_over_wireline',\n color: '#BF7500',\n },\n {\n name: 'Waiting on Offset Wells',\n key: 'waiting_on_offset_wells',\n color: '#BDBDBD',\n },\n];\n\nexport const WIRELINE_PARAMETERS = [\n {\n key: 'line_speed',\n label: 'Line Speed',\n unitType: 'velocity',\n unit: 'ft/min',\n isDefaultView: true,\n },\n {\n key: 'line_tension',\n label: 'Line Tension',\n unitType: 'mass',\n unit: 'lb',\n isDefaultView: true,\n },\n {\n key: 'casing_collar_locator',\n label: 'CCL',\n isDefaultView: true,\n },\n {\n key: 'elapsed_time',\n label: 'Elapsed Time',\n unitType: 'time',\n unit: 's',\n },\n {\n key: 'voltage',\n label: 'Voltage',\n unitType: 'voltage',\n unit: 'mV',\n },\n {\n key: 'current',\n label: 'Current',\n unitType: 'current',\n unit: 'mA',\n },\n {\n key: 'measured_depth',\n label: 'Measured Depth',\n unitType: 'length',\n unit: 'ft',\n },\n];\n\nexport const DEFAULT_SUPPORTED_PAD_MODES = [\n {\n key: 'pad',\n label: 'Pad Mode',\n },\n];\n\n/**\n * There are 5 different modes in completion apps\n *\n * 1 - Pad Mode (Display data from all assets on pad in series)\n * 2 - Active Frac Mode (Display data from active frac asset on active pad)\n * 3 - Active Wireline Mode (Display data from active wireline asset on active pad)\n * 4 - Active Pumpdown Mode (Display data from active pumpdown asset on active pad)\n * 5 - Custom Mode (Display data from user selected asset on active pad)\n * 6 - Pad Line (Display data from selected simul frac line)\n *\n */\nexport const COMPLETION_MODES = {\n pad: 'pad',\n activeFrac: 'active_frac',\n activeWireline: 'active_wireline',\n activePumpdown: 'active_pumpdown',\n custom: 'custom',\n padLine: 'padLine',\n};\n\n/**\n * There are 8 different types of completion apps,\n * and each one will have different modes in the dropdown\n *\n * 1 - Pad apps\n * 2 - Frac & Wireline Multi-Well Apps\n * 3 - Frac Multi-Well Apps\n * 4 - Wireline Multi-Well Apps\n * 5 - Pumpdown Multi-Well Apps\n * 6 - Frac Single Well Apps\n * 7 - Wireline Single Well Apps\n * 8 - Pumpdown Single Well Apps\n *\n */\nexport const COMPLETION_APP_TYPES = {\n padApp: 'Pad Apps',\n fracWirelineMultiWellApp: 'Frac & Wireline Multi-Well Apps',\n fracMultiWellApp: 'Frac Multi-Well Apps',\n wirelineMultiWellApp: 'Wireline Multi-Well Apps',\n pumpdownMultiWellApp: 'Pumpdown Multi-Well Apps',\n fracSingleWellApp: 'Frac Single Well Apps',\n wirelineSingleWellApp: 'Wireline Single Well Apps',\n pumpdownSingleWellApp: 'Pumpdown Single Well Apps',\n};\n\nexport const COMPLETION_APPTYPE_MODES_DICT = {\n [COMPLETION_APP_TYPES.padApp]: [COMPLETION_MODES.pad, COMPLETION_MODES.custom],\n [COMPLETION_APP_TYPES.fracWirelineMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activeFrac,\n COMPLETION_MODES.activeWireline,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.fracMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activeFrac,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.fracSingleWellApp]: [COMPLETION_MODES.activeFrac, COMPLETION_MODES.custom],\n [COMPLETION_APP_TYPES.wirelineMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activeWireline,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.wirelineSingleWellApp]: [\n COMPLETION_MODES.activeWireline,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.pumpdownMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activePumpdown,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.wirelineSingleWellApp]: [\n COMPLETION_MODES.activePumpdown,\n COMPLETION_MODES.custom,\n ],\n};\n"],"names":["CHEMICALS_VOL_TYPES","name","color","key","CHEMICALS_MASS_TYPES","CHEMICALS_TYPES","map","item","_objectSpread","unitType","COMPLETION_MODES","pad","activeFrac","activeWireline","activePumpdown","custom","padLine","COMPLETION_APP_TYPES","padApp","fracWirelineMultiWellApp","fracMultiWellApp","wirelineMultiWellApp","pumpdownMultiWellApp","fracSingleWellApp","wirelineSingleWellApp","pumpdownSingleWellApp","COMPLETION_APPTYPE_MODES_DICT","_defineProperty","_COMPLETION_APPTYPE_M","isFlatTime","label","clean_flow_rate_in","slurry_flow_rate_in","max_flow_rate","ave_flow_rate","well_head_pressure","wellhead_sensor","pipe_frictional_pressure_loss","nwb_frictional_pressure_loss","bottomhole_pressure","net_pressure","max_treating_pressure","ave_treating_pressure","breakdown_pressure","isip_pressure","delta_pressure","hydrostatic_pressure","backside_pressure","pumpside_pressure","negative_hydrostatic_pressure","pressure_at_gauge_md","sleeve_pressure_loss","unit","precision","top_perforation","bottom_perforation","perforated_length","total_shots","flush_volume","total_slurry_volume_in","total_clean_volume_in","fr_concentration","surfactant_concentration","powder_breaker_concentration","isDefaultView"],"mappings":"o1BAAO,IAgJMA,EAAsB,CACjC,CACEC,KAAM,aACNC,MAAO,UACPC,IAAK,OAEP,CACEF,KAAM,OACNC,MAAO,UACPC,IAAK,QAEP,CACEF,KAAM,YACNC,MAAO,UACPC,IAAK,oBAEP,CACEF,KAAM,kBACNC,MAAO,UACPC,IAAK,0BAEP,CACEF,KAAM,kBACNC,MAAO,UACPC,IAAK,0BAEP,CACEF,KAAM,eACNC,MAAO,UACPC,IAAK,gBAEP,CACEF,KAAM,YACNC,MAAO,UACPC,IAAK,kBAEP,CACEF,KAAM,eACNC,MAAO,UACPC,IAAK,gBAEP,CACEF,KAAM,iBACNC,MAAO,UACPC,IAAK,kBAEP,CACEF,KAAM,gBACNC,MAAO,UACPC,IAAK,iBAEP,CACEF,KAAM,aACNC,MAAO,UACPC,IAAK,cAEP,CACEF,KAAM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AAM,QACNE,IAAK,QACL0B,YAAY,EACZ3B,MAAO,uOAoc8B,CACvC,CACED,KAAM,aACNE,IAAK,aACLD,MAAO,WAET,CACED,KAAM,WACNE,IAAK,WACLD,MAAO,WAET,CACED,KAAM,yBACNE,IAAK,uBACLD,MAAO,WAET,CACED,KAAM,uBACNE,IAAK,qBACLD,MAAO,WAET,CACED,KAAM,0BACNE,IAAK,0BACLD,MAAO,gDAkDgC,CACzC,CACEC,IAAK,MACL2B,MAAO,sCAzFqB,CAC9BC,mBAAoB,UACpBC,oBAAqB,UACrBC,cAAe,UACfC,cAAe,gCAtXW,CAC1B,CACEjC,KAAM,WACNE,IAAK,WACLM,SAAU,MACVP,MAAO,WAET,CACED,KAAM,iBACNE,IAAK,iBACLM,SAAU,MACVP,MAAO,WAET,CACED,KAAM,eACNE,IAAK,eACLM,SAAU,MACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,MACVP,MAAO,WAET,CACED,KAAM,gBACNE,IAAK,gBACLM,SAAU,MACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,MACVP,MAAO,oCAqToB,CAC7BiC,mBAAoB,UACpBC,gBAAiB,UACjBC,8BAA+B,UAC/BC,6BAA8B,UAC9BC,oBAAqB,UACrBC,aAAc,UACdC,sBAAuB,UACvBC,sBAAuB,UACvBC,mBAAoB,UACpBC,cAAe,UACfC,eAAgB,UAChBC,qBAAsB,UACtBC,kBAAmB,UACnBC,kBAAmB,UACnBC,8BAA+B,UAC/BC,qBAAsB,UACtBC,qBAAsB,uCA5DW,CACjC,CACElD,KAAM,sBACNE,IAAK,+BACLM,SAAU,oBACV2C,KAAM,SACNlD,MAAO,WAET,CACED,KAAM,OACNE,IAAK,oCACLM,SAAU,oBACV2C,KAAM,SACNlD,MAAO,UACPmD,UAAW,iCAIqB,CAClC,CACEpD,KAAM,sBACNE,IAAK,sBACLM,SAAU,OACVP,MAAO,UACPkD,KAAM,MAER,CACEnD,KAAM,yBACNE,IAAK,kBACLM,SAAU,OACVP,MAAO,UACPkD,KAAM,+BApGqB,CAC7B,CACEnD,KAAM,WACNE,IAAK,WACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,YACNE,IAAK,YACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,YACNE,IAAK,YACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,iBACNE,IAAK,iBACLM,SAAU,OACVP,MAAO,8CAuC8B,CACvCoD,gBAAiB,UACjBC,mBAAoB,UACpBC,kBAAmB,UACnBC,YAAa,UACbC,aAAc,uCA9SmB,CACjCzD,KAAM,kBACNE,IAAK,yBACLD,MAAO,uCA+U0B,CACjCyD,uBAAwB,UACxBC,sBAAuB,iDAfoB,CAC3CC,iBAAkB,UAClBC,yBAA0B,UAC1BC,6BAA8B,uCAjbG,CACjC,CACE9D,KAAM,mBACNE,IAAK,mBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,gBACNE,IAAK,gBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,SACNE,IAAK,SACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACL0B,YAAY,EACZ3B,MAAO,kDAIkC,CAC3C,CACED,KAAM,wBACNE,IAAK,4BACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,wBACNE,IAAK,8BACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,mBACNE,IAAK,uBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,mBACNE,IAAK,yBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,SACNE,IAAK,SACL0B,YAAY,EACZ3B,MAAO,wCA8ZwB,CACjC,CACEC,IAAK,aACL2B,MAAO,aACPrB,SAAU,WACV2C,KAAM,SACNY,eAAe,GAEjB,CACE7D,IAAK,eACL2B,MAAO,eACPrB,SAAU,OACV2C,KAAM,KACNY,eAAe,GAEjB,CACE7D,IAAK,wBACL2B,MAAO,MACPkC,eAAe,GAEjB,CACE7D,IAAK,eACL2B,MAAO,eACPrB,SAAU,OACV2C,KAAM,KAER,CACEjD,IAAK,UACL2B,MAAO,UACPrB,SAAU,UACV2C,KAAM,MAER,CACEjD,IAAK,UACL2B,MAAO,UACPrB,SAAU,UACV2C,KAAM,MAER,CACEjD,IAAK,iBACL2B,MAAO,iBACPrB,SAAU,SACV2C,KAAM"}
|
|
1
|
+
{"version":3,"file":"completion.js","sources":["../../../src/constants/completion.js"],"sourcesContent":["export const ACTIVITIES = [\n {\n name: 'Pressure Testing',\n key: 'pressure testing',\n isFlatTime: true,\n color: '#FFF350',\n },\n {\n name: 'Pump Off',\n key: 'pump off',\n isFlatTime: true,\n color: '#939E98',\n },\n {\n name: 'Fracturing',\n key: 'fracturing',\n isFlatTime: false,\n color: '#429FF8',\n },\n {\n name: 'Pad',\n key: 'pad',\n isFlatTime: false,\n color: '#FF8260',\n },\n {\n name: 'Flush',\n key: 'flush',\n isFlatTime: false,\n color: '#10EAF0',\n },\n];\n\nexport const WIRELINE_ACTIVITIES = [\n {\n name: 'Pull out of Hole',\n key: 'pull out of hole',\n isFlatTime: false,\n color: '#800080',\n },\n {\n name: 'Plug and Perf',\n key: 'plug and perf',\n isFlatTime: false,\n color: '#FFA500',\n },\n {\n name: 'Run in Hole',\n key: 'run in hole',\n isFlatTime: false,\n color: '#00008B',\n },\n {\n name: 'Static',\n key: 'static',\n isFlatTime: false,\n color: '#D3D3D3',\n },\n {\n name: 'Out of Hole',\n key: 'out of hole',\n isFlatTime: false,\n color: '#FFC0CB',\n },\n];\n\nexport const WIRELINE_BREAKDOWN_ACTIVITIES = [\n {\n name: 'Pull out of Hole (VT)',\n key: 'pull out of hole vertical',\n isFlatTime: false,\n color: '#EB3447',\n },\n {\n name: 'Pull out of Hole (HZ)',\n key: 'pull out of hole horizontal',\n isFlatTime: false,\n color: '#ED602A',\n },\n {\n name: 'Run in Hole (VT)',\n key: 'run in hole vertical',\n isFlatTime: false,\n color: '#390099',\n },\n {\n name: 'Run in Hole (HZ)',\n key: 'run in hole horizontal',\n isFlatTime: false,\n color: '#6150C1',\n },\n {\n name: 'Static',\n key: 'static',\n isFlatTime: false,\n color: '#FFBD00',\n },\n];\n\nexport const FLUIDS_TYPES = [\n {\n name: 'HVFR Low',\n key: 'hvfr_low',\n unitType: 'oil',\n color: '#1fff71',\n },\n {\n name: '15# Linear Gel',\n key: '15#_linear_gel',\n unitType: 'oil',\n color: '#00E7E9',\n },\n {\n name: '15% HCL Acid',\n key: '15%_hcl_acid',\n unitType: 'oil',\n color: '#6ec732',\n },\n {\n name: 'Slickwater',\n key: 'slickwater',\n unitType: 'oil',\n color: '#7AB8ED',\n },\n {\n name: '15# XL Borate',\n key: '15#_xl_borate',\n unitType: 'oil',\n color: '#ff9a4c',\n },\n {\n name: 'Fresh Water',\n key: 'fresh_water',\n unitType: 'oil',\n color: '#4c7fff',\n },\n];\n\nexport const TOTAL_CHEMICAL_TYPE = {\n name: 'Total Chemicals',\n key: 'total_chemical_rate_in',\n color: '#00FF00',\n};\n\nexport const CHEMICALS_VOL_TYPES = [\n {\n name: 'Liquid Gel',\n color: '#84F4F7',\n key: 'gel',\n },\n {\n name: 'Acid',\n color: '#6ec732',\n key: 'acid',\n },\n {\n name: 'Liquid FR',\n color: '#FFA891',\n key: 'friction_reducer',\n },\n {\n name: 'Liquid FR Extra',\n color: '#91FFA8',\n key: 'friction_reducer_extra',\n },\n {\n name: 'Total Liquid FR',\n color: '#FF91A8',\n key: 'total_friction_reducer',\n },\n {\n name: 'Cross Linker',\n color: '#B0CA87',\n key: 'cross_linker',\n },\n {\n name: 'Liquid EB',\n color: '#32b8c7',\n key: 'enzyme_breaker',\n },\n {\n name: 'Polymer Plug',\n color: '#9fc732',\n key: 'ploymer_plug',\n },\n {\n name: 'Acid Inhibitor',\n color: '#AB9081',\n key: 'acid_inhibitor',\n },\n {\n name: 'Acid Retarder',\n color: '#7CC6FE',\n key: 'acid_retarder',\n },\n {\n name: 'Emulsifier',\n color: '#5DFDCB',\n key: 'emulsifier',\n },\n {\n name: 'Clay Stabilizer',\n color: '#9C6B20',\n key: 'clay_stabilizer',\n },\n {\n name: 'Surfactant',\n color: '#FFF689',\n key: 'surfactant',\n },\n {\n name: 'Non-Emulsifier',\n color: '#C0DF85',\n key: 'non_emulsifier',\n },\n {\n name: 'Fines Suspender',\n color: '#7B8E55',\n key: 'fines_suspender',\n },\n {\n name: 'Anti-Sludge',\n color: '#07393C',\n key: 'anti_sludge',\n },\n {\n name: 'Scale Inhibitor',\n color: '#C0E5CA',\n key: 'scale_inhibitor',\n },\n {\n name: 'Iron Control',\n color: '#CD5334',\n key: 'iron_control',\n },\n {\n name: 'Oxygen Scavenger',\n color: '#DFF283',\n key: 'oxygen_scavenger',\n },\n {\n name: 'Mutual Solvent',\n color: '#ad5ec7',\n key: 'mutual_solvent',\n },\n {\n name: 'Corrosion Inhibitor',\n color: '#7C2209',\n key: 'corrosion_inhibitor',\n },\n {\n name: 'Paraffin Control',\n color: '#F5A65B',\n key: 'paraffin_control',\n },\n {\n name: 'Biocide',\n color: '#E9B76A',\n key: 'biocide',\n },\n {\n name: 'PH Adjusting Agent',\n color: '#519872',\n key: 'ph_adjusting_agent',\n },\n {\n name: 'Accelerator',\n color: '#5E3023',\n key: 'accelerator',\n },\n {\n name: 'Instant Crosslinker',\n color: '#6E6E23',\n key: 'instant_crosslinker',\n },\n {\n name: 'Delayed Crosslinker',\n color: '#7E306E',\n key: 'delayed_crosslinker',\n },\n {\n name: 'Liquid Breaker',\n color: '#233023',\n key: 'liquid_breaker',\n },\n];\n\nexport const CHEMICALS_MASS_TYPES = [\n {\n // NOTE: Incorrect spellling `divertor` was used by accident in the begnning of development.\n // Since it was used in the column mapper, the key field should be kept as is for existing assets.\n name: 'Diverter',\n color: '#BB9394',\n key: 'divertor',\n },\n\n {\n name: 'Powder Breaker',\n color: '#c732b8',\n key: 'powder_breaker',\n },\n\n {\n name: 'Powder Gel',\n color: '#308E23',\n key: 'powder_gel',\n },\n {\n name: 'Powder FR',\n color: '#30239E',\n key: 'powder_friction_reducer',\n },\n {\n name: 'Powder EB',\n color: '#A32A78',\n key: 'powder_enzyme_breaker',\n },\n {\n name: 'Fluid Loss',\n color: '#c7bd32',\n key: 'fluid_loss',\n },\n];\n\n// TODO: These checmials are shared between wits channels and settings chemicals app\n// Like proppants, we might need to separate those two usage.\nexport const CHEMICALS_TYPES = [\n ...CHEMICALS_VOL_TYPES.map(item => ({ ...item, unitType: 'volume' })),\n ...CHEMICALS_MASS_TYPES.map(item => ({ ...item, unitType: 'mass' })),\n];\n\nexport const PROPPANTS_TYPES = [\n {\n name: '100 Mesh',\n key: '100_mesh',\n unitType: 'mass',\n color: '#ff0000',\n },\n {\n name: '40/70 Brown',\n key: '40_70_brown',\n unitType: 'mass',\n color: '#603000',\n },\n {\n name: '40/70 Mesh',\n key: '40_70_mesh',\n unitType: 'mass',\n color: '#5454cc',\n },\n {\n name: '40/70 NWS',\n key: '40_70_nws',\n unitType: 'mass',\n color: '#ff4242',\n },\n {\n name: '40/70 RBS',\n key: '40_70_rbs',\n unitType: 'mass',\n color: '#ff42bc',\n },\n {\n name: '30/50 Brown',\n key: '30_50_brown',\n unitType: 'mass',\n color: '#964B00',\n },\n {\n name: '30/50 Mesh',\n key: '30_50_mesh',\n unitType: 'mass',\n color: '#9898cc',\n },\n {\n name: '25/50 Brown',\n key: '25_50_brown',\n unitType: 'mass',\n color: '#B27C45',\n },\n {\n name: '25/50 Mesh',\n key: '25_50_mesh',\n unitType: 'mass',\n color: '#32aa32',\n },\n {\n name: '20/40 Mesh',\n key: '20_40_mesh',\n unitType: 'mass',\n color: '#ff7979',\n },\n {\n name: 'Petroleum Coke',\n key: 'petroleum_coke',\n unitType: 'mass',\n color: '#ff7c4d',\n },\n];\n\nexport const PROPPANTS_CON_TYPES = [\n {\n name: 'Total Proppant Conc',\n key: 'total_proppant_concentration',\n unitType: 'massConcentration',\n unit: 'lb/gal',\n color: '#FF8F0B',\n },\n {\n name: 'BHPC',\n key: 'bottomhole_proppant_concentration',\n unitType: 'massConcentration',\n unit: 'lb/gal',\n color: '#9F4BED',\n precision: 2,\n },\n];\n\nexport const PROPPANTS_MASS_TYPES = [\n {\n name: 'Total Proppant Mass',\n key: 'total_proppant_mass',\n unitType: 'mass',\n color: '#EE964B',\n unit: 'lb',\n },\n {\n name: 'Streamed Proppant Mass',\n key: 'proppant_1_mass',\n unitType: 'mass',\n color: '#C6C013',\n unit: 'lb',\n },\n];\n\nexport const STAGE_ACTUAL_PARAM_COLORS = {\n top_perforation: '#0085e3',\n bottom_perforation: '#8BC7F2',\n perforated_length: '#519872',\n total_shots: '#9500b7',\n flush_volume: '#FF6161',\n};\n\nexport const PRESSURE_COLORS = {\n well_head_pressure: '#F50057',\n wellhead_sensor: '#A0A0A0',\n pipe_frictional_pressure_loss: '#D8496B',\n nwb_frictional_pressure_loss: '#807DFF',\n bottomhole_pressure: '#4DCFB3',\n net_pressure: '#EE752F',\n max_treating_pressure: '#F50258',\n ave_treating_pressure: '#FF6161',\n breakdown_pressure: '#03db5a',\n isip_pressure: '#7169AE',\n delta_pressure: '#efd34b',\n hydrostatic_pressure: '#E458C8',\n backside_pressure: '#32aa32',\n pumpside_pressure: '#855CF8',\n negative_hydrostatic_pressure: '#EF83D9',\n pressure_at_gauge_md: '#D43AB5',\n sleeve_pressure_loss: '#F9B6EB',\n};\n\nexport const TRACKING_CONCENTRATION_COLORS = {\n fr_concentration: '#D99C88',\n surfactant_concentration: '#FEF798',\n powder_breaker_concentration: '#993895',\n};\n\nexport const FLOW_RATE_COLORS = {\n clean_flow_rate_in: '#7CC900',\n slurry_flow_rate_in: '#64B5FF',\n max_flow_rate: '#0085e3',\n ave_flow_rate: '#8BC7F2',\n};\n\nexport const TOTAL_VOLUME_COLORS = {\n total_slurry_volume_in: '#7169AE',\n total_clean_volume_in: '#257CFF',\n};\n\nexport const COMPLETION_OPERATION_TYPE = [\n {\n name: 'Fracturing',\n key: 'fracturing',\n color: '#429FF8',\n },\n {\n name: 'Wireline',\n key: 'wireline',\n color: '#FF9C00',\n },\n {\n name: 'Swap Over - Fracturing',\n key: 'swap_over_fracturing',\n color: '#347EC5',\n },\n {\n name: 'Swap Over - Wireline',\n key: 'swap_over_wireline',\n color: '#BF7500',\n },\n {\n name: 'Waiting on Offset Wells',\n key: 'waiting_on_offset_wells',\n color: '#BDBDBD',\n },\n];\n\nexport const WIRELINE_PARAMETERS = [\n {\n key: 'line_speed',\n label: 'Line Speed',\n unitType: 'velocity',\n unit: 'ft/min',\n isDefaultView: true,\n },\n {\n key: 'line_tension',\n label: 'Line Tension',\n unitType: 'mass',\n unit: 'lb',\n isDefaultView: true,\n },\n {\n key: 'casing_collar_locator',\n label: 'CCL',\n isDefaultView: true,\n },\n {\n key: 'elapsed_time',\n label: 'Elapsed Time',\n unitType: 'time',\n unit: 's',\n },\n {\n key: 'voltage',\n label: 'Voltage',\n unitType: 'voltage',\n unit: 'mV',\n },\n {\n key: 'current',\n label: 'Current',\n unitType: 'current',\n unit: 'mA',\n },\n {\n key: 'measured_depth',\n label: 'Measured Depth',\n unitType: 'length',\n unit: 'ft',\n },\n];\n\nexport const EMPTY_FRAC_FLEET_LINE_LABEL_SUFFIX = ' (empty)';\n\nexport const DEFAULT_SUPPORTED_PAD_MODES = [\n {\n key: 'pad',\n label: 'Pad Mode',\n },\n];\n\n/**\n * There are 5 different modes in completion apps\n *\n * 1 - Pad Mode (Display data from all assets on pad in series)\n * 2 - Active Frac Mode (Display data from active frac asset on active pad)\n * 3 - Active Wireline Mode (Display data from active wireline asset on active pad)\n * 4 - Active Pumpdown Mode (Display data from active pumpdown asset on active pad)\n * 5 - Custom Mode (Display data from user selected asset on active pad)\n * 6 - Pad Line (Display data from selected simul frac line)\n *\n */\nexport const COMPLETION_MODES = {\n pad: 'pad',\n activeFrac: 'active_frac',\n activeWireline: 'active_wireline',\n activePumpdown: 'active_pumpdown',\n custom: 'custom',\n padLine: 'padLine',\n};\n\n/**\n * There are 8 different types of completion apps,\n * and each one will have different modes in the dropdown\n *\n * 1 - Pad apps\n * 2 - Frac & Wireline Multi-Well Apps\n * 3 - Frac Multi-Well Apps\n * 4 - Wireline Multi-Well Apps\n * 5 - Pumpdown Multi-Well Apps\n * 6 - Frac Single Well Apps\n * 7 - Wireline Single Well Apps\n * 8 - Pumpdown Single Well Apps\n *\n */\nexport const COMPLETION_APP_TYPES = {\n padApp: 'Pad Apps',\n fracWirelineMultiWellApp: 'Frac & Wireline Multi-Well Apps',\n fracMultiWellApp: 'Frac Multi-Well Apps',\n wirelineMultiWellApp: 'Wireline Multi-Well Apps',\n pumpdownMultiWellApp: 'Pumpdown Multi-Well Apps',\n fracSingleWellApp: 'Frac Single Well Apps',\n wirelineSingleWellApp: 'Wireline Single Well Apps',\n pumpdownSingleWellApp: 'Pumpdown Single Well Apps',\n};\n\nexport const COMPLETION_APPTYPE_MODES_DICT = {\n [COMPLETION_APP_TYPES.padApp]: [COMPLETION_MODES.pad, COMPLETION_MODES.custom],\n [COMPLETION_APP_TYPES.fracWirelineMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activeFrac,\n COMPLETION_MODES.activeWireline,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.fracMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activeFrac,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.fracSingleWellApp]: [COMPLETION_MODES.activeFrac, COMPLETION_MODES.custom],\n [COMPLETION_APP_TYPES.wirelineMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activeWireline,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.wirelineSingleWellApp]: [\n COMPLETION_MODES.activeWireline,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.pumpdownMultiWellApp]: [\n COMPLETION_MODES.pad,\n COMPLETION_MODES.activePumpdown,\n COMPLETION_MODES.custom,\n ],\n [COMPLETION_APP_TYPES.wirelineSingleWellApp]: [\n COMPLETION_MODES.activePumpdown,\n COMPLETION_MODES.custom,\n ],\n};\n"],"names":["CHEMICALS_VOL_TYPES","name","color","key","CHEMICALS_MASS_TYPES","CHEMICALS_TYPES","map","item","_objectSpread","unitType","COMPLETION_MODES","pad","activeFrac","activeWireline","activePumpdown","custom","padLine","COMPLETION_APP_TYPES","padApp","fracWirelineMultiWellApp","fracMultiWellApp","wirelineMultiWellApp","pumpdownMultiWellApp","fracSingleWellApp","wirelineSingleWellApp","pumpdownSingleWellApp","COMPLETION_APPTYPE_MODES_DICT","_defineProperty","_COMPLETION_APPTYPE_M","isFlatTime","label","clean_flow_rate_in","slurry_flow_rate_in","max_flow_rate","ave_flow_rate","well_head_pressure","wellhead_sensor","pipe_frictional_pressure_loss","nwb_frictional_pressure_loss","bottomhole_pressure","net_pressure","max_treating_pressure","ave_treating_pressure","breakdown_pressure","isip_pressure","delta_pressure","hydrostatic_pressure","backside_pressure","pumpside_pressure","negative_hydrostatic_pressure","pressure_at_gauge_md","sleeve_pressure_loss","unit","precision","top_perforation","bottom_perforation","perforated_length","total_shots","flush_volume","total_slurry_volume_in","total_clean_volume_in","fr_concentration","surfactant_concentration","powder_breaker_concentration","isDefaultView"],"mappings":"o1BAAO,IAgJMA,EAAsB,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,gBAAiB,UACjBC,8BAA+B,UAC/BC,6BAA8B,UAC9BC,oBAAqB,UACrBC,aAAc,UACdC,sBAAuB,UACvBC,sBAAuB,UACvBC,mBAAoB,UACpBC,cAAe,UACfC,eAAgB,UAChBC,qBAAsB,UACtBC,kBAAmB,UACnBC,kBAAmB,UACnBC,8BAA+B,UAC/BC,qBAAsB,UACtBC,qBAAsB,uCA5DW,CACjC,CACElD,KAAM,sBACNE,IAAK,+BACLM,SAAU,oBACV2C,KAAM,SACNlD,MAAO,WAET,CACED,KAAM,OACNE,IAAK,oCACLM,SAAU,oBACV2C,KAAM,SACNlD,MAAO,UACPmD,UAAW,iCAIqB,CAClC,CACEpD,KAAM,sBACNE,IAAK,sBACLM,SAAU,OACVP,MAAO,UACPkD,KAAM,MAER,CACEnD,KAAM,yBACNE,IAAK,kBACLM,SAAU,OACVP,MAAO,UACPkD,KAAM,+BApGqB,CAC7B,CACEnD,KAAM,WACNE,IAAK,WACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,YACNE,IAAK,YACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,YACNE,IAAK,YACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,aACNE,IAAK,aACLM,SAAU,OACVP,MAAO,WAET,CACED,KAAM,iBACNE,IAAK,iBACLM,SAAU,OACVP,MAAO,8CAuC8B,CACvCoD,gBAAiB,UACjBC,mBAAoB,UACpBC,kBAAmB,UACnBC,YAAa,UACbC,aAAc,uCA9SmB,CACjCzD,KAAM,kBACNE,IAAK,yBACLD,MAAO,uCA+U0B,CACjCyD,uBAAwB,UACxBC,sBAAuB,iDAfoB,CAC3CC,iBAAkB,UAClBC,yBAA0B,UAC1BC,6BAA8B,uCAjbG,CACjC,CACE9D,KAAM,mBACNE,IAAK,mBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,gBACNE,IAAK,gBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,SACNE,IAAK,SACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,cACNE,IAAK,cACL0B,YAAY,EACZ3B,MAAO,kDAIkC,CAC3C,CACED,KAAM,wBACNE,IAAK,4BACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,wBACNE,IAAK,8BACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,mBACNE,IAAK,uBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,mBACNE,IAAK,yBACL0B,YAAY,EACZ3B,MAAO,WAET,CACED,KAAM,SACNE,IAAK,SACL0B,YAAY,EACZ3B,MAAO,wCA8ZwB,CACjC,CACEC,IAAK,aACL2B,MAAO,aACPrB,SAAU,WACV2C,KAAM,SACNY,eAAe,GAEjB,CACE7D,IAAK,eACL2B,MAAO,eACPrB,SAAU,OACV2C,KAAM,KACNY,eAAe,GAEjB,CACE7D,IAAK,wBACL2B,MAAO,MACPkC,eAAe,GAEjB,CACE7D,IAAK,eACL2B,MAAO,eACPrB,SAAU,OACV2C,KAAM,KAER,CACEjD,IAAK,UACL2B,MAAO,UACPrB,SAAU,UACV2C,KAAM,MAER,CACEjD,IAAK,UACL2B,MAAO,UACPrB,SAAU,UACV2C,KAAM,MAER,CACEjD,IAAK,iBACL2B,MAAO,iBACPrB,SAAU,SACV2C,KAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PadMode.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppHeader/PadMode.js"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;yBAMlB,EACf,SAAS,EACT,KAAK,EACL,IAAI,EACJ,eAAoD,EACpD,WAA2C,EAC3C,iBAAiB,EACjB,6BAAqC,EACrC,0BAAkC,GACnC;;;;;;;;;CAAA;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PadMode.d.ts","sourceRoot":"","sources":["../../../../src/components/DevCenter/AppHeader/PadMode.js"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,YAAY,CAAC;yBAMlB,EACf,SAAS,EACT,KAAK,EACL,IAAI,EACJ,eAAoD,EACpD,WAA2C,EAC3C,iBAAiB,EACjB,6BAAqC,EACrC,0BAAkC,GACnC;;;;;;;;;CAAA;;;;;;;;;;;;;;;eA0Dc,OAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{isEmpty as t,get as r,noop as n}from"lodash";import o from"prop-types";import l from"../../PadModeSelect/PadModeSelect.js";import{COMPLETION_APP_TYPES as i}from"../../../constants/completion.js";import{getAssetKey as p,getDefaultPadModeSetting as a}from"../../../utils/completion.js";import{jsx as s}from"react/jsx-runtime";function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=function(n){var o,c=n.fracFleet,d=n.wells,b=n.well,y=n.onSettingChange,g=void 0===y?m:y,
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{isEmpty as t,get as r,noop as n}from"lodash";import o from"prop-types";import l from"../../PadModeSelect/PadModeSelect.js";import{COMPLETION_APP_TYPES as i}from"../../../constants/completion.js";import{getAssetKey as p,getDefaultPadModeSetting as a}from"../../../utils/completion.js";import{jsx as s}from"react/jsx-runtime";function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?c(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var d=function(n){var o,c=n.fracFleet,d=n.wells,b=n.well,y=n.onSettingChange,g=void 0===y?m:y,v=n.appSettings,O=void 0===v?u:v,S=n.completionAppType,P=n.disableActiveWellsInPadSelect,j=void 0!==P&&P,h=n.enableSimulFracInPadSelect,w=void 0!==h&&h;if(b||!c)return null;var A=O.padId,I=(null===(o=c.pad_frac_fleets.find((function(e){return A?+e.pad.id==+A:e.current})))||void 0===o?void 0:o.frac_fleet_lines)||[];if(t(d)&&(!w||!I.length))return null;var F=S||i.fracMultiWellApp,D=p(c,b,A),M=r(O,["settingsByAsset",D]),T=t(M)?a(c,b,F,w,A):M;return s(l,{assets:d,completionAppType:F,disableActiveWellsInPadSelect:j,enableSimulFracInPadSelect:w,padModeSetting:T,fracFleetLines:I,onChange:function(t){return g("settingsByAsset",f(f({},r(O,"settingsByAsset",{})),{},e({},D,t)))}})};d.propTypes={appSettings:o.shape({padId:o.number}),completionAppType:o.string,fracFleet:o.shape({}),onSettingChange:o.func,well:o.shape({}),wells:o.arrayOf(o.shape()),disableActiveWellsInPadSelect:o.bool,enableSimulFracInPadSelect:o.bool};var u={},m=n;export{d as default};
|
|
2
2
|
//# sourceMappingURL=PadMode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PadMode.js","sources":["../../../../src/components/DevCenter/AppHeader/PadMode.js"],"sourcesContent":["import { get, isEmpty, noop } from 'lodash';\nimport PropTypes from 'prop-types';\n\nimport PadModeSelect from '~/components/PadModeSelect';\nimport { COMPLETION_APP_TYPES } from '~/constants/completion';\nimport { getAssetKey, getDefaultPadModeSetting } from '~/utils/completion';\n\nconst PadMode = ({\n fracFleet,\n wells,\n well,\n onSettingChange = DEFAULT_PAD_MODE_ON_SETTING_CHANGE,\n appSettings = DEFAULT_PAD_MODE_APP_SETTINGS,\n completionAppType,\n disableActiveWellsInPadSelect = false,\n enableSimulFracInPadSelect = false,\n}) => {\n if (well ||
|
|
1
|
+
{"version":3,"file":"PadMode.js","sources":["../../../../src/components/DevCenter/AppHeader/PadMode.js"],"sourcesContent":["import { get, isEmpty, noop } from 'lodash';\nimport PropTypes from 'prop-types';\n\nimport PadModeSelect from '~/components/PadModeSelect';\nimport { COMPLETION_APP_TYPES } from '~/constants/completion';\nimport { getAssetKey, getDefaultPadModeSetting } from '~/utils/completion';\n\nconst PadMode = ({\n fracFleet,\n wells,\n well,\n onSettingChange = DEFAULT_PAD_MODE_ON_SETTING_CHANGE,\n appSettings = DEFAULT_PAD_MODE_APP_SETTINGS,\n completionAppType,\n disableActiveWellsInPadSelect = false,\n enableSimulFracInPadSelect = false,\n}) => {\n if (well || !fracFleet) return null;\n\n // use COMPLETION_APP_TYPES.fracMultiWellApp as a default if not defined in app;\n // this will be moved to the Apps Wizard soon\n // https://corvaqa.atlassian.net/browse/DC-1317\n\n const { padId } = appSettings;\n\n const lines =\n fracFleet.pad_frac_fleets.find(padFracFleet =>\n padId ? +padFracFleet.pad.id === +padId : padFracFleet.current\n )?.frac_fleet_lines || [];\n\n if (isEmpty(wells) && !(enableSimulFracInPadSelect && lines.length)) return null;\n\n const appType = completionAppType || COMPLETION_APP_TYPES.fracMultiWellApp;\n const assetKey = getAssetKey(fracFleet, well, padId);\n const currentPadModeSetting = get(appSettings, ['settingsByAsset', assetKey]);\n\n const padModeSetting = !isEmpty(currentPadModeSetting)\n ? currentPadModeSetting\n : getDefaultPadModeSetting(fracFleet, well, appType, enableSimulFracInPadSelect, padId);\n\n return (\n <PadModeSelect\n assets={wells}\n completionAppType={appType}\n disableActiveWellsInPadSelect={disableActiveWellsInPadSelect}\n enableSimulFracInPadSelect={enableSimulFracInPadSelect}\n padModeSetting={padModeSetting}\n fracFleetLines={lines}\n onChange={newPadModeSetting =>\n onSettingChange('settingsByAsset', {\n ...get(appSettings, 'settingsByAsset', {}),\n [assetKey]: newPadModeSetting,\n })\n }\n />\n );\n};\n\nPadMode.propTypes = {\n appSettings: PropTypes.shape({\n padId: PropTypes.number,\n }),\n completionAppType: PropTypes.string,\n fracFleet: PropTypes.shape({}),\n onSettingChange: PropTypes.func,\n well: PropTypes.shape({}),\n wells: PropTypes.arrayOf(PropTypes.shape()),\n disableActiveWellsInPadSelect: PropTypes.bool,\n enableSimulFracInPadSelect: PropTypes.bool,\n};\n\nconst DEFAULT_PAD_MODE_APP_SETTINGS = {};\nconst DEFAULT_PAD_MODE_ON_SETTING_CHANGE = noop;\n\nexport default PadMode;\n"],"names":["PadMode","_ref","_fracFleet$pad_frac_f","fracFleet","wells","well","_ref$onSettingChange","onSettingChange","DEFAULT_PAD_MODE_ON_SETTING_CHANGE","_ref$appSettings","appSettings","DEFAULT_PAD_MODE_APP_SETTINGS","completionAppType","_ref$disableActiveWel","disableActiveWellsInPadSelect","_ref$enableSimulFracI","enableSimulFracInPadSelect","padId","lines","pad_frac_fleets","find","padFracFleet","pad","id","current","frac_fleet_lines","isEmpty","length","appType","COMPLETION_APP_TYPES","fracMultiWellApp","assetKey","getAssetKey","currentPadModeSetting","get","padModeSetting","getDefaultPadModeSetting","_jsx","PadModeSelect","assets","fracFleetLines","onChange","newPadModeSetting","propT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AAUI,KAC3B3C,KAAMuC,EAAUC,MAAM,IACtBzC,MAAOwC,EAAUK,QAAQL,EAAUC,SACnC/B,8BAA+B8B,EAAUM,KACzClC,2BAA4B4B,EAAUM,MAGxC,IAAMvC,EAAgC,CAAA,EAChCH,EAAqC2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PadMode.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppHeader/__tests__/PadMode.test.js"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type AppsDataRequest = 'WELLS' | 'RIGS' | 'FRAC_FLEETS' | 'FRAC_FLEET_WELLS' | 'PAD_WELLS' | 'INTERVENTION_UNITS' | 'INTERVENTION_UNIT_WELLS';
|
|
1
|
+
export type AppsDataRequest = 'WELLS' | 'RIGS' | 'FRAC_FLEETS' | 'FRAC_FLEETS_REFRESH' | 'FRAC_FLEET_WELLS' | 'PAD_WELLS' | 'INTERVENTION_UNITS' | 'INTERVENTION_UNIT_WELLS';
|
|
2
2
|
export declare const APPS_DATA_REQUESTS: {
|
|
3
3
|
[Request in AppsDataRequest]: Request;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,MAAM,GACN,aAAa,GACb,kBAAkB,GAClB,WAAW,GACX,oBAAoB,GACpB,yBAAyB,CAAC;AAE9B,eAAO,MAAM,kBAAkB,EAAE;KAAG,OAAO,IAAI,eAAe,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GACvB,OAAO,GACP,MAAM,GACN,aAAa,GACb,qBAAqB,GACrB,kBAAkB,GAClB,WAAW,GACX,oBAAoB,GACpB,yBAAyB,CAAC;AAE9B,eAAO,MAAM,kBAAkB,EAAE;KAAG,OAAO,IAAI,eAAe,GAAG,OAAO;CASvE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var E={WELLS:"WELLS",RIGS:"RIGS",FRAC_FLEETS:"FRAC_FLEETS",FRAC_FLEET_WELLS:"FRAC_FLEET_WELLS",PAD_WELLS:"PAD_WELLS",INTERVENTION_UNITS:"INTERVENTION_UNITS",INTERVENTION_UNIT_WELLS:"INTERVENTION_UNIT_WELLS"};export{E as APPS_DATA_REQUESTS};
|
|
1
|
+
var E={WELLS:"WELLS",RIGS:"RIGS",FRAC_FLEETS:"FRAC_FLEETS",FRAC_FLEETS_REFRESH:"FRAC_FLEETS_REFRESH",FRAC_FLEET_WELLS:"FRAC_FLEET_WELLS",PAD_WELLS:"PAD_WELLS",INTERVENTION_UNITS:"INTERVENTION_UNITS",INTERVENTION_UNIT_WELLS:"INTERVENTION_UNIT_WELLS"};export{E as APPS_DATA_REQUESTS};
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/constants.ts"],"sourcesContent":["export type AppsDataRequest =\n | 'WELLS'\n | 'RIGS'\n | 'FRAC_FLEETS'\n | 'FRAC_FLEET_WELLS'\n | 'PAD_WELLS'\n | 'INTERVENTION_UNITS'\n | 'INTERVENTION_UNIT_WELLS';\n\nexport const APPS_DATA_REQUESTS: { [Request in AppsDataRequest]: Request } = {\n WELLS: 'WELLS',\n RIGS: 'RIGS',\n FRAC_FLEETS: 'FRAC_FLEETS',\n FRAC_FLEET_WELLS: 'FRAC_FLEET_WELLS',\n PAD_WELLS: 'PAD_WELLS',\n INTERVENTION_UNITS: 'INTERVENTION_UNITS',\n INTERVENTION_UNIT_WELLS: 'INTERVENTION_UNIT_WELLS',\n};\n"],"names":["APPS_DATA_REQUESTS","WELLS","RIGS","FRAC_FLEETS","FRAC_FLEET_WELLS","PAD_WELLS","INTERVENTION_UNITS","INTERVENTION_UNIT_WELLS"],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/constants.ts"],"sourcesContent":["export type AppsDataRequest =\n | 'WELLS'\n | 'RIGS'\n | 'FRAC_FLEETS'\n | 'FRAC_FLEETS_REFRESH'\n | 'FRAC_FLEET_WELLS'\n | 'PAD_WELLS'\n | 'INTERVENTION_UNITS'\n | 'INTERVENTION_UNIT_WELLS';\n\nexport const APPS_DATA_REQUESTS: { [Request in AppsDataRequest]: Request } = {\n WELLS: 'WELLS',\n RIGS: 'RIGS',\n FRAC_FLEETS: 'FRAC_FLEETS',\n FRAC_FLEETS_REFRESH: 'FRAC_FLEETS_REFRESH',\n FRAC_FLEET_WELLS: 'FRAC_FLEET_WELLS',\n PAD_WELLS: 'PAD_WELLS',\n INTERVENTION_UNITS: 'INTERVENTION_UNITS',\n INTERVENTION_UNIT_WELLS: 'INTERVENTION_UNIT_WELLS',\n};\n"],"names":["APPS_DATA_REQUESTS","WELLS","RIGS","FRAC_FLEETS","FRAC_FLEETS_REFRESH","FRAC_FLEET_WELLS","PAD_WELLS","INTERVENTION_UNITS","INTERVENTION_UNIT_WELLS"],"mappings":"AAUO,IAAMA,EAAgE,CAC3EC,MAAO,QACPC,KAAM,OACNC,YAAa,cACbC,oBAAqB,sBACrBC,iBAAkB,mBAClBC,UAAW,YACXC,mBAAoB,qBACpBC,wBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataResolvers.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/dataResolvers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAiCnD,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,SAC1B,WAAW,EAAE,qBACA,gBAAgB,KAClC,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAWlC,CAAC;AAEF,eAAO,MAAM,iCAAiC,uBACxB,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,SAC9C,gBAAgB,KACtB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAoCrC,CAAC;AAGF,eAAO,MAAM,0BAA0B,SAC/B,mBAAmB,EAAE,oBACT,gBAAgB,SAC3B,gBAAgB,KACtB,OAAO,CAAC,mBAAmB,EAAE,CAgB/B,CAAC;AAEF,eAAO,MAAM,eAAe,8DAMzB,qBAAqB,KAAG,OAAO,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"dataResolvers.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/dataResolvers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAiCnD,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,KAAK,EAAE,gBAAgB,CAAC;IACxB,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,qBAAqB,SAC1B,WAAW,EAAE,qBACA,gBAAgB,KAClC,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAWlC,CAAC;AAEF,eAAO,MAAM,iCAAiC,uBACxB,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,SAC9C,gBAAgB,KACtB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAoCrC,CAAC;AAGF,eAAO,MAAM,0BAA0B,SAC/B,mBAAmB,EAAE,oBACT,gBAAgB,SAC3B,gBAAgB,KACtB,OAAO,CAAC,mBAAmB,EAAE,CAgB/B,CAAC;AAEF,eAAO,MAAM,eAAe,8DAMzB,qBAAqB,KAAG,OAAO,CAAC,cAAc,CAiFhD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/toConsumableArray";import s from"@babel/runtime/regenerator";import{merge as u}from"lodash";import{ASSET_TYPES as a}from"../../../../constants/assetTypes.js";import{APPS_DATA_REQUESTS as
|
|
1
|
+
import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/asyncToGenerator";import n from"@babel/runtime/helpers/toConsumableArray";import s from"@babel/runtime/regenerator";import{merge as u}from"lodash";import{ASSET_TYPES as a}from"../../../../constants/assetTypes.js";import{APPS_DATA_REQUESTS as c}from"./constants.js";import{buildWellCache as i,buildRigCache as o,buildFracFleetCache as p,buildInterventionUnitCache as d,getAppsDataByWells as l,getAppsDataByRigs as f,getAppsDataByFFs as I,getAppsDataByPads as b,getAppsDataByInterventionUnits as m,prepareDataForResolver as y,getUniqAssetIds as E,fetchWells as v,fetchRigs as O,fetchFracFleets as h,fetchFracFleetWells as F,fetchPadWells as L,fetchInterventionUnits as S,isAppWithSettings as T,getAppAssetSpecificTypeId as g,fetchAssetEntitiesByAssetIds as w}from"./utils.js";function _(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var N=[c.WELLS,c.RIGS,c.FRAC_FLEETS,c.FRAC_FLEET_WELLS,c.PAD_WELLS,c.INTERVENTION_UNITS],R=function(e,r){var t=e.reduce((function(e,t){if(T(t))return e;var n=g(t,"deprecatedAssetId");return e.add(n||r),e}),new Set);return n(t)},A=function(){var e=t(s.mark((function e(t,n){var u,c,i,o,p,d,l;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=n.current.deprecatedAssetData,c=Object.keys(u),(i=t.filter((function(e){return!c.includes(String(e))}))).length){e.next=5;break}return e.abrupt("return",u);case 5:return e.next=7,w(i);case 7:if(o=e.sent){e.next=10;break}return e.abrupt("return",u);case 10:return p={rig:a.rig.id,well:a.well.id},d=Object.values(o).flat().reduce((function(e,t){var n=t.data;return e[n.attributes.asset_id]=r({},p[n.type],n.id),e}),{}),l=j(j({},u),d),n.current.cachedDeprecatedAssetData=l,e.abrupt("return",l);case 15:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),P=function(){var e=t(s.mark((function e(r,t,n){var u;return s.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,A(R(r,t),n);case 2:return u=e.sent,e.abrupt("return",r.map((function(e){if(T(e))return e;var r=g(e,"deprecatedAssetId");return j(j({},e),{},{settings:u[r||String(t)]})})));case 4:case"end":return e.stop()}}),e)})));return function(r,t,n){return e.apply(this,arguments)}}(),W=function(){var r=t(s.mark((function r(t){var n,a,T,g,w,_,R,A,W,x,B,D,U,k,C,q,V,G,H,z,J,K,M,Q,X,Y,Z,$,ee,re,te,ne,se,ue,ae,ce,ie,oe,pe;return s.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=t.apps,a=t.dashboardAssetId,T=t.cache,g=t.updateCache,w=t.requests,_=void 0===w?N:w,r.next=3,P(n,a,T);case 3:return R=r.sent,A=y(R,T),W=A.appsWellIds,x=A.appsRigIds,B=A.appsFracFleetIds,D=A.appsInterventionUnitIds,U=A.appsFracFleetToFetchWellsIds,k=A.appsPadIds,C=A.uniqueWellIds,q=A.uniqueRigIds,V=A.uniqueFFIds,G=A.uniqueInterventionUnitIds,H=E(D,[]),z=_.includes(c.INTERVENTION_UNIT_WELLS)?H:G,J=_.includes(c.FRAC_FLEETS_REFRESH),K=J?E(B,[]):V,r.next=11,Promise.all([_.includes(c.WELLS)&&v(C),_.includes(c.RIGS)&&O(q),(_.includes(c.FRAC_FLEETS)||J)&&h(K),_.includes(c.FRAC_FLEET_WELLS)&&F(U,n),_.includes(c.PAD_WELLS)&&L(k,n),(_.includes(c.INTERVENTION_UNITS)||_.includes(c.INTERVENTION_UNIT_WELLS))&&S(z)]);case 11:return M=r.sent,Q=e(M,6),X=Q[0],Y=Q[1],Z=Q[2],$=Q[3],ee=Q[4],re=Q[5],te=X?i(X):{},ne=Y?o(Y):{},se=Z?p(Z):{},ue=re?d(re):{},g({wellsById:te,rigsById:ne,interventionUnitsById:ue}),T.current.fracFleetsById=j(j({},T.current.fracFleetsById),se),ae=l(W,T.current.wellsById),ce=f(x,T.current.rigsById),ie=I(B,T.current.fracFleetsById,$),oe=b(k,ee),pe=m(D,T.current.interventionUnitsById,W,T.current.wellsById),r.abrupt("return",u(ae,ce,ie,oe,pe));case 31:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}();export{A as getAppSettingsByDeprecatedAssetId,P as getAppsWithUnifiedSettings,R as getDeprecatedAssetIds,W as resolveAppsData};
|
|
2
2
|
//# sourceMappingURL=dataResolvers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataResolvers.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/dataResolvers.ts"],"sourcesContent":["import { merge } from 'lodash';\n\nimport { ASSET_TYPES } from '~/constants/assetTypes';\n\nimport type {\n AppDataPatches,\n AppSettings,\n AppsDataCacheRef,\n AssetId,\n DashboardAssetId,\n PreparedProviderApp,\n ProviderApp,\n UpdateAppsDataCache,\n} from '../types';\nimport { APPS_DATA_REQUESTS } from './constants';\nimport type { AppsDataRequest } from './constants';\nimport {\n buildFracFleetCache,\n buildInterventionUnitCache,\n buildRigCache,\n buildWellCache,\n fetchAssetEntitiesByAssetIds,\n fetchFracFleets,\n fetchFracFleetWells,\n fetchInterventionUnits,\n fetchPadWells,\n fetchRigs,\n fetchWells,\n getAppsDataByFFs,\n getAppsDataByInterventionUnits,\n getAppsDataByPads,\n getAppsDataByRigs,\n getAppsDataByWells,\n getAppAssetSpecificTypeId,\n getUniqAssetIds,\n isAppWithSettings,\n prepareDataForResolver,\n} from './utils';\n\nconst DEFAULT_REQUESTS: AppsDataRequest[] = [\n APPS_DATA_REQUESTS.WELLS,\n APPS_DATA_REQUESTS.RIGS,\n APPS_DATA_REQUESTS.FRAC_FLEETS,\n APPS_DATA_REQUESTS.FRAC_FLEET_WELLS,\n APPS_DATA_REQUESTS.PAD_WELLS,\n APPS_DATA_REQUESTS.INTERVENTION_UNITS,\n];\n\ntype ResolveAppsDataParams = {\n apps: PreparedProviderApp[];\n dashboardAssetId?: DashboardAssetId;\n cache: AppsDataCacheRef;\n updateCache: UpdateAppsDataCache;\n requests?: AppsDataRequest[];\n};\n\nexport const getDeprecatedAssetIds = (\n apps: ProviderApp[],\n dashboardAssetId?: DashboardAssetId\n): Array<AssetId | null | undefined> => {\n const uniqueIds = apps.reduce<Set<AssetId | null | undefined>>((acc, app) => {\n if (isAppWithSettings(app)) return acc;\n\n const deprecatedAssetId = getAppAssetSpecificTypeId(app, 'deprecatedAssetId');\n acc.add(deprecatedAssetId || dashboardAssetId);\n\n return acc;\n }, new Set());\n\n return [...uniqueIds];\n};\n\nexport const getAppSettingsByDeprecatedAssetId = async (\n deprecatedAssetIds: Array<AssetId | null | undefined>,\n cache: AppsDataCacheRef\n): Promise<Record<string, AppSettings>> => {\n const { deprecatedAssetData: cachedDeprecatedAssetData } = cache.current;\n const cachedDeprecatedAssetIds = Object.keys(cachedDeprecatedAssetData);\n const notResolvedDeprecatedAssetIds = deprecatedAssetIds.filter(\n deprecatedAssetId => !cachedDeprecatedAssetIds.includes(String(deprecatedAssetId))\n );\n\n if (!notResolvedDeprecatedAssetIds.length) return cachedDeprecatedAssetData;\n\n const assetsData = await fetchAssetEntitiesByAssetIds(notResolvedDeprecatedAssetIds);\n if (!assetsData) return cachedDeprecatedAssetData;\n\n const deprecatedAssetTypeToSetting: Record<string, string> = {\n rig: ASSET_TYPES.rig.id,\n well: ASSET_TYPES.well.id,\n };\n\n const dataByDeprecatedAssetId = Object.values(assetsData)\n .flat()\n .reduce<Record<string, AppSettings>>((acc, { data }) => {\n acc[data.attributes.asset_id] = {\n [deprecatedAssetTypeToSetting[data.type]]: data.id,\n };\n\n return acc;\n }, {});\n\n const updatedCachedDeprecatedAssetData = {\n ...cachedDeprecatedAssetData,\n ...dataByDeprecatedAssetId,\n };\n\n // Keep the legacy typo during this type-only migration; changing cache behavior is separate.\n cache.current.cachedDeprecatedAssetData = updatedCachedDeprecatedAssetData;\n\n return updatedCachedDeprecatedAssetData;\n};\n\n// NOTE: converts feed page apps and asset page apps deprecated asset ids to regular rigId/wellId in app settings\nexport const getAppsWithUnifiedSettings = async (\n apps: PreparedProviderApp[],\n dashboardAssetId: DashboardAssetId,\n cache: AppsDataCacheRef\n): Promise<PreparedProviderApp[]> => {\n const appSettingsByDeprecatedAssetId = await getAppSettingsByDeprecatedAssetId(\n getDeprecatedAssetIds(apps, dashboardAssetId),\n cache\n );\n\n return apps.map(app => {\n if (isAppWithSettings(app)) return app;\n\n const appDeprecatedAssetId = getAppAssetSpecificTypeId(app, 'deprecatedAssetId');\n\n return {\n ...app,\n settings: appSettingsByDeprecatedAssetId[appDeprecatedAssetId || String(dashboardAssetId)],\n };\n });\n};\n\nexport const resolveAppsData = async ({\n apps,\n dashboardAssetId,\n cache,\n updateCache,\n requests = DEFAULT_REQUESTS,\n}: ResolveAppsDataParams): Promise<AppDataPatches> => {\n const unifiedApps = await getAppsWithUnifiedSettings(apps, dashboardAssetId, cache);\n const {\n appsWellIds,\n appsRigIds,\n appsFracFleetIds,\n appsInterventionUnitIds,\n appsFracFleetToFetchWellsIds,\n appsPadIds,\n uniqueWellIds,\n uniqueRigIds,\n uniqueFFIds,\n uniqueInterventionUnitIds,\n } = prepareDataForResolver(unifiedApps, cache);\n\n // NOTE: Non-cache-filtered IDs for intervention unit wells refresh\n const allInterventionUnitIds = getUniqAssetIds(appsInterventionUnitIds, []);\n const interventionUnitIdsToFetch = requests.includes(APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS)\n ? allInterventionUnitIds\n : uniqueInterventionUnitIds;\n\n const [\n wellsResponse,\n rigsResponse,\n fracFleetsResponse,\n fracFleetWellsData,\n padWellsData,\n interventionUnitsResponse,\n ] = await Promise.all([\n requests.includes(APPS_DATA_REQUESTS.WELLS) && fetchWells(uniqueWellIds),\n requests.includes(APPS_DATA_REQUESTS.RIGS) && fetchRigs(uniqueRigIds),\n requests.includes(APPS_DATA_REQUESTS.FRAC_FLEETS) && fetchFracFleets(uniqueFFIds),\n requests.includes(APPS_DATA_REQUESTS.FRAC_FLEET_WELLS) &&\n fetchFracFleetWells(appsFracFleetToFetchWellsIds, apps),\n requests.includes(APPS_DATA_REQUESTS.PAD_WELLS) && fetchPadWells(appsPadIds, apps),\n (requests.includes(APPS_DATA_REQUESTS.INTERVENTION_UNITS) ||\n requests.includes(APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS)) &&\n fetchInterventionUnits(interventionUnitIdsToFetch),\n ]);\n\n const fetchedWellsById = wellsResponse ? buildWellCache(wellsResponse) : {};\n const fetchedRigsById = rigsResponse ? buildRigCache(rigsResponse) : {};\n const fetchedFracFleetsById = fracFleetsResponse ? buildFracFleetCache(fracFleetsResponse) : {};\n const fetchedInterventionUnitsById = interventionUnitsResponse\n ? buildInterventionUnitCache(interventionUnitsResponse)\n : {};\n\n updateCache({\n wellsById: fetchedWellsById,\n rigsById: fetchedRigsById,\n fracFleetsById: fetchedFracFleetsById,\n interventionUnitsById: fetchedInterventionUnitsById,\n });\n\n const appsDataByWells = getAppsDataByWells(appsWellIds, cache.current.wellsById);\n const appsDataByRigs = getAppsDataByRigs(appsRigIds, cache.current.rigsById);\n const appsDataByFracFleets = getAppsDataByFFs(\n appsFracFleetIds,\n cache.current.fracFleetsById,\n fracFleetWellsData\n );\n const appsDataByPads = getAppsDataByPads(appsPadIds, padWellsData);\n const appsDataByInterventionUnits = getAppsDataByInterventionUnits(\n appsInterventionUnitIds,\n cache.current.interventionUnitsById,\n appsWellIds,\n cache.current.wellsById\n );\n\n return merge(\n appsDataByWells,\n appsDataByRigs,\n appsDataByFracFleets,\n appsDataByPads,\n appsDataByInterventionUnits\n );\n};\n"],"names":["DEFAULT_REQUESTS","APPS_DATA_REQUESTS","WELLS","RIGS","FRAC_FLEETS","FRAC_FLEET_WELLS","PAD_WELLS","INTERVENTION_UNITS","getDeprecatedAssetIds","apps","dashboardAssetId","uniqueIds","reduce","acc","app","isAppWithSettings","deprecatedAssetId","getAppAssetSpecificTypeId","add","Set","_toConsumableArray","getAppSettingsByDeprecatedAssetId","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","deprecatedAssetIds","cache","cachedDeprecatedAssetData","cachedDeprecatedAssetIds","notResolvedDeprecatedAssetIds","assetsData","deprecatedAssetTypeToSetting","dataByDeprecatedAssetId","updatedCachedDeprecatedAssetData","wrap","_context","prev","next","current","deprecatedAssetData","Object","keys","filter","includes","String","length","abrupt","fetchAssetEntitiesByAssetIds","sent","rig","ASSET_TYPES","id","well","values","flat","_ref2","data","attributes","asset_id","type","stop","_x","_x2","apply","this","arguments","getAppsWithUnifiedSettings","_ref3","appSettingsByDeprecatedAssetId","_context2","map","appDeprecatedAssetId","_objectSpread","settings","_callee2","_x3","_x4","_x5","resolveAppsData","_ref5","_callee3","_ref4","updateCache","_ref4$requests","requests","unifiedApps","_prepareDataForResolv","appsWellIds","appsRigIds","appsFracFleetIds","appsInterventionUnitIds","appsFracFleetToFetchWellsIds","appsPadIds","uniqueWellIds","uniqueRigIds","uniqueFFIds","uniqueInterventionUnitIds","allInterventionUnitIds","interventionUnitIdsToFetch","_yield$Promise$all","_yield$Promise$all2","wellsResponse","rigsResponse","fracFleetsResponse","fracFleetWellsData","padWellsData","interventionUnitsResponse","fetchedWellsById","fetchedRigsById","fetchedFracFleetsById","fetchedInterventionUnitsById","appsDataByWells","appsDataByRigs","appsDataByFracFleets","appsDataByPads","appsDataByInterventionUnits","_context3","prepareDataForResolver","getUniqAssetIds","INTERVENTION_UNIT_WELLS","Promise","all","fetchWells","fetchRigs","fetchFracFleets","fetchFracFleetWells","fetchPadWells","fetchInterventionUnits","_slicedToArray","buildWellCache","buildRigCache","buildFracFleetCache","buildInterventionUnitCache","wellsById","rigsById","fracFleetsById","interventionUnitsById","getAppsDataByWells","getAppsDataByRigs","getAppsDataByFFs","getAppsDataByPads","getAppsDataByInterventionUnits","merge","_x6"],"mappings":"m9CAuCA,IAAMA,EAAsC,CAC1CC,EAAmBC,MACnBD,EAAmBE,KACnBF,EAAmBG,YACnBH,EAAmBI,iBACnBJ,EAAmBK,UACnBL,EAAmBM,oBAWRC,EAAwB,SACnCC,EACAC,GAEA,IAAMC,EAAY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EAAA,GAarBO,EAAmBN,EAAgB4B,EAAe5B,GAAiB,CAAA,EACnEO,GAAkBN,EAAe4B,EAAc5B,GAAgB,CAAA,EAC/DO,GAAwBN,EAAqB4B,EAAoB5B,GAAsB,CAAA,EACvFO,GAA+BJ,EACjC0B,EAA2B1B,GAC3B,CAAA,EAEJxB,EAAY,CACVmD,UAAW1B,EACX2B,SAAU1B,GACV2B,eAAgB1B,GAChB2B,sBAAuB1B,KAGnBC,GAAkB0B,EAAmBlD,EAAa7D,EAAMY,QAAQ+F,WAChErB,GAAiB0B,EAAkBlD,EAAY9D,EAAMY,QAAQgG,UAC7DrB,GAAuB0B,EAC3BlD,EACA/D,EAAMY,QAAQiG,eACd/B,GAEIU,GAAiB0B,EAAkBhD,EAAYa,GAC/CU,GAA8B0B,EAClCnD,EACAhE,EAAMY,QAAQkG,sBACdjD,EACA7D,EAAMY,QAAQ+F,WAGTS,EAAAA,OAAAA,SAAAA,EACL/B,GACAC,GACAC,GACAC,GACAC,KACD,KAAA,GAAA,IAAA,MAAA,OAAAC,EAAAxD,OAAA,GAAAoB,EACF,KAAA,OAAA,SAlF2B+D,GAAA,OAAAhE,EAAAhB,MAAAC,KAAAC,UAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"dataResolvers.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/dataResolvers.ts"],"sourcesContent":["import { merge } from 'lodash';\n\nimport { ASSET_TYPES } from '~/constants/assetTypes';\n\nimport type {\n AppDataPatches,\n AppSettings,\n AppsDataCacheRef,\n AssetId,\n DashboardAssetId,\n PreparedProviderApp,\n ProviderApp,\n UpdateAppsDataCache,\n} from '../types';\nimport { APPS_DATA_REQUESTS } from './constants';\nimport type { AppsDataRequest } from './constants';\nimport {\n buildFracFleetCache,\n buildInterventionUnitCache,\n buildRigCache,\n buildWellCache,\n fetchAssetEntitiesByAssetIds,\n fetchFracFleets,\n fetchFracFleetWells,\n fetchInterventionUnits,\n fetchPadWells,\n fetchRigs,\n fetchWells,\n getAppsDataByFFs,\n getAppsDataByInterventionUnits,\n getAppsDataByPads,\n getAppsDataByRigs,\n getAppsDataByWells,\n getAppAssetSpecificTypeId,\n getUniqAssetIds,\n isAppWithSettings,\n prepareDataForResolver,\n} from './utils';\n\nconst DEFAULT_REQUESTS: AppsDataRequest[] = [\n APPS_DATA_REQUESTS.WELLS,\n APPS_DATA_REQUESTS.RIGS,\n APPS_DATA_REQUESTS.FRAC_FLEETS,\n APPS_DATA_REQUESTS.FRAC_FLEET_WELLS,\n APPS_DATA_REQUESTS.PAD_WELLS,\n APPS_DATA_REQUESTS.INTERVENTION_UNITS,\n];\n\ntype ResolveAppsDataParams = {\n apps: PreparedProviderApp[];\n dashboardAssetId?: DashboardAssetId;\n cache: AppsDataCacheRef;\n updateCache: UpdateAppsDataCache;\n requests?: AppsDataRequest[];\n};\n\nexport const getDeprecatedAssetIds = (\n apps: ProviderApp[],\n dashboardAssetId?: DashboardAssetId\n): Array<AssetId | null | undefined> => {\n const uniqueIds = apps.reduce<Set<AssetId | null | undefined>>((acc, app) => {\n if (isAppWithSettings(app)) return acc;\n\n const deprecatedAssetId = getAppAssetSpecificTypeId(app, 'deprecatedAssetId');\n acc.add(deprecatedAssetId || dashboardAssetId);\n\n return acc;\n }, new Set());\n\n return [...uniqueIds];\n};\n\nexport const getAppSettingsByDeprecatedAssetId = async (\n deprecatedAssetIds: Array<AssetId | null | undefined>,\n cache: AppsDataCacheRef\n): Promise<Record<string, AppSettings>> => {\n const { deprecatedAssetData: cachedDeprecatedAssetData } = cache.current;\n const cachedDeprecatedAssetIds = Object.keys(cachedDeprecatedAssetData);\n const notResolvedDeprecatedAssetIds = deprecatedAssetIds.filter(\n deprecatedAssetId => !cachedDeprecatedAssetIds.includes(String(deprecatedAssetId))\n );\n\n if (!notResolvedDeprecatedAssetIds.length) return cachedDeprecatedAssetData;\n\n const assetsData = await fetchAssetEntitiesByAssetIds(notResolvedDeprecatedAssetIds);\n if (!assetsData) return cachedDeprecatedAssetData;\n\n const deprecatedAssetTypeToSetting: Record<string, string> = {\n rig: ASSET_TYPES.rig.id,\n well: ASSET_TYPES.well.id,\n };\n\n const dataByDeprecatedAssetId = Object.values(assetsData)\n .flat()\n .reduce<Record<string, AppSettings>>((acc, { data }) => {\n acc[data.attributes.asset_id] = {\n [deprecatedAssetTypeToSetting[data.type]]: data.id,\n };\n\n return acc;\n }, {});\n\n const updatedCachedDeprecatedAssetData = {\n ...cachedDeprecatedAssetData,\n ...dataByDeprecatedAssetId,\n };\n\n // Keep the legacy typo during this type-only migration; changing cache behavior is separate.\n cache.current.cachedDeprecatedAssetData = updatedCachedDeprecatedAssetData;\n\n return updatedCachedDeprecatedAssetData;\n};\n\n// NOTE: converts feed page apps and asset page apps deprecated asset ids to regular rigId/wellId in app settings\nexport const getAppsWithUnifiedSettings = async (\n apps: PreparedProviderApp[],\n dashboardAssetId: DashboardAssetId,\n cache: AppsDataCacheRef\n): Promise<PreparedProviderApp[]> => {\n const appSettingsByDeprecatedAssetId = await getAppSettingsByDeprecatedAssetId(\n getDeprecatedAssetIds(apps, dashboardAssetId),\n cache\n );\n\n return apps.map(app => {\n if (isAppWithSettings(app)) return app;\n\n const appDeprecatedAssetId = getAppAssetSpecificTypeId(app, 'deprecatedAssetId');\n\n return {\n ...app,\n settings: appSettingsByDeprecatedAssetId[appDeprecatedAssetId || String(dashboardAssetId)],\n };\n });\n};\n\nexport const resolveAppsData = async ({\n apps,\n dashboardAssetId,\n cache,\n updateCache,\n requests = DEFAULT_REQUESTS,\n}: ResolveAppsDataParams): Promise<AppDataPatches> => {\n const unifiedApps = await getAppsWithUnifiedSettings(apps, dashboardAssetId, cache);\n const {\n appsWellIds,\n appsRigIds,\n appsFracFleetIds,\n appsInterventionUnitIds,\n appsFracFleetToFetchWellsIds,\n appsPadIds,\n uniqueWellIds,\n uniqueRigIds,\n uniqueFFIds,\n uniqueInterventionUnitIds,\n } = prepareDataForResolver(unifiedApps, cache);\n\n // NOTE: Non-cache-filtered IDs for intervention unit wells refresh\n const allInterventionUnitIds = getUniqAssetIds(appsInterventionUnitIds, []);\n const interventionUnitIdsToFetch = requests.includes(APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS)\n ? allInterventionUnitIds\n : uniqueInterventionUnitIds;\n const isFracFleetsRefresh = requests.includes(APPS_DATA_REQUESTS.FRAC_FLEETS_REFRESH);\n const fracFleetIdsToFetch = isFracFleetsRefresh\n ? getUniqAssetIds(appsFracFleetIds, [])\n : uniqueFFIds;\n\n const [\n wellsResponse,\n rigsResponse,\n fracFleetsResponse,\n fracFleetWellsData,\n padWellsData,\n interventionUnitsResponse,\n ] = await Promise.all([\n requests.includes(APPS_DATA_REQUESTS.WELLS) && fetchWells(uniqueWellIds),\n requests.includes(APPS_DATA_REQUESTS.RIGS) && fetchRigs(uniqueRigIds),\n (requests.includes(APPS_DATA_REQUESTS.FRAC_FLEETS) || isFracFleetsRefresh) &&\n fetchFracFleets(fracFleetIdsToFetch),\n requests.includes(APPS_DATA_REQUESTS.FRAC_FLEET_WELLS) &&\n fetchFracFleetWells(appsFracFleetToFetchWellsIds, apps),\n requests.includes(APPS_DATA_REQUESTS.PAD_WELLS) && fetchPadWells(appsPadIds, apps),\n (requests.includes(APPS_DATA_REQUESTS.INTERVENTION_UNITS) ||\n requests.includes(APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS)) &&\n fetchInterventionUnits(interventionUnitIdsToFetch),\n ]);\n\n const fetchedWellsById = wellsResponse ? buildWellCache(wellsResponse) : {};\n const fetchedRigsById = rigsResponse ? buildRigCache(rigsResponse) : {};\n const fetchedFracFleetsById = fracFleetsResponse ? buildFracFleetCache(fracFleetsResponse) : {};\n const fetchedInterventionUnitsById = interventionUnitsResponse\n ? buildInterventionUnitCache(interventionUnitsResponse)\n : {};\n\n updateCache({\n wellsById: fetchedWellsById,\n rigsById: fetchedRigsById,\n interventionUnitsById: fetchedInterventionUnitsById,\n });\n cache.current.fracFleetsById = { ...cache.current.fracFleetsById, ...fetchedFracFleetsById };\n\n const appsDataByWells = getAppsDataByWells(appsWellIds, cache.current.wellsById);\n const appsDataByRigs = getAppsDataByRigs(appsRigIds, cache.current.rigsById);\n const appsDataByFracFleets = getAppsDataByFFs(\n appsFracFleetIds,\n cache.current.fracFleetsById,\n fracFleetWellsData\n );\n const appsDataByPads = getAppsDataByPads(appsPadIds, padWellsData);\n const appsDataByInterventionUnits = getAppsDataByInterventionUnits(\n appsInterventionUnitIds,\n cache.current.interventionUnitsById,\n appsWellIds,\n cache.current.wellsById\n );\n\n return merge(\n appsDataByWells,\n appsDataByRigs,\n appsDataByFracFleets,\n appsDataByPads,\n appsDataByInterventionUnits\n );\n};\n"],"names":["DEFAULT_REQUESTS","APPS_DATA_REQUESTS","WELLS","RIGS","FRAC_FLEETS","FRAC_FLEET_WELLS","PAD_WELLS","INTERVENTION_UNITS","getDeprecatedAssetIds","apps","dashboardAssetId","uniqueIds","reduce","acc","app","isAppWithSettings","deprecatedAssetId","getAppAssetSpecificTypeId","add","Set","_toConsumableArray","getAppSettingsByDeprecatedAssetId","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","deprecatedAssetIds","cache","cachedDeprecatedAssetData","cachedDeprecatedAssetIds","notResolvedDeprecatedAssetIds","assetsData","deprecatedAssetTypeToSetting","dataByDeprecatedAssetId","updatedCachedDeprecatedAssetData","wrap","_context","prev","next","current","deprecatedAssetData","Object","keys","filter","includes","String","length","abrupt","fetchAssetEntitiesByAssetIds","sent","rig","ASSET_TYPES","id","well","values","flat","_ref2","data","attributes","asset_id","type","stop","_x","_x2","apply","this","arguments","getAppsWithUnifiedSettings","_ref3","appSettingsByDeprecatedAssetId","_context2","map","appDeprecatedAssetId","_objectSpread","settings","_callee2","_x3","_x4","_x5","resolveAppsData","_ref5","_callee3","_ref4","updateCache","_ref4$requests","requests","unifiedApps","_prepareDataForResolv","appsWellIds","appsRigIds","appsFracFleetIds","appsInterventionUnitIds","appsFracFleetToFetchWellsIds","appsPadIds","uniqueWellIds","uniqueRigIds","uniqueFFIds","uniqueInterventionUnitIds","allInterventionUnitIds","interventionUnitIdsToFetch","isFracFleetsRefresh","fracFleetIdsToFetch","_yield$Promise$all","_yield$Promise$all2","wellsResponse","rigsResponse","fracFleetsResponse","fracFleetWellsData","padWellsData","interventionUnitsResponse","fetchedWellsById","fetchedRigsById","fetchedFracFleetsById","fetchedInterventionUnitsById","appsDataByWells","appsDataByRigs","appsDataByFracFleets","appsDataByPads","appsDataByInterventionUnits","_context3","prepareDataForResolver","getUniqAssetIds","INTERVENTION_UNIT_WELLS","FRAC_FLEETS_REFRESH","Promise","all","fetchWells","fetchRigs","fetchFracFleets","fetchFracFleetWells","fetchPadWells","fetchInterventionUnits","_slicedToArray","buildWellCache","buildRigCache","buildFracFleetCache","buildInterventionUnitCache","wellsById","rigsById","interventionUnitsById","fracFleetsById","getAppsDataByWells","getAppsDataByRigs","getAppsDataByFFs","getAppsDataByPads","getAppsDataByInterventionUnits","merge","_x6"],"mappings":"m9CAuCA,IAAMA,EAAsC,CAC1CC,EAAmBC,MACnBD,EAAmBE,KACnBF,EAAmBG,YACnBH,EAAmBI,iBACnBJ,EAAmBK,UACnBL,EAAmBM,oBAWRC,EAAwB,SACnCC,EACAC,GAEA,IAAMC,EAAYF,EAAKG,QAAwC,SAACC,EAAKC,GACnE,GAAIC,EAAkBD,GAAM,OAAOD,EAEnC,IAAMG,EAAoBC,EAA0BH,EAAK,qBAGzD,OAFAD,EAAIK,IAAIF,GAAqBN,GAEtBG,CACT,GAAG,IAAIM,KAEP,OAAAC,EAAWT,EACb,EAEaU,EAAiC,WAAA,IAAGC,EAAAC,EAAAC,EAAAC,MAAA,SAAAC,EAC/CC,EACAC,GAAuB,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,OAAAX,EAAAY,MAAA,SAAAC,GAAA,OAAA,OAAAA,EAAAC,KAAAD,EAAAE,MAAA,KAAA,EAMtB,GAJ4BV,EAA8BD,EAAM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qG,gBAAmB5B,IAE/DE,GAAkB2B,EAAmBrD,EAAa7D,EAAMY,QAAQkG,WAChEtB,GAAiB2B,EAAkBrD,EAAY9D,EAAMY,QAAQmG,UAC7DtB,GAAuB2B,EAC3BrD,EACA/D,EAAMY,QAAQqG,eACdjC,GAEIU,GAAiB2B,EAAkBnD,EAAYe,IAC/CU,GAA8B2B,EAClCtD,EACAhE,EAAMY,QAAQoG,sBACdnD,EACA7D,EAAMY,QAAQkG,WAGTS,EAAAA,OAAAA,SAAAA,EACLhC,GACAC,GACAC,GACAC,GACAC,KACD,KAAA,GAAA,IAAA,MAAA,OAAAC,EAAA1D,OAAA,GAAAoB,EACF,KAAA,OAAA,SAvF2BkE,GAAA,OAAAnE,EAAAhB,MAAAC,KAAAC,UAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppsData.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EAEZ,KAAK,EAIL,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAgBlB,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAElE,QAAA,MAAM,WAAW,uDAAwD,iBAAiB,
|
|
1
|
+
{"version":3,"file":"useAppsData.d.ts","sourceRoot":"","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,YAAY,EAEZ,KAAK,EAIL,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAgBlB,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAElE,QAAA,MAAM,WAAW,uDAAwD,iBAAiB,kBAsKzF,CAAC;eAEa,WAAW"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/helpers/slicedToArray";import n from"@babel/runtime/regenerator";import{useState as i,useRef as o,useEffect as a}from"react";import{merge as u,isEqual as s}from"lodash";import{getAppHash as c,getInitialAppsDataState as f,isAppNeedingInterventionUnitWellRefresh as l}from"./utils.js";import{resolveAppsData as d}from"./dataResolvers.js";import{isDCAppMultiRig as p,isDevCenterApp as v}from"../../../../utils/devcenter.js";import{APPS_DATA_REQUESTS as b}from"./constants.js";function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}var O=function(r){var m=r.apps,O=r.dashboardAssetId,g=r.dashboardMeta,j=i({}),y=t(j,2),E=y[0],w=y[1],S=o(null),I=o(0),L=o({wellsById:{},rigsById:{},fracFleetsById:{},interventionUnitsById:{},deprecatedAssetData:{}}),P=m.reduce((function(e,r){var t,n=p({uiSettings:null===(t=r.app)||void 0===t?void 0:t.ui_settings,isChiplessDashboard:null==g?void 0:g.isChiplessDashboard});return v(r)&&!n&&e.push(h(h({},r),{},{appHash:c(r)})),e}),[]),A=function(e,r){return Object.fromEntries(Object.entries(e).map((function(e){var n=t(e,2),i=n[0],o=n[1];return[i,h(h(h({},o),r[o.id]),{},{isLoading:!1})]})))},D=function(e){return w((function(r){return A(r,e)}))},_=function(e){L.current=u(L.current,e)};a((function(){var e=Object.values(E);if(P.length||e.length)if(P.length<e.length){var r=new Set(P.map((function(e){return String(e.id)}))),n=e.find((function(e){return!r.has(String(e.id))}));if(!n)return;w((function(e){return Object.fromEntries(Object.entries(e).filter((function(e){return t(e,1)[0]!==String(n.id)})))}))}else{var i=P.filter((function(e){return!E[e.id]||E[e.id].appHash!==e.appHash}));w((function(e){return h(h({},e),f(i))})),d({apps:P,dashboardAssetId:O,cache:L,updateCache:_}).then(D)}}),[String(P.map((function(e){return e.appHash}))),O]),S.current={apps:P,dashboardAssetId:O,cache:L,updateCache:_},a((function(){var e=function(){var e=S.current;if(e){var r=++I.current;d(h(h({},e),{},{requests:[b.FRAC_FLEETS_REFRESH,b.FRAC_FLEET_WELLS,b.PAD_WELLS]})).then((function(e){r===I.current&&function(e){w((function(r){var t=A(r,e);return s(t,r)?r:t}))}(e)}))}},r=function(){"visible"===document.visibilityState&&e()},t=setInterval(e,3e5);return document.addEventListener("visibilitychange",r),function(){clearInterval(t),document.removeEventListener("visibilitychange",r)}}),[]);var T=P.some(l);return a((function(){if(T){var r=setInterval(e(n.mark((function e(){var r,i,o,a;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=S.current){e.next=3;break}return e.abrupt("return");case 3:return i=r.apps,o=new Set(i.filter(l).map((function(e){return e.id}))),e.next=7,d(h(h({},r),{},{requests:[b.INTERVENTION_UNIT_WELLS]}));case 7:a=e.sent,w((function(e){var r=Object.entries(e);return r.some((function(e){var r,n,i=t(e,2),u=i[0],s=i[1];if(!o.has(u))return!1;var c=a[u];return!!c&&(null===(r=c.well)||void 0===r?void 0:r.id)!==(null===(n=s.well)||void 0===n?void 0:n.id)}))?r.reduce((function(e,r){var n,i,u=t(r,2),s=u[0],c=u[1];if(!o.has(s))return e[s]=c,e;var f=a[s];return f&&(null===(n=f.well)||void 0===n?void 0:n.id)!==(null===(i=c.well)||void 0===i?void 0:i.id)?(e[s]=h(h(h({},c),f),{},{isLoading:!1}),e):(e[s]=c,e)}),{}):e}));case 9:case"end":return e.stop()}}),e)}))),3e5);return function(){return clearInterval(r)}}}),[T]),E};export{O as default};
|
|
2
2
|
//# sourceMappingURL=useAppsData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppsData.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { merge } from 'lodash';\n\nimport type {\n AppDataEntry,\n AppDataPatches,\n AppId,\n AppsDataCache,\n AppsDataCacheUpdate,\n PreparedProviderApp,\n UseAppsDataParams,\n} from '../types';\n\nimport {\n getInitialAppsDataState,\n getAppHash,\n isAppNeedingInterventionUnitWellRefresh,\n} from './utils';\nimport { resolveAppsData } from './dataResolvers';\n\nimport { isDCAppMultiRig, isDevCenterApp } from '~/utils/devcenter';\nimport { APPS_DATA_REQUESTS } from '~/components/DevCenter/AppsDataProvider/effects/constants';\n\nconst MINUTE = 60_000;\nconst FRAC_FLEETS_REFRESH_INTERVAL = 5 * MINUTE;\nconst INTERVENTION_UNITS_REFRESH_INTERVAL = 5 * MINUTE;\n\ntype LoadedAppData = Record<string, AppDataEntry & { id: AppId }>;\n\nconst useAppsData = ({ apps: allApps, dashboardAssetId, dashboardMeta }: UseAppsDataParams) => {\n const [appsData, setAppsData] = useState<LoadedAppData>({});\n const resolveAppsDataParamsRef = useRef<Parameters<typeof resolveAppsData>[0] | null>(null);\n\n const cache = useRef<AppsDataCache>({\n wellsById: {},\n rigsById: {},\n fracFleetsById: {},\n interventionUnitsById: {},\n deprecatedAssetData: {},\n });\n\n const apps = allApps.reduce<PreparedProviderApp[]>((acc, app) => {\n const isMultiRig = isDCAppMultiRig({\n uiSettings: app.app?.ui_settings,\n isChiplessDashboard: dashboardMeta?.isChiplessDashboard,\n });\n\n if (isDevCenterApp(app) && !isMultiRig) acc.push({ ...app, appHash: getAppHash(app) });\n return acc;\n }, []);\n\n const handleResolvedAppsData = (resolvedAppsData: AppDataPatches) =>\n setAppsData(prevAppsData =>\n Object.fromEntries(\n Object.entries(prevAppsData).map(([appId, prevAppData]) => [\n appId,\n { ...prevAppData, ...resolvedAppsData[prevAppData.id], isLoading: false },\n ])\n )\n );\n\n const updateCache = (updates: AppsDataCacheUpdate) => {\n cache.current = merge(cache.current, updates);\n };\n\n useEffect(() => {\n const appsDataValues = Object.values(appsData);\n\n // NOTE: empty dashboard\n if (!apps.length && !appsDataValues.length) {\n return;\n }\n\n // NOTE: app was removed from db\n if (apps.length < appsDataValues.length) {\n const appIds = new Set(apps.map(app => String(app.id)));\n const removedApp = appsDataValues.find(appData => !appIds.has(String(appData.id)));\n if (!removedApp) return;\n\n setAppsData(prevAppsData =>\n Object.fromEntries(\n Object.entries(prevAppsData).filter(([appId]) => appId !== String(removedApp.id))\n )\n );\n return;\n }\n\n const changedApps = apps.filter(\n app => !appsData[app.id] || appsData[app.id].appHash !== app.appHash\n );\n setAppsData(prevAppsData => ({ ...prevAppsData, ...getInitialAppsDataState(changedApps) }));\n resolveAppsData({ apps, dashboardAssetId, cache, updateCache }).then(handleResolvedAppsData);\n }, [String(apps.map(({ appHash }) => appHash)), dashboardAssetId]);\n\n // NOTE: Keep this data in ref to avoid closure in setInterval\n resolveAppsDataParamsRef.current = { apps, dashboardAssetId, cache, updateCache };\n\n useEffect(() => {\n // NOTE: Refresh fracfleet wells and pad wells every 5 minutes\n const interval = setInterval(() => {\n const params = resolveAppsDataParamsRef.current;\n if (!params) return;\n\n resolveAppsData({\n ...params,\n requests: [APPS_DATA_REQUESTS.FRAC_FLEET_WELLS, APPS_DATA_REQUESTS.PAD_WELLS],\n }).then(handleResolvedAppsData);\n }, FRAC_FLEETS_REFRESH_INTERVAL);\n\n return () => clearInterval(interval);\n }, []);\n\n const hasAppsNeedingInterventionUnitRefresh = apps.some(isAppNeedingInterventionUnitWellRefresh);\n\n useEffect((): (() => void) | undefined => {\n if (!hasAppsNeedingInterventionUnitRefresh) return;\n\n const interval = setInterval(async () => {\n const params = resolveAppsDataParamsRef.current;\n if (!params) return;\n\n const currentApps = params.apps;\n const interventionUnitAppIds = new Set(\n currentApps.filter(isAppNeedingInterventionUnitWellRefresh).map(app => app.id)\n );\n\n const resolvedAppsData = await resolveAppsData({\n ...params,\n requests: [APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS],\n });\n\n setAppsData(prevAppsData => {\n const entries = Object.entries(prevAppsData);\n const hasChanges = entries.some(([appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) return false;\n const newData = resolvedAppsData[appId];\n if (!newData) return false;\n return newData.well?.id !== prevAppData.well?.id;\n });\n\n if (!hasChanges) return prevAppsData;\n\n return entries.reduce<LoadedAppData>((acc, [appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n const newData = resolvedAppsData[appId];\n if (!newData || newData.well?.id === prevAppData.well?.id) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n acc[appId] = { ...prevAppData, ...newData, isLoading: false };\n return acc;\n }, {});\n });\n }, INTERVENTION_UNITS_REFRESH_INTERVAL);\n\n return () => clearInterval(interval);\n }, [hasAppsNeedingInterventionUnitRefresh]);\n\n return appsData;\n};\n\nexport default useAppsData;\n"],"names":["useAppsData","_ref","allApps","apps","dashboardAssetId","dashboardMeta","_useState","useState","_useState2","_slicedToArray","appsData","setAppsData","resolveAppsDataParamsRef","useRef","cache","wellsById","rigsById","fracFleetsById","interventionUnitsById","deprecatedAssetData","reduce","acc","app","_app$app","isMultiRig","isDCAppMultiRig","uiSettings","ui_settings","isChiplessDashboard","isDevCenterApp","push","_objectSpread","appHash","getAppHash","handleResolvedAppsData","resolvedAppsData","prevAppsData","Object","fromEntries","entries","map","_ref2","_ref3","appId","prevAppData","id","isLoading","updateCache","updates","current","merge","useEffect","appsDataValues","values","length","appIds","Set","String","removedApp","find","appData","has","filter","_ref4","changedApps","getInitialAppsDataState","resolveAppsData","then","_ref6","interval","setInterval","params","requests","APPS_DATA_REQUESTS","FRAC_FLEET_WELLS","PAD_WELLS","clearInterval","hasAppsNeedingInterventionUnitRefresh","some","isAppNeedingInterventionUnitWellRefresh","_asyncToGenerator","_regeneratorRuntime","mark","_callee","currentApps","interventionUnitAppIds","wrap","_context","prev","next","abrupt","INTERVENTION_UNIT_WELLS","sent","_ref8","_newData$well","_prevAppData$well","_ref9","newData","well","_ref10","_newData$well2","_prevAppData$well2","_ref11","stop"],"mappings":"opCAuBA,IAMMA,EAAc,SAA2EC,GAAA,IAAlEC,IAANC,KAAeC,IAAAA,iBAAkBC,IAAAA,cACtDC,EAAgCC,EAAwB,IAAGC,EAAAC,EAAAH,EAAA,GAApDI,EAAQF,EAAA,GAAEG,EAAWH,EAAA,GACtBI,EAA2BC,EAAqD,MAEhFC,EAAQD,EAAsB,CAClCE,UAAW,CAAE,EACbC,SAAU,CAAE,EACZC,eAAgB,CAAE,EAClBC,sBAAuB,CAAE,EACzBC,oBAAqB,CAAC,IAGlBhB,EAAOD,EAAQkB,QAA8B,SAACC,EAAKC,GAAQ,IAAAC,EACzDC,EAAaC,EAAgB,CACjCC,WAAmB,UAAPJ,EAAIA,WAAG,IAAAC,OAAA,EAAPA,EAASI,YACrBC,oBAAqBvB,aAAa,EAAbA,EAAeuB,sBAItC,OADIC,EAAeP,KAASE,GAAYH,EAAIS,KAAIC,EAAAA,EAAA,CAAA,EAAMT,GAAG,CAAA,EAAA,CAAEU,QAASC,EAAWX,MACxED,CACR,GAAE,IAEGa,EAAyB,SAACC,GAAgC,OAC9DxB,GAAY,SAAAyB,GAAY,OACtBC,OAAOC,YACLD,OAAOE,QAAQH,GAAcI,KAAI,SAAAC,GAAA,IAAAC,EAAAjC,EAAAgC,EAAA,GAAEE,EAAKD,EAAA,GAAEE,EAAWF,EAAA,GAAA,MAAM,CACzDC,EAAKZ,EAAAA,EAAAA,EAAA,CAAA,EACAa,GAAgBT,EAAiBS,EAAYC,KAAG,CAAA,EAAA,CAAEC,WAAW,IACnE,OAEJ,EAEGC,EAAc,SAAC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AIlB,GAE9B,OADAtB,EAAIsB,GAASC,EACNvB,EAGT,IAAM4E,EAAU9D,EAAiBQ,GACjC,OAAKsD,IAAuB,QAAZA,EAAAA,EAAQC,YAAI,IAAAE,OAAA,EAAZA,EAAcvD,OAAO,UAAAD,EAAYsD,YAAZ,IAAAG,OAAA,EAAAA,EAAkBxD,KAKvDxB,EAAIsB,GAAcC,EAAAA,EAAAA,EAAAA,CAAAA,EAAAA,GAAgBqD,GAAO,GAAA,CAAEnD,WAAW,IAC/CzB,IALLA,EAAIsB,GAASC,EACNvB,EAKV,GAAE,CAAE,GAhBmBe,CAiB1B,IAAG,KAAA,EAAA,IAAA,MAAA,OAAAmD,EAAAgB,OAAA,GAAApB,OApImC,KAuIxC,OAAO,WAAA,OAAMP,cAAcP,EAAS,CA7CQ,CA8C9C,GAAG,CAACQ,IAEGnE,CACT"}
|
|
1
|
+
{"version":3,"file":"useAppsData.js","sources":["../../../../../src/components/DevCenter/AppsDataProvider/effects/useAppsData.ts"],"sourcesContent":["import { useState, useEffect, useRef } from 'react';\nimport { isEqual, merge } from 'lodash';\n\nimport type {\n AppDataEntry,\n AppDataPatches,\n AppId,\n AppsDataCache,\n AppsDataCacheUpdate,\n PreparedProviderApp,\n UseAppsDataParams,\n} from '../types';\n\nimport {\n getInitialAppsDataState,\n getAppHash,\n isAppNeedingInterventionUnitWellRefresh,\n} from './utils';\nimport { resolveAppsData } from './dataResolvers';\n\nimport { isDCAppMultiRig, isDevCenterApp } from '~/utils/devcenter';\nimport { APPS_DATA_REQUESTS } from '~/components/DevCenter/AppsDataProvider/effects/constants';\n\nconst MINUTE = 60_000;\nconst FRAC_FLEETS_REFRESH_INTERVAL = 5 * MINUTE;\nconst INTERVENTION_UNITS_REFRESH_INTERVAL = 5 * MINUTE;\n\ntype LoadedAppData = Record<string, AppDataEntry & { id: AppId }>;\n\nconst useAppsData = ({ apps: allApps, dashboardAssetId, dashboardMeta }: UseAppsDataParams) => {\n const [appsData, setAppsData] = useState<LoadedAppData>({});\n const resolveAppsDataParamsRef = useRef<Parameters<typeof resolveAppsData>[0] | null>(null);\n const fracFleetsRefreshSequenceRef = useRef(0);\n\n const cache = useRef<AppsDataCache>({\n wellsById: {},\n rigsById: {},\n fracFleetsById: {},\n interventionUnitsById: {},\n deprecatedAssetData: {},\n });\n\n const apps = allApps.reduce<PreparedProviderApp[]>((acc, app) => {\n const isMultiRig = isDCAppMultiRig({\n uiSettings: app.app?.ui_settings,\n isChiplessDashboard: dashboardMeta?.isChiplessDashboard,\n });\n\n if (isDevCenterApp(app) && !isMultiRig) acc.push({ ...app, appHash: getAppHash(app) });\n return acc;\n }, []);\n\n const getUpdatedAppsData = (\n prevAppsData: LoadedAppData,\n resolvedAppsData: AppDataPatches\n ): LoadedAppData =>\n Object.fromEntries(\n Object.entries(prevAppsData).map(([appId, prevAppData]) => [\n appId,\n { ...prevAppData, ...resolvedAppsData[prevAppData.id], isLoading: false },\n ])\n );\n\n const handleResolvedAppsData = (resolvedAppsData: AppDataPatches) =>\n setAppsData(prevAppsData => getUpdatedAppsData(prevAppsData, resolvedAppsData));\n\n const handleRefreshedAppsData = (resolvedAppsData: AppDataPatches) =>\n setAppsData(prevAppsData => {\n const updatedAppsData = getUpdatedAppsData(prevAppsData, resolvedAppsData);\n return isEqual(updatedAppsData, prevAppsData) ? prevAppsData : updatedAppsData;\n });\n\n const updateCache = (updates: AppsDataCacheUpdate) => {\n cache.current = merge(cache.current, updates);\n };\n\n useEffect(() => {\n const appsDataValues = Object.values(appsData);\n\n // NOTE: empty dashboard\n if (!apps.length && !appsDataValues.length) {\n return;\n }\n\n // NOTE: app was removed from db\n if (apps.length < appsDataValues.length) {\n const appIds = new Set(apps.map(app => String(app.id)));\n const removedApp = appsDataValues.find(appData => !appIds.has(String(appData.id)));\n if (!removedApp) return;\n\n setAppsData(prevAppsData =>\n Object.fromEntries(\n Object.entries(prevAppsData).filter(([appId]) => appId !== String(removedApp.id))\n )\n );\n return;\n }\n\n const changedApps = apps.filter(\n app => !appsData[app.id] || appsData[app.id].appHash !== app.appHash\n );\n setAppsData(prevAppsData => ({ ...prevAppsData, ...getInitialAppsDataState(changedApps) }));\n resolveAppsData({ apps, dashboardAssetId, cache, updateCache }).then(handleResolvedAppsData);\n }, [String(apps.map(({ appHash }) => appHash)), dashboardAssetId]);\n\n // NOTE: Keep this data in ref to avoid closure in setInterval\n resolveAppsDataParamsRef.current = { apps, dashboardAssetId, cache, updateCache };\n\n useEffect(() => {\n const refreshFracFleets = () => {\n const params = resolveAppsDataParamsRef.current;\n if (!params) return;\n\n const sequence = ++fracFleetsRefreshSequenceRef.current;\n\n resolveAppsData({\n ...params,\n requests: [\n APPS_DATA_REQUESTS.FRAC_FLEETS_REFRESH,\n APPS_DATA_REQUESTS.FRAC_FLEET_WELLS,\n APPS_DATA_REQUESTS.PAD_WELLS,\n ],\n }).then(resolvedAppsData => {\n if (sequence === fracFleetsRefreshSequenceRef.current) {\n handleRefreshedAppsData(resolvedAppsData);\n }\n });\n };\n\n const handleVisibilityChange = () => {\n if (document.visibilityState === 'visible') refreshFracFleets();\n };\n\n // NOTE: Refresh frac fleets, fracfleet wells and pad wells every 5 minutes and when the tab becomes visible\n const interval = setInterval(refreshFracFleets, FRAC_FLEETS_REFRESH_INTERVAL);\n document.addEventListener('visibilitychange', handleVisibilityChange);\n\n return () => {\n clearInterval(interval);\n document.removeEventListener('visibilitychange', handleVisibilityChange);\n };\n }, []);\n\n const hasAppsNeedingInterventionUnitRefresh = apps.some(isAppNeedingInterventionUnitWellRefresh);\n\n useEffect((): (() => void) | undefined => {\n if (!hasAppsNeedingInterventionUnitRefresh) return;\n\n const interval = setInterval(async () => {\n const params = resolveAppsDataParamsRef.current;\n if (!params) return;\n\n const currentApps = params.apps;\n const interventionUnitAppIds = new Set(\n currentApps.filter(isAppNeedingInterventionUnitWellRefresh).map(app => app.id)\n );\n\n const resolvedAppsData = await resolveAppsData({\n ...params,\n requests: [APPS_DATA_REQUESTS.INTERVENTION_UNIT_WELLS],\n });\n\n setAppsData(prevAppsData => {\n const entries = Object.entries(prevAppsData);\n const hasChanges = entries.some(([appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) return false;\n const newData = resolvedAppsData[appId];\n if (!newData) return false;\n return newData.well?.id !== prevAppData.well?.id;\n });\n\n if (!hasChanges) return prevAppsData;\n\n return entries.reduce<LoadedAppData>((acc, [appId, prevAppData]) => {\n if (!interventionUnitAppIds.has(appId)) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n const newData = resolvedAppsData[appId];\n if (!newData || newData.well?.id === prevAppData.well?.id) {\n acc[appId] = prevAppData;\n return acc;\n }\n\n acc[appId] = { ...prevAppData, ...newData, isLoading: false };\n return acc;\n }, {});\n });\n }, INTERVENTION_UNITS_REFRESH_INTERVAL);\n\n return () => clearInterval(interval);\n }, [hasAppsNeedingInterventionUnitRefresh]);\n\n return appsData;\n};\n\nexport default useAppsData;\n"],"names":["useAppsData","_ref","allApps","apps","dashboardAssetId","dashboardMeta","_useState","useState","_useState2","_slicedToArray","appsData","setAppsData","resolveAppsDataParamsRef","useRef","fracFleetsRefreshSequenceRef","cache","wellsById","rigsById","fracFleetsById","interventionUnitsById","deprecatedAssetData","reduce","acc","app","_app$app","isMultiRig","isDCAppMultiRig","uiSettings","ui_settings","isChiplessDashboard","isDevCenterApp","push","_objectSpread","appHash","getAppHash","getUpdatedAppsData","prevAppsData","resolvedAppsData","Object","fromEntries","entries","map","_ref2","_ref3","appId","prevAppData","id","isLoading","handleResolvedAppsData","updateCache","updates","current","merge","useEffect","appsDataValues","values","length","appIds","Set","String","removedApp","find","appData","has","filter","_ref4","changedApps","getInitialAppsDataState","resolveAppsData","then","_ref6","refreshFracFleets","params","sequence","requests","APPS_DATA_REQUESTS","FRAC_FLEETS_REFRESH","FRAC_FLEET_WELLS","PAD_WELLS","updatedAppsData","isEqual","handleRefreshedAppsData","handleVisibilityChange","document","visibilityState","interval","setInterval","addEventListener","clearInterval","removeEventListener","hasAppsNeedingInterventionUnitRefresh","some","isAppNeedingInterventionUnitWellRefresh","_asyncToGenerator","_regeneratorRuntime","mark","_callee","currentApps","interventionUnitAppIds","wrap","_context","prev","next","abrupt","INTERVENTION_UNIT_WELLS","sent","_ref8","_newData$well","_prevAppData$well","_ref9","newData","well","_ref10","_newData$well2","_prevAppData$well2","_ref11","stop"],"mappings":"iqCAuBA,IAMMA,EAAc,SAA2EC,GAAA,IAAlEC,IAANC,KAAeC,IAAAA,iBAAkBC,IAAAA,cACtDC,EAAgCC,EAAwB,IAAGC,EAAAC,EAAAH,EAAA,GAApDI,EAAQF,EAAA,GAAEG,EAAWH,EAAA,GACtBI,EAA2BC,EAAqD,MAChFC,EAA+BD,EAAO,GAEtCE,EAAQF,EAAsB,CAClCG,UAAW,CAAE,EACbC,SAAU,CAAE,EACZC,eAAgB,CAAE,EAClBC,sBAAuB,CAAE,EACzBC,oBAAqB,CAAC,IAGlBjB,EAAOD,EAAQmB,QAA8B,SAACC,EAAKC,GAAQ,IAAAC,EACzDC,EAAaC,EAAgB,CACjCC,WAAmB,UAAPJ,EAAIA,WAAG,IAAAC,OAAA,EAAPA,EAASI,YACrBC,oBAAqBxB,aAAa,EAAbA,EAAewB,sBAItC,OADIC,EAAeP,KAASE,GAAYH,EAAIS,KAAIC,EAAAA,EAAA,CAAA,EAAMT,GAAG,CAAA,EAAA,CAAEU,QAASC,EAAWX,MACxED,CACR,GAAE,IAEGa,EAAqB,SACzBC,EACAC,GAAgC,OAEhCC,OAAOC,YACLD,OAAOE,QAAQJ,GAAcK,KAAI,SAAAC,GAAA,IAAAC,EAAAlC,EAAAiC,EAAA,GAAEE,EAAKD,EAAA,GAAEE,EAAWF,EAAA,GAAA,MAAM,CACzDC,EAAKZ,EAAAA,EAAAA,EAAA,CAAA,EACAa,GAAgBR,EAAiBQ,EAAYC,KAAG,CAAA,EAAA,CAAEC,WAAW,IACnE,IACF,EAEGC,EAAyB,SAACX,GAAgC,OAC9D1B,GAAY,SAAAyB,GAAY,OAA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AAA,GAAEhE,EAAWgE,EAAA,GAClD,IAAKX,EAAuBnC,IAAInB,GAAQ,OAAO,EAC/C,IAAMkE,EAAUzE,EAAiBO,GACjC,QAAKkE,IACE,QAAAA,EAAAA,EAAQC,YAAR,IAAAJ,OAAA,EAAAA,EAAc7D,OAAuB,QAArB8D,EAAK/D,EAAYkE,YAAI,IAAAH,OAAA,EAAhBA,EAAkB9D,GAChD,IAION,EAAQnB,QAAsB,SAACC,EAA8B0F,GAAA,IAAAC,EAAAC,EAAAC,EAAA1G,EAAAuG,EAAA,GAAxBpE,EAAKuE,EAAA,GAAEtE,EAAWsE,EAAA,GAC5D,IAAKjB,EAAuBnC,IAAInB,GAE9B,OADAtB,EAAIsB,GAASC,EACNvB,EAGT,IAAMwF,EAAUzE,EAAiBO,GACjC,OAAKkE,IAAuB,QAAZA,EAAAA,EAAQC,YAAI,IAAAE,OAAA,EAAZA,EAAcnE,OAAO,UAAAD,EAAYkE,YAAZ,IAAAG,OAAA,EAAAA,EAAkBpE,KAKvDxB,EAAIsB,GAAcC,EAAAA,EAAAA,EAAAA,CAAAA,EAAAA,GAAgBiE,GAAO,GAAA,CAAE/D,WAAW,IAC/CzB,IALLA,EAAIsB,GAASC,EACNvB,EAKV,GAAE,CAAE,GAhBmBc,CAiB1B,IAAG,KAAA,EAAA,IAAA,MAAA,OAAAgE,EAAAgB,OAAA,GAAApB,OAnKmC,KAsKxC,OAAO,WAAA,OAAMR,cAAcH,EAAS,CA7CQ,CA8C9C,GAAG,CAACK,IAEGhF,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenuItems.d.ts","sourceRoot":"","sources":["../../../../src/components/PadModeSelect/effects/useMenuItems.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useMenuItems.d.ts","sourceRoot":"","sources":["../../../../src/components/PadModeSelect/effects/useMenuItems.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,QAAQ,EAAE,MAAM,UAAU,CAAC;AAOjD,OAAO,EAAE,aAAa,EAAW,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAE1E,wBAAgB,YAAY,CAAC,EAC3B,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,0BAA0B,GAC3B,EAAE;IACD,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;IAChB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B,EAAE,OAAO,CAAC;CACrC,GAAG,QAAQ,EAAE,CAwBb"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useMemo as e}from"react";import{some as t}from"lodash";import{AssetStatus as
|
|
1
|
+
import{useMemo as e}from"react";import{some as t}from"lodash";import{AssetStatus as n}from"../types.js";import{EMPTY_FRAC_FLEET_LINE_LABEL_SUFFIX as r,DEFAULT_SUPPORTED_PAD_MODES as o}from"../../../constants/completion.js";import{getWellsMenuItems as l,getMenuItemKey as a}from"../utils/selectMenuKey.js";import{PadMode as i}from"../../../types/shared/Completions.js";function c(c){var s=c.completionAppType,m=c.assets,u=c.fracFleetLines,f=c.enableSimulFracInPadSelect;return e((function(){if(f&&u.length){var e=u.reduce((function(e,o){var c,s=l(null!==(c=o.frac_fleet_line_wells)&&void 0!==c?c:[],!0),m=!s.length,u={key:a(i.padLine,o.id),label:m?"".concat(o.name).concat(r):o.name,isDisabled:!m&&!t(o.frac_fleet_line_wells,(function(e){return e.status===n.active})),isSubItem:!1};return e.concat(u,s)}),[]);return e}var c=l(null!=m?m:[]);return o.concat(c)}),[s,m,u,f])}export{c as useMenuItems};
|
|
2
2
|
//# sourceMappingURL=useMenuItems.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenuItems.js","sources":["../../../../src/components/PadModeSelect/effects/useMenuItems.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { some } from 'lodash';\nimport { AssetStatus, MenuItem } from '../types';\nimport {
|
|
1
|
+
{"version":3,"file":"useMenuItems.js","sources":["../../../../src/components/PadModeSelect/effects/useMenuItems.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { some } from 'lodash';\nimport { AssetStatus, MenuItem } from '../types';\nimport {\n DEFAULT_SUPPORTED_PAD_MODES,\n EMPTY_FRAC_FLEET_LINE_LABEL_SUFFIX,\n} from '~/constants/completion';\nimport { getMenuItemKey, getWellsMenuItems } from '../utils/selectMenuKey';\n\nimport { FracFleetLine, PadMode, Well } from '~/types/shared/Completions';\n\nexport function useMenuItems({\n completionAppType,\n assets,\n fracFleetLines,\n enableSimulFracInPadSelect,\n}: {\n assets?: Well[];\n fracFleetLines: FracFleetLine[];\n completionAppType: string;\n enableSimulFracInPadSelect: boolean;\n}): MenuItem[] {\n return useMemo(() => {\n if (enableSimulFracInPadSelect && fracFleetLines.length) {\n const linesMenuItems = fracFleetLines.reduce<MenuItem[]>((result, line) => {\n const wellsMenuItems = getWellsMenuItems(line.frac_fleet_line_wells ?? [], true);\n const isEmptyLine = !wellsMenuItems.length;\n const lineMenuItem: MenuItem = {\n key: getMenuItemKey(PadMode.padLine, line.id),\n label: isEmptyLine ? `${line.name}${EMPTY_FRAC_FLEET_LINE_LABEL_SUFFIX}` : line.name,\n isDisabled:\n !isEmptyLine &&\n !some(line.frac_fleet_line_wells, well => well.status === AssetStatus.active),\n isSubItem: false,\n };\n\n return result.concat(lineMenuItem, wellsMenuItems);\n }, []);\n\n return linesMenuItems;\n } else {\n const wellsMenuItems = getWellsMenuItems(assets ?? []);\n return (DEFAULT_SUPPORTED_PAD_MODES as MenuItem[]).concat(wellsMenuItems);\n }\n }, [completionAppType, assets, fracFleetLines, enableSimulFracInPadSelect]);\n}\n"],"names":["useMenuItems","_ref","completionAppType","assets","fracFleetLines","enableSimulFracInPadSelect","useMemo","length","linesMenuItems","reduce","result","line","_line$frac_fleet_line","wellsMenuItems","getWellsMenuItems","frac_fleet_line_wells","isEmptyLine","lineMenuItem","key","getMenuItemKey","PadMode","padLine","id","label","concat","name","EMPTY_FRAC_FLEET_LINE_LABEL_SUFFIX","isDisabled","some","well","status","AssetStatus","active","isSubItem","DEFAULT_SUPPORTED_PAD_MODES"],"mappings":"gXAWO,SAASA,EAUDC,GAAA,IATbC,IAAAA,kBACAC,IAAAA,OACAC,IAAAA,eACAC,IAAAA,2BAOA,OAAOC,GAAQ,WACb,GAAID,GAA8BD,EAAeG,OAAQ,CACvD,IAAMC,EAAiBJ,EAAeK,QAAmB,SAACC,EAAQC,GAAS,IAAAC,EACnEC,EAAiBC,EAAgD,QAA9BH,EAAAA,EAAKI,6BAAyB,IAAAH,EAAAA,EAAA,IAAI,GACrEI,GAAeH,EAAeN,OAC9BU,EAAyB,CAC7BC,IAAKC,EAAeC,EAAQC,QAASV,EAAKW,IAC1CC,MAAOP,EAAW,GAAAQ,OAAMb,EAAKc,MAAID,OAAGE,GAAuCf,EAAKc,KAChFE,YACGX,IACAY,EAAKjB,EAAKI,uBAAuB,SAAAc,GAAI,OAAIA,EAAKC,SAAWC,EAAYC,UACxEC,WAAW,GAGb,OAAOvB,EAAOc,OAAOP,EAAcJ,EACpC,GAAE,IAEH,OAAOL,CACT,CACE,IAAMK,EAAiBC,EAAkBX,QAAAA,EAAU,IACnD,OAAQ+B,EAA2CV,OAAOX,EAE7D,GAAE,CAACX,EAAmBC,EAAQC,EAAgBC,GACjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PadMode.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/AppHeader/PadMode/PadMode.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI5D,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAiBF,eAAO,MAAM,OAAO,mEAOjB,YAAY,
|
|
1
|
+
{"version":3,"file":"PadMode.d.ts","sourceRoot":"","sources":["../../../../src/componentsV2/AppHeader/PadMode/PadMode.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI5D,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAiBF,eAAO,MAAM,OAAO,mEAOjB,YAAY,mDA0Cd,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"@babel/runtime/helpers/defineProperty";import{isEmpty as t}from"lodash";import r from"../../../components/PadModeSelect/PadModeSelect.js";import{TextMiddleTruncated as n}from"../../TextMiddleTruncated/TextMiddleTruncated.js";import"../../TextMiddleTruncated/TextMiddleTruncated.constants.js";import{Text as
|
|
1
|
+
import e from"@babel/runtime/helpers/defineProperty";import{isEmpty as t}from"lodash";import r from"../../../components/PadModeSelect/PadModeSelect.js";import{TextMiddleTruncated as n}from"../../TextMiddleTruncated/TextMiddleTruncated.js";import"../../TextMiddleTruncated/TextMiddleTruncated.constants.js";import{Text as i}from"../../Text/Text.js";import o from"./PadMode.scss.js";import{COMPLETION_APP_TYPES as l}from"../../../constants/completion.js";import{getAssetKey as s,getDefaultPadModeSetting as a}from"../../../utils/completion.js";import{jsx as c,jsxs as d}from"react/jsx-runtime";function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?p(Object(n),!0).forEach((function(r){e(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var m=function(e){var t=e.name,r=e.statusBadge;return d("div",{className:o.activeAsset,children:[c(i,{className:o.activeAssetName,size:12,children:c(n,{children:t})}),r]})},f=function(n){var i,d,p,f,v,b,j=n.fracFleet,g=n.wells,y=n.well,O=n.onSettingChange,P=n.appSettings,S=n.app,h=(null==S||null===(i=S.package)||void 0===i||null===(d=i.manifest)||void 0===d||null===(p=d.application)||void 0===p?void 0:p.ui)||{},T=h.enableSimulFracInPadSelect,A=h.completionAppType,M=h.disableActiveWellsInPadSelect;if(y||!j)return null;var w=P.padId,x=(null===(f=j.pad_frac_fleets)||void 0===f||null===(v=f.find((function(e){return w&&e.pad.id?+e.pad.id==+w:e.current})))||void 0===v?void 0:v.frac_fleet_lines)||[];if(t(g)&&(!T||!x.length))return null;var C=A||l.fracMultiWellApp,F=s(j,y,w),I=null==P||null===(b=P.settingsByAsset)||void 0===b?void 0:b[F],B=t(I)?a(j,y,C):I;return c(r,{assets:g,completionAppType:C,disableActiveWellsInPadSelect:M,enableSimulFracInPadSelect:T,padModeSetting:B,fracFleetLines:x,onChange:function(t){return O("settingsByAsset",u(u({},null==P?void 0:P.settingsByAsset),{},e({},F,t)))},formControlClassName:o.formField,activeAssetComponent:m})};export{f as PadMode};
|
|
2
2
|
//# sourceMappingURL=PadMode.js.map
|