local function generateAdvancedInsertGroup(i)
    return {
        key = "insert_" .. i,
        label = "Insert " .. i,
        type = "group",
        default = {},
        items = {
            {
                key = "media_type",
                type = "tiny_select",
                default = "none",
                specialValue = "insetMediaTypes",
                label = "Type",
                description = "What media type to insert",
            },
            {
                key = "size",
                type = "tiny_select",
                default = "m",
                values = { "xs", "s", "m", "l", "xl", "xxl" },
                label = "Size",
                description = "Element Size",
            },
            {
                key = "size_adjust",
                type = "number",
                default = 0,
                options = { max = 100, min = -100 },
                label = "Size Adjust",
                description = "Make minor adjustment to the element size",
            },
            {
                key = "size_ratio",
                type = "tiny_select",
                default = "proportional",
                values = { "proportional", "square" },
                label = "Size Ratio",
                description = "Ratio of input element (proportional to screen or square)",
            },
            {
                key = "fit",
                type = "tiny_select",
                default = "contain",
                values = { "contain", "cover", "fill", "none" },
                label = "Fit",
                description = "How to size the insert element. Use `contain` in most cases and possibly `cover` for screenshot. `fill` will stretch the element, `none` will not resize the element at all (probably not what you want)",
            },
            {
                key = "stroke_color",
                type = "tiny_select",
                default = "none",
                values = { "none", "white", "black" },
                label = "Stroke Color",
                description = "Place an outline around the element",
            },
            {
                key = "z_index",
                type = "number",
                default = 1,
                options = { max = 10, min = 1 },
                label = "Z-Index",
                description = "Layer to place the element. Higher numbers render on top of lower",
            },
            {
                key = "position",
                type = "tiny_select",
                default = "middle_right",
                values = {
                    "top_left",
                    "top_centre",
                    "top_right",
                    "middle_left",
                    "middle_centre",
                    "middle_right",
                    "bottom_left",
                    "bottom_centre",
                    "bottom_right",
                },
                label = "Position",
                description = "Where to place the element",
            },
            {
                key = "anchor",
                type = "tiny_select",
                default = "inner",
                values = {
                    "inner",
                    "edge",
                },
                label = "Anchor",
                description = "Anchor the element to the edge or the inner grid",
            },
            {
                key = "offset_x",
                type = "number",
                default = 0,
                options = { max = 100, min = -100 },
                label = "Offset X %",
                description = "Adjust the position of the element horizontally by % relative to the screen",
            },
            {
                key = "offset_y",
                type = "number",
                default = 0,
                options = { max = 100, min = -100 },
                label = "Offset Y %",
                description = "Adjust the position of the element vertically by % relative to the screen",
            },
        },
    }
end

return {
    advanced = {
        order = 1,
        strategy = "module.mix.strategy.advanced",
        options = {
            {
                key = "background",
                label = "Background",
                type = "group",
                default = {},
                items = {
                    {
                        key = "bg_color",
                        label = "BG Color",
                        type = "tiny_select",
                        default = "transparent",
                        values = { "transparent", "black", "white", "custom" },
                        description = "The background color",
                    },
                    {
                        key = "header_footer",
                        type = "boolean",
                        default = false,
                        label = "Header/Footer",
                        description = "Leaves a gap for the header and footer of the theme. Set the height of both in config",
                    },
                    {
                        key = "flip_h",
                        type = "boolean",
                        default = false,
                        label = "Flip H",
                        description = "Flips the mask & sceenshot location horizontally",
                    },
                    {
                        key = "screenshot",
                        label = "Screenshot",
                        type = "tiny_select",
                        default = "1/2",
                        values = { "full", "1/2", "3/4", "3/5", "top_1/4", "middle_1/4", "bottom_1/4", "none" },
                        description = "Screenshot size and location",
                    },
                    {
                        key = "mask",
                        label = "Mask",
                        type = "tiny_select",
                        default = "none",
                        values = {
                            "splatter",
                            "grunge",
                            "grunge_alt",
                            "halftone_1/2",
                            "halftone_3/4",
                            "halftone_cover",
                            "gradient_1/2",
                            "gradient_3/4",
                            "gradient_1/2_rad",
                            "none",
                        },
                        description = "Mask Type",
                    },
                    {
                        key = "opacity",
                        label = "Opacity",
                        type = "number",
                        default = 100,
                        options = { max = 100, min = 0 },
                        description = "Mask Type",
                    },
                },
            },
            generateAdvancedInsertGroup(1),
            generateAdvancedInsertGroup(2),
            generateAdvancedInsertGroup(3),
            generateAdvancedInsertGroup(4),
        },
    },
}
