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.4.5",
                date = "05/21/2026",
                sections = {
                    { label = "Maintenance", body = [[Maintenance release. No changes to how CritMatic tracks or displays your critical hits and normal hits.]] },
                },
            },
            {
                version = "6.4.4",
                date = "05/20/2026",
                sections = {
                    { label = "Changed", body = [[The RepMatic link in the About section of General Options now shows RepMatic's refreshed, higher-resolution icon.]] },
                },
            },
            {
                version = "6.4.3",
                date = "05/20/2026",
                sections = {
                    { label = "Fixed", body = [[Fixed errors that could appear at login for some players who updated to v6.4.2.]] },
                },
            },
        },
    }
end

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