def _get_imports(self) -> ParsedImportDict:
        """Get all the libraries and fields that are used by the component.

        Returns:
            The imports needed by the component.
        """
        _imports = {}

        # Import this component's tag from the main library.
        if self.library is not None and self.tag is not None:
            _imports[self.library] = {self.import_var}

        # Get static imports required for event processing.
        event_imports = Imports.EVENTS if self.event_triggers else {}

        # Collect imports from Vars used directly by this component.
        var_imports = [
            var_data.imports
            for var in self._get_vars()
            if (var_data := var._get_all_var_data()) is not None
        ]

        added_import_dicts: list[ParsedImportDict] = []
        for clz in self._iter_parent_classes_with_method("add_imports"):
            list_of_import_dict = clz.add_imports(self)

            if not isinstance(list_of_import_dict, list):
                list_of_import_dict = [list_of_import_dict]

            added_import_dicts.extend(
                [parse_imports(import_dict) for import_dict in list_of_import_dict]
            )

        return imports.merge_imports(
            self._get_dependencies_imports(),
            self._get_hooks_imports(),
            _imports,
            event_imports,
            *var_imports,
            *added_import_dicts,
        )
Get all the libraries and fields that are used by the component.

        Returns:
            The imports needed by the component.
        
reflex/components/component.py