{
    "tabs": [
        {
            "title": "General",
            "forms": [
                {
                    "class": "counter-form",
                    "id": "settingsForm-0",
                    "elements": [
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Name",
                                    "id": "title",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "inputRequired": true
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Count",
                                    "id": "count",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputRequired": true,
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "html",
                            "elements": [
                                "<hr>"
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Avatar URL",
                                    "id": "imageURL",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text"
                                }, 
                                {
                                    "label": "or",
                                    "id": "imageFile",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "file",
                                    "inputFileAccept": "image/png, image/jpeg"
                                }
                            ]
                        },
                        {
                            "type": "html",
                            "elements": [
                                "<hr>"
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Banner URL",
                                    "id": "bannerURL",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text"
                                }, 
                                {
                                    "label": "or",
                                    "id": "bannerFile",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "file",
                                    "inputFileAccept": "image/png, image/jpeg"
                                }
                            ]
                        },
                        {
                            "type": "html",
                            "elements": [
                                "<hr>"
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Footer",
                                    "id": "footer",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "title": "Counter",
            "forms": [
                {
                    "class": "counter-form",
                    "id": "settingsForm-1",
                    "elements": [
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Gain type",
                                    "id": "gainType",
                                    "type": "option",
                                    "tag": "select",
                                    "inputRequired": true,
                                    "selectOptions": [
                                        ["0", "Uniform (Default)"],
                                        ["1", "Gaussian"],
                                        ["2", "Custom"]
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "class": "gain-0",
                            "elements": [
                                {
                                    "label": "Minimum rate",
                                    "id": "minRate",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "class": "gain-0",
                            "elements": [
                                {
                                    "label": "Maximum rate",
                                    "id": "maxRate",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "class": "gain-1",
                            "elements": [
                                {
                                    "label": "Mean rate",
                                    "id": "meanRate",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "class": "gain-1",
                            "elements": [
                                {
                                    "label": "Standard deviation",
                                    "id": "stdevRate",
                                    "info": "The expected distance from the mean the rate will be.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 0,
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "class": "gain-2",
                            "elements": [
                                {
                                    "label": "Custom distribution",
                                    "id": "customRate",
                                    "info": "Each line is of the form Min,Max,Weight. Weight is the relative probability of the line being chosen. Min and Max are the minimum and maximum rates for if this line is chosen.",
                                    "type": "option",
                                    "tag": "textarea",
                                    "placeholder": "Min1,Max1,Weight1\nMin2,Max2,Weight2"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Gain per (seconds)",
                                    "id": "gainPer",
                                    "info": "The amount of time in seconds that the gain rates are calculated per. For example, set to 60 for a rate in followers/subscribers per minute, and 3600 for a rate in per hour.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 0.001,
                                    "inputNumberStep": "any"
                                }
                            ]
                        }
                    ]
                }
            ]
        }, 
        {
            "title": "Styles",
            "forms": [
                {
                    "class": "counter-form",
                    "id": "settingsForm-2",
                    "elements": [
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Username color",
                                    "id": "titleColor",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Counter color",
                                    "id": "counterColor",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Counter up color",
                                    "id": "upColor",
                                    "info": "The color the counter changes to when counting up.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Counter down color",
                                    "id": "downColor",
                                    "info": "The color the counter changes to when counting down.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Footer color",
                                    "id": "footerColor",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Background color",
                                    "id": "bgColor",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Chart color",
                                    "id": "chartColor",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Chart grid and label color",
                                    "id": "chartGridColor",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "color"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Banner blur amount",
                                    "id": "bannerBlur",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 0,
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Font type",
                                    "id": "fontType",
                                    "type": "option",
                                    "tag": "select",
                                    "intputRequired": true,
                                    "selectOptions": [
                                        ["0", "Default"],
                                        ["1", "Serif"],
                                        ["2", "Sans Serif"],
                                        ["3", "Monospace"],
                                        ["4", "Math"],
                                        ["5", "Custom (System)"],
                                        ["6", "Custom (Google Fonts)"]
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "class": "custom-font-input",
                            "elements": [
                                {
                                    "label": "Font",
                                    "id": "font",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Font weight",
                                    "id": "fontWeight",
                                    "info": "How thin or bold the font is. Only affects the number of the counter. Note: Not all font weights are supported on all fonts.",
                                    "type": "option",
                                    "tag": "select",
                                    "selectOptions": [
                                        ["100", "Thin"],
                                        ["200", "Extra Light"],
                                        ["300", "Light"],
                                        ["400", "Regular"],
                                        ["500", "Medium"],
                                        ["600", "Semibold"],
                                        ["700", "Bold"],
                                        ["800", "Extra Bold"],
                                        ["900", "Black"]
                                    ]
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "title": "Advanced Settings",
            "id": "settingsForm-3",
            "forms": [
                {
                    "class": "counter-form",
                    "elements": [
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Show avatar",
                                    "id": "showImage",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Show banner",
                                    "id": "showBanner",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Show chart",
                                    "id": "showChart",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Show chart grid and labels",
                                    "id": "showChartGrid",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Show \"lcedit.com\" chart credits",
                                    "id": "chartCreditsEnabled",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Show footer",
                                    "id": "showFooter",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Abbreviate counter",
                                    "id": "abb",
                                    "info": "Limit the counter to show up to three significant digits, as in YouTube's API.",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Offline gains",
                                    "id": "offlineGains",
                                    "info": "Upon loading, update the counter if it has been gaining while the counter was not open. Only applies if the counter has not been open for at least ten update intervals.",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Keep chart data on reload",
                                    "id": "keepChartData",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Reverse odometer animation direction",
                                    "id": "reverseAnimation",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Max chart values",
                                    "id": "maxChartValues",
                                    "info": "The maximum number of data points the chart will show.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 3,
                                    "inputNumberMax": 10000
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Animation duration in seconds",
                                    "id": "animationDuration",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 0,
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Minimum count",
                                    "id": "min",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Maximum count",
                                    "id": "max",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Animation type",
                                    "id": "animationType",
                                    "type": "option",
                                    "tag": "select",
                                    "selectOptions": [
                                        ["0", "Odometer (default)"],
                                        ["1", "Odomter (YouTube Studio)"],
                                        ["2", "Counting"],
                                        ["3", "Odometer (minimal animation)"]
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Number format",
                                    "id": "numberFormat",
                                    "type": "option",
                                    "tag": "select",
                                    "selectOptions": [
                                        [",ddd", "12,345 (comma separator)"],
                                        [".ddd", "12.345 (dot separator)"],
                                        [" ddd", "12 345 (space separator)"],
                                        ["d", "12345 (no separator)"]
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Update interval in seconds",
                                    "id": "updateInterval",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 0.001,
                                    "inputNumberMax": 2147483.647,
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Update probability in percent",
                                    "id": "updateProbability",
                                    "info": "The percent chance that the counter will update during each update interval. If it updates, the gains will be scaled accordingly to match the given rates.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 0,
                                    "inputNumberMax": 100,
                                    "inputNumberStep": "any"
                                }
                            ]
                        }
                    ]
                }
            ]
        }, 
        {
            "title": "API Updates",
            "forms": [
                {
                    "class": "api-form",
                    "id": "settingsForm-4",
                    "elements": [
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Channel ID",
                                    "id": "channelID",
                                    "info": "The channel ID to check (e.g., UC... for YouTube). This will be used in the API URL.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "inputRequired": true
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "API URL",
                                    "id": "apiURL",
                                    "info": "API URL. Use {{channelID}} where the channel ID should be inserted, or append it at the end.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "placeholder": "https://www.googleapis.com/youtube/v3/channels?part=statistics,snippet&key=KEY&id={{channelID}}"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Method",
                                    "id": "apiMethod",
                                    "type": "option",
                                    "tag": "select",
                                    "selectOptions": [
                                        ["GET", "GET"],
                                        ["POST", "POST"]
                                    ]
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Loop through (data = root)",
                                    "id": "apiLoop",
                                    "info": "Path to loop through in response. Leave as 'data' if response is directly an object, or use like 'data.items' for arrays.",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "placeholder": "data"
                                }
                            ]
                        },
                        {
                            "type": "html",
                            "elements": [
                                "<h4>Updates</h4>"
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Update Name",
                                    "id": "updateName",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Name Path",
                                    "id": "pathName",
                                    "info": "Path to name in response (e.g., snippet.title)",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "placeholder": "snippet.title"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Update Image",
                                    "id": "updateImage",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Image Path",
                                    "id": "pathImage",
                                    "info": "Path to image in response (e.g., snippet.thumbnails.default.url)",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "placeholder": "snippet.thumbnails.default.url"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Update Count",
                                    "id": "updateCount",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Count Path",
                                    "id": "pathCount",
                                    "info": "Path to count in response (e.g., statistics.subscriberCount)",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "placeholder": "statistics.subscriberCount"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "ID Path (Required)",
                                    "id": "pathID",
                                    "info": "Path to ID in response (e.g., id)",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "text",
                                    "placeholder": "id",
                                    "inputRequired": true
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "ID Includes (Enable if ID is part of another string)",
                                    "id": "IDIncludes",
                                    "type": "checkbox"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Headers (optional)",
                                    "id": "extraCred",
                                    "info": "Format: HeaderName: value;",
                                    "type": "option",
                                    "tag": "textarea",
                                    "placeholder": "Authorization: Bearer token;"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Body (optional, for POST)",
                                    "id": "body",
                                    "info": "Format: key: value;",
                                    "type": "option",
                                    "tag": "textarea",
                                    "placeholder": "key1: value1;"
                                }
                            ]
                        },
                        {
                            "type": "section",
                            "elements": [
                                {
                                    "label": "Update Interval (seconds)",
                                    "id": "apiUpdateInt",
                                    "type": "option",
                                    "tag": "input",
                                    "inputType": "number",
                                    "inputNumberMin": 1,
                                    "inputNumberStep": "any"
                                }
                            ]
                        },
                        {
                            "type": "checkbox",
                            "elements": [
                                {
                                    "label": "Force Updates (even without count changes)",
                                    "id": "forceUpdates",
                                    "type": "checkbox"
                                }
                            ]
                        }
                    ]
                }
            ],
            "trailingHTML": [
                "<button class=\"btn btn-primary\" onclick=\"saveAPIUpdates()\">Save API Update Settings</button>",
                "<br>",
                "<button class=\"btn btn-primary\" onclick=\"apiUpdate()\">Update Now</button>",
                "<br>",
                "<button class=\"btn btn-secondary\" onclick=\"enableApiUpdate()\" id=\"enableApiUpdate\">Enable API Updates</button>",
                "<br>",
                "<h5>Status indicator: <span id=\"apiStatusIndicator\">--</span></h5>"
            ]
        }
    ]
}