Tell me about an advanced Jetpack Compose component you implemented in a project.
Implement the component's pure state reducer as process_component_events(events). Process tree updates, expansion, selection, search queries, and asynchronous refresh events while ignoring stale refresh results. Return the final component state as a dictionary containing items, expanded, selected, query, visible_ids, latest_request_id, and loading.
Each item has id, parent, and label; parent is null for roots. Preserve item order and expose a node during search when it matches the query or is an ancestor of a match. The function signature and event formats are defined by the examples and constraints.
def process_component_events(events):