using Avalonia;
using Avalonia.ReactiveUI;
using Serilog;
using WebViewControl;
using xwd.utils;

namespace detect.gui;

sealed class Program
{
    public static void Main(string[] args)
    {
        AppSettingsManager.ActiveProfile = "dev";
        LogConfig.Init();
        Log.Information("系统启动");

        WebView.Settings.OsrEnabled = false;
        WebView.Settings.AddCommandLineSwitch("--disable-web-security", "");
        WebView.Settings.AddCommandLineSwitch("--default-background-color", "transparent");
        WebView.Settings.AddCommandLineSwitch("--cast-app-background-color", "transparent");
        WebView.Settings.AddCommandLineSwitch("--disable-http-cache", "1");
        WebView.Settings.LogFile = "ceflog.txt";
        WebView.Settings.EnableErrorLogOnly = true;

        BuildApp()
            .StartWithClassicDesktopLifetime(args);
    }

    private static AppBuilder BuildApp()
        => AppBuilder.Configure<App>()
            .UsePlatformDetect()
            .WithInterFont()
            .LogToTrace()
            .UseReactiveUI();
}