package ua

import (
	"math/rand"
	"net/http"
)

func SetHeader(req *http.Request) {
	req.Header.Set("User-Agent", Random())
}

func Random() string {
	return "Mozilla/5.0 (" + platforms[rand.Intn(len(platforms))] + ") AppleWebKit/537.36 (KHTML, like Gecko) Chrome/" + chromeVersions[rand.Intn(len(chromeVersions))] + " Safari/537.36"
}

var (
	chromeVersions = []string{
		"139.0.7258.128",
		"139.0.7258.67",
		"138.0.7204.185",
		"138.0.7204.170",
		"138.0.7204.159",
		"138.0.7204.102",
		"138.0.7204.100",
		"138.0.7204.51",
		"138.0.7204.49",
		"137.0.7151.122",
		"138.0.7204.35",
		"137.0.7151.121",
		"137.0.7151.105",
		"137.0.7151.104",
		"137.0.7151.57",
		"137.0.7151.55",
		"136.0.7103.116",
		"137.0.7151.40",
		"136.0.7103.113",
		"136.0.7103.92",
		"135.0.7049.117",
		"136.0.7103.48",
		"135.0.7049.114",
		"135.0.7049.86",
		"135.0.7049.42",
		"135.0.7049.41",
		"134.0.6998.167",
		"134.0.6998.119",
		"134.0.6998.117",
		"134.0.6998.37",
		"134.0.6998.35",
		"133.0.6943.128",
		"133.0.6943.100",
		"133.0.6943.59",
		"133.0.6943.53",
		"132.0.6834.162",
		"133.0.6943.35",
		"132.0.6834.160",
		"132.0.6834.112",
		"132.0.6834.110",
		"131.0.6778.267",
		"132.0.6834.83",
		"131.0.6778.264",
		"131.0.6778.204",
		"131.0.6778.139",
		"131.0.6778.109",
		"131.0.6778.71",
		"131.0.6778.69",
		"130.0.6723.119",
		"131.0.6778.33",
		"130.0.6723.116",
		"130.0.6723.71",
		"130.0.6723.60",
		"130.0.6723.58",
		"129.0.6668.103",
		"130.0.6723.44",
		"129.0.6668.100",
		"129.0.6668.72",
		"129.0.6668.60",
		"129.0.6668.42",
		"128.0.6613.122",
		"128.0.6613.121",
		"128.0.6613.115",
		"128.0.6613.113",
		"127.0.6533.122",
		"128.0.6613.36",
		"127.0.6533.119",
		"127.0.6533.100",
		"127.0.6533.74",
		"127.0.6533.72",
		"126.0.6478.185",
		"127.0.6533.57",
		"126.0.6478.183",
		"126.0.6478.128",
		"126.0.6478.116",
		"126.0.6478.114",
		"126.0.6478.61",
		"125.0.6422.176",
		"126.0.6478.56",
		"125.0.6422.144",
		"126.0.6478.36",
		"125.0.6422.142",
		"125.0.6422.114",
		"125.0.6422.77",
		"125.0.6422.76",
		"124.0.6367.210",
		"125.0.6422.60",
		"124.0.6367.208",
		"124.0.6367.201",
		"124.0.6367.156",
		"125.0.6422.41",
		"124.0.6367.155",
		"124.0.6367.119",
		"124.0.6367.92",
		"124.0.6367.63",
		"124.0.6367.61",
		"123.0.6312.124",
		"124.0.6367.60",
		"123.0.6312.122",
		"123.0.6312.106",
		"123.0.6312.105",
		"123.0.6312.60",
		"123.0.6312.58",
		"122.0.6261.131",
		"123.0.6312.46",
		"122.0.6261.129",
		"122.0.6261.128",
		"122.0.6261.112",
		"122.0.6261.111",
		"122.0.6261.71",
		"122.0.6261.69",
		"121.0.6167.189",
		"122.0.6261.57",
		"121.0.6167.187",
		"121.0.6167.186",
		"121.0.6167.162",
		"121.0.6167.160",
		"121.0.6167.140",
		"121.0.6167.86",
		"121.0.6167.85",
		"120.0.6099.227",
		"120.0.6099.225",
		"121.0.6167.75",
		"120.0.6099.224",
		"120.0.6099.218",
		"120.0.6099.216",
		"120.0.6099.200",
		"120.0.6099.199",
		"120.0.6099.129",
		"120.0.6099.110",
		"120.0.6099.109",
		"120.0.6099.62",
		"120.0.6099.56",
	}

	platforms = []string{
		"Windows NT 10.0; Win64; x64",
		"Macintosh; Intel Mac OS X 10_15_7",
	}
)
