import { getLabwareLocation } from './getLabwareLocation' ; import { getModuleInitialLoadInfo } from './getModuleInitialLoadInfo' ; import type { LabwareOffsetLocation } from '@opentrons/api-client' ; import { ProtocolFile } from '@opentrons/shared-data' ; export const getLabwareOffsetLocation = ( labwareId , commands , modules ) : LabwareOffsetLocation => { let location ; const labwareLocation = getLabwareLocation ( labwareId , commands ) ; if ( 'moduleId' in labwareLocation ) { const moduleModel = modules [ labwareLocation . moduleId ] . model ; const slotName = getModuleInitialLoadInfo ( labwareLocation . moduleId , commands ) . location . slotName ; location = { slotName , moduleModel } ; } else { location = labwareLocation ; } return location ; } ;