Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

cyclotronDirectives.directive 'tableRule', ->
    {
        restrict: 'CA'
        link: (scope, element, attrs) ->
            $element = $(element)
            rules = scope.row.__matchingRules

            # Apply matching CSS styles
            _.each rules, (rule) ->
                # Apply all properties (keys) of each rule in turn.
                _.each _.keys(rule), (key) ->
                    return if key == 'columns' or key == 'rule' or key == 'text'

                    value = rule[key]

                    if _.isNullOrUndefined(rule.columnsAffected)
                        # Set entire row
                        $element.css(key, _.compile(value, scope.row))
                    else if not _.isNullOrUndefined scope.column
                        if scope.column.name in rule.columnsAffected
                            # Replace #value, then compile
                            value = _.valSub(value, scope.row[scope.column.name])
                            value = _.compile(value, scope.row)

                            # Set single columns
                            $element.css(key, value)
    }
```

Response:
/*
 * Copyright (c) 2013-2018 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
var indexOf = [].indexOf;

cyclotronDirectives.directive('tableRule', function() {
  return {
    restrict: 'CA',
    link: function(scope, element, attrs) {
      var $element, rules;
      $element = $(element);
      rules = scope.row.__matchingRules;
      // Apply matching CSS styles
      return _.each(rules, function(rule) {
        // Apply all properties (keys) of each rule in turn.
        return _.each(_.keys(rule), function(key) {
          var ref, value;
          if (key === 'columns' || key === 'rule' || key === 'text') {
            return;
          }
          value = rule[key];
          if (_.isNullOrUndefined(rule.columnsAffected)) {
            // Set entire row
            return $element.css(key, _.compile(value, scope.row));
          } else if (!_.isNullOrUndefined(scope.column)) {
            if (ref = scope.column.name, indexOf.call(rule.columnsAffected, ref) >= 0) {
              // Replace #value, then compile
              value = _.valSub(value, scope.row[scope.column.name]);
              value = _.compile(value, scope.row);
              // Set single columns
              return $element.css(key, value);
            }
          }
        });
      });
    }
  };
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Copyright (c) 2013-2018 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */
var indexOf = [].indexOf;

cyclotronDirectives.directive('tableRule', function() {
  return {
    restrict: 'CA',
    link: function(scope, element, attrs) {
      var $element, rules;
      $element = $(element);
      rules = scope.row.__matchingRules;
      // Apply matching CSS styles
      return _.each(rules, function(rule) {
        // Apply all properties (keys) of each rule in turn.
        return _.each(_.keys(rule), function(key) {
          var ref, value;
          if (key === 'columns' || key === 'rule' || key === 'text') {
            return;
          }
          value = rule[key];
          if (_.isNullOrUndefined(rule.columnsAffected)) {
            // Set entire row
            return $element.css(key, _.compile(value, scope.row));
          } else if (!_.isNullOrUndefined(scope.column)) {
            if (ref = scope.column.name, indexOf.call(rule.columnsAffected, ref) >= 0) {
              // Replace #value, then compile
              value = _.valSub(value, scope.row[scope.column.name]);
              value = _.compile(value, scope.row);
              // Set single columns
              return $element.css(key, value);
            }
          }
        });
      });
    }
  };
});
```

Response:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

cyclotronDirectives.directive 'tableRule', ->
    {
        restrict: 'CA'
        link: (scope, element, attrs) ->
            $element = $(element)
            rules = scope.row.__matchingRules

            # Apply matching CSS styles
            _.each rules, (rule) ->
                # Apply all properties (keys) of each rule in turn.
                _.each _.keys(rule), (key) ->
                    return if key == 'columns' or key == 'rule' or key == 'text'

                    value = rule[key]

                    if _.isNullOrUndefined(rule.columnsAffected)
                        # Set entire row
                        $element.css(key, _.compile(value, scope.row))
                    else if not _.isNullOrUndefined scope.column
                        if scope.column.name in rule.columnsAffected
                            # Replace #value, then compile
                            value = _.valSub(value, scope.row[scope.column.name])
                            value = _.compile(value, scope.row)

                            # Set single columns
                            $element.css(key, value)
    }


Prompt:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

cyclotronDirectives.directive 'tableRule', ->
    {
        restrict: 'CA'
        link: (scope, element, attrs) ->
            $element = $(element)

Response:
rules = scope.row.__matchingRules

            # Apply matching CSS styles
            _.each rules, (rule) ->
                # Apply all properties (keys) of each rule in turn.
                _.each _.keys(rule), (key) ->
                    return if key == 'columns' or key == 'rule' or key == 'text'

                    value = rule[key]

                    if _.isNullOrUndefined(rule.columnsAffected)
                        # Set entire row
                        $element.css(key, _.compile(value, scope.row))
                    else if not _.isNullOrUndefined scope.column
                        if scope.column.name in rule.columnsAffected
                            # Replace #value, then compile
                            value = _.valSub(value, scope.row[scope.column.name])
                            value = _.compile(value, scope.row)

                            # Set single columns
                            $element.css(key, value)
    }


Response:
xdescribe 'Actions: user', ->

  beforeEach ->
    @action = require 'actions/user'
    @api = require 'network/api'

  describe 'Method: userSignout', ->
    it 'should call api', ->
      spyOn(@api.users.signout, 'post').and.callThrough()
      @action.userSignout()
      expect(@api.users.signout.post).toHaveBeenCalled()

  describe 'Method: userMe', ->
    it 'should call api', ->
      spyOn(@api.users.me, 'get').and.callThrough()
      @action.userMe()
      expect(@api.users.me.get).toHaveBeenCalled()

  describe 'Method: userUpdate', ->
    it 'should call api', ->
      spyOn(@api.users.update, 'put').and.callThrough()

      userId = 1
      data = {}
      config =
        pathParams:
          id: userId
        data: data

      @action.userUpdate(userId, data)
      expect(@api.users.update.put).toHaveBeenCalledWith config

  describe 'Method: state', ->
    it 'should call api', ->
      spyOn(@api.state, 'get').and.callThrough()

      teamId = 1
      config =
        queryParams:
          _teamId: teamId
          scope: 'version,checkfornewnotice,unread'

      @action.state(teamId)
      expect(@api.state.get).toHaveBeenCalledWith config

  describe 'Method: recommandFriends', ->
    it 'should call api', ->
      spyOn(@api.recommends.friends, 'get').and.callThrough()
      @action.recommandFriends()
      expect(@api.recommends.friends.get).toHaveBeenCalled()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
xdescribe 'Actions: user', ->

  beforeEach ->
    @action = require 'actions/user'
    @api = require 'network/api'

  describe 'Method: userSignout', ->
    it 'should call api', ->
      spyOn(@api.users.signout, 'post').and.callThrough()
      @action.userSignout()
      expect(@api.users.signout.post).toHaveBeenCalled()

  describe 'Method: userMe', ->
    it 'should call api', ->
      spyOn(@api.users.me, 'get').and.callThrough()
      @action.userMe()
      expect(@api.users.me.get).toHaveBeenCalled()

  describe 'Method: userUpdate', ->
    it 'should call api', ->
      spyOn(@api.users.update, 'put').and.callThrough()

      userId = 1
      data = {}
      config =
        pathParams:
          id: userId
        data: data

      @action.userUpdate(userId, data)
      expect(@api.users.update.put).toHaveBeenCalledWith config

  describe 'Method: state', ->
    it 'should call api', ->
      spyOn(@api.state, 'get').and.callThrough()

      teamId = 1
      config =
        queryParams:
          _teamId: teamId
          scope: 'version,checkfornewnotice,unread'

      @action.state(teamId)
      expect(@api.state.get).toHaveBeenCalledWith config

  describe 'Method: recommandFriends', ->
    it 'should call api', ->
      spyOn(@api.recommends.friends, 'get').and.callThrough()
      @action.recommandFriends()
      expect(@api.recommends.friends.get).toHaveBeenCalled()
```

Response:
xdescribe('Actions: user', function() {
  beforeEach(function() {
    this.action = require('actions/user');
    return this.api = require('network/api');
  });
  describe('Method: userSignout', function() {
    return it('should call api', function() {
      spyOn(this.api.users.signout, 'post').and.callThrough();
      this.action.userSignout();
      return expect(this.api.users.signout.post).toHaveBeenCalled();
    });
  });
  describe('Method: userMe', function() {
    return it('should call api', function() {
      spyOn(this.api.users.me, 'get').and.callThrough();
      this.action.userMe();
      return expect(this.api.users.me.get).toHaveBeenCalled();
    });
  });
  describe('Method: userUpdate', function() {
    return it('should call api', function() {
      var config, data, userId;
      spyOn(this.api.users.update, 'put').and.callThrough();
      userId = 1;
      data = {};
      config = {
        pathParams: {
          id: userId
        },
        data: data
      };
      this.action.userUpdate(userId, data);
      return expect(this.api.users.update.put).toHaveBeenCalledWith(config);
    });
  });
  describe('Method: state', function() {
    return it('should call api', function() {
      var config, teamId;
      spyOn(this.api.state, 'get').and.callThrough();
      teamId = 1;
      config = {
        queryParams: {
          _teamId: teamId,
          scope: 'version,checkfornewnotice,unread'
        }
      };
      this.action.state(teamId);
      return expect(this.api.state.get).toHaveBeenCalledWith(config);
    });
  });
  return describe('Method: recommandFriends', function() {
    return it('should call api', function() {
      spyOn(this.api.recommends.friends, 'get').and.callThrough();
      this.action.recommandFriends();
      return expect(this.api.recommends.friends.get).toHaveBeenCalled();
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
xdescribe('Actions: user', function() {
  beforeEach(function() {
    this.action = require('actions/user');
    return this.api = require('network/api');
  });
  describe('Method: userSignout', function() {
    return it('should call api', function() {
      spyOn(this.api.users.signout, 'post').and.callThrough();
      this.action.userSignout();
      return expect(this.api.users.signout.post).toHaveBeenCalled();
    });
  });
  describe('Method: userMe', function() {
    return it('should call api', function() {
      spyOn(this.api.users.me, 'get').and.callThrough();
      this.action.userMe();
      return expect(this.api.users.me.get).toHaveBeenCalled();
    });
  });
  describe('Method: userUpdate', function() {
    return it('should call api', function() {
      var config, data, userId;
      spyOn(this.api.users.update, 'put').and.callThrough();
      userId = 1;
      data = {};
      config = {
        pathParams: {
          id: userId
        },
        data: data
      };
      this.action.userUpdate(userId, data);
      return expect(this.api.users.update.put).toHaveBeenCalledWith(config);
    });
  });
  describe('Method: state', function() {
    return it('should call api', function() {
      var config, teamId;
      spyOn(this.api.state, 'get').and.callThrough();
      teamId = 1;
      config = {
        queryParams: {
          _teamId: teamId,
          scope: 'version,checkfornewnotice,unread'
        }
      };
      this.action.state(teamId);
      return expect(this.api.state.get).toHaveBeenCalledWith(config);
    });
  });
  return describe('Method: recommandFriends', function() {
    return it('should call api', function() {
      spyOn(this.api.recommends.friends, 'get').and.callThrough();
      this.action.recommandFriends();
      return expect(this.api.recommends.friends.get).toHaveBeenCalled();
    });
  });
});
```

Response:
xdescribe 'Actions: user', ->

  beforeEach ->
    @action = require 'actions/user'
    @api = require 'network/api'

  describe 'Method: userSignout', ->
    it 'should call api', ->
      spyOn(@api.users.signout, 'post').and.callThrough()
      @action.userSignout()
      expect(@api.users.signout.post).toHaveBeenCalled()

  describe 'Method: userMe', ->
    it 'should call api', ->
      spyOn(@api.users.me, 'get').and.callThrough()
      @action.userMe()
      expect(@api.users.me.get).toHaveBeenCalled()

  describe 'Method: userUpdate', ->
    it 'should call api', ->
      spyOn(@api.users.update, 'put').and.callThrough()

      userId = 1
      data = {}
      config =
        pathParams:
          id: userId
        data: data

      @action.userUpdate(userId, data)
      expect(@api.users.update.put).toHaveBeenCalledWith config

  describe 'Method: state', ->
    it 'should call api', ->
      spyOn(@api.state, 'get').and.callThrough()

      teamId = 1
      config =
        queryParams:
          _teamId: teamId
          scope: 'version,checkfornewnotice,unread'

      @action.state(teamId)
      expect(@api.state.get).toHaveBeenCalledWith config

  describe 'Method: recommandFriends', ->
    it 'should call api', ->
      spyOn(@api.recommends.friends, 'get').and.callThrough()
      @action.recommandFriends()
      expect(@api.recommends.friends.get).toHaveBeenCalled()


Prompt:
xdescribe 'Actions: user', ->

  beforeEach ->
    @action = require 'actions/user'
    @api = require 'network/api'

  describe 'Method: userSignout', ->
    it 'should call api', ->
      spyOn(@api.users.signout, 'post').and.callThrough()
      @action.userSignout()
      expect(@api.users.signout.post).toHaveBeenCalled()

  describe 'Method: userMe', ->
    it 'should call api', ->
      spyOn(@api.users.me, 'get').and.callThrough()
      @action.userMe()
      expect(@api.users.me.get).toHaveBeenCalled()

  describe 'Method: userUpdate', ->
    it 'should call api', ->
      spyOn(@api.users.update, 'put').and.callThrough()

      userId = 1
      data = {}
      config =

Response:
pathParams:
          id: userId
        data: data

      @action.userUpdate(userId, data)
      expect(@api.users.update.put).toHaveBeenCalledWith config

  describe 'Method: state', ->
    it 'should call api', ->
      spyOn(@api.state, 'get').and.callThrough()

      teamId = 1
      config =
        queryParams:
          _teamId: teamId
          scope: 'version,checkfornewnotice,unread'

      @action.state(teamId)
      expect(@api.state.get).toHaveBeenCalledWith config

  describe 'Method: recommandFriends', ->
    it 'should call api', ->
      spyOn(@api.recommends.friends, 'get').and.callThrough()
      @action.recommandFriends()
      expect(@api.recommends.friends.get).toHaveBeenCalled()


Response:
React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'

draftActions = require '../actions/draft'

FormFile = React.createFactory require './form-file'
FormLink = React.createFactory require './form-link'
FormTopic = React.createFactory require './form-topic'
PanelChat = React.createFactory require './panel-chat'
PanelRoom = React.createFactory require './panel-room'
MembersRow = React.createFactory require '../app/members-row'

{ div, noscript } = React.DOM
T = React.PropTypes

STORY_TYPES = [ 'file', 'link', 'topic' ]

module.exports = React.createClass
  displayName: 'launch-tabpage'

  propTypes:
    _teamId: T.string.isRequired
    _userId: T.string.isRequired
    data: T.instanceOf Immutable.Map
    tabKey: T.string.isRequired
    onChange: T.func
    onClose: T.func
    formDatum: T.instanceOf Immutable.Map
    rooms: T.instanceOf Immutable.List
    contacts: T.instanceOf Immutable.List
    invitations: T.instanceOf Immutable.List
    leftContacts: T.instanceOf Immutable.List
    archivedRooms: T.instanceOf Immutable.List

  onChange: (key, value) ->
    draftActions.updateStoryDraft @props._teamId, @props.tabKey, { key, value }

  render: ->

    formProps = =>
      data: @props.data.get 'data'
      onChange: (data) => @onChange 'data', data
      displayMode: 'create'

    div className: 'launch-tabpage',
      switch @props.tabKey
        when 'file' then FormFile formProps()
        when 'link' then FormLink formProps()
        when 'topic' then FormTopic formProps()


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'

draftActions = require '../actions/draft'

FormFile = React.createFactory require './form-file'
FormLink = React.createFactory require './form-link'
FormTopic = React.createFactory require './form-topic'
PanelChat = React.createFactory require './panel-chat'
PanelRoom = React.createFactory require './panel-room'
MembersRow = React.createFactory require '../app/members-row'

{ div, noscript } = React.DOM
T = React.PropTypes

STORY_TYPES = [ 'file', 'link', 'topic' ]

module.exports = React.createClass
  displayName: 'launch-tabpage'

  propTypes:
    _teamId: T.string.isRequired
    _userId: T.string.isRequired
    data: T.instanceOf Immutable.Map
    tabKey: T.string.isRequired
    onChange: T.func
    onClose: T.func
    formDatum: T.instanceOf Immutable.Map
    rooms: T.instanceOf Immutable.List
    contacts: T.instanceOf Immutable.List
    invitations: T.instanceOf Immutable.List
    leftContacts: T.instanceOf Immutable.List
    archivedRooms: T.instanceOf Immutable.List

  onChange: (key, value) ->
    draftActions.updateStoryDraft @props._teamId, @props.tabKey, { key, value }

  render: ->

    formProps = =>
      data: @props.data.get 'data'
      onChange: (data) => @onChange 'data', data
      displayMode: 'create'

    div className: 'launch-tabpage',
      switch @props.tabKey
        when 'file' then FormFile formProps()
        when 'link' then FormLink formProps()
        when 'topic' then FormTopic formProps()
```

Response:
var FormFile, FormLink, FormTopic, Immutable, MembersRow, PanelChat, PanelRoom, React, STORY_TYPES, T, assign, div, draftActions, noscript;

React = require('react');

assign = require('object-assign');

Immutable = require('immutable');

draftActions = require('../actions/draft');

FormFile = React.createFactory(require('./form-file'));

FormLink = React.createFactory(require('./form-link'));

FormTopic = React.createFactory(require('./form-topic'));

PanelChat = React.createFactory(require('./panel-chat'));

PanelRoom = React.createFactory(require('./panel-room'));

MembersRow = React.createFactory(require('../app/members-row'));

({div, noscript} = React.DOM);

T = React.PropTypes;

STORY_TYPES = ['file', 'link', 'topic'];

module.exports = React.createClass({
  displayName: 'launch-tabpage',
  propTypes: {
    _teamId: T.string.isRequired,
    _userId: T.string.isRequired,
    data: T.instanceOf(Immutable.Map),
    tabKey: T.string.isRequired,
    onChange: T.func,
    onClose: T.func,
    formDatum: T.instanceOf(Immutable.Map),
    rooms: T.instanceOf(Immutable.List),
    contacts: T.instanceOf(Immutable.List),
    invitations: T.instanceOf(Immutable.List),
    leftContacts: T.instanceOf(Immutable.List),
    archivedRooms: T.instanceOf(Immutable.List)
  },
  onChange: function(key, value) {
    return draftActions.updateStoryDraft(this.props._teamId, this.props.tabKey, {key, value});
  },
  render: function() {
    var formProps;
    formProps = () => {
      return {
        data: this.props.data.get('data'),
        onChange: (data) => {
          return this.onChange('data', data);
        },
        displayMode: 'create'
      };
    };
    return div({
      className: 'launch-tabpage'
    }, (function() {
      switch (this.props.tabKey) {
        case 'file':
          return FormFile(formProps());
        case 'link':
          return FormLink(formProps());
        case 'topic':
          return FormTopic(formProps());
      }
    }).call(this));
  }
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var FormFile, FormLink, FormTopic, Immutable, MembersRow, PanelChat, PanelRoom, React, STORY_TYPES, T, assign, div, draftActions, noscript;

React = require('react');

assign = require('object-assign');

Immutable = require('immutable');

draftActions = require('../actions/draft');

FormFile = React.createFactory(require('./form-file'));

FormLink = React.createFactory(require('./form-link'));

FormTopic = React.createFactory(require('./form-topic'));

PanelChat = React.createFactory(require('./panel-chat'));

PanelRoom = React.createFactory(require('./panel-room'));

MembersRow = React.createFactory(require('../app/members-row'));

({div, noscript} = React.DOM);

T = React.PropTypes;

STORY_TYPES = ['file', 'link', 'topic'];

module.exports = React.createClass({
  displayName: 'launch-tabpage',
  propTypes: {
    _teamId: T.string.isRequired,
    _userId: T.string.isRequired,
    data: T.instanceOf(Immutable.Map),
    tabKey: T.string.isRequired,
    onChange: T.func,
    onClose: T.func,
    formDatum: T.instanceOf(Immutable.Map),
    rooms: T.instanceOf(Immutable.List),
    contacts: T.instanceOf(Immutable.List),
    invitations: T.instanceOf(Immutable.List),
    leftContacts: T.instanceOf(Immutable.List),
    archivedRooms: T.instanceOf(Immutable.List)
  },
  onChange: function(key, value) {
    return draftActions.updateStoryDraft(this.props._teamId, this.props.tabKey, {key, value});
  },
  render: function() {
    var formProps;
    formProps = () => {
      return {
        data: this.props.data.get('data'),
        onChange: (data) => {
          return this.onChange('data', data);
        },
        displayMode: 'create'
      };
    };
    return div({
      className: 'launch-tabpage'
    }, (function() {
      switch (this.props.tabKey) {
        case 'file':
          return FormFile(formProps());
        case 'link':
          return FormLink(formProps());
        case 'topic':
          return FormTopic(formProps());
      }
    }).call(this));
  }
});
```

Response:
React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'

draftActions = require '../actions/draft'

FormFile = React.createFactory require './form-file'
FormLink = React.createFactory require './form-link'
FormTopic = React.createFactory require './form-topic'
PanelChat = React.createFactory require './panel-chat'
PanelRoom = React.createFactory require './panel-room'
MembersRow = React.createFactory require '../app/members-row'

{ div, noscript } = React.DOM
T = React.PropTypes

STORY_TYPES = [ 'file', 'link', 'topic' ]

module.exports = React.createClass
  displayName: 'launch-tabpage'

  propTypes:
    _teamId: T.string.isRequired
    _userId: T.string.isRequired
    data: T.instanceOf Immutable.Map
    tabKey: T.string.isRequired
    onChange: T.func
    onClose: T.func
    formDatum: T.instanceOf Immutable.Map
    rooms: T.instanceOf Immutable.List
    contacts: T.instanceOf Immutable.List
    invitations: T.instanceOf Immutable.List
    leftContacts: T.instanceOf Immutable.List
    archivedRooms: T.instanceOf Immutable.List

  onChange: (key, value) ->
    draftActions.updateStoryDraft @props._teamId, @props.tabKey, { key, value }

  render: ->

    formProps = =>
      data: @props.data.get 'data'
      onChange: (data) => @onChange 'data', data
      displayMode: 'create'

    div className: 'launch-tabpage',
      switch @props.tabKey
        when 'file' then FormFile formProps()
        when 'link' then FormLink formProps()
        when 'topic' then FormTopic formProps()


Prompt:
React = require 'react'
assign = require 'object-assign'
Immutable = require 'immutable'

draftActions = require '../actions/draft'

FormFile = React.createFactory require './form-file'
FormLink = React.createFactory require './form-link'
FormTopic = React.createFactory require './form-topic'
PanelChat = React.createFactory require './panel-chat'
PanelRoom = React.createFactory require './panel-room'
MembersRow = React.createFactory require '../app/members-row'

{ div, noscript } = React.DOM
T = React.PropTypes

STORY_TYPES = [ 'file', 'link', 'topic' ]

module.exports = React.createClass
  displayName: 'launch-tabpage'

  propTypes:
    _teamId: T.string.isRequired
    _userId: T.string.isRequired
    data: T.instanceOf Immutable.Map

Response:
tabKey: T.string.isRequired
    onChange: T.func
    onClose: T.func
    formDatum: T.instanceOf Immutable.Map
    rooms: T.instanceOf Immutable.List
    contacts: T.instanceOf Immutable.List
    invitations: T.instanceOf Immutable.List
    leftContacts: T.instanceOf Immutable.List
    archivedRooms: T.instanceOf Immutable.List

  onChange: (key, value) ->
    draftActions.updateStoryDraft @props._teamId, @props.tabKey, { key, value }

  render: ->

    formProps = =>
      data: @props.data.get 'data'
      onChange: (data) => @onChange 'data', data
      displayMode: 'create'

    div className: 'launch-tabpage',
      switch @props.tabKey
        when 'file' then FormFile formProps()
        when 'link' then FormLink formProps()
        when 'topic' then FormTopic formProps()


Response:
when 'chat'
          PanelChat
            _teamId: @props._teamId
            contacts: @props.contacts
            leftContacts: @props.leftContacts
        when 'room'
          PanelRoom
            _teamId: @props._teamId
            rooms: @props.rooms
            onClose: @props.onClose
            archivedRooms: @props.archivedRooms

      if @props.tabKey in STORY_TYPES
        MembersRow
          _teamId: @props._teamId
          _memberIds: @props.data.get('_memberIds') or Immutable.List [ @props._userId ]
          contacts: @props.contacts
          onChange: (data) => @onChange '_memberIds', data
          isEditable: true
      else noscript()


Prompt:
when 'chat'
          PanelChat
            _teamId: @props._teamId
            contacts: @props.contacts
            leftContacts: @props.leftContacts
        when 'room'
          PanelRoom
            _teamId: @props._teamId
            rooms: @props.rooms
            onClose: @props.onClose

Response:
archivedRooms: @props.archivedRooms

      if @props.tabKey in STORY_TYPES
        MembersRow
          _teamId: @props._teamId
          _memberIds: @props.data.get('_memberIds') or Immutable.List [ @props._userId ]
          contacts: @props.contacts
          onChange: (data) => @onChange '_memberIds', data
          isEditable: true
      else noscript()


Response:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }
```

Response:
/*
 * Copyright (c) 2013-2018 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Mock Data Source
// Injected by the DataService as needed
// Supports one property, 'format', that determines whether the mock data
// should be object-based or row-based.

cyclotronDataSources.factory('mockDataSource', function($q, dataSourceFactory, logService) {
  var getDucatiFunction;
  // Ducati initializations
  return getDucatiFunction = function() {
    var gb, grossBookings, rn, roomNights, startTime;
    gb = 2500;
    rn = 70;
    grossBookings = function() {
      return Math.floor(gb + (Math.random() * 5000 - 2500));
    };
    roomNights = function() {
      return Math.floor(rn + (Math.random() * 170 - 70));
    };
    startTime = moment().startOf('minute');
    return function(num) {
      return {
        id: num,
        _time: moment(startTime).add(num, 'minutes').unix(),
        grossbookingvalue: grossBookings(),
        roomnightcount: roomNights()
      };
    };
  };
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Copyright (c) 2013-2018 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Mock Data Source
// Injected by the DataService as needed
// Supports one property, 'format', that determines whether the mock data
// should be object-based or row-based.

cyclotronDataSources.factory('mockDataSource', function($q, dataSourceFactory, logService) {
  var getDucatiFunction;
  // Ducati initializations
  return getDucatiFunction = function() {
    var gb, grossBookings, rn, roomNights, startTime;
    gb = 2500;
    rn = 70;
    grossBookings = function() {
      return Math.floor(gb + (Math.random() * 5000 - 2500));
    };
    roomNights = function() {
      return Math.floor(rn + (Math.random() * 170 - 70));
    };
    startTime = moment().startOf('minute');
    return function(num) {
      return {
        id: num,
        _time: moment(startTime).add(num, 'minutes').unix(),
        grossbookingvalue: grossBookings(),
        roomnightcount: roomNights()
      };
    };
  };
});
```

Response:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }


Prompt:
###
# Copyright (c) 2013-2018 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed

Response:
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }


Response:
runner = (options, state) ->
        q = $q.defer()

        if !options.format? || options.format == 'object'
            state.cache = [
                {color: "red", number: 1, state: "WA", status: "green"}
                {state: "CA", color: "green", number: 41, status: "green"}
                {state: "CA", color: "red", number: 2, status: "green"}
                {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                {color: "blue", number: 23, state: "CO", status: "yellow"}
                {color: "black", number: 45, state: "WA", status: "red"}
                {color: "green", number: 32, state: "WA", status: "yellow"}
                {color: "green", number: 99, state: "WA", status: "yellow"}
                {color: "black", number: 1, state: "WA", status: "red"}
                {color: "black", number: 45, state: "CA", status: "red"}
                {color: "white", number: 24, state: "AK", status: "red"}
                {color: "white", number: 16, state: "AK", status: "yellow"}
            ]

        else if options.format == 'pie'
            state.cache = [
                {browser: "Firefox", percent: 45, isSliced: true},
                {browser: "IE", percent: 26.8, isSliced: false},
                {browser: "Chrome", percent: 12.8, isSliced: false},
                {browser: "Safari", percent: 8.5, isSliced: false},
                {browser: "Opera", percent: 6.2, isSliced: false},
                {browser: "Other", percent: 0.7, isSliced: false}
            ]

        else if options.format == 'ducati'
            if state.cache?
                state.cache.push state.ducati(_.last(state.cache).id + 1)
                state.cache = _.tail(state.cache)
            else
                state.ducati = getDucatiFunction()
                state.cache = (state.ducati(num) for num in [0..10])

        q.resolve
            '0':
                data: state.cache
                columns: null


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
runner = (options, state) ->
        q = $q.defer()

        if !options.format? || options.format == 'object'
            state.cache = [
                {color: "red", number: 1, state: "WA", status: "green"}
                {state: "CA", color: "green", number: 41, status: "green"}
                {state: "CA", color: "red", number: 2, status: "green"}
                {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                {color: "blue", number: 23, state: "CO", status: "yellow"}
                {color: "black", number: 45, state: "WA", status: "red"}
                {color: "green", number: 32, state: "WA", status: "yellow"}
                {color: "green", number: 99, state: "WA", status: "yellow"}
                {color: "black", number: 1, state: "WA", status: "red"}
                {color: "black", number: 45, state: "CA", status: "red"}
                {color: "white", number: 24, state: "AK", status: "red"}
                {color: "white", number: 16, state: "AK", status: "yellow"}
            ]

        else if options.format == 'pie'
            state.cache = [
                {browser: "Firefox", percent: 45, isSliced: true},
                {browser: "IE", percent: 26.8, isSliced: false},
                {browser: "Chrome", percent: 12.8, isSliced: false},
                {browser: "Safari", percent: 8.5, isSliced: false},
                {browser: "Opera", percent: 6.2, isSliced: false},
                {browser: "Other", percent: 0.7, isSliced: false}
            ]

        else if options.format == 'ducati'
            if state.cache?
                state.cache.push state.ducati(_.last(state.cache).id + 1)
                state.cache = _.tail(state.cache)
            else
                state.ducati = getDucatiFunction()
                state.cache = (state.ducati(num) for num in [0..10])

        q.resolve
            '0':
                data: state.cache
                columns: null
```

Response:
var runner;

runner = function(options, state) {
  var num, q;
  q = $q.defer();
  if ((options.format == null) || options.format === 'object') {
    state.cache = [
      {
        color: "red",
        number: 1,
        state: "WA",
        status: "green"
      },
      {
        state: "CA",
        color: "green",
        number: 41,
        status: "green"
      },
      {
        state: "CA",
        color: "red",
        number: 2,
        status: "green"
      },
      {
        color: "red",
        number: 15,
        state: "WA",
        country: "USA",
        status: "green"
      },
      {
        color: "blue",
        number: 23,
        state: "CO",
        status: "yellow"
      },
      {
        color: "black",
        number: 45,
        state: "WA",
        status: "red"
      },
      {
        color: "green",
        number: 32,
        state: "WA",
        status: "yellow"
      },
      {
        color: "green",
        number: 99,
        state: "WA",
        status: "yellow"
      },
      {
        color: "black",
        number: 1,
        state: "WA",
        status: "red"
      },
      {
        color: "black",
        number: 45,
        state: "CA",
        status: "red"
      },
      {
        color: "white",
        number: 24,
        state: "AK",
        status: "red"
      },
      {
        color: "white",
        number: 16,
        state: "AK",
        status: "yellow"
      }
    ];
  } else if (options.format === 'pie') {
    state.cache = [
      {
        browser: "Firefox",
        percent: 45,
        isSliced: true
      },
      {
        browser: "IE",
        percent: 26.8,
        isSliced: false
      },
      {
        browser: "Chrome",
        percent: 12.8,
        isSliced: false
      },
      {
        browser: "Safari",
        percent: 8.5,
        isSliced: false
      },
      {
        browser: "Opera",
        percent: 6.2,
        isSliced: false
      },
      {
        browser: "Other",
        percent: 0.7,
        isSliced: false
      }
    ];
  } else if (options.format === 'ducati') {
    if (state.cache != null) {
      state.cache.push(state.ducati(_.last(state.cache).id + 1));
      state.cache = _.tail(state.cache);
    } else {
      state.ducati = getDucatiFunction();
      state.cache = (function() {
        var i, results;
        results = [];
        for (num = i = 0; i <= 10; num = ++i) {
          results.push(state.ducati(num));
        }
        return results;
      })();
    }
  }
  return q.resolve({
    '0': {
      data: state.cache,
      columns: null
    }
  });
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var runner;

runner = function(options, state) {
  var num, q;
  q = $q.defer();
  if ((options.format == null) || options.format === 'object') {
    state.cache = [
      {
        color: "red",
        number: 1,
        state: "WA",
        status: "green"
      },
      {
        state: "CA",
        color: "green",
        number: 41,
        status: "green"
      },
      {
        state: "CA",
        color: "red",
        number: 2,
        status: "green"
      },
      {
        color: "red",
        number: 15,
        state: "WA",
        country: "USA",
        status: "green"
      },
      {
        color: "blue",
        number: 23,
        state: "CO",
        status: "yellow"
      },
      {
        color: "black",
        number: 45,
        state: "WA",
        status: "red"
      },
      {
        color: "green",
        number: 32,
        state: "WA",
        status: "yellow"
      },
      {
        color: "green",
        number: 99,
        state: "WA",
        status: "yellow"
      },
      {
        color: "black",
        number: 1,
        state: "WA",
        status: "red"
      },
      {
        color: "black",
        number: 45,
        state: "CA",
        status: "red"
      },
      {
        color: "white",
        number: 24,
        state: "AK",
        status: "red"
      },
      {
        color: "white",
        number: 16,
        state: "AK",
        status: "yellow"
      }
    ];
  } else if (options.format === 'pie') {
    state.cache = [
      {
        browser: "Firefox",
        percent: 45,
        isSliced: true
      },
      {
        browser: "IE",
        percent: 26.8,
        isSliced: false
      },
      {
        browser: "Chrome",
        percent: 12.8,
        isSliced: false
      },
      {
        browser: "Safari",
        percent: 8.5,
        isSliced: false
      },
      {
        browser: "Opera",
        percent: 6.2,
        isSliced: false
      },
      {
        browser: "Other",
        percent: 0.7,
        isSliced: false
      }
    ];
  } else if (options.format === 'ducati') {
    if (state.cache != null) {
      state.cache.push(state.ducati(_.last(state.cache).id + 1));
      state.cache = _.tail(state.cache);
    } else {
      state.ducati = getDucatiFunction();
      state.cache = (function() {
        var i, results;
        results = [];
        for (num = i = 0; i <= 10; num = ++i) {
          results.push(state.ducati(num));
        }
        return results;
      })();
    }
  }
  return q.resolve({
    '0': {
      data: state.cache,
      columns: null
    }
  });
};
```

Response:
runner = (options, state) ->
        q = $q.defer()

        if !options.format? || options.format == 'object'
            state.cache = [
                {color: "red", number: 1, state: "WA", status: "green"}
                {state: "CA", color: "green", number: 41, status: "green"}
                {state: "CA", color: "red", number: 2, status: "green"}
                {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                {color: "blue", number: 23, state: "CO", status: "yellow"}
                {color: "black", number: 45, state: "WA", status: "red"}
                {color: "green", number: 32, state: "WA", status: "yellow"}
                {color: "green", number: 99, state: "WA", status: "yellow"}
                {color: "black", number: 1, state: "WA", status: "red"}
                {color: "black", number: 45, state: "CA", status: "red"}
                {color: "white", number: 24, state: "AK", status: "red"}
                {color: "white", number: 16, state: "AK", status: "yellow"}
            ]

        else if options.format == 'pie'
            state.cache = [
                {browser: "Firefox", percent: 45, isSliced: true},
                {browser: "IE", percent: 26.8, isSliced: false},
                {browser: "Chrome", percent: 12.8, isSliced: false},
                {browser: "Safari", percent: 8.5, isSliced: false},
                {browser: "Opera", percent: 6.2, isSliced: false},
                {browser: "Other", percent: 0.7, isSliced: false}
            ]

        else if options.format == 'ducati'
            if state.cache?
                state.cache.push state.ducati(_.last(state.cache).id + 1)
                state.cache = _.tail(state.cache)
            else
                state.ducati = getDucatiFunction()
                state.cache = (state.ducati(num) for num in [0..10])

        q.resolve
            '0':
                data: state.cache
                columns: null


Prompt:
runner = (options, state) ->
        q = $q.defer()

        if !options.format? || options.format == 'object'
            state.cache = [
                {color: "red", number: 1, state: "WA", status: "green"}
                {state: "CA", color: "green", number: 41, status: "green"}
                {state: "CA", color: "red", number: 2, status: "green"}
                {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                {color: "blue", number: 23, state: "CO", status: "yellow"}
                {color: "black", number: 45, state: "WA", status: "red"}
                {color: "green", number: 32, state: "WA", status: "yellow"}
                {color: "green", number: 99, state: "WA", status: "yellow"}
                {color: "black", number: 1, state: "WA", status: "red"}
                {color: "black", number: 45, state: "CA", status: "red"}
                {color: "white", number: 24, state: "AK", status: "red"}
                {color: "white", number: 16, state: "AK", status: "yellow"}
            ]

        else if options.format == 'pie'

Response:
state.cache = [
                {browser: "Firefox", percent: 45, isSliced: true},
                {browser: "IE", percent: 26.8, isSliced: false},
                {browser: "Chrome", percent: 12.8, isSliced: false},
                {browser: "Safari", percent: 8.5, isSliced: false},
                {browser: "Opera", percent: 6.2, isSliced: false},
                {browser: "Other", percent: 0.7, isSliced: false}
            ]

        else if options.format == 'ducati'
            if state.cache?
                state.cache.push state.ducati(_.last(state.cache).id + 1)
                state.cache = _.tail(state.cache)
            else
                state.ducati = getDucatiFunction()
                state.cache = (state.ducati(num) for num in [0..10])

        q.resolve
            '0':
                data: state.cache
                columns: null


Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }
```

Response:
/*
 * Copyright (c) 2013-2015 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Mock Data Source
// Injected by the DataService as needed
// Supports one property, 'format', that determines whether the mock data
// should be object-based or row-based.

cyclotronDataSources.factory('mockDataSource', function($q, dataSourceFactory, logService) {
  var getDucatiFunction;
  // Ducati initializations
  return getDucatiFunction = function() {
    var gb, grossBookings, rn, roomNights, startTime;
    gb = 2500;
    rn = 70;
    grossBookings = function() {
      return Math.floor(gb + (Math.random() * 5000 - 2500));
    };
    roomNights = function() {
      return Math.floor(rn + (Math.random() * 170 - 70));
    };
    startTime = moment().startOf('minute');
    return function(num) {
      return {
        id: num,
        _time: moment(startTime).add(num, 'minutes').unix(),
        grossbookingvalue: grossBookings(),
        roomnightcount: roomNights()
      };
    };
  };
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
/*
 * Copyright (c) 2013-2015 the original author or authors.
 *
 * Licensed under the MIT License (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.opensource.org/licenses/mit-license.php
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the License.
 */

// Mock Data Source
// Injected by the DataService as needed
// Supports one property, 'format', that determines whether the mock data
// should be object-based or row-based.

cyclotronDataSources.factory('mockDataSource', function($q, dataSourceFactory, logService) {
  var getDucatiFunction;
  // Ducati initializations
  return getDucatiFunction = function() {
    var gb, grossBookings, rn, roomNights, startTime;
    gb = 2500;
    rn = 70;
    grossBookings = function() {
      return Math.floor(gb + (Math.random() * 5000 - 2500));
    };
    roomNights = function() {
      return Math.floor(rn + (Math.random() * 170 - 70));
    };
    startTime = moment().startOf('minute');
    return function(num) {
      return {
        id: num,
        _time: moment(startTime).add(num, 'minutes').unix(),
        grossbookingvalue: grossBookings(),
        roomnightcount: roomNights()
      };
    };
  };
});
```

Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }


Prompt:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed

Response:
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($q, dataSourceFactory, logService) ->

    # Ducati initializations
    getDucatiFunction = ->
        gb = 2500
        rn = 70
        grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
        roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
        startTime = moment().startOf('minute')

        return (num) ->
            return {
                id: num
                _time: moment(startTime).add(num, 'minutes').unix()
                grossbookingvalue: grossBookings()
                roomnightcount: roomNights()
            }


Response:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.
#
cyclotronDataSources.factory 'mockDataSource', ($rootScope, dataService) ->
    {
        # Called with the actual options, returns the data source object
        initialize: (options) ->
            cache = null
            clients = []
            firstLoad = true

            # Ducati initializations
            gb = 2500
            rn = 70
            grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
            roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
            startTime = moment().startOf('minute')
            ducati = (num) ->
                return {
                    id: num
                    _time: moment(startTime).add(num, 'minutes').unix()
                    grossbookingvalue: grossBookings()
                    roomnightcount: roomNights()
                }


Prompt:
###
# Copyright (c) 2013-2015 the original author or authors.
#
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.opensource.org/licenses/mit-license.php
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
###

#
# Mock Data Source
# Injected by the DataService as needed
# Supports one property, 'format', that determines whether the mock data
# should be object-based or row-based.

Response:
#
cyclotronDataSources.factory 'mockDataSource', ($rootScope, dataService) ->
    {
        # Called with the actual options, returns the data source object
        initialize: (options) ->
            cache = null
            clients = []
            firstLoad = true

            # Ducati initializations
            gb = 2500
            rn = 70
            grossBookings = -> Math.floor(gb + (Math.random() * 5000 - 2500))
            roomNights = -> Math.floor(rn + (Math.random() * 170 - 70))
            startTime = moment().startOf('minute')
            ducati = (num) ->
                return {
                    id: num
                    _time: moment(startTime).add(num, 'minutes').unix()
                    grossbookingvalue: grossBookings()
                    roomnightcount: roomNights()
                }


Response:
execute = ->

                if !options.format? || options.format == 'object'
                    cache = [
                        {color: "red", number: 1, state: "WA", status: "green"}
                        {state: "CA", color: "green", number: 41, status: "green"}
                        {state: "CA", color: "red", number: 2, status: "green"}
                        {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                        {color: "blue", number: 23, state: "CO", status: "yellow"}
                        {color: "black", number: 45, state: "WA", status: "red"}
                        {color: "green", number: 32, state: "WA", status: "yellow"}
                        {color: "green", number: 99, state: "WA", status: "yellow"}
                        {color: "black", number: 1, state: "WA", status: "red"}
                        {color: "black", number: 45, state: "CA", status: "red"}
                        {color: "white", number: 24, state: "AK", status: "red"}
                        {color: "white", number: 16, state: "AK", status: "yellow"}
                    ]

                else if options.format == 'pie'
                    cache = [
                        {browser: "Firefox", percent: 45, isSliced: true},
                        {browser: "IE", percent: 26.8, isSliced: false},
                        {browser: "Chrome", percent: 12.8, isSliced: false},
                        {browser: "Safari", percent: 8.5, isSliced: false},
                        {browser: "Opera", percent: 6.2, isSliced: false},
                        {browser: "Other", percent: 0.7, isSliced: false}
                    ]

                else if options.format == 'ducati'
                    if cache?
                        cache.push ducati(_.last(cache).id + 1)
                        cache = _.tail(cache)
                    else
                        cache = (ducati(num) for num in [0..10])

                if options.filters?
                    # Filter the result set
                    cache = dataService.filter(cache, options.filters)

                if options.sortBy?
                    # Sort the result set
                    cache = dataService.sort(cache, options.sortBy)


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
execute = ->

                if !options.format? || options.format == 'object'
                    cache = [
                        {color: "red", number: 1, state: "WA", status: "green"}
                        {state: "CA", color: "green", number: 41, status: "green"}
                        {state: "CA", color: "red", number: 2, status: "green"}
                        {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                        {color: "blue", number: 23, state: "CO", status: "yellow"}
                        {color: "black", number: 45, state: "WA", status: "red"}
                        {color: "green", number: 32, state: "WA", status: "yellow"}
                        {color: "green", number: 99, state: "WA", status: "yellow"}
                        {color: "black", number: 1, state: "WA", status: "red"}
                        {color: "black", number: 45, state: "CA", status: "red"}
                        {color: "white", number: 24, state: "AK", status: "red"}
                        {color: "white", number: 16, state: "AK", status: "yellow"}
                    ]

                else if options.format == 'pie'
                    cache = [
                        {browser: "Firefox", percent: 45, isSliced: true},
                        {browser: "IE", percent: 26.8, isSliced: false},
                        {browser: "Chrome", percent: 12.8, isSliced: false},
                        {browser: "Safari", percent: 8.5, isSliced: false},
                        {browser: "Opera", percent: 6.2, isSliced: false},
                        {browser: "Other", percent: 0.7, isSliced: false}
                    ]

                else if options.format == 'ducati'
                    if cache?
                        cache.push ducati(_.last(cache).id + 1)
                        cache = _.tail(cache)
                    else
                        cache = (ducati(num) for num in [0..10])

                if options.filters?
                    # Filter the result set
                    cache = dataService.filter(cache, options.filters)

                if options.sortBy?
                    # Sort the result set
                    cache = dataService.sort(cache, options.sortBy)
```

Response:
var execute;

execute = function() {
  var cache, num;
  if ((options.format == null) || options.format === 'object') {
    cache = [
      {
        color: "red",
        number: 1,
        state: "WA",
        status: "green"
      },
      {
        state: "CA",
        color: "green",
        number: 41,
        status: "green"
      },
      {
        state: "CA",
        color: "red",
        number: 2,
        status: "green"
      },
      {
        color: "red",
        number: 15,
        state: "WA",
        country: "USA",
        status: "green"
      },
      {
        color: "blue",
        number: 23,
        state: "CO",
        status: "yellow"
      },
      {
        color: "black",
        number: 45,
        state: "WA",
        status: "red"
      },
      {
        color: "green",
        number: 32,
        state: "WA",
        status: "yellow"
      },
      {
        color: "green",
        number: 99,
        state: "WA",
        status: "yellow"
      },
      {
        color: "black",
        number: 1,
        state: "WA",
        status: "red"
      },
      {
        color: "black",
        number: 45,
        state: "CA",
        status: "red"
      },
      {
        color: "white",
        number: 24,
        state: "AK",
        status: "red"
      },
      {
        color: "white",
        number: 16,
        state: "AK",
        status: "yellow"
      }
    ];
  } else if (options.format === 'pie') {
    cache = [
      {
        browser: "Firefox",
        percent: 45,
        isSliced: true
      },
      {
        browser: "IE",
        percent: 26.8,
        isSliced: false
      },
      {
        browser: "Chrome",
        percent: 12.8,
        isSliced: false
      },
      {
        browser: "Safari",
        percent: 8.5,
        isSliced: false
      },
      {
        browser: "Opera",
        percent: 6.2,
        isSliced: false
      },
      {
        browser: "Other",
        percent: 0.7,
        isSliced: false
      }
    ];
  } else if (options.format === 'ducati') {
    if (cache != null) {
      cache.push(ducati(_.last(cache).id + 1));
      cache = _.tail(cache);
    } else {
      cache = (function() {
        var i, results;
        results = [];
        for (num = i = 0; i <= 10; num = ++i) {
          results.push(ducati(num));
        }
        return results;
      })();
    }
  }
  if (options.filters != null) {
    // Filter the result set
    cache = dataService.filter(cache, options.filters);
  }
  if (options.sortBy != null) {
    // Sort the result set
    return cache = dataService.sort(cache, options.sortBy);
  }
};


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var execute;

execute = function() {
  var cache, num;
  if ((options.format == null) || options.format === 'object') {
    cache = [
      {
        color: "red",
        number: 1,
        state: "WA",
        status: "green"
      },
      {
        state: "CA",
        color: "green",
        number: 41,
        status: "green"
      },
      {
        state: "CA",
        color: "red",
        number: 2,
        status: "green"
      },
      {
        color: "red",
        number: 15,
        state: "WA",
        country: "USA",
        status: "green"
      },
      {
        color: "blue",
        number: 23,
        state: "CO",
        status: "yellow"
      },
      {
        color: "black",
        number: 45,
        state: "WA",
        status: "red"
      },
      {
        color: "green",
        number: 32,
        state: "WA",
        status: "yellow"
      },
      {
        color: "green",
        number: 99,
        state: "WA",
        status: "yellow"
      },
      {
        color: "black",
        number: 1,
        state: "WA",
        status: "red"
      },
      {
        color: "black",
        number: 45,
        state: "CA",
        status: "red"
      },
      {
        color: "white",
        number: 24,
        state: "AK",
        status: "red"
      },
      {
        color: "white",
        number: 16,
        state: "AK",
        status: "yellow"
      }
    ];
  } else if (options.format === 'pie') {
    cache = [
      {
        browser: "Firefox",
        percent: 45,
        isSliced: true
      },
      {
        browser: "IE",
        percent: 26.8,
        isSliced: false
      },
      {
        browser: "Chrome",
        percent: 12.8,
        isSliced: false
      },
      {
        browser: "Safari",
        percent: 8.5,
        isSliced: false
      },
      {
        browser: "Opera",
        percent: 6.2,
        isSliced: false
      },
      {
        browser: "Other",
        percent: 0.7,
        isSliced: false
      }
    ];
  } else if (options.format === 'ducati') {
    if (cache != null) {
      cache.push(ducati(_.last(cache).id + 1));
      cache = _.tail(cache);
    } else {
      cache = (function() {
        var i, results;
        results = [];
        for (num = i = 0; i <= 10; num = ++i) {
          results.push(ducati(num));
        }
        return results;
      })();
    }
  }
  if (options.filters != null) {
    // Filter the result set
    cache = dataService.filter(cache, options.filters);
  }
  if (options.sortBy != null) {
    // Sort the result set
    return cache = dataService.sort(cache, options.sortBy);
  }
};
```

Response:
execute = ->

                if !options.format? || options.format == 'object'
                    cache = [
                        {color: "red", number: 1, state: "WA", status: "green"}
                        {state: "CA", color: "green", number: 41, status: "green"}
                        {state: "CA", color: "red", number: 2, status: "green"}
                        {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                        {color: "blue", number: 23, state: "CO", status: "yellow"}
                        {color: "black", number: 45, state: "WA", status: "red"}
                        {color: "green", number: 32, state: "WA", status: "yellow"}
                        {color: "green", number: 99, state: "WA", status: "yellow"}
                        {color: "black", number: 1, state: "WA", status: "red"}
                        {color: "black", number: 45, state: "CA", status: "red"}
                        {color: "white", number: 24, state: "AK", status: "red"}
                        {color: "white", number: 16, state: "AK", status: "yellow"}
                    ]

                else if options.format == 'pie'
                    cache = [
                        {browser: "Firefox", percent: 45, isSliced: true},
                        {browser: "IE", percent: 26.8, isSliced: false},
                        {browser: "Chrome", percent: 12.8, isSliced: false},
                        {browser: "Safari", percent: 8.5, isSliced: false},
                        {browser: "Opera", percent: 6.2, isSliced: false},
                        {browser: "Other", percent: 0.7, isSliced: false}
                    ]

                else if options.format == 'ducati'
                    if cache?
                        cache.push ducati(_.last(cache).id + 1)
                        cache = _.tail(cache)
                    else
                        cache = (ducati(num) for num in [0..10])

                if options.filters?
                    # Filter the result set
                    cache = dataService.filter(cache, options.filters)

                if options.sortBy?
                    # Sort the result set
                    cache = dataService.sort(cache, options.sortBy)


Prompt:
execute = ->

                if !options.format? || options.format == 'object'
                    cache = [
                        {color: "red", number: 1, state: "WA", status: "green"}
                        {state: "CA", color: "green", number: 41, status: "green"}
                        {state: "CA", color: "red", number: 2, status: "green"}
                        {color: "red", number: 15, state: "WA", country: "USA", status: "green"}
                        {color: "blue", number: 23, state: "CO", status: "yellow"}
                        {color: "black", number: 45, state: "WA", status: "red"}
                        {color: "green", number: 32, state: "WA", status: "yellow"}
                        {color: "green", number: 99, state: "WA", status: "yellow"}
                        {color: "black", number: 1, state: "WA", status: "red"}
                        {color: "black", number: 45, state: "CA", status: "red"}
                        {color: "white", number: 24, state: "AK", status: "red"}
                        {color: "white", number: 16, state: "AK", status: "yellow"}
                    ]

                else if options.format == 'pie'
                    cache = [
                        {browser: "Firefox", percent: 45, isSliced: true},

Response:
{browser: "IE", percent: 26.8, isSliced: false},
                        {browser: "Chrome", percent: 12.8, isSliced: false},
                        {browser: "Safari", percent: 8.5, isSliced: false},
                        {browser: "Opera", percent: 6.2, isSliced: false},
                        {browser: "Other", percent: 0.7, isSliced: false}
                    ]

                else if options.format == 'ducati'
                    if cache?
                        cache.push ducati(_.last(cache).id + 1)
                        cache = _.tail(cache)
                    else
                        cache = (ducati(num) for num in [0..10])

                if options.filters?
                    # Filter the result set
                    cache = dataService.filter(cache, options.filters)

                if options.sortBy?
                    # Sort the result set
                    cache = dataService.sort(cache, options.sortBy)


Response:
firstLoad = false

            return {
                execute: (toggleSpinners) ->
                    if toggleSpinners? && toggleSpinners == true
                        # Notify each client that it is currently loading
                        _.each clients, (client) ->
                            if client.loadingCallback? && _.isFunction(client.loadingCallback)
                                client.loadingCallback()
                            return

                    $rootScope.$apply ->
                        isUpdate = !firstLoad
                        execute()
                        _.each clients, (client) ->
                            client.callback(cache, null, isUpdate)
                            return

                getData: (dataSourceDefinition, callback, errorCallback, loadingCallback) ->

                    # Abort if the callback is not valid
                    return unless _.isFunction(callback)

                    # Store arguments for future data refreshes
                    clients.push {
                        callback
                        errorCallback
                        loadingCallback
                        dataSourceDefinition
                    }

                    # Check the cache for a previously-retrieved result
                    if cache?
                        # Invoke callback
                        callback(cache, null, false)

                    else if options.deferred == true
                        callback(null)
                        return


Prompt:
firstLoad = false

            return {
                execute: (toggleSpinners) ->
                    if toggleSpinners? && toggleSpinners == true
                        # Notify each client that it is currently loading
                        _.each clients, (client) ->
                            if client.loadingCallback? && _.isFunction(client.loadingCallback)
                                client.loadingCallback()
                            return

                    $rootScope.$apply ->
                        isUpdate = !firstLoad
                        execute()
                        _.each clients, (client) ->
                            client.callback(cache, null, isUpdate)
                            return

                getData: (dataSourceDefinition, callback, errorCallback, loadingCallback) ->

Response:
# Abort if the callback is not valid
                    return unless _.isFunction(callback)

                    # Store arguments for future data refreshes
                    clients.push {
                        callback
                        errorCallback
                        loadingCallback
                        dataSourceDefinition
                    }

                    # Check the cache for a previously-retrieved result
                    if cache?
                        # Invoke callback
                        callback(cache, null, false)

                    else if options.deferred == true
                        callback(null)
                        return


Response:
# Generate the cache if it doesn't exist
                    else if not cache?

                        # Generate cache
                        execute()

                        # Invoke callback
                        callback(cache, null, false)

                        # Schedule refresh
                        if options.refresh?
                            setInterval(->
                                $rootScope.$apply ->
                                    execute()
                                    _.each clients, (client) -> client.callback(cache, null, true)
                            , options.refresh * 1000)

            }
    }


Prompt:
# Generate the cache if it doesn't exist
                    else if not cache?

                        # Generate cache
                        execute()

                        # Invoke callback
                        callback(cache, null, false)

Response:
# Schedule refresh
                        if options.refresh?
                            setInterval(->
                                $rootScope.$apply ->
                                    execute()
                                    _.each clients, (client) -> client.callback(cache, null, true)
                            , options.refresh * 1000)

            }
    }


Response:
{getVimState} = require './spec-helper'

describe "Insert mode commands", ->
  [set, ensure, editor, editorElement, vimState] = []

  beforeEach ->
    getVimState (_vimState, vim) ->
      vimState = _vimState
      {editor, editorElement} = _vimState
      {set, ensure} = vim

  describe "Copy from line above/below", ->
    beforeEach ->
      set
        text: """
          12345

          abcd
          efghi
          """
        cursor: [[1, 0], [3, 0]]
      ensure 'i'

    describe "the ctrl-y command", ->
      it "copies from the line above", ->
        ensure 'ctrl-y',
          text: """
            12345
            1
            abcd
            aefghi
            """
        editor.insertText ' '
        ensure 'ctrl-y',
          text: """
            12345
            1 3
            abcd
            a cefghi
            """


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
{getVimState} = require './spec-helper'

describe "Insert mode commands", ->
  [set, ensure, editor, editorElement, vimState] = []

  beforeEach ->
    getVimState (_vimState, vim) ->
      vimState = _vimState
      {editor, editorElement} = _vimState
      {set, ensure} = vim

  describe "Copy from line above/below", ->
    beforeEach ->
      set
        text: """
          12345

          abcd
          efghi
          """
        cursor: [[1, 0], [3, 0]]
      ensure 'i'

    describe "the ctrl-y command", ->
      it "copies from the line above", ->
        ensure 'ctrl-y',
          text: """
            12345
            1
            abcd
            aefghi
            """
        editor.insertText ' '
        ensure 'ctrl-y',
          text: """
            12345
            1 3
            abcd
            a cefghi
            """
```

Response:
var getVimState;

({getVimState} = require('./spec-helper'));

describe("Insert mode commands", function() {
  var editor, editorElement, ensure, set, vimState;
  [set, ensure, editor, editorElement, vimState] = [];
  beforeEach(function() {
    return getVimState(function(_vimState, vim) {
      vimState = _vimState;
      ({editor, editorElement} = _vimState);
      return ({set, ensure} = vim);
    });
  });
  return describe("Copy from line above/below", function() {
    beforeEach(function() {
      set({
        text: `12345

abcd
efghi`,
        cursor: [[1, 0], [3, 0]]
      });
      return ensure('i');
    });
    return describe("the ctrl-y command", function() {
      return it("copies from the line above", function() {
        ensure('ctrl-y', {
          text: `12345
1
abcd
aefghi`
        });
        editor.insertText(' ');
        return ensure('ctrl-y', {
          text: `12345
1 3
abcd
a cefghi`
        });
      });
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
var getVimState;

({getVimState} = require('./spec-helper'));

describe("Insert mode commands", function() {
  var editor, editorElement, ensure, set, vimState;
  [set, ensure, editor, editorElement, vimState] = [];
  beforeEach(function() {
    return getVimState(function(_vimState, vim) {
      vimState = _vimState;
      ({editor, editorElement} = _vimState);
      return ({set, ensure} = vim);
    });
  });
  return describe("Copy from line above/below", function() {
    beforeEach(function() {
      set({
        text: `12345

abcd
efghi`,
        cursor: [[1, 0], [3, 0]]
      });
      return ensure('i');
    });
    return describe("the ctrl-y command", function() {
      return it("copies from the line above", function() {
        ensure('ctrl-y', {
          text: `12345
1
abcd
aefghi`
        });
        editor.insertText(' ');
        return ensure('ctrl-y', {
          text: `12345
1 3
abcd
a cefghi`
        });
      });
    });
  });
});
```

Response:
{getVimState} = require './spec-helper'

describe "Insert mode commands", ->
  [set, ensure, editor, editorElement, vimState] = []

  beforeEach ->
    getVimState (_vimState, vim) ->
      vimState = _vimState
      {editor, editorElement} = _vimState
      {set, ensure} = vim

  describe "Copy from line above/below", ->
    beforeEach ->
      set
        text: """
          12345

          abcd
          efghi
          """
        cursor: [[1, 0], [3, 0]]
      ensure 'i'

    describe "the ctrl-y command", ->
      it "copies from the line above", ->
        ensure 'ctrl-y',
          text: """
            12345
            1
            abcd
            aefghi
            """
        editor.insertText ' '
        ensure 'ctrl-y',
          text: """
            12345
            1 3
            abcd
            a cefghi
            """


Prompt:
{getVimState} = require './spec-helper'

describe "Insert mode commands", ->
  [set, ensure, editor, editorElement, vimState] = []

  beforeEach ->
    getVimState (_vimState, vim) ->
      vimState = _vimState
      {editor, editorElement} = _vimState
      {set, ensure} = vim

  describe "Copy from line above/below", ->
    beforeEach ->
      set
        text: """
          12345

          abcd
          efghi
          """

Response:
cursor: [[1, 0], [3, 0]]
      ensure 'i'

    describe "the ctrl-y command", ->
      it "copies from the line above", ->
        ensure 'ctrl-y',
          text: """
            12345
            1
            abcd
            aefghi
            """
        editor.insertText ' '
        ensure 'ctrl-y',
          text: """
            12345
            1 3
            abcd
            a cefghi
            """


Response:
it "does nothing if there's nothing above the cursor", ->
        editor.insertText 'fill'
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """

      it "does nothing on the first line", ->
        set
          textC: """
          12|345

          abcd
          ef!ghi
          """

        editor.insertText 'a'
        ensure null,
          textC: """
            12a|345

            abcd
            efa!ghi
            """
        ensure 'ctrl-y',
          textC: """
            12a|345

            abcd
            efad!ghi
            """


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
it "does nothing if there's nothing above the cursor", ->
        editor.insertText 'fill'
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """

      it "does nothing on the first line", ->
        set
          textC: """
          12|345

          abcd
          ef!ghi
          """

        editor.insertText 'a'
        ensure null,
          textC: """
            12a|345

            abcd
            efa!ghi
            """
        ensure 'ctrl-y',
          textC: """
            12a|345

            abcd
            efad!ghi
            """
```

Response:
it("does nothing if there's nothing above the cursor", function() {
  editor.insertText('fill');
  ensure('ctrl-y', {
    text: `12345
fill5
abcd
fillefghi`
  });
  return ensure('ctrl-y', {
    text: `12345
fill5
abcd
fillefghi`
  });
});

it("does nothing on the first line", function() {
  set({
    textC: `12|345

abcd
ef!ghi`
  });
  editor.insertText('a');
  ensure(null, {
    textC: `12a|345

abcd
efa!ghi`
  });
  return ensure('ctrl-y', {
    textC: `12a|345

abcd
efad!ghi`
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
it("does nothing if there's nothing above the cursor", function() {
  editor.insertText('fill');
  ensure('ctrl-y', {
    text: `12345
fill5
abcd
fillefghi`
  });
  return ensure('ctrl-y', {
    text: `12345
fill5
abcd
fillefghi`
  });
});

it("does nothing on the first line", function() {
  set({
    textC: `12|345

abcd
ef!ghi`
  });
  editor.insertText('a');
  ensure(null, {
    textC: `12a|345

abcd
efa!ghi`
  });
  return ensure('ctrl-y', {
    textC: `12a|345

abcd
efad!ghi`
  });
});
```

Response:
it "does nothing if there's nothing above the cursor", ->
        editor.insertText 'fill'
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """

      it "does nothing on the first line", ->
        set
          textC: """
          12|345

          abcd
          ef!ghi
          """

        editor.insertText 'a'
        ensure null,
          textC: """
            12a|345

            abcd
            efa!ghi
            """
        ensure 'ctrl-y',
          textC: """
            12a|345

            abcd
            efad!ghi
            """


Prompt:
it "does nothing if there's nothing above the cursor", ->
        editor.insertText 'fill'
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """
        ensure 'ctrl-y',
          text: """
            12345
            fill5
            abcd
            fillefghi
            """

      it "does nothing on the first line", ->
        set
          textC: """

Response:
12|345

          abcd
          ef!ghi
          """

        editor.insertText 'a'
        ensure null,
          textC: """
            12a|345

            abcd
            efa!ghi
            """
        ensure 'ctrl-y',
          textC: """
            12a|345

            abcd
            efad!ghi
            """


Response:
describe "the ctrl-e command", ->
      beforeEach ->
        atom.keymaps.add "test",
          'atom-text-editor.vim-mode-plus.insert-mode':
            'ctrl-e': 'vim-mode-plus:copy-from-line-below'

      it "copies from the line below", ->
        ensure 'ctrl-e',
          text: """
            12345
            a
            abcd
            efghi
            """
        editor.insertText ' '
        ensure 'ctrl-e',
          text: """
            12345
            a c
            abcd
             efghi
            """

      it "does nothing if there's nothing below the cursor", ->
        editor.insertText 'foo'
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """


Prompt:
Convert this CoffeeScript to JavaScript.
```coffeescript
describe "the ctrl-e command", ->
      beforeEach ->
        atom.keymaps.add "test",
          'atom-text-editor.vim-mode-plus.insert-mode':
            'ctrl-e': 'vim-mode-plus:copy-from-line-below'

      it "copies from the line below", ->
        ensure 'ctrl-e',
          text: """
            12345
            a
            abcd
            efghi
            """
        editor.insertText ' '
        ensure 'ctrl-e',
          text: """
            12345
            a c
            abcd
             efghi
            """

      it "does nothing if there's nothing below the cursor", ->
        editor.insertText 'foo'
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """
```

Response:
describe("the ctrl-e command", function() {
  beforeEach(function() {
    return atom.keymaps.add("test", {
      'atom-text-editor.vim-mode-plus.insert-mode': {
        'ctrl-e': 'vim-mode-plus:copy-from-line-below'
      }
    });
  });
  it("copies from the line below", function() {
    ensure('ctrl-e', {
      text: `12345
a
abcd
efghi`
    });
    editor.insertText(' ');
    return ensure('ctrl-e', {
      text: `12345
a c
abcd
 efghi`
    });
  });
  return it("does nothing if there's nothing below the cursor", function() {
    editor.insertText('foo');
    ensure('ctrl-e', {
      text: `12345
food
abcd
fooefghi`
    });
    return ensure('ctrl-e', {
      text: `12345
food
abcd
fooefghi`
    });
  });
});


Prompt:
Convert this JavaScript to CoffeeScript.
```javascript
describe("the ctrl-e command", function() {
  beforeEach(function() {
    return atom.keymaps.add("test", {
      'atom-text-editor.vim-mode-plus.insert-mode': {
        'ctrl-e': 'vim-mode-plus:copy-from-line-below'
      }
    });
  });
  it("copies from the line below", function() {
    ensure('ctrl-e', {
      text: `12345
a
abcd
efghi`
    });
    editor.insertText(' ');
    return ensure('ctrl-e', {
      text: `12345
a c
abcd
 efghi`
    });
  });
  return it("does nothing if there's nothing below the cursor", function() {
    editor.insertText('foo');
    ensure('ctrl-e', {
      text: `12345
food
abcd
fooefghi`
    });
    return ensure('ctrl-e', {
      text: `12345
food
abcd
fooefghi`
    });
  });
});
```

Response:
describe "the ctrl-e command", ->
      beforeEach ->
        atom.keymaps.add "test",
          'atom-text-editor.vim-mode-plus.insert-mode':
            'ctrl-e': 'vim-mode-plus:copy-from-line-below'

      it "copies from the line below", ->
        ensure 'ctrl-e',
          text: """
            12345
            a
            abcd
            efghi
            """
        editor.insertText ' '
        ensure 'ctrl-e',
          text: """
            12345
            a c
            abcd
             efghi
            """

      it "does nothing if there's nothing below the cursor", ->
        editor.insertText 'foo'
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """


Prompt:
describe "the ctrl-e command", ->
      beforeEach ->
        atom.keymaps.add "test",
          'atom-text-editor.vim-mode-plus.insert-mode':
            'ctrl-e': 'vim-mode-plus:copy-from-line-below'

      it "copies from the line below", ->
        ensure 'ctrl-e',
          text: """
            12345
            a
            abcd
            efghi
            """
        editor.insertText ' '
        ensure 'ctrl-e',
          text: """
            12345
            a c

Response:
abcd
             efghi
            """

      it "does nothing if there's nothing below the cursor", ->
        editor.insertText 'foo'
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """
        ensure 'ctrl-e',
          text: """
            12345
            food
            abcd
            fooefghi
            """


Response:
describe "InsertLastInserted", ->
      ensureInsertLastInserted = (key, options) ->
        {insert, text, finalText} = options
        ensure key
        editor.insertText(insert)
        ensure "escape", text: text
        ensure "G I ctrl-a", text: finalText

      beforeEach ->
        atom.keymaps.add "test",
          'atom-text-editor.vim-mode-plus.insert-mode':
            'ctrl-a': 'vim-mode-plus:insert-last-inserted'

        initialText = """
          abc
          def\n
          """
        set text: "", cursor: [0, 0]
        ensure 'i'
        editor.insertText(initialText)
        ensure "escape g g",
          text: initialText
          cursor: [0, 0]

      it "case-i: single-line", ->
        ensureInsertLastInserted 'i',
          insert: 'xxx'
          text: "xxxabc\ndef\n"
          finalText: "xxxabc\nxxxdef\n"
      it "case-o: single-line", ->
        ensureInsertLastInserted 'o',
          insert: 'xxx'
          text: "abc\nxxx\ndef\n"
          finalText: "abc\nxxx\nxxxdef\n"
      it "case-O: single-line", ->
        ensureInsertLastInserted 'O',
          insert: 'xxx'
          text: "xxx\nabc\ndef\n"
          finalText: "xxx\nabc\nxxxdef\n"