def _compile_app(app_root: Component) -> str:
    """Compile the app template component.

    Args:
        app_root: The app root to compile.

    Returns:
        The compiled app.
    """
    from reflex.components.dynamic import bundled_libraries

    window_libraries = [
        (_normalize_library_name(name), name) for name in bundled_libraries
    ]

    app_root_imports = app_root._get_all_imports()
    _apply_common_imports(app_root_imports)

    return templates.APP_ROOT.render(
        imports=utils.compile_imports(app_root_imports),
        custom_codes=app_root._get_all_custom_code(),
        hooks=app_root._get_all_hooks(),
        window_libraries=window_libraries,
        render=app_root.render(),
        dynamic_imports=app_root._get_all_dynamic_imports(),
    )
Compile the app template component.

    Args:
        app_root: The app root to compile.

    Returns:
        The compiled app.
    
reflex/compiler/compiler.py