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.26.0",
                date = "06/17/2026",
                sections = {
                    { label = "Added", body = [[You can now change the font, size, and outline of the minimap tooltip. The controls are on the Broker tab in the appearance options.]] },
                    { label = "Changed", body = [[The minimap tooltip now uses the game's default font instead of Anton. You can switch it to any font you like on the Broker tab.]] },
                },
            },
            {
                version = "6.25.0",
                date = "06/16/2026",
                sections = {
                    { label = "Changed", body = [[The Record Threshold now decides whether a new record is kept, not just whether it is announced. A hit only becomes your record when it beats your current one by at least the set percent, and smaller improvements are skipped. The default is now 5%.]] },
                },
            },
            {
                version = "6.24.0",
                date = "06/15/2026",
                sections = {
                    { label = "Added", body = [[The Crit Log has a new Group Order option. When you group your records into Damage and Healing sections, you can now choose which section appears on top.]] },
                    { label = "Fixed", body = [[The Level Up font now shows up and displays correctly in the font lists.]] },
                },
            },
        },
    }
end

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