def _get_all_imports(self, collapse: bool = False) -> ParsedImportDict:
        """Get all the libraries and fields that are used by the component and its children.

        Args:
            collapse: Whether to collapse the imports by removing duplicates.

        Returns:
            The import dict with the required imports.
        """
        _imports = imports.merge_imports(
            self._get_imports(), *[child._get_all_imports() for child in self.children]
        )
        return imports.collapse_imports(_imports) if collapse else _imports
Get all the libraries and fields that are used by the component and its children.

        Args:
            collapse: Whether to collapse the imports by removing duplicates.

        Returns:
            The import dict with the required imports.
        
reflex/components/component.py