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.20.0",
                date = "06/13/2026",
                sections = {
                    { label = "Added", body = [[The minimap and broker tooltip now show your full crit log: every spell with its icon and its crit, hit, crit heal, and heal records, in your own crit and hit colors. You can choose how many spells it lists, or switch it back to the short top-records summary, in the options.]] },
                    { label = "Fixed", body = [[The short broker summary now also shows your highest non-crit heal.]] },
                },
            },
            {
                version = "6.19.0",
                date = "06/12/2026",
                sections = {
                    { label = "Added", body = [[CritMatic now comes with its own built-in alert sounds. Twelve new sounds for crits, healing crits, heals, and hits, each in three styles, are ready to pick in CritMatic's sound dropdowns.]] },
                },
            },
            {
                version = "6.18.2",
                date = "06/12/2026",
                sections = {
                    { label = "Fixed", body = [[Changing, copying, or resetting a profile no longer tells you to reload your interface. Your settings apply right away.]] },
                },
            },
        },
    }
end

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