<commit_before>// explicit polyfills for older browsers
import 'core-js/es6';

import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import FormModal from './components/common/modal/FormModal';
import AppRouter from './router';
import configureStore from 'store';
import { FetchUser } from 'actions/api/auth';
import { FetchGroups } from 'actions/api/requestGroups';
import { actions as tailerActions } from 'singularityui-tailer';
import { AddStarredRequests } from 'actions/api/users';
import Utils from './utils';
import parseurl from 'parseurl';
import { useRouterHistory } from 'react-router';
import { createHistory } from 'history';

// Set up third party configurations
import { loadThirdParty } from 'thirdPartyConfigurations';

import './assets/static/images/favicon.ico';

import './styles/index.scss';
import './styles/index.styl';

function setApiRoot(data) {
  if (data.apiRoot) {
    window.localStorage.setItem('apiRootOverride', data.apiRoot);
  }
  return location.reload();
}

const HMRContainer = (module.hot)
  ? AppContainer
  : ({ children }) => (children);

document.addEventListener('DOMContentLoaded', () => {
  loadThirdParty();

  if (window.config.apiRoot) {
    // set up Redux store
    const parsedUrl = parseurl({ url: config.appRoot });
    const history = useRouterHistory(createHistory)({
      basename: parsedUrl.path
    });

    const store = configureStore({}, history);

    store.dispatch(tailerActions.sandboxSetApiRoot(config.apiRoot));

    // set up user<commit_msg>get around react-hot-loader build issue<commit_after>// explicit polyfills for older browsers
import 'core-js/es6';

import React from 'react';
import ReactDOM from 'react-dom';
import FormModal from './components/common/modal/FormModal';
import AppRouter from './router';
import configureStore from 'store';
import { FetchUser } from 'actions/api/auth';
import { FetchGroups } from 'actions/api/requestGroups';
import { actions as tailerActions } from 'singularityui-tailer';
import { AddStarredRequests } from 'actions/api/users';
import Utils from './utils';
import parseurl from 'parseurl';
import { useRouterHistory } from 'react-router';
import { createHistory } from 'history';

// Set up third party configurations
import { loadThirdParty } from 'thirdPartyConfigurations';

import './assets/static/images/favicon.ico';

import './styles/index.scss';
import './styles/index.styl';

function setApiRoot(data) {
  if (data.apiRoot) {
    window.localStorage.setItem('apiRootOverride', data.apiRoot);
  }
  return location.reload();
}

const HMRContainer = (module.hot)
  ? require('react-hot-loader').AppContainer
  : ({ children }) => (children);

document.addEventListener('DOMContentLoaded', () => {
  loadThirdParty();

  if (window.config.apiRoot) {
    // set up Redux store
    const parsedUrl = parseurl({ url: config.appRoot });
    const history = useRouterHistory(createHistory)({
      basename: parsedUrl.path
    });

    const store = configureStore({}, history);

    store.dispatch(tailerActions.sandboxSetApiRoot(config.apiRoot));

    // set up user
{'fraction_non_alphanumeric': 0.13299395482023543, 'fraction_numerical': 0.0006363347120585428, 'mean_word_length': 4.614285714285714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2740476', 'n_tokens_mistral': 925, 'n_tokens_neox': 898, 'n_words': 241}