local lib = LibStub("LibMatic-ChangeLog-1.0", true)

local function buildSpec()
    return {
        title = "CritMatic - Change Log",
        statusText = "For the full changelog, visit CurseForge.",
        version = tostring(Critmatic.newVersion or ""),
        style = (Critmatic.db and Critmatic.db.profile and Critmatic.db.profile.changeLogPopUp) or nil,
        entries = {
            {
                version = "6.8.1",
                date = "05/31/2026",
                sections = {
                    { label = "Changed", body = [[CritMatic's newest options and the minimap button tooltips are now translated into all supported languages.]] },
                },
            },
            {
                version = "6.8.0",
                date = "05/31/2026",
                sections = {
                    { label = "Added", body = [[Records now show up in your pet's ability tooltips, just like your own spells. CritMatic also has a minimap button now, and shows up on info bars like Titan Panel: left-click opens the Crit Log, right-click opens the options. And there's a new option to stop recording records on grey-level mobs and critters, just turn on "Ignore Grey-Level Targets" in the General options.]] },
                    { label = "Changed", body = [[New records now show your previous best and how much you beat it by, like (prev 11200, +1145). You can turn this off in the General options. Guild crit announcements are also spaced at least a minute apart now, so CritMatic won't spam your guild.]] },
                },
            },
            {
                version = "6.7.0",
                date = "05/31/2026",
                sections = {
                    { label = "Changed", body = [[New highest crits are now shared to your guild chat by default. If you'd rather keep them to yourself, just turn off "Send Crits to Guild" in the Social settings. If you already changed that setting before, your choice is kept.]] },
                },
            },
        },
    }
end

Critmatic.showChangeLog = function()
    if not lib then return end
    lib:Show(buildSpec())
end
