<commit_before>/* @flow */
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { t } from 'i18next';
import Radium from 'radium';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import withWidth from 'material-ui/utils/withWidth';
import { AppBar, Drawer } from 'material-ui';

import Menu from './Menu';
import RightMenu from './RightMenu';
import { addAnimation } from '../Actions/animations';

const style = {
  appRight: {
    marginTop: 0,
    display: 'flex',
  },
  wrap: {
    display: 'flex',
    flexDirection: 'column',
    height: '100%',
    overflow: 'auto',
    position: 'relative',
    width: '100%',
  },
  contentClose: {
    display: 'flex',
    flex: '1 1 0',
  },
  contentOpen: {
    paddingLeft: '250px',
    display: 'flex',
    flex: '1 1 0',
  },
};

const muiTheme = getMuiTheme({});

type Props = {
  width: number,
};

type State = {
  drawerOpen: boolean,
};

@Radium
class Webedit extends React.Component<Props, State> {
  state = {
    drawerOpen: !(/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)),
  };

  componentDidMount() {
    const encodedAnimation = this.props.location.query.s;

    if (encodedAnimation) {
      const decodedAnimation = JSON.parse(atob(encodedAnimation));
      this.props.addAnimation(decodedAnimation);
    }
  }

  toggleDrawer = () => {
    this.setState({
      drawerOpen: !this.state.drawerOpen,
    });
  };

  render() {
    const { activeView, currentAnimationId } = this.props<commit_msg>minor cleanup of share-by-url feature<commit_after>/* @flow */
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { t } from 'i18next';
import Radium from 'radium';
import UUID from 'uuid-js';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import withWidth from 'material-ui/utils/withWidth';
import { AppBar, Drawer } from 'material-ui';

import Menu from './Menu';
import RightMenu from './RightMenu';
import { addAnimation } from '../Actions/animations';

const style = {
  appRight: {
    marginTop: 0,
    display: 'flex',
  },
  wrap: {
    display: 'flex',
    flexDirection: 'column',
    height: '100%',
    overflow: 'auto',
    position: 'relative',
    width: '100%',
  },
  contentClose: {
    display: 'flex',
    flex: '1 1 0',
  },
  contentOpen: {
    paddingLeft: '250px',
    display: 'flex',
    flex: '1 1 0',
  },
};

const muiTheme = getMuiTheme({});

type Props = {
  width: number,
};

type State = {
  drawerOpen: boolean,
};

@Radium
class Webedit extends React.Component<Props, State> {
  state = {
    drawerOpen: !(/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)),
  };

  componentDidMount() {
    const encodedAnimation = this.props.location.query.s;

    if (encodedAnimation) {
      const decodedAnimation = JSON.parse(atob(encodedAnimation));
      decodedAnimation.id = UUID.create().toString();
      this.props.addAnimation(decodedAnimation);
      this.props.router.push(`/${decodedAnimation.id}`);
    }
  }

  toggleDrawer = () => {
    this.setState({
      drawerOpen: !this.state.drawerOpen,
    });
  };

  render() {
    const { activeView, currentAnimationId } = this.props
{'fraction_non_alphanumeric': 0.15063253898205353, 'fraction_numerical': 0.01059135039717564, 'mean_word_length': 3.582210242587601, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2935497', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1117, 'n_words': 264}