<commit_before>/*eslint-disable*/
import Navigation from './../Navigation';
import Controllers, {Modal, Notification} from './controllers';
const React = Controllers.hijackReact();
const {
  ControllerRegistry,
  TabBarControllerIOS,
  NavigationControllerIOS,
  DrawerControllerIOS
} = React;
import _ from 'lodash';

import PropRegistry from '../PropRegistry';

function startTabBasedApp(params) {
  if (!params.tabs) {
    console.error('startTabBasedApp(params): params.tabs is required');
    return;
  }

  let tabs = [...params.tabs];

  const controllerID = _.uniqueId('controllerID');
  const drawerID = controllerID + '_drawer';
  const drawerIDLeft = drawerID + '_left';
  const drawerIDRight = drawerID + '_right';

  tabs.map(function(tab, index) {
    const navigatorID = controllerID + '_nav' + index;
    const screenInstanceID = _.uniqueId('screenInstanceID');
    if (!tab.screen) {
      console.error('startTabBasedApp(params): every tab must include a screen property, take a look at tab#' + (index + 1));
      return;
    }
    const {
      navigatorStyle,
      navigatorButtons,
      navigatorOptions,
      navigatorEventID
    } = _mergeScreenSpecificSettings(tab.screen, screenInstanceID, tab);
    tab.navigationParams = {
      screenInstanceID,
      navigatorStyle,
      navigatorButtons,
      navigatorEventID,
      navigatorID
    };

    _injectOptionsInParams(tab, navigatorOptions);
  });

  if (params.screen) {
    let screen = params.screen;
    screen.noTab = true;
    const navigatorID = controllerID + '_nav' + tabs.count;
    const screenInstanceID = _.uniqueId('screenInstanceID');
    const {
      navigatorStyle,
      navigatorButtons,
      navigatorOptions,
      navigatorEventID,
    } = _mergeScreenSpecificSettings(screen.screen, screenInstanceID, screen);
    screen.navigationParams = {
      screenInstanceID,
      navigatorStyle,
      navigatorButtons,
      navigatorEventID,
      navigatorID,
    };
    _injectOptionsInParams(screen, navigatorOptions);

    tabs.push(screen);
  }

  const tabsNavigatorID = controllerID + '_tabs';

  const Controller = Controllers.createClass({
    render: function() {
      if (!params.drawer || (!params.drawer.left && !params.drawer.right)) {
        return this.renderBody();
      } else {
        return (
          <DrawerControllerIOS id={drawerID}
                               componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
                               passPropsLeft={{navigatorID: drawerIDLeft}}
                               componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
                               passPropsRight={{navigatorID: drawerIDRight}}<commit_msg>Set menu width for tab based apps ios<commit_after>/*eslint-disable*/
import Navigation from './../Navigation';
import Controllers, {Modal, Notification} from './controllers';
const React = Controllers.hijackReact();
const {
  ControllerRegistry,
  TabBarControllerIOS,
  NavigationControllerIOS,
  DrawerControllerIOS
} = React;
import _ from 'lodash';

import PropRegistry from '../PropRegistry';

function startTabBasedApp(params) {
  if (!params.tabs) {
    console.error('startTabBasedApp(params): params.tabs is required');
    return;
  }

  let tabs = [...params.tabs];

  const controllerID = _.uniqueId('controllerID');
  const drawerID = controllerID + '_drawer';
  const drawerIDLeft = drawerID + '_left';
  const drawerIDRight = drawerID + '_right';

  tabs.map(function(tab, index) {
    const navigatorID = controllerID + '_nav' + index;
    const screenInstanceID = _.uniqueId('screenInstanceID');
    if (!tab.screen) {
      console.error('startTabBasedApp(params): every tab must include a screen property, take a look at tab#' + (index + 1));
      return;
    }
    const {
      navigatorStyle,
      navigatorButtons,
      navigatorOptions,
      navigatorEventID
    } = _mergeScreenSpecificSettings(tab.screen, screenInstanceID, tab);
    tab.navigationParams = {
      screenInstanceID,
      navigatorStyle,
      navigatorButtons,
      navigatorEventID,
      navigatorID
    };

    _injectOptionsInParams(tab, navigatorOptions);
  });

  if (params.screen) {
    let screen = params.screen;
    screen.noTab = true;
    const navigatorID = controllerID + '_nav' + tabs.count;
    const screenInstanceID = _.uniqueId('screenInstanceID');
    const {
      navigatorStyle,
      navigatorButtons,
      navigatorOptions,
      navigatorEventID,
    } = _mergeScreenSpecificSettings(screen.screen, screenInstanceID, screen);
    screen.navigationParams = {
      screenInstanceID,
      navigatorStyle,
      navigatorButtons,
      navigatorEventID,
      navigatorID,
    };
    _injectOptionsInParams(screen, navigatorOptions);

    tabs.push(screen);
  }

  if (!params.drawer.style) {
    params.drawer.style = {};
  }
  if (params.drawer.left) {
    params.drawer.style.leftDrawerWidth = params.drawer.left.drawerWidth;
  }
  if (params.drawer.right) {
    params.drawer.style.rightDrawerWidth = params.drawer.right.drawerWidth;
  }

  const tabsNavigatorID = controllerID + '_tabs';

  const Controller = Controllers.createClass({
    render: function() {
      if (!params.drawer || (!params.drawer.left && !params.drawer.right)) {
        return this.renderBody();
      } else {
        return (
          <DrawerControllerIOS id={drawerID}
                               componentLeft={params.drawer.left ? params.drawer.left.screen : undefined}
                               passPropsLeft={{navigatorID: drawerIDLeft}}
                               componentRight={params.drawer.right ? params.drawer.right.screen : undefined}
                               passPropsRight={{navigatorID: drawerIDRight}}
{'fraction_non_alphanumeric': 0.10867311679336558, 'fraction_numerical': 0.0003455425017277125, 'mean_word_length': 3.0090027700831024, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2395427', 'n_tokens_mistral': 1661, 'n_tokens_neox': 1639, 'n_words': 335}