<commit_before>import React from 'react'
// import fetch from 'isomorphic-fetch'
// import qs from 'qs'
import { Mobilization, Reducer as MobilizationReducer } from '../webviewer/webviewer'
import { Provider } from 'react-redux'
import { ApolloProvider } from 'react-apollo'
import { configureStore, client } from '../store'
import styles from './../webviewer/main.3b3e3ca1d1b88a76b379'

import { IntlProvider, addLocaleData } from 'react-intl'
import pt from 'react-intl/locale-data/pt'
import es from 'react-intl/locale-data/es'
import en from 'react-intl/locale-data/en'
import localeData from './../locale-data'

const APP_DOMAIN = process.env.APP_DOMAIN !== undefined ? process.env.APP_DOMAIN : 'localhost:8000'
// const API_URL = process.env.API_URL !== undefined ? process.env.API_URL : 'http://localhost:3000'

const initialState = {} || {
  intl: { currentLocale: 'pt-BR', messages: localeData }
}

addLocaleData([...pt, ...es, ...en])

// const { intl: { currentLocale, messages: localeMessages } } = initialState
const currentLocale = 'pt-BR'
const locale = currentLocale
const messages = {}
const intlProvider = new IntlProvider({ locale, messages })
const { intl } = intlProvider.getChildContext()

export const store = configureStore(initialState, { intl })

export default class extends React.Component {
  static async getInitialProps ({ req }) {
    const { actions: MobilizationActions } = MobilizationReducer
    const host = req.headers['host']
    // eslint-disable-next-line
    const regex = host.match(`(.+)\.${APP_DOMAIN}`)

    const where = regex
      ? { slug: regex[1].replace(/^www\./, '') }
      : { custom_domain: host }

    const promises = []
    console.log()
    promises.push(store.dispatch(MobilizationActions.asyncFilterMobilization(where)))
    promises.push(store.dispatch(MobilizationActions.asyncFilterBlock(where)))
    promises.push(store.dispatch(MobilizationActions.asyncFilterWidget(where)))
    return Promise.all(promises).then((values) => ({
      mobilization: values[0],
      blocks: values[1],
      widgets: values[2]
    }))
  }

  render () {
    return this.props.mobilization ? (
      <IntlProvider locale={locale} messages={messages}>
        <Provider store={store}>
          <ApolloProvider store={store} client={client()}>
            <Mobilization editable={false} />
            <style global jsx>{styles}</style>
          </ApolloProvider>
        </Provider>
      </IntlProvider>
    ) : (<h2>Loading...</h2>)
  }
}<commit_msg>chore(webviewer): Fix css filename<commit_after>import React from 'react'
// import fetch from 'isomorphic-fetch'
// import qs from 'qs'
import { Mobilization, Reducer as MobilizationReducer } from '../webviewer/webviewer'
import { Provider } from 'react-redux'
import { ApolloProvider } from 'react-apollo'
import { configureStore, client } from '../store'

import styles from './../webviewer/main.3b3e3ca1d1b88a76b379.css'

import { IntlProvider, addLocaleData } from 'react-intl'
import pt from 'react-intl/locale-data/pt'
import es from 'react-intl/locale-data/es'
import en from 'react-intl/locale-data/en'
import localeData from './../locale-data'

const APP_DOMAIN = process.env.APP_DOMAIN !== undefined ? process.env.APP_DOMAIN : 'localhost:8000'
// const API_URL = process.env.API_URL !== undefined ? process.env.API_URL : 'http://localhost:3000'

const initialState = {} || {
  intl: { currentLocale: 'pt-BR', messages: localeData }
}

addLocaleData([...pt, ...es, ...en])

// const { intl: { currentLocale, messages: localeMessages } } = initialState
const currentLocale = 'pt-BR'
const locale = currentLocale
const messages = {}
const intlProvider = new IntlProvider({ locale, messages })
const { intl } = intlProvider.getChildContext()

export const store = configureStore(initialState, { intl })

export default class extends React.Component {
  static async getInitialProps ({ req }) {
    const { actions: MobilizationActions } = MobilizationReducer
    const host = req.headers['host']
    // eslint-disable-next-line
    const regex = host.match(`(.+)\.${APP_DOMAIN}`)

    const where = regex
      ? { slug: regex[1].replace(/^www\./, '') }
      : { custom_domain: host }

    const promises = []
    promises.push(store.dispatch(MobilizationActions.asyncFilterMobilization(where)))
    promises.push(store.dispatch(MobilizationActions.asyncFilterBlock(where)))
    promises.push(store.dispatch(MobilizationActions.asyncFilterWidget(where)))
    return Promise.all(promises).then((values) => ({
      mobilization: values[0],
      blocks: values[1],
      widgets: values[2]
    }))
  }

  render () {
    return this.props.mobilization ? (
      <IntlProvider locale={locale} messages={messages}>
        <Provider store={store}>
          <ApolloProvider store={store} client={client()}>
            <Mobilization editable={false} />
            <style global jsx>{styles}</style>
          </ApolloProvider>
        </Provider>
      </IntlProvider>
    ) : (<h2>Loading...</h2>)
  }
}
{'fraction_non_alphanumeric': 0.1454509177972865, 'fraction_numerical': 0.010375099760574621, 'mean_word_length': 3.7381852551984878, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4006737', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1513, 'n_words': 338}