<commit_before>/* global cozy */
// eslint-disable-next-line no-unused-vars
import mainStyles from 'drive/styles/main.styl'

import 'whatwg-fetch'
import React from 'react'
import { render } from 'react-dom'
import { Router, hashHistory } from 'react-router'

import { initTranslation } from 'cozy-ui/transpiled/react/I18n'
import CozyClient from 'cozy-client'
import {
  shouldEnableTracking,
  getTracker
} from 'cozy-ui/transpiled/react/helpers/tracker'
import { configureReporter, setCozyUrl } from 'drive/lib/reporter'
import { registerClientPlugins } from 'drive/mobile/lib/cozy-helper'

import appMetadata from 'drive/appMetadata'
import AppRoute from 'drive/web/modules/navigation/AppRoute'
import configureStore from 'drive/store/configureStore'
import { schema } from 'drive/lib/doctypes'
import { hot } from 'react-hot-loader'
import { Document } from 'cozy-doctypes'

import App from 'components/App/App'
document.addEventListener('DOMContentLoaded', () => {
  const root = document.querySelector('[role=application]')
  const data = root.dataset

  const protocol = window.location ? window.location.protocol : 'https:'
  const cozyUrl = `${protocol}//${data.cozyDomain}`

  configureReporter()
  setCozyUrl(cozyUrl)
  const client = new CozyClient({
    uri: cozyUrl,
    token: data.cozyToken,
    appMetadata,
    schema
  })

  if (!Document.cozyClient) {
    Document.registerClient(client)<commit_msg>feat: Make flag accessible from console in development<commit_after>/* global cozy, __DEVELOPMENT__ */
// eslint-disable-next-line no-unused-vars
import mainStyles from 'drive/styles/main.styl'

import 'whatwg-fetch'
import React from 'react'
import { render } from 'react-dom'
import { Router, hashHistory } from 'react-router'

import { initTranslation } from 'cozy-ui/transpiled/react/I18n'
import CozyClient from 'cozy-client'
import {
  shouldEnableTracking,
  getTracker
} from 'cozy-ui/transpiled/react/helpers/tracker'
import { configureReporter, setCozyUrl } from 'drive/lib/reporter'
import { registerClientPlugins } from 'drive/mobile/lib/cozy-helper'

import appMetadata from 'drive/appMetadata'
import AppRoute from 'drive/web/modules/navigation/AppRoute'
import configureStore from 'drive/store/configureStore'
import { schema } from 'drive/lib/doctypes'
import { hot } from 'react-hot-loader'
import { Document } from 'cozy-doctypes'

import App from 'components/App/App'

import flag from 'cozy-flags'

if (__DEVELOPMENT__) {
  window.flag = flag
}

document.addEventListener('DOMContentLoaded', () => {
  const root = document.querySelector('[role=application]')
  const data = root.dataset

  const protocol = window.location ? window.location.protocol : 'https:'
  const cozyUrl = `${protocol}//${data.cozyDomain}`

  configureReporter()
  setCozyUrl(cozyUrl)
  const client = new CozyClient({
    uri: cozyUrl,
    token: data.cozyToken,
    appMetadata,
    schema
  })

  if (!Document.cozyClient) {
    Document.registerClient(client)
{'fraction_non_alphanumeric': 0.11790393013100436, 'fraction_numerical': 0.0013436345314074571, 'mean_word_length': 4.850687622789784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7302381', 'n_tokens_mistral': 939, 'n_tokens_neox': 935, 'n_words': 223}