const { origin } = window.location;
export const CURRENT_URL = `${origin}`;

const getAPIBaseUrl = () => {
  let rs = CURRENT_URL;
  console.log('VITE_APP_ENV : ', import.meta.env.VITE_APP_ENV);
  if(import.meta.env.VITE_APP_ENV === 'production'){
    rs = import.meta.env.VITE_APP_API_PROXY_HOST;
  }
  return rs;
};
const getAPIAuthBaseUrl = () => {
  let rs = CURRENT_URL;
  console.log('VITE_APP_ENV : ', import.meta.env.VITE_APP_ENV);
  if(import.meta.env.VITE_APP_ENV === 'production'){
    rs = import.meta.env.VITE_APP_AUTH_PROXY_HOST;
  }
  return rs;
}
const getHeaderUserAgent = () => {
  let os = 'Android';
  let deviceType = 'Galaxy Flip 6';
  let deviceID = 'uuid';
  let appVersion = '1.0.0';
  let browserInformation = 'Chrome135';
  return `${os} ${deviceType} ${deviceID} ${appVersion} ${browserInformation}`;
};

export const API_BASE_URL = getAPIBaseUrl();
export const API_AUTH_BASE_URL = getAPIAuthBaseUrl();
export const API_URL_KEY = 'nmsa';
export const HEADER_USER_AGENT = getHeaderUserAgent();
export const API_PARAM = {};

