export const CHROMIUM_USER_AGENT =
  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36";

export const BROWSER_ACCEPT_LANGUAGE = "en-US,en;q=0.9";

export const FETCH_URL_ACCEPT =
  "text/html,application/xhtml+xml,application/xml;q=0.9,application/pdf;q=0.9,*/*;q=0.8";

export function buildBrowserLikeRequestHeaders(accept: string): Record<string, string> {
  return {
    "User-Agent": CHROMIUM_USER_AGENT,
    Accept: accept,
    "Accept-Language": BROWSER_ACCEPT_LANGUAGE,
  };
}

export function buildBrowserLikeNavigationHeaders(accept = FETCH_URL_ACCEPT): Record<string, string> {
  return {
    ...buildBrowserLikeRequestHeaders(accept),
    "Upgrade-Insecure-Requests": "1",
    "Sec-Fetch-Dest": "document",
    "Sec-Fetch-Mode": "navigate",
    "Sec-Fetch-Site": "none",
    "Sec-Fetch-User": "?1",
  };
}
