{"size": 2354, "ext": "js", "max_stars_repo_path": "view/src/config/config.js", "max_stars_repo_name": "actions-on-google-labs/cookie-detective-game-nodejs", "max_stars_repo_stars_event_min_datetime": "2020-10-29T16:23:12.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-04T23:27:03.000Z", "max_issues_repo_path": "view/src/config/config.js", "max_issues_repo_name": "actions-on-google-labs/cookie-detective-game-nodejs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "view/src/config/config.js", "max_forks_repo_name": "actions-on-google-labs/cookie-detective-game-nodejs", "max_forks_repo_forks_event_min_datetime": "2020-10-19T03:49:39.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-13T03:44:53.000Z"}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 25.5869565217, "max_line_length": 76, "alphanum_fraction": 0.663126593}
/**
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import {
  EnvironmentNames,
  PropertyNames,
  URLNames,
  VariableNames,
} from '../data/enum/configNames';

const config = {
  environments: {
    [EnvironmentNames.PRODUCTION]: {
      variables: {},
      urls: {},
    },
    [EnvironmentNames.STAGING]: {
      extends: EnvironmentNames.PRODUCTION,
      variables: {},
      urls: {},
    },
    [EnvironmentNames.DEVELOPMENT]: {
      extends: EnvironmentNames.STAGING,
      variables: {},
      urls: {},
    },
    [EnvironmentNames.LOCAL]: {
      extends: EnvironmentNames.DEVELOPMENT,
      variables: {},
      urls: {},
    },
  },
  variables: {
    [VariableNames.LOCALE_ENABLED]: false,
    [VariableNames.LOCALE_ROUTING_ENABLED]: false,
    [VariableNames.VERSIONED_STATIC_ROOT]:
      (window.webpackPublicPath || process.env.PUBLIC_PATH) +
      process.env.VERSIONED_STATIC_ROOT,
    [VariableNames.STATIC_ROOT]:
      (window.webpackPublicPath || process.env.PUBLIC_PATH) +
      process.env.STATIC_ROOT,
    [VariableNames.PUBLIC_PATH]:
      window.webpackPublicPath || process.env.PUBLIC_PATH,
    [VariableNames.TTS_API_KEY]: {
      production: '',
      development: '',
    },
    [VariableNames.TTS_URL]: {
      production: '',
      development: 'https://texttospeech.googleapis.com/v1/text:synthesize',
    },
  },
  urls: {
    [URLNames.API]: `${process.env.PUBLIC_PATH}api/`,
  },
  properties: {
    [PropertyNames.PERSIST_QUERY_PARAMS]: [],
  },
};

let environment = EnvironmentNames.PRODUCTION;
const {host} = document.location;

switch (host.split(':').shift()) {
  case 'localhost': {
    environment = EnvironmentNames.LOCAL;
    break;
  }
  default: {
    environment = EnvironmentNames.PRODUCTION;
    break;
  }
}

export default {
  config,
  environment,
};
