/* Minification failed. Returning unminified contents.
(925,63-64): run-time error JS1014: Invalid character: \
(925,64-65): run-time error JS1014: Invalid character: \
(925,65-66): run-time error JS1006: Expected ')': ]
(925,66): run-time error JS1004: Expected ';'
(925,66-67): run-time error JS1195: Expected expression: )
(925,67-68): run-time error JS1195: Expected expression: /
(925,77): run-time error JS1004: Expected ';'
(925,77-78): run-time error JS1195: Expected expression: )
(925,65-66): run-time error JS1013: Syntax error in regular expression: ]
(155629,2-5): run-time error JS1013: Syntax error in regular expression: var
 */
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// identity function for calling harmony imports with the correct context
/******/ 	__webpack_require__.i = function(value) { return value; };
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/Content/";
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 1396);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {
  module.exports = require('./cjs/react.production.min.js');
} else {
  module.exports = __webpack_require__(1367);
}


/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */



var React = __webpack_require__(0);
var factory = __webpack_require__(917);

if (typeof React === 'undefined') {
  throw Error(
    'create-react-class could not find the React object. If you are using script tags, ' +
      'make sure that React is being loaded before create-react-class.'
  );
}

// Hack to grab NoopUpdateQueue from isomorphic React
var ReactNoopUpdateQueue = new React.Component().updater;

module.exports = factory(
  React.Component,
  React.isValidElement,
  ReactNoopUpdateQueue
);


/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var core = __webpack_require__(57);
var hide = __webpack_require__(48);
var redefine = __webpack_require__(49);
var ctx = __webpack_require__(58);
var PROTOTYPE = 'prototype';

var $export = function (type, name, source) {
  var IS_FORCED = type & $export.F;
  var IS_GLOBAL = type & $export.G;
  var IS_STATIC = type & $export.S;
  var IS_PROTO = type & $export.P;
  var IS_BIND = type & $export.B;
  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  var key, own, out, exp;
  if (IS_GLOBAL) source = name;
  for (key in source) {
    // contains in native
    own = !IS_FORCED && target && target[key] !== undefined;
    // export native or passed
    out = (own ? target : source)[key];
    // bind timers to global for call from export context
    exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
    // extend global
    if (target) redefine(target, key, out, type & $export.U);
    // export
    if (exports[key] != out) hide(exports, key, exp);
    if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  }
};
global.core = core;
// type bitmap
$export.F = 1;   // forced
$export.G = 2;   // global
$export.S = 4;   // static
$export.P = 8;   // proto
$export.B = 16;  // bind
$export.W = 32;  // wrap
$export.U = 64;  // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;


/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {

exports.ListenerMethods = __webpack_require__(379);

exports.PublisherMethods = __webpack_require__(1370);

exports.createAction = __webpack_require__(380);

exports.createStore = __webpack_require__(1373);

exports.connect = __webpack_require__(1372);

exports.ListenerMixin = __webpack_require__(1369);

exports.listenTo = __webpack_require__(1374);

exports.listenToMany = __webpack_require__(1375);

exports.all = __webpack_require__(1371);

/**
 * Convenience function for creating a set of actions
 *
 * @param actionNames the names for the actions to be created
 * @returns an object with actions of corresponding action names
 */
exports.createActions = function(actionNames) {
    var i = 0, actions = {};
    for (; i < actionNames.length; i++) {
        actions[actionNames[i]] = exports.createAction();
    }
    return actions;
};

/**
 * Sets the eventmitter that Reflux uses
 */
exports.setEventEmitter = function(ctx) {
    var _ = __webpack_require__(85);
    _.EventEmitter = ctx;
};

/**
 * Sets the method used for deferring actions and stores
 */
exports.nextTick = function(nextTick) {
    var _ = __webpack_require__(85);
    _.nextTick = nextTick;
};

/**
 * Provides the set of created actions and stores for introspection
 */
exports.__keep = __webpack_require__(251);


/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = _reflux2.default.createActions([
// session
'NEW_USER_SESSION', 'UPDATE_USER_NAME', 'SESSION_ERROR', 'UPDATE_USER_PREFERENCE', 'OPTIMISICALLY_UPDATE_USER_PREFERENCE', 'UPDATE_DATASET_LIST', 'UPDATE_DATASETLIST_GROUP', 'SET_DATA_PROPERTIES', 'UPDATE_FARM_LIST', 'SET_APP_STATUS', 'SET_DATASET_UNSAVED', 'RECEIVE_AUTH_UPDATE',

// dataset
'POPULATE_ACTIVE_DATASET', 'REPLACE_ACTIVE_DATASET', 'RECEIVE_DATA_UPDATE', 'UPDATE_DATA_ELEMENT', 'DISCARD_DATASET_CHANGES', 'SAVE_DATASET', 'CLEAR_DATASET', 'UPDATE_DATASET_DETAIL',

// budget
'READ_BUDGET_DATA', 'UPDATE_BUDGET_STATE', 'CLOSE_BUDGET_EDITOR', 'UPDATE_CC_RATIO_SWITCH',

// reports
'SET_REPORT_PROPS', 'SET_REPORT_FILTERS', 'UPDATE_REPORT_FILTER_ELEMENT', 'UPDATE_COMPARISON_COUNT', 'MAP_REPORT_DATA',

// requests
'POST_NEW_DATA', 'REPORT_ERROR', 'CLEAR_FIELD_ERROR', 'CLEAR_ALL_ERRORS', 'ROLLBACK_FIELD_DATA', 'SET_DATA_ERROR',

// routes
'UPDATE_PHYSICAL_TAB', 'UPDATE_FINANCIAL_TAB',

// Filters
'CLEAR_DATASETLIST_FILTER', 'UPDATE_DATASETLIST_FILTER', 'UPDATE_GROUP_LIST', 'CREATE_GROUP', 'DELETE_GROUP',

// charts
'UPDATE_CHART_DATA', 'UPDATE_CHART_SETTINGS']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(141);

var _reactDom2 = _interopRequireDefault(_reactDom);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Portal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      created: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (newProps.isOpen === this.props.isOpen) {
      if (!this.state.created) return;
      return this.renderPortal(newProps);
    }
    if (newProps.isOpen) {
      this.setState({
        created: true
      });
      this.createPortal(newProps);
    } else {
      this.setState({
        created: false
      });
      this.destroyPortal();
    }
  },
  componentWillUnmount: function componentWillUnmount() {
    if (this.props.isOpen) {
      this.destroyPortal();
    }
  },
  createPortal: function createPortal(props) {
    this.node = document.createElement('div');
    this.node.className = props.className || 'PortalBox';
    this.node.style = props.forceZ ? 'z-index: 1' : '';
    props.context.appendChild(this.node);
    this.renderPortal(props);
  },
  destroyPortal: function destroyPortal() {
    if (typeof this.node === 'undefined') return;
    this.props.context.removeChild(this.node);
  },
  renderPortal: function renderPortal(props) {
    delete props.ref;
    _reactDom2.default.render(_react2.default.createElement(
      'div',
      { className: '_content' },
      props.children
    ), this.node);
  },
  render: function render() {
    return null;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Portal, 'Portal', 'C:/_repos_windows/dairybase/Frontend/app/utils/_Portal/index.jsx');
}();

;

/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _iconList = __webpack_require__(193);

var _iconList2 = _interopRequireDefault(_iconList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = _react2.default.forwardRef(function (props, ref) {
  return _react2.default.createElement('div', {
    ref: ref,
    className: props.className,
    dangerouslySetInnerHTML: { __html: _iconList2.default[props.id] }
  });
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  Copyright (c) 2015 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/

function classNames() {
	var classes = '';
	var arg;

	for (var i = 0; i < arguments.length; i++) {
		arg = arguments[i];
		if (!arg) {
			continue;
		}

		if ('string' === typeof arg || 'number' === typeof arg) {
			classes += ' ' + arg;
		} else if (Object.prototype.toString.call(arg) === '[object Array]') {
			classes += ' ' + classNames.apply(null, arg);
		} else if ('object' === typeof arg) {
			for (var key in arg) {
				if (!arg.hasOwnProperty(key) || !arg[key]) {
					continue;
				}
				classes += ' ' + key;
			}
		}
	}
	return classes.substr(1);
}

// safely export classNames for node / browserify
if (typeof module !== 'undefined' && module.exports) {
	module.exports = classNames;
}

// safely export classNames for RequireJS
if (true) {
	!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
		return classNames;
	}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
}


/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = ReactClass;
exports.FunctionComponent = FunctionComponent;

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactRouterDom = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function passOptions(options, reactComponent) {
  if (options.withRouter) {
    reactComponent = (0, _reactRouterDom.withRouter)(reactComponent);
  }

  return reactComponent;
}

function ReactClass(options, reactClass) {
  var ReturnReactClass = __webpack_require__(1)(reactClass);
  return passOptions(options, ReturnReactClass);
}

function FunctionComponent(options, reactFunction) {
  return passOptions(options, reactFunction);
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(passOptions, 'passOptions', 'C:/_repos_windows/dairybase/Frontend/app/_shared/xch-ReactClass/index.js');

  __REACT_HOT_LOADER__.register(ReactClass, 'ReactClass', 'C:/_repos_windows/dairybase/Frontend/app/_shared/xch-ReactClass/index.js');

  __REACT_HOT_LOADER__.register(FunctionComponent, 'FunctionComponent', 'C:/_repos_windows/dairybase/Frontend/app/_shared/xch-ReactClass/index.js');
}();

;

/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __dataDefinition = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.properties = {};
    this.selectOptions = {};
    this.farmList = [];
    this.chartSettings = [];
    this.listenToMany(_Actions2.default);
  },
  SET_DATA_PROPERTIES: function SET_DATA_PROPERTIES(blob) {
    this.properties = blob.DataProperties;
    this.selectOptions = blob.DataSelectOptions;
    this.chartSettings = blob.DataChartSettings;
    this.farmList = blob.DataFarmList;
    this.trigger();
  },
  UPDATE_FARM_LIST: function UPDATE_FARM_LIST(blob) {
    this.farmList = blob.DataFarmList;
    this.selectOptions = blob.DataSelectOptions;
    this.trigger();
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__dataDefinition, '__dataDefinition', 'C:/_repos_windows/dairybase/Frontend/app/stores/__dataDefinition/index.js');
}();

;

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _GET__usersDetails = __webpack_require__(411);

var _GET__usersDetails2 = _interopRequireDefault(_GET__usersDetails);

var _stripCCD = __webpack_require__(257);

var _stripCCD2 = _interopRequireDefault(_stripCCD);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __datasetList = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.store = [];
    this.listenToMany(_Actions2.default);
  },


  // allows us to update the name in this list from the budget editor
  UPDATE_DATASET_DETAIL: function UPDATE_DATASET_DETAIL(newData) {
    var Id = newData.Id;


    var newStore = this.store.map(function (dataset) {
      if (dataset.Id !== Id) return dataset;
      var obj = _extends({}, dataset, newData);
      return obj;
    });

    this.store = newStore;
    this.trigger();
  },
  UPDATE_DATASET_LIST: function UPDATE_DATASET_LIST(data) {
    if (data === null) return console.log('datasetList not returned');

    var _data$reduce = data.reduce(function (__obj, dataset) {
      var _dataset = !dataset.IsCcModel ? dataset : _extends({}, dataset, {
        Name: (0, _stripCCD2.default)(dataset.Name)
      });

      if (!dataset.ArchiveStatus) {
        __obj.datasetCache[_dataset.Id] = true;
      }

      __obj.dataList.push(_dataset);

      return __obj;
    }, { dataList: [], datasetCache: {} }),
        dataList = _data$reduce.dataList,
        datasetCache = _data$reduce.datasetCache;

    var nullNames = dataList.filter(function (dataset) {
      return dataset.OwnerName === '';
    });

    if (nullNames.length > 0) {
      (0, _GET__usersDetails2.default)();
    }

    var _dataList$reduce = dataList.reduce(function (__obj, dataset) {
      var IsCcModel = dataset.IsCcModel,
          CcModelSourceId = dataset.CcModelSourceId;


      if (dataset.IsCcModel) {
        var ref = __obj.budgetCache[CcModelSourceId] || [];
        ref.push(dataset);
        __obj.budgetCache[CcModelSourceId] = ref;

        if (!datasetCache[CcModelSourceId] && !dataset.ArchiveStatus) {
          __obj.dataListWithOrphans.push(_extends({}, dataset, { _isOrphan: true }));
          return __obj;
        }
      }

      __obj.dataListWithOrphans.push(dataset);

      return __obj;
    }, { budgetCache: {}, dataListWithOrphans: [] }),
        budgetCache = _dataList$reduce.budgetCache,
        dataListWithOrphans = _dataList$reduce.dataListWithOrphans;

    var dataWithBudgets = dataListWithOrphans.map(function (dataset, index) {
      var ref = budgetCache[dataset.Id];
      if (ref) {
        return _extends({}, dataset, {
          _budgets: ref.filter(function (b) {
            return !b.ArchiveStatus;
          })
        });
      }

      return dataset;
    });

    this.store = this._sortList(dataWithBudgets);
    this.trigger();
  },
  _sortList: function _sortList(list) {
    return _.sortByAll(list, [function (item) {
      return item.Name.toLowerCase();
    }, 'DairyBaseId', 'FinancialYear', function (item) {
      return item.OwnerName.toLowerCase();
    }, 'IsActual', 'EditAuthority']);
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__datasetList, '__datasetList', 'C:/_repos_windows/dairybase/Frontend/app/stores/__datasetList/index.js');
}();

;

/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(22);
module.exports = function (it) {
  if (!isObject(it)) throw TypeError(it + ' is not an object!');
  return it;
};


/***/ }),
/* 12 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BrowserRouter", function() { return BrowserRouter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HashRouter", function() { return HashRouter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Link", function() { return Link; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NavLink", function() { return NavLink; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__ = __webpack_require__(254);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react_router__ = __webpack_require__(185);
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["MemoryRouter"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["Prompt"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["Redirect"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["Route"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["Router"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["StaticRouter"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["Switch"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "generatePath", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["generatePath"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["matchPath"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["withRouter"]; });
/* harmony namespace reexport (by provided) */ __webpack_require__.d(__webpack_exports__, "__RouterContext", function() { return __WEBPACK_IMPORTED_MODULE_2_react_router__["__RouterContext"]; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history__ = __webpack_require__(358);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(183);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_tiny_warning__ = __webpack_require__(253);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_extends__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__ = __webpack_require__(255);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_tiny_invariant__ = __webpack_require__(252);











/**
 * The public API for a <Router> that uses HTML5 history.
 */

var BrowserRouter =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(BrowserRouter, _React$Component);

  function BrowserRouter() {
    var _this;

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
    _this.history = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history__["e" /* createBrowserHistory */])(_this.props);
    return _this;
  }

  var _proto = BrowserRouter.prototype;

  _proto.render = function render() {
    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["Router"], {
      history: this.history,
      children: this.props.children
    });
  };

  return BrowserRouter;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);

if (true) {
  BrowserRouter.propTypes = {
    basename: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
    children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node,
    forceRefresh: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
    getUserConfirmation: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
    keyLength: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.number
  };

  BrowserRouter.prototype.componentDidMount = function () {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_tiny_warning__["a" /* default */])(!this.props.history, "<BrowserRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { BrowserRouter as Router }`.") : void 0;
  };
}

/**
 * The public API for a <Router> that uses window.location.hash.
 */

var HashRouter =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(HashRouter, _React$Component);

  function HashRouter() {
    var _this;

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
    _this.history = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history__["f" /* createHashHistory */])(_this.props);
    return _this;
  }

  var _proto = HashRouter.prototype;

  _proto.render = function render() {
    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["Router"], {
      history: this.history,
      children: this.props.children
    });
  };

  return HashRouter;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);

if (true) {
  HashRouter.propTypes = {
    basename: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
    children: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.node,
    getUserConfirmation: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
    hashType: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOf(["hashbang", "noslash", "slash"])
  };

  HashRouter.prototype.componentDidMount = function () {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_tiny_warning__["a" /* default */])(!this.props.history, "<HashRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { HashRouter as Router }`.") : void 0;
  };
}

function isModifiedEvent(event) {
  return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
/**
 * The public API for rendering a history-aware <a>.
 */


var Link =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Link, _React$Component);

  function Link() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = Link.prototype;

  _proto.handleClick = function handleClick(event, history) {
    if (this.props.onClick) this.props.onClick(event);

    if (!event.defaultPrevented && // onClick prevented default
    event.button === 0 && ( // ignore everything but left clicks
    !this.props.target || this.props.target === "_self") && // let browser handle "target=_blank" etc.
    !isModifiedEvent(event) // ignore clicks with modifier keys
    ) {
        event.preventDefault();
        var method = this.props.replace ? history.replace : history.push;
        method(this.props.to);
      }
  };

  _proto.render = function render() {
    var _this = this;

    var _this$props = this.props,
        innerRef = _this$props.innerRef,
        replace = _this$props.replace,
        to = _this$props.to,
        rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(_this$props, ["innerRef", "replace", "to"]); // eslint-disable-line no-unused-vars


    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["__RouterContext"].Consumer, null, function (context) {
      !context ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8_tiny_invariant__["a" /* default */])(false, "You should not use <Link> outside a <Router>") : invariant(false) : void 0;
      var location = typeof to === "string" ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_history__["b" /* createLocation */])(to, null, null, context.location) : to;
      var href = location ? context.history.createHref(location) : "";
      return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement("a", __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_extends__["a" /* default */])({}, rest, {
        onClick: function onClick(event) {
          return _this.handleClick(event, context.history);
        },
        href: href,
        ref: innerRef
      }));
    });
  };

  return Link;
}(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);

if (true) {
  var toType = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object]);
  var innerRefType = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({
    current: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.any
  })]);
  Link.propTypes = {
    innerRef: innerRefType,
    onClick: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
    replace: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.bool,
    target: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
    to: toType.isRequired
  };
}

function joinClassnames() {
  for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
    classnames[_key] = arguments[_key];
  }

  return classnames.filter(function (i) {
    return i;
  }).join(" ");
}
/**
 * A <Link> wrapper that knows if it's "active" or not.
 */


function NavLink(_ref) {
  var _ref$ariaCurrent = _ref["aria-current"],
      ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent,
      _ref$activeClassName = _ref.activeClassName,
      activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName,
      activeStyle = _ref.activeStyle,
      classNameProp = _ref.className,
      exact = _ref.exact,
      isActiveProp = _ref.isActive,
      location = _ref.location,
      strict = _ref.strict,
      styleProp = _ref.style,
      to = _ref.to,
      rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "strict", "style", "to"]);

  var path = typeof to === "object" ? to.pathname : to; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202

  var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
  return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_2_react_router__["Route"], {
    path: escapedPath,
    exact: exact,
    strict: strict,
    location: location,
    children: function children(_ref2) {
      var location = _ref2.location,
          match = _ref2.match;
      var isActive = !!(isActiveProp ? isActiveProp(match, location) : match);
      var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp;
      var style = isActive ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_extends__["a" /* default */])({}, styleProp, activeStyle) : styleProp;
      return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Link, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_extends__["a" /* default */])({
        "aria-current": isActive && ariaCurrent || null,
        className: className,
        style: style,
        to: to
      }, rest));
    }
  });
}

if (true) {
  var ariaCurrentType = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOf(["page", "step", "location", "date", "time", "true"]);
  NavLink.propTypes = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_extends__["a" /* default */])({}, Link.propTypes, {
    "aria-current": ariaCurrentType,
    activeClassName: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
    activeStyle: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
    className: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.string,
    exact: __WEBPACK_IMPORTED_MODULE_2_react_router__["Route"].propTypes.exact,
    isActive: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
    location: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object,
    strict: __WEBPACK_IMPORTED_MODULE_2_react_router__["Route"].propTypes.strict,
    style: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.object
  });
}




/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _mutateDataWithProps = __webpack_require__(196);

var _mutateDataWithProps2 = _interopRequireDefault(_mutateDataWithProps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var __activeDataset = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.id = undefined;
    this.store = {};
    this.DataSetSaved = false;
    this.DataSetAligned = false;

    this.listenToMany(_Actions2.default);
  },
  POPULATE_ACTIVE_DATASET: function POPULATE_ACTIVE_DATASET(blob) {
    var _this = this;

    this.id = blob.FarmDataSetId;

    // create empty objects for the rows of our table
    // to insert fields into later...

    _dataDefinition2.default.properties.Data.Tables.forEach(function (table, index) {
      if (table.MultiRow) {
        var _name = table.TableName;
        _this.store[_name] = [];
        blob.Data[_name].forEach(function (row, index) {
          _this.store[_name].push({});
        });
      }
    });

    this.RECEIVE_DATA_UPDATE(blob);
  },
  REPLACE_ACTIVE_DATASET: function REPLACE_ACTIVE_DATASET(blob) {
    this.id = blob.FarmDataSetId;
    this.RECEIVE_DATA_UPDATE(blob);
  },
  RECEIVE_DATA_UPDATE: function RECEIVE_DATA_UPDATE(blob) {

    if (typeof blob.DataSetSaved !== "undefined") {
      this.DataSetSaved = blob.DataSetSaved;
      this.DataSetAligned = blob.DataSetAligned;
    }

    if (typeof blob.Data === "undefined" || blob.Data === null) return;
    this.store = (0, _mutateDataWithProps2.default)(blob.Data, 'Data', this.store);
    this.trigger();
  },
  UPDATE_DATA_ELEMENT: function UPDATE_DATA_ELEMENT(newData) {
    // send the old and new data to request log

    var newPostData = {
      "Table": newData.Table,
      "Data": [{
        "RowId": this.store[newData.Element].RowId,
        "Fields": _defineProperty({}, newData.Element, this.store[newData.Element].Type === "Percent" ? newData.Value / 100 : newData.Value)
      }]
    };

    var oldData = _.cloneDeep(this.store[newData.Element]);
    _Actions2.default.POST_NEW_DATA(oldData, newPostData, true);

    // optimistically set data on local store
    this.store[newData.Element].Value = newData.Value;
    this.trigger();
  },
  SET_DATA_ERROR: function SET_DATA_ERROR(fieldId, errorStatus) {
    this.store[fieldId].error = errorStatus;
    this.trigger();
  },
  ROLLBACK_FIELD_DATA: function ROLLBACK_FIELD_DATA(oldData) {
    if (typeof this.store[oldData.Element] === 'undefined') return;
    this.store[oldData.Element].Value = oldData.Value;
    this.trigger();
  },
  SET_DATASET_UNSAVED: function SET_DATASET_UNSAVED() {
    this.DataSetSaved = false;
    this.trigger();
  },
  SAVE_DATASET: function SAVE_DATASET(blob) {
    this.DataSetAligned = blob.DataSetAligned;
    this.DataSetSaved = blob.DataSetSaved;
    this.trigger();
  },
  SET_APP_STATUS: function SET_APP_STATUS(status) {
    this.store.status = status;
    this.trigger();
  },
  DISCARD_DATASET_CHANGES: function DISCARD_DATASET_CHANGES(callback) {
    this.store.status = 'discarded';
    (0, _POST__loadDataset2.default)(this.id);
    if (typeof callback !== "undefined") {
      callback();
    }
  },
  CLEAR_DATASET: function CLEAR_DATASET() {
    this.id = undefined;
    this.store = {};
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__activeDataset, '__activeDataset', 'C:/_repos_windows/dairybase/Frontend/app/stores/__activeDataset/index.js');
}();

;

/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1082);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var RequestModal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      pending: true,
      fail: false,
      success: false
    };
  },
  componentWillMount: function componentWillMount() {
    this._callAsyncRequest();
  },
  _setPendingState: function _setPendingState() {
    this.setState({
      pending: true,
      fail: false,
      success: false
    }, this._callAsyncRequest);
  },
  _callAsyncRequest: function _callAsyncRequest() {
    if (this.props.GET) return this.props.request(this._handleRequestResp);
    this.props.request(this.props.data, this._handleRequestResp);
  },
  _handleRequestResp: function _handleRequestResp(resp) {
    if (this.props.debug) return this._handleFail(resp);

    if (resp.statusCode === 200) {
      this._handleSuccess(resp);
    } else {
      this._handleFail(resp);
    }
  },
  _handleSuccess: function _handleSuccess(resp) {
    this.setState({
      pending: false,
      success: true,
      reponse: resp
    }, function () {
      if (this.props.wait) return;
      if (typeof this.props.timeout !== 'number') return this.props.successHandler(resp);
      this._handleRespSuccessTimeout(resp);
    });
  },
  _handleFail: function _handleFail(resp) {
    this.setState({
      pending: false,
      fail: true,
      reponse: resp
    });
  },
  _handleRespSuccessTimeout: function _handleRespSuccessTimeout(resp) {
    var _this = this;

    setTimeout(function () {
      _this.props.successHandler(resp);
    }, this.props.timeout);
  },
  _renderCloseBtn: function _renderCloseBtn() {
    return !this.props.wait ? null : _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.failHandler });
  },
  _renderPendingState: function _renderPendingState() {
    var content = this.props.pendingText;
    return !this.state.pending ? null : _react2.default.createElement(
      'div',
      { className: '_pending' },
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      )
    );
  },
  _renderSuccessState: function _renderSuccessState() {
    var content = this.props.successText;
    return !this.state.success ? null : _react2.default.createElement(
      'div',
      { className: '_success' },
      this._renderCloseBtn(),
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      )
    );
  },
  _renderFailState: function _renderFailState() {
    var content = this.props.failText;
    return !this.state.fail ? null : _react2.default.createElement(
      'div',
      { className: '_fail' },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.failHandler }),
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      ),
      _react2.default.createElement(
        'div',
        { className: 'RequestModal__actions' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this.props.failHandler },
          'Cancel'
        ),
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._setPendingState },
          'Try again?'
        )
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'RequestModal' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: 'RequestModal__content' },
          this._renderPendingState(),
          this._renderSuccessState(),
          this._renderFailState()
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RequestModal, 'RequestModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_RequestModal/index.jsx');
}();

;

/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _iconList = __webpack_require__(193);

var _iconList2 = _interopRequireDefault(_iconList);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(960);

var _style2 = _interopRequireDefault(_style);

var _style3 = __webpack_require__(408);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getClass: function getClass(className) {
    if (typeof this.props.classes === 'undefined' || typeof this.props.classes[className] === 'undefined') {
      return _style2.default[className];
    }

    return this.props.classes[className];
  },
  render: function render() {
    return _react2.default.createElement(_style3.Icon, _extends({}, this.props, {
      iconId: this.props.id,
      styled: this.props.styled,
      className: this.getClass('icon') + ' ' + this.props.className,
      dangerouslySetInnerHTML: { __html: _iconList2.default[this.props.id] }
    }));
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/xch-Icon/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 16 */
/***/ (function(module, exports) {

// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
  ? window : typeof self != 'undefined' && self.Math == Math ? self
  // eslint-disable-next-line no-new-func
  : Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef


/***/ }),
/* 17 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* WEBPACK VAR INJECTION */(function(process, module) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "css", function() { return css; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keyframes", function() { return keyframes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "injectGlobal", function() { return injectGlobal; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isStyledComponent", function() { return isStyledComponent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "consolidateStreamedStyles", function() { return consolidateStreamedStyles; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ThemeProvider", function() { return ThemeProvider; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withTheme", function() { return withTheme; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerStyleSheet", function() { return ServerStyleSheet; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StyleSheetManager", function() { return StyleSheetManager; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS", function() { return __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName__ = __webpack_require__(1212);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_stylis__ = __webpack_require__(1387);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_stylis___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_stylis__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet__ = __webpack_require__(1386);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types__ = __webpack_require__(183);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics__ = __webpack_require__(1385);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_is__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_react_is___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_react_is__);








var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
  return typeof obj;
} : function (obj) {
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

var classCallCheck = function (instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
};

var createClass = function () {
  function defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  return function (Constructor, protoProps, staticProps) {
    if (protoProps) defineProperties(Constructor.prototype, protoProps);
    if (staticProps) defineProperties(Constructor, staticProps);
    return Constructor;
  };
}();

var _extends = Object.assign || function (target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i];

    for (var key in source) {
      if (Object.prototype.hasOwnProperty.call(source, key)) {
        target[key] = source[key];
      }
    }
  }

  return target;
};

var inherits = function (subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  }

  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      enumerable: false,
      writable: true,
      configurable: true
    }
  });
  if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
};

var objectWithoutProperties = function (obj, keys) {
  var target = {};

  for (var i in obj) {
    if (keys.indexOf(i) >= 0) continue;
    if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;
    target[i] = obj[i];
  }

  return target;
};

var possibleConstructorReturn = function (self, call) {
  if (!self) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }

  return call && (typeof call === "object" || typeof call === "function") ? call : self;
};

// 
var isPlainObject = (function (x) {
  return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x.constructor === Object;
});

// 


/**
 * Parse errors.md and turn it into a simple hash of code: message
 */
var ERRORS =  true ? {
  "1": "Cannot create styled-component for component: %s.\n\n",
  "2": "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n* Are you trying to reuse it across renders?\n* Are you accidentally calling collectStyles twice?\n\n",
  "3": "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",
  "4": "The `StyleSheetManager` expects a valid target or sheet prop!\n\n* Does this error occur on the client and is your target falsy?\n* Does this error occur on the server and is the sheet falsy?\n\n",
  "5": "The clone method cannot be used on the client!\n\n* Are you running in a client-like environment on the server?\n* Are you trying to run SSR on the client?\n\n",
  "6": "Trying to insert a new style tag, but the given Node is unmounted!\n\n* Are you using a custom target that isn't mounted?\n* Does your document not have a valid head element?\n* Have you accidentally removed a style tag manually?\n\n",
  "7": "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n",
  "8": "ThemeProvider: Please make your \"theme\" prop an object.\n\n",
  "9": "Missing document `<head>`\n\n",
  "10": "Cannot find sheet for given tag\n\n",
  "11": "A plain React class (%s) has been interpolated into styles, probably as a component selector (https://www.styled-components.com/docs/advanced#referring-to-other-components). Only styled-component classes can be targeted in this fashion."
} : {};

/**
 * super basic version of sprintf
 */
function format() {
  for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }

  var a = args[0];
  var b = [];
  var c = void 0;

  for (c = 1; c < args.length; c += 1) {
    b.push(args[c]);
  }

  b.forEach(function (d) {
    a = a.replace(/%[a-z]/, d);
  });

  return a;
}

/**
 * Create an error file out of errors.md for development and a simple web link to the full errors
 * in production mode.
 */

var StyledComponentsError = function (_Error) {
  inherits(StyledComponentsError, _Error);

  function StyledComponentsError(code) {
    classCallCheck(this, StyledComponentsError);

    for (var _len2 = arguments.length, interpolations = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
      interpolations[_key2 - 1] = arguments[_key2];
    }

    if (false) {
      var _this = possibleConstructorReturn(this, _Error.call(this, 'An error occurred. See https://github.com/styled-components/styled-components/blob/master/src/utils/errors.md#' + code + ' for more information. ' + (interpolations ? 'Additional arguments: ' + interpolations.join(', ') : '')));
    } else {
      var _this = possibleConstructorReturn(this, _Error.call(this, format.apply(undefined, [ERRORS[code]].concat(interpolations))));
    }
    return possibleConstructorReturn(_this);
  }

  return StyledComponentsError;
}(Error);

// 

var objToCss = function objToCss(obj, prevKey) {
  var css = Object.keys(obj).filter(function (key) {
    var chunk = obj[key];
    return chunk !== undefined && chunk !== null && chunk !== false && chunk !== '';
  }).map(function (key) {
    if (isPlainObject(obj[key])) return objToCss(obj[key], key);
    return __WEBPACK_IMPORTED_MODULE_0_fbjs_lib_hyphenateStyleName___default()(key) + ': ' + obj[key] + ';';
  }).join(' ');
  return prevKey ? prevKey + ' {\n  ' + css + '\n}' : css;
};

var flatten = function flatten(chunks, executionContext) {
  return chunks.reduce(function (ruleSet, chunk) {
    /* Remove falsey values */
    if (chunk === undefined || chunk === null || chunk === false || chunk === '') {
      return ruleSet;
    }

    /* Flatten ruleSet */
    if (Array.isArray(chunk)) {
      ruleSet.push.apply(ruleSet, flatten(chunk, executionContext));
      return ruleSet;
    }

    /* Handle other components */
    if (chunk.hasOwnProperty('styledComponentId')) {
      // $FlowFixMe not sure how to make this pass
      ruleSet.push('.' + chunk.styledComponentId);
      return ruleSet;
    }

    /* Either execute or defer the function */
    if (typeof chunk === 'function') {
      if (executionContext) {
        var nextChunk = chunk(executionContext);
        /* Throw if a React Element was given styles */
        if (__WEBPACK_IMPORTED_MODULE_1_react___default.a.isValidElement(nextChunk)) {
          var elementName = chunk.displayName || chunk.name;
          throw new StyledComponentsError(11, elementName);
        }
        ruleSet.push.apply(ruleSet, flatten([nextChunk], executionContext));
      } else ruleSet.push(chunk);

      return ruleSet;
    }

    /* Handle objects */
    ruleSet.push(
    // $FlowFixMe have to add %checks somehow to isPlainObject
    isPlainObject(chunk) ? objToCss(chunk) : chunk.toString());

    return ruleSet;
  }, []);
};

// 

var COMMENT_REGEX = /^\s*\/\/.*$/gm;

// NOTE: This stylis instance is only used to split rules from SSR'd style tags
var stylisSplitter = new __WEBPACK_IMPORTED_MODULE_2_stylis___default.a({
  global: false,
  cascade: true,
  keyframe: false,
  prefix: false,
  compress: false,
  semicolon: true
});

var stylis = new __WEBPACK_IMPORTED_MODULE_2_stylis___default.a({
  global: false,
  cascade: true,
  keyframe: false,
  prefix: true,
  compress: false,
  semicolon: false // NOTE: This means "autocomplete missing semicolons"
});

// Wrap `insertRulePlugin to build a list of rules,
// and then make our own plugin to return the rules. This
// makes it easier to hook into the existing SSR architecture

var parsingRules = [];
// eslint-disable-next-line consistent-return
var returnRulesPlugin = function returnRulesPlugin(context) {
  if (context === -2) {
    var parsedRules = parsingRules;
    parsingRules = [];
    return parsedRules;
  }
};

var parseRulesPlugin = __WEBPACK_IMPORTED_MODULE_3_stylis_rule_sheet___default()(function (rule) {
  parsingRules.push(rule);
});

stylis.use([parseRulesPlugin, returnRulesPlugin]);
stylisSplitter.use([parseRulesPlugin, returnRulesPlugin]);

var stringifyRules = function stringifyRules(rules, selector, prefix) {
  var flatCSS = rules.join('').replace(COMMENT_REGEX, ''); // replace JS comments

  var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS;

  return stylis(prefix || !selector ? '' : selector, cssStr);
};

var splitByRules = function splitByRules(css) {
  return stylisSplitter('', css);
};

// 

function isStyledComponent(target) /* : %checks */{
  return (
    // $FlowFixMe TODO: flow for styledComponentId
    typeof target === 'function' && typeof target.styledComponentId === 'string'
  );
}

// 

/* This function is DEPRECATED and will be removed on the next major version release.
 * It was needed to rehydrate all style blocks prepended to chunks before React
 * tries to rehydrate its HTML stream. Since the master StyleSheet will now detect
 * the use of streamed style tags and will perform the rehydration earlier when needed
 * this function will not be needed anymore */
function consolidateStreamedStyles() {
  if (true) {
    // eslint-disable-next-line no-console
    console.warn('styled-components automatically does streaming SSR rehydration now.\n' + 'Calling consolidateStreamedStyles manually is no longer necessary and a noop now.\n' + '- Please remove the consolidateStreamedStyles call from your client.');
  }
}

// 
/* eslint-disable no-bitwise */

/* This is the "capacity" of our alphabet i.e. 2x26 for all letters plus their capitalised
 * counterparts */
var charsLength = 52;

/* start at 75 for 'a' until 'z' (25) and then start at 65 for capitalised letters */
var getAlphabeticChar = function getAlphabeticChar(code) {
  return String.fromCharCode(code + (code > 25 ? 39 : 97));
};

/* input a number, usually a hash and convert it to base-52 */
var generateAlphabeticName = function generateAlphabeticName(code) {
  var name = '';
  var x = void 0;

  /* get a char and divide by alphabet-length */
  for (x = code; x > charsLength; x = Math.floor(x / charsLength)) {
    name = getAlphabeticChar(x % charsLength) + name;
  }

  return getAlphabeticChar(x % charsLength) + name;
};

// 

var interleave = (function (strings, interpolations) {
  var result = [strings[0]];

  for (var i = 0, len = interpolations.length; i < len; i += 1) {
    result.push(interpolations[i], strings[i + 1]);
  }

  return result;
});

// 
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});

// 

var css = (function (styles) {
  for (var _len = arguments.length, interpolations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    interpolations[_key - 1] = arguments[_key];
  }

  if (typeof styles === 'function' || isPlainObject(styles)) {
    // $FlowFixMe
    return flatten(interleave(EMPTY_ARRAY, [styles].concat(interpolations)));
  }

  // $FlowFixMe
  return flatten(interleave(styles, interpolations));
});

// 


var SC_ATTR = typeof process !== 'undefined' && __webpack_require__.i({"NODE_ENV":"development"}).SC_ATTR || 'data-styled-components';
var SC_STREAM_ATTR = 'data-styled-streamed';
var CONTEXT_KEY = '__styled-components-stylesheet__';

var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;

var DISABLE_SPEEDY = "development" !== 'production';

// 
var SC_COMPONENT_ID = /^[^\S\n]*?\/\* sc-component-id:\s*(\S+)\s+\*\//gm;

var extractComps = (function (maybeCSS) {
  var css = '' + (maybeCSS || ''); // Definitely a string, and a clone
  var existingComponents = [];
  css.replace(SC_COMPONENT_ID, function (match, componentId, matchIndex) {
    existingComponents.push({ componentId: componentId, matchIndex: matchIndex });
    return match;
  });
  return existingComponents.map(function (_ref, i) {
    var componentId = _ref.componentId,
        matchIndex = _ref.matchIndex;

    var nextComp = existingComponents[i + 1];
    var cssFromDOM = nextComp ? css.slice(matchIndex, nextComp.matchIndex) : css.slice(matchIndex);
    return { componentId: componentId, cssFromDOM: cssFromDOM };
  });
});

// 
/* eslint-disable camelcase, no-undef */

var getNonce = (function () {
  return  true ? __webpack_require__.nc : null;
});

// 
// Helper to call a given function, only once
var once = (function (cb) {
  var called = false;

  return function () {
    if (!called) {
      called = true;
      cb();
    }
  };
});

// 
/* These are helpers for the StyleTags to keep track of the injected
 * rule names for each (component) ID that they're keeping track of.
 * They're crucial for detecting whether a name has already been
 * injected.
 * (This excludes rehydrated names) */

/* adds a new ID:name pairing to a names dictionary */
var addNameForId = function addNameForId(names, id, name) {
  if (name) {
    // eslint-disable-next-line no-param-reassign
    var namesForId = names[id] || (names[id] = Object.create(null));
    namesForId[name] = true;
  }
};

/* resets an ID entirely by overwriting it in the dictionary */
var resetIdNames = function resetIdNames(names, id) {
  // eslint-disable-next-line no-param-reassign
  names[id] = Object.create(null);
};

/* factory for a names dictionary checking the existance of an ID:name pairing */
var hasNameForId = function hasNameForId(names) {
  return function (id, name) {
    return names[id] !== undefined && names[id][name];
  };
};

/* stringifies names for the html/element output */
var stringifyNames = function stringifyNames(names) {
  var str = '';
  // eslint-disable-next-line guard-for-in
  for (var id in names) {
    str += Object.keys(names[id]).join(' ') + ' ';
  }
  return str.trim();
};

/* clones the nested names dictionary */
var cloneNames = function cloneNames(names) {
  var clone = Object.create(null);
  // eslint-disable-next-line guard-for-in
  for (var id in names) {
    clone[id] = _extends({}, names[id]);
  }
  return clone;
};

// 

/* These are helpers that deal with the insertRule (aka speedy) API
 * They are used in the StyleTags and specifically the speedy tag
 */

/* retrieve a sheet for a given style tag */
var sheetForTag = function sheetForTag(tag) {
  // $FlowFixMe
  if (tag.sheet) return tag.sheet;

  /* Firefox quirk requires us to step through all stylesheets to find one owned by the given tag */
  var size = document.styleSheets.length;
  for (var i = 0; i < size; i += 1) {
    var sheet = document.styleSheets[i];
    // $FlowFixMe
    if (sheet.ownerNode === tag) return sheet;
  }

  /* we should always be able to find a tag */
  throw new StyledComponentsError(10);
};

/* insert a rule safely and return whether it was actually injected */
var safeInsertRule = function safeInsertRule(sheet, cssRule, index) {
  /* abort early if cssRule string is falsy */
  if (!cssRule) return false;

  var maxIndex = sheet.cssRules.length;

  try {
    /* use insertRule and cap passed index with maxIndex (no of cssRules) */
    sheet.insertRule(cssRule, index <= maxIndex ? index : maxIndex);
  } catch (err) {
    /* any error indicates an invalid rule */
    return false;
  }

  return true;
};

/* deletes `size` rules starting from `removalIndex` */
var deleteRules = function deleteRules(sheet, removalIndex, size) {
  var lowerBound = removalIndex - size;
  for (var i = removalIndex; i > lowerBound; i -= 1) {
    sheet.deleteRule(i);
  }
};

// 

/* this marker separates component styles and is important for rehydration */
var makeTextMarker = function makeTextMarker(id) {
  return '\n/* sc-component-id: ' + id + ' */\n';
};

/* add up all numbers in array up until and including the index */
var addUpUntilIndex = function addUpUntilIndex(sizes, index) {
  var totalUpToIndex = 0;
  for (var i = 0; i <= index; i += 1) {
    totalUpToIndex += sizes[i];
  }

  return totalUpToIndex;
};

/* create a new style tag after lastEl */
var makeStyleTag = function makeStyleTag(target, tagEl, insertBefore) {
  var el = document.createElement('style');
  el.setAttribute(SC_ATTR, '');

  var nonce = getNonce();
  if (nonce) {
    el.setAttribute('nonce', nonce);
  }

  /* Work around insertRule quirk in EdgeHTML */
  el.appendChild(document.createTextNode(''));

  if (target && !tagEl) {
    /* Append to target when no previous element was passed */
    target.appendChild(el);
  } else {
    if (!tagEl || !target || !tagEl.parentNode) {
      throw new StyledComponentsError(6);
    }

    /* Insert new style tag after the previous one */
    tagEl.parentNode.insertBefore(el, insertBefore ? tagEl : tagEl.nextSibling);
  }

  return el;
};

/* takes a css factory function and outputs an html styled tag factory */
var wrapAsHtmlTag = function wrapAsHtmlTag(css, names) {
  return function (additionalAttrs) {
    var nonce = getNonce();
    var attrs = [nonce && 'nonce="' + nonce + '"', SC_ATTR + '="' + stringifyNames(names) + '"', additionalAttrs];

    var htmlAttr = attrs.filter(Boolean).join(' ');
    return '<style ' + htmlAttr + '>' + css() + '</style>';
  };
};

/* takes a css factory function and outputs an element factory */
var wrapAsElement = function wrapAsElement(css, names) {
  return function () {
    var _props;

    var props = (_props = {}, _props[SC_ATTR] = stringifyNames(names), _props);

    var nonce = getNonce();
    if (nonce) {
      // $FlowFixMe
      props.nonce = nonce;
    }

    // eslint-disable-next-line react/no-danger
    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement('style', _extends({}, props, { dangerouslySetInnerHTML: { __html: css() } }));
  };
};

var getIdsFromMarkersFactory = function getIdsFromMarkersFactory(markers) {
  return function () {
    return Object.keys(markers);
  };
};

/* speedy tags utilise insertRule */
var makeSpeedyTag = function makeSpeedyTag(el, getImportRuleTag) {
  var names = Object.create(null);
  var markers = Object.create(null);
  var sizes = [];

  var extractImport = getImportRuleTag !== undefined;
  /* indicates whther getImportRuleTag was called */
  var usedImportRuleTag = false;

  var insertMarker = function insertMarker(id) {
    var prev = markers[id];
    if (prev !== undefined) {
      return prev;
    }

    markers[id] = sizes.length;
    sizes.push(0);
    resetIdNames(names, id);

    return markers[id];
  };

  var insertRules = function insertRules(id, cssRules, name) {
    var marker = insertMarker(id);
    var sheet = sheetForTag(el);
    var insertIndex = addUpUntilIndex(sizes, marker);

    var injectedRules = 0;
    var importRules = [];
    var cssRulesSize = cssRules.length;

    for (var i = 0; i < cssRulesSize; i += 1) {
      var cssRule = cssRules[i];
      var mayHaveImport = extractImport; /* @import rules are reordered to appear first */
      if (mayHaveImport && cssRule.indexOf('@import') !== -1) {
        importRules.push(cssRule);
      } else if (safeInsertRule(sheet, cssRule, insertIndex + injectedRules)) {
        mayHaveImport = false;
        injectedRules += 1;
      }
    }

    if (extractImport && importRules.length > 0) {
      usedImportRuleTag = true;
      // $FlowFixMe
      getImportRuleTag().insertRules(id + '-import', importRules);
    }

    sizes[marker] += injectedRules; /* add up no of injected rules */
    addNameForId(names, id, name);
  };

  var removeRules = function removeRules(id) {
    var marker = markers[id];
    if (marker === undefined) return;

    var size = sizes[marker];
    var sheet = sheetForTag(el);
    var removalIndex = addUpUntilIndex(sizes, marker);
    deleteRules(sheet, removalIndex, size);
    sizes[marker] = 0;
    resetIdNames(names, id);

    if (extractImport && usedImportRuleTag) {
      // $FlowFixMe
      getImportRuleTag().removeRules(id + '-import');
    }
  };

  var css = function css() {
    var _sheetForTag = sheetForTag(el),
        cssRules = _sheetForTag.cssRules;

    var str = '';

    // eslint-disable-next-line guard-for-in
    for (var id in markers) {
      str += makeTextMarker(id);
      var marker = markers[id];
      var end = addUpUntilIndex(sizes, marker);
      var size = sizes[marker];
      for (var i = end - size; i < end; i += 1) {
        var rule = cssRules[i];
        if (rule !== undefined) {
          str += rule.cssText;
        }
      }
    }

    return str;
  };

  return {
    styleTag: el,
    getIds: getIdsFromMarkersFactory(markers),
    hasNameForId: hasNameForId(names),
    insertMarker: insertMarker,
    insertRules: insertRules,
    removeRules: removeRules,
    css: css,
    toHTML: wrapAsHtmlTag(css, names),
    toElement: wrapAsElement(css, names),
    clone: function clone() {
      throw new StyledComponentsError(5);
    }
  };
};

var makeTextNode = function makeTextNode(id) {
  return document.createTextNode(makeTextMarker(id));
};

var makeBrowserTag = function makeBrowserTag(el, getImportRuleTag) {
  var names = Object.create(null);
  var markers = Object.create(null);

  var extractImport = getImportRuleTag !== undefined;

  /* indicates whther getImportRuleTag was called */
  var usedImportRuleTag = false;

  var insertMarker = function insertMarker(id) {
    var prev = markers[id];
    if (prev !== undefined) {
      return prev;
    }

    markers[id] = makeTextNode(id);
    el.appendChild(markers[id]);
    names[id] = Object.create(null);

    return markers[id];
  };

  var insertRules = function insertRules(id, cssRules, name) {
    var marker = insertMarker(id);
    var importRules = [];
    var cssRulesSize = cssRules.length;

    for (var i = 0; i < cssRulesSize; i += 1) {
      var rule = cssRules[i];
      var mayHaveImport = extractImport;
      if (mayHaveImport && rule.indexOf('@import') !== -1) {
        importRules.push(rule);
      } else {
        mayHaveImport = false;
        var separator = i === cssRulesSize - 1 ? '' : ' ';
        marker.appendData('' + rule + separator);
      }
    }

    addNameForId(names, id, name);

    if (extractImport && importRules.length > 0) {
      usedImportRuleTag = true;
      // $FlowFixMe
      getImportRuleTag().insertRules(id + '-import', importRules);
    }
  };

  var removeRules = function removeRules(id) {
    var marker = markers[id];
    if (marker === undefined) return;

    /* create new empty text node and replace the current one */
    var newMarker = makeTextNode(id);
    el.replaceChild(newMarker, marker);
    markers[id] = newMarker;
    resetIdNames(names, id);

    if (extractImport && usedImportRuleTag) {
      // $FlowFixMe
      getImportRuleTag().removeRules(id + '-import');
    }
  };

  var css = function css() {
    var str = '';
    // eslint-disable-next-line guard-for-in
    for (var id in markers) {
      str += markers[id].data;
    }
    return str;
  };

  return {
    clone: function clone() {
      throw new StyledComponentsError(5);
    },

    css: css,
    getIds: getIdsFromMarkersFactory(markers),
    hasNameForId: hasNameForId(names),
    insertMarker: insertMarker,
    insertRules: insertRules,
    removeRules: removeRules,
    styleTag: el,
    toElement: wrapAsElement(css, names),
    toHTML: wrapAsHtmlTag(css, names)
  };
};

var makeServerTagInternal = function makeServerTagInternal(namesArg, markersArg) {
  var names = namesArg === undefined ? Object.create(null) : namesArg;
  var markers = markersArg === undefined ? Object.create(null) : markersArg;

  var insertMarker = function insertMarker(id) {
    var prev = markers[id];
    if (prev !== undefined) {
      return prev;
    }

    return markers[id] = [''];
  };

  var insertRules = function insertRules(id, cssRules, name) {
    var marker = insertMarker(id);
    marker[0] += cssRules.join(' ');
    addNameForId(names, id, name);
  };

  var removeRules = function removeRules(id) {
    var marker = markers[id];
    if (marker === undefined) return;
    marker[0] = '';
    resetIdNames(names, id);
  };

  var css = function css() {
    var str = '';
    // eslint-disable-next-line guard-for-in
    for (var id in markers) {
      var cssForId = markers[id][0];
      if (cssForId) {
        str += makeTextMarker(id) + cssForId;
      }
    }
    return str;
  };

  var clone = function clone() {
    var namesClone = cloneNames(names);
    var markersClone = Object.create(null);

    // eslint-disable-next-line guard-for-in
    for (var id in markers) {
      markersClone[id] = [markers[id][0]];
    }

    return makeServerTagInternal(namesClone, markersClone);
  };

  var tag = {
    clone: clone,
    css: css,
    getIds: getIdsFromMarkersFactory(markers),
    hasNameForId: hasNameForId(names),
    insertMarker: insertMarker,
    insertRules: insertRules,
    removeRules: removeRules,
    styleTag: null,
    toElement: wrapAsElement(css, names),
    toHTML: wrapAsHtmlTag(css, names)
  };

  return tag;
};

var makeServerTag = function makeServerTag() {
  return makeServerTagInternal();
};

var makeTag = function makeTag(target, tagEl, forceServer, insertBefore, getImportRuleTag) {
  if (IS_BROWSER && !forceServer) {
    var el = makeStyleTag(target, tagEl, insertBefore);

    if (DISABLE_SPEEDY) {
      return makeBrowserTag(el, getImportRuleTag);
    } else {
      return makeSpeedyTag(el, getImportRuleTag);
    }
  }

  return makeServerTag();
};

/* wraps a given tag so that rehydration is performed once when necessary */
var makeRehydrationTag = function makeRehydrationTag(tag, els, extracted, immediateRehydration) {
  /* rehydration function that adds all rules to the new tag */
  var rehydrate = once(function () {
    /* add all extracted components to the new tag */
    for (var i = 0, len = extracted.length; i < len; i += 1) {
      var _extracted$i = extracted[i],
          componentId = _extracted$i.componentId,
          cssFromDOM = _extracted$i.cssFromDOM;

      var cssRules = splitByRules(cssFromDOM);
      tag.insertRules(componentId, cssRules);
    }

    /* remove old HTMLStyleElements, since they have been rehydrated */
    for (var _i = 0, _len = els.length; _i < _len; _i += 1) {
      var el = els[_i];
      if (el.parentNode) {
        el.parentNode.removeChild(el);
      }
    }
  });

  if (immediateRehydration) rehydrate();

  return _extends({}, tag, {
    /* add rehydration hook to insertion methods */
    insertMarker: function insertMarker(id) {
      rehydrate();
      return tag.insertMarker(id);
    },
    insertRules: function insertRules(id, cssRules, name) {
      rehydrate();
      return tag.insertRules(id, cssRules, name);
    }
  });
};

// 

var SPLIT_REGEX = /\s+/;

/* determine the maximum number of components before tags are sharded */
var MAX_SIZE = void 0;
if (IS_BROWSER) {
  /* in speedy mode we can keep a lot more rules in a sheet before a slowdown can be expected */
  MAX_SIZE = DISABLE_SPEEDY ? 40 : 1000;
} else {
  /* for servers we do not need to shard at all */
  MAX_SIZE = -1;
}

var sheetRunningId = 0;
var master = void 0;

var StyleSheet = function () {
  /* a map from ids to tags */
  /* deferred rules for a given id */
  /* this is used for not reinjecting rules via hasNameForId() */
  /* when rules for an id are removed using remove() we have to ignore rehydratedNames for it */
  /* a list of tags belonging to this StyleSheet */
  /* a tag for import rules */
  /* current capacity until a new tag must be created */
  /* children (aka clones) of this StyleSheet inheriting all and future injections */

  function StyleSheet() {
    var _this = this;

    var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : IS_BROWSER ? document.head : null;
    var forceServer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
    classCallCheck(this, StyleSheet);

    this.getImportRuleTag = function () {
      var importRuleTag = _this.importRuleTag;

      if (importRuleTag !== undefined) {
        return importRuleTag;
      }

      var firstTag = _this.tags[0];
      var insertBefore = true;

      return _this.importRuleTag = makeTag(_this.target, firstTag ? firstTag.styleTag : null, _this.forceServer, insertBefore);
    };

    sheetRunningId += 1;
    this.id = sheetRunningId;
    this.sealed = false;
    this.forceServer = forceServer;
    this.target = forceServer ? null : target;
    this.tagMap = {};
    this.deferred = {};
    this.rehydratedNames = {};
    this.ignoreRehydratedNames = {};
    this.tags = [];
    this.capacity = 1;
    this.clones = [];
  }

  /* rehydrate all SSR'd style tags */


  StyleSheet.prototype.rehydrate = function rehydrate() {
    if (!IS_BROWSER || this.forceServer) {
      return this;
    }

    var els = [];
    var extracted = [];
    var isStreamed = false;

    /* retrieve all of our SSR style elements from the DOM */
    var nodes = document.querySelectorAll('style[' + SC_ATTR + ']');
    var nodesSize = nodes.length;

    /* abort rehydration if no previous style tags were found */
    if (nodesSize === 0) {
      return this;
    }

    for (var i = 0; i < nodesSize; i += 1) {
      // $FlowFixMe: We can trust that all elements in this query are style elements
      var el = nodes[i];

      /* check if style tag is a streamed tag */
      if (!isStreamed) isStreamed = !!el.getAttribute(SC_STREAM_ATTR);

      /* retrieve all component names */
      var elNames = (el.getAttribute(SC_ATTR) || '').trim().split(SPLIT_REGEX);
      var elNamesSize = elNames.length;
      for (var j = 0; j < elNamesSize; j += 1) {
        var name = elNames[j];
        /* add rehydrated name to sheet to avoid readding styles */
        this.rehydratedNames[name] = true;
      }

      /* extract all components and their CSS */
      extracted.push.apply(extracted, extractComps(el.textContent));

      /* store original HTMLStyleElement */
      els.push(el);
    }

    /* abort rehydration if nothing was extracted */
    var extractedSize = extracted.length;
    if (extractedSize === 0) {
      return this;
    }

    /* create a tag to be used for rehydration */
    var tag = this.makeTag(null);
    var rehydrationTag = makeRehydrationTag(tag, els, extracted, isStreamed);

    /* reset capacity and adjust MAX_SIZE by the initial size of the rehydration */
    this.capacity = Math.max(1, MAX_SIZE - extractedSize);
    this.tags.push(rehydrationTag);

    /* retrieve all component ids */
    for (var _j = 0; _j < extractedSize; _j += 1) {
      this.tagMap[extracted[_j].componentId] = rehydrationTag;
    }

    return this;
  };

  /* retrieve a "master" instance of StyleSheet which is typically used when no other is available
   * The master StyleSheet is targeted by injectGlobal, keyframes, and components outside of any
    * StyleSheetManager's context */


  /* reset the internal "master" instance */
  StyleSheet.reset = function reset() {
    var forceServer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

    master = new StyleSheet(undefined, forceServer).rehydrate();
  };

  /* adds "children" to the StyleSheet that inherit all of the parents' rules
   * while their own rules do not affect the parent */


  StyleSheet.prototype.clone = function clone() {
    var sheet = new StyleSheet(this.target, this.forceServer);
    /* add to clone array */
    this.clones.push(sheet);

    /* clone all tags */
    sheet.tags = this.tags.map(function (tag) {
      var ids = tag.getIds();
      var newTag = tag.clone();

      /* reconstruct tagMap */
      for (var i = 0; i < ids.length; i += 1) {
        sheet.tagMap[ids[i]] = newTag;
      }

      return newTag;
    });

    /* clone other maps */
    sheet.rehydratedNames = _extends({}, this.rehydratedNames);
    sheet.deferred = _extends({}, this.deferred);

    return sheet;
  };

  /* force StyleSheet to create a new tag on the next injection */


  StyleSheet.prototype.sealAllTags = function sealAllTags() {
    this.capacity = 1;
    this.sealed = true;
  };

  StyleSheet.prototype.makeTag = function makeTag$$1(tag) {
    var lastEl = tag ? tag.styleTag : null;
    var insertBefore = false;

    return makeTag(this.target, lastEl, this.forceServer, insertBefore, this.getImportRuleTag);
  };

  /* get a tag for a given componentId, assign the componentId to one, or shard */
  StyleSheet.prototype.getTagForId = function getTagForId(id) {
    /* simply return a tag, when the componentId was already assigned one */
    var prev = this.tagMap[id];
    if (prev !== undefined && !this.sealed) {
      return prev;
    }

    var tag = this.tags[this.tags.length - 1];

    /* shard (create a new tag) if the tag is exhausted (See MAX_SIZE) */
    this.capacity -= 1;
    if (this.capacity === 0) {
      this.capacity = MAX_SIZE;
      this.sealed = false;
      tag = this.makeTag(tag);
      this.tags.push(tag);
    }

    return this.tagMap[id] = tag;
  };

  /* mainly for injectGlobal to check for its id */


  StyleSheet.prototype.hasId = function hasId(id) {
    return this.tagMap[id] !== undefined;
  };

  /* caching layer checking id+name to already have a corresponding tag and injected rules */


  StyleSheet.prototype.hasNameForId = function hasNameForId(id, name) {
    /* exception for rehydrated names which are checked separately */
    if (this.ignoreRehydratedNames[id] === undefined && this.rehydratedNames[name]) {
      return true;
    }

    var tag = this.tagMap[id];
    return tag !== undefined && tag.hasNameForId(id, name);
  };

  /* registers a componentId and registers it on its tag */


  StyleSheet.prototype.deferredInject = function deferredInject(id, cssRules) {
    /* don't inject when the id is already registered */
    if (this.tagMap[id] !== undefined) return;

    var clones = this.clones;

    for (var i = 0; i < clones.length; i += 1) {
      clones[i].deferredInject(id, cssRules);
    }

    this.getTagForId(id).insertMarker(id);
    this.deferred[id] = cssRules;
  };

  /* injects rules for a given id with a name that will need to be cached */


  StyleSheet.prototype.inject = function inject(id, cssRules, name) {
    var clones = this.clones;

    for (var i = 0; i < clones.length; i += 1) {
      clones[i].inject(id, cssRules, name);
    }

    var tag = this.getTagForId(id);

    /* add deferred rules for component */
    if (this.deferred[id] !== undefined) {
      // Combine passed cssRules with previously deferred CSS rules
      // NOTE: We cannot mutate the deferred array itself as all clones
      // do the same (see clones[i].inject)
      var rules = this.deferred[id].concat(cssRules);
      tag.insertRules(id, rules, name);
      this.deferred[id] = undefined;
    } else {
      tag.insertRules(id, cssRules, name);
    }
  };

  /* removes all rules for a given id, which doesn't remove its marker but resets it */


  StyleSheet.prototype.remove = function remove(id) {
    var tag = this.tagMap[id];
    if (tag === undefined) return;

    var clones = this.clones;

    for (var i = 0; i < clones.length; i += 1) {
      clones[i].remove(id);
    }

    /* remove all rules from the tag */
    tag.removeRules(id);
    /* ignore possible rehydrated names */
    this.ignoreRehydratedNames[id] = true;
    /* delete possible deferred rules */
    this.deferred[id] = undefined;
  };

  StyleSheet.prototype.toHTML = function toHTML() {
    return this.tags.map(function (tag) {
      return tag.toHTML();
    }).join('');
  };

  StyleSheet.prototype.toReactElements = function toReactElements() {
    var id = this.id;


    return this.tags.map(function (tag, i) {
      var key = 'sc-' + id + '-' + i;
      return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_react__["cloneElement"])(tag.toElement(), { key: key });
    });
  };

  createClass(StyleSheet, null, [{
    key: 'master',
    get: function get$$1() {
      return master || (master = new StyleSheet().rehydrate());
    }

    /* NOTE: This is just for backwards-compatibility with jest-styled-components */

  }, {
    key: 'instance',
    get: function get$$1() {
      return StyleSheet.master;
    }
  }]);
  return StyleSheet;
}();

var _StyleSheetManager$ch;

var StyleSheetManager = function (_Component) {
  inherits(StyleSheetManager, _Component);

  function StyleSheetManager() {
    classCallCheck(this, StyleSheetManager);
    return possibleConstructorReturn(this, _Component.apply(this, arguments));
  }

  StyleSheetManager.prototype.getChildContext = function getChildContext() {
    var _ref;

    return _ref = {}, _ref[CONTEXT_KEY] = this.sheetInstance, _ref;
  };

  StyleSheetManager.prototype.componentWillMount = function componentWillMount() {
    if (this.props.sheet) {
      this.sheetInstance = this.props.sheet;
    } else if (this.props.target) {
      this.sheetInstance = new StyleSheet(this.props.target);
    } else {
      throw new StyledComponentsError(4);
    }
  };

  StyleSheetManager.prototype.render = function render() {
    /* eslint-disable react/prop-types */
    // Flow v0.43.1 will report an error accessing the `children` property,
    // but v0.47.0 will not. It is necessary to use a type cast instead of
    // a "fixme" comment to satisfy both Flow versions.
    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
  };

  return StyleSheetManager;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);

StyleSheetManager.childContextTypes = (_StyleSheetManager$ch = {}, _StyleSheetManager$ch[CONTEXT_KEY] = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(ServerStyleSheet)]).isRequired, _StyleSheetManager$ch);
 true ? StyleSheetManager.propTypes = {
  sheet: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(ServerStyleSheet)]),
  target: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({
    appendChild: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func.isRequired
  })
} : void 0;

// 

var ServerStyleSheet = function () {
  function ServerStyleSheet() {
    classCallCheck(this, ServerStyleSheet);

    /* The master sheet might be reset, so keep a reference here */
    this.masterSheet = StyleSheet.master;
    this.instance = this.masterSheet.clone();
    this.closed = false;
  }

  ServerStyleSheet.prototype.complete = function complete() {
    if (!this.closed) {
      /* Remove closed StyleSheets from the master sheet */
      var index = this.masterSheet.clones.indexOf(this.instance);
      this.masterSheet.clones.splice(index, 1);
      this.closed = true;
    }
  };

  ServerStyleSheet.prototype.collectStyles = function collectStyles(children) {
    if (this.closed) {
      throw new StyledComponentsError(2);
    }

    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(
      StyleSheetManager,
      { sheet: this.instance },
      children
    );
  };

  ServerStyleSheet.prototype.getStyleTags = function getStyleTags() {
    this.complete();
    return this.instance.toHTML();
  };

  ServerStyleSheet.prototype.getStyleElement = function getStyleElement() {
    this.complete();
    return this.instance.toReactElements();
  };

  ServerStyleSheet.prototype.interleaveWithNodeStream = function interleaveWithNodeStream(readableStream) {
    var _this = this;

    {
      throw new StyledComponentsError(3);
    }

    /* the tag index keeps track of which tags have already been emitted */
    var instance = this.instance;

    var instanceTagIndex = 0;

    var streamAttr = SC_STREAM_ATTR + '="true"';

    var transformer = new stream.Transform({
      transform: function appendStyleChunks(chunk, /* encoding */_, callback) {
        var tags = instance.tags;

        var html = '';

        /* retrieve html for each new style tag */
        for (; instanceTagIndex < tags.length; instanceTagIndex += 1) {
          var tag = tags[instanceTagIndex];
          html += tag.toHTML(streamAttr);
        }

        /* force our StyleSheets to emit entirely new tags */
        instance.sealAllTags();

        /* prepend style html to chunk */
        this.push(html + chunk);
        callback();
      }
    });

    readableStream.on('end', function () {
      return _this.complete();
    });
    readableStream.on('error', function (err) {
      _this.complete();

      // forward the error to the transform stream
      transformer.emit('error', err);
    });

    return readableStream.pipe(transformer);
  };

  return ServerStyleSheet;
}();

// 

var LIMIT = 200;

var createWarnTooManyClasses = (function (displayName) {
  var generatedClasses = {};
  var warningSeen = false;

  return function (className) {
    if (!warningSeen) {
      generatedClasses[className] = true;
      if (Object.keys(generatedClasses).length >= LIMIT) {
        // Unable to find latestRule in test environment.
        /* eslint-disable no-console, prefer-template */
        console.warn('Over ' + LIMIT + ' classes were generated for component ' + displayName + '. \n' + 'Consider using the attrs method, together with a style object for frequently changed styles.\n' + 'Example:\n' + '  const Component = styled.div.attrs({\n' + '    style: ({ background }) => ({\n' + '      background,\n' + '    }),\n' + '  })`width: 100%;`\n\n' + '  <Component />');
        warningSeen = true;
        generatedClasses = {};
      }
    }
  };
});

// 

var determineTheme = (function (props, fallbackTheme, defaultProps) {
  // Props should take precedence over ThemeProvider, which should take precedence over
  // defaultProps, but React automatically puts defaultProps on props.

  /* eslint-disable react/prop-types */
  var isDefaultTheme = defaultProps && props.theme === defaultProps.theme;
  var theme = props.theme && !isDefaultTheme ? props.theme : fallbackTheme;
  /* eslint-enable */

  return theme;
});

// 
var escapeRegex = /[[\].#*$><+~=|^:(),"'`-]+/g;
var dashesAtEnds = /(^-|-$)/g;

/**
 * TODO: Explore using CSS.escape when it becomes more available
 * in evergreen browsers.
 */
function escape(str) {
  return str
  // Replace all possible CSS selectors
  .replace(escapeRegex, '-')

  // Remove extraneous hyphens at the start and end
  .replace(dashesAtEnds, '');
}

// 

function getComponentName(target) {
  return target.displayName || target.name || 'Component';
}

// 

function isTag(target) /* : %checks */{
  return typeof target === 'string';
}

// 

function generateDisplayName(target) {
  return isTag(target) ? 'styled.' + target : 'Styled(' + getComponentName(target) + ')';
}

// 
/* eslint-disable max-len */
/**
 * Trying to avoid the unknown-prop errors on styled components by filtering by
 * React's attribute whitelist.
 *
 * To regenerate this regex:
 *
 * 1. `npm i -g regexgen` (https://github.com/devongovett/regexgen)
 * 2. Run `regexgen` with the list of space-separated words below as input
 * 3. Surround the emitted regex with this: `/^(GENERATED_REGEX)$/` -- this will ensure a full string match
 *    and no false positives from partials
 * */
/*
children dangerouslySetInnerHTML key ref autoFocus defaultValue valueLink defaultChecked checkedLink innerHTML suppressContentEditableWarning onFocusIn onFocusOut className onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onInvalid onSubmit onReset onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onAnimationStart onAnimationEnd onAnimationIteration onTransitionEnd onCopyCapture onCutCapture onPasteCapture onCompositionEndCapture onCompositionStartCapture onCompositionUpdateCapture onKeyDownCapture onKeyPressCapture onKeyUpCapture onFocusCapture onBlurCapture onChangeCapture onInputCapture onSubmitCapture onResetCapture onClickCapture onContextMenuCapture onDoubleClickCapture onDragCapture onDragEndCapture onDragEnterCapture onDragExitCapture onDragLeaveCapture onDragOverCapture onDragStartCapture onDropCapture onMouseDownCapture onMouseEnterCapture onMouseLeaveCapture onMouseMoveCapture onMouseOutCapture onMouseOverCapture onMouseUpCapture onSelectCapture onTouchCancelCapture onTouchEndCapture onTouchMoveCapture onTouchStartCapture onScrollCapture onWheelCapture onAbortCapture onCanPlayCapture onCanPlayThroughCapture onDurationChangeCapture onEmptiedCapture onEncryptedCapture onEndedCapture onErrorCapture onLoadedDataCapture onLoadedMetadataCapture onLoadStartCapture onPauseCapture onPlayCapture onPlayingCapture onProgressCapture onRateChangeCapture onSeekedCapture onSeekingCapture onStalledCapture onSuspendCapture onTimeUpdateCapture onVolumeChangeCapture onWaitingCapture onLoadCapture onAnimationStartCapture onAnimationEndCapture onAnimationIterationCapture onTransitionEndCapture accept acceptCharset accessKey action allowFullScreen allowTransparency alt as async autoComplete autoPlay capture cellPadding cellSpacing charSet challenge checked cite classID className cols colSpan content contentEditable contextMenu controlsList controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name nonce noValidate open optimum pattern placeholder playsInline poster preload profile radioGroup readOnly referrerPolicy rel required reversed role rows rowSpan sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap about datatype inlist prefix property resource typeof vocab autoCapitalize autoCorrect autoSave color itemProp itemScope itemType itemID itemRef results security unselectable accentHeight accumulate additive alignmentBaseline allowReorder alphabetic amplitude arabicForm ascent attributeName attributeType autoReverse azimuth baseFrequency baseProfile baselineShift bbox begin bias by calcMode capHeight clip clipPath clipRule clipPathUnits colorInterpolation colorInterpolationFilters colorProfile colorRendering contentScriptType contentStyleType cursor cx cy d decelerate descent diffuseConstant direction display divisor dominantBaseline dur dx dy edgeMode elevation enableBackground end exponent externalResourcesRequired fill fillOpacity fillRule filter filterRes filterUnits floodColor floodOpacity focusable fontFamily fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontWeight format from fx fy g1 g2 glyphName glyphOrientationHorizontal glyphOrientationVertical glyphRef gradientTransform gradientUnits hanging horizAdvX horizOriginX ideographic imageRendering in in2 intercept k k1 k2 k3 k4 kernelMatrix kernelUnitLength kerning keyPoints keySplines keyTimes lengthAdjust letterSpacing lightingColor limitingConeAngle local markerEnd markerMid markerStart markerHeight markerUnits markerWidth mask maskContentUnits maskUnits mathematical mode numOctaves offset opacity operator order orient orientation origin overflow overlinePosition overlineThickness paintOrder panose1 pathLength patternContentUnits patternTransform patternUnits pointerEvents points pointsAtX pointsAtY pointsAtZ preserveAlpha preserveAspectRatio primitiveUnits r radius refX refY renderingIntent repeatCount repeatDur requiredExtensions requiredFeatures restart result rotate rx ry scale seed shapeRendering slope spacing specularConstant specularExponent speed spreadMethod startOffset stdDeviation stemh stemv stitchTiles stopColor stopOpacity strikethroughPosition strikethroughThickness string stroke strokeDasharray strokeDashoffset strokeLinecap strokeLinejoin strokeMiterlimit strokeOpacity strokeWidth surfaceScale systemLanguage tableValues targetX targetY textAnchor textDecoration textRendering textLength to transform u1 u2 underlinePosition underlineThickness unicode unicodeBidi unicodeRange unitsPerEm vAlphabetic vHanging vIdeographic vMathematical values vectorEffect version vertAdvY vertOriginX vertOriginY viewBox viewTarget visibility widths wordSpacing writingMode x xHeight x1 x2 xChannelSelector xlinkActuate xlinkArcrole xlinkHref xlinkRole xlinkShow xlinkTitle xlinkType xmlBase xmlns xmlnsXlink xmlLang xmlSpace y y1 y2 yChannelSelector z zoomAndPan onPointerDown onPointerMove onPointerUp onPointerCancel onGotPointerCapture onLostPointerCapture onPointerEnter onPointerLeave onPointerOver onPointerOut class for autofocus
*/
/* eslint-enable max-len */

var ATTRIBUTE_REGEX = /^((?:s(?:uppressContentEditableWarn|croll|pac)|(?:shape|image|text)Render|(?:letter|word)Spac|vHang|hang)ing|(?:on(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:Animation|Touch|Load|Drag)Start|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|Lo(?:stPointer|ad)|TimeUpdate|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|GotPointer|MouseDown|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|KeyPress|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|P(?:rogress|laying)|DragEnd|Key(?:Down|Up)|(?:MouseU|Dro)p|(?:Wait|Seek)ing|Scroll|Focus|Paste|Abort|Drag|Play|Blur)Captur|alignmentBaselin|(?:limitingConeAng|xlink(?:(?:Arcr|R)o|Tit)|s(?:urfaceSca|ty|ca)|unselectab|baseProfi|fontSty|(?:focus|dragg)ab|multip|profi|tit)l|d(?:ominantBaselin|efaultValu)|onPointerLeav|a(?:uto(?:Capitaliz|Revers|Sav)|dditiv)|(?:(?:formNoValid|xlinkActu|noValid|accumul|rot)a|autoComple|decelera)t|(?:(?:attribute|item)T|datat)yp|onPointerMov|(?:attribute|glyph)Nam|playsInlin|(?:writing|input|edge)Mod|(?:formE|e)ncTyp|(?:amplitu|mo)d|(?:xlinkTy|itemSco|keyTy|slo)p|(?:xmlSpa|non)c|fillRul|(?:dateTi|na)m|r(?:esourc|ol)|xmlBas|wmod)e|(?:glyphOrientationHorizont|loc)al|(?:externalResourcesRequir|select|revers|mut)ed|c(?:o(?:lorInterpolationFilter|ord)s|o(?:lor(?:Interpolation)?|nt(?:rols|ent))|(?:ontentS(?:cript|tyle)Typ|o(?:ntentEditab|lorProfi)l|l(?:assNam|ipRul)|a(?:lcMod|ptur)|it)e|olorRendering|l(?:ipPathUnits|assID)|(?:ontrolsLis|apHeigh)t|h(?:eckedLink|a(?:llenge|rSet)|ildren|ecked)|ell(?:Spac|Padd)ing|o(?:ntextMenu|ls)|(?:rossOrigi|olSpa)n|l(?:ip(?:Path)?|ass)|ursor|[xy])|glyphOrientationVertical|d(?:angerouslySetInnerHTML|efaultChecked|ownload|isabled|isplay|[xy])|(?:s(?:trikethroughThickn|eaml)es|(?:und|ov)erlineThicknes|r(?:equiredExtension|adiu)|(?:requiredFeatur|tableValu|stitchTil|numOctav|filterR)e|key(?:(?:Splin|Tim)e|Param)|auto[Ff]ocu|header|bia)s|(?:(?:st(?:rikethroughPosi|dDevia)|(?:und|ov)erlinePosi|(?:textDecor|elev)a|orienta)tio|(?:strokeLinejo|orig)i|on(?:PointerDow|FocusI)|formActio|zoomAndPa|directio|(?:vers|act)io|rowSpa|begi|ico)n|o(?:n(?:AnimationIteration|C(?:o(?:mposition(?:Update|Start|End)|ntextMenu|py)|anPlayThrough|anPlay|hange|lick|ut)|(?:(?:Duration|Volume|Rate)Chang|(?:MouseLea|(?:Touch|Mouse)Mo|DragLea)v|Paus)e|Loaded(?:Metad|D)ata|(?:Animation|Touch|Load|Drag)Start|(?:(?:T(?:ransition|ouch)|Animation)E|Suspe)nd|DoubleClick|(?:TouchCanc|Whe)el|(?:Mouse(?:Ent|Ov)e|Drag(?:Ent|Ov)e|Erro)r|TimeUpdate|(?:E(?:n(?:crypt|d)|mpti)|S(?:tall|eek))ed|MouseDown|P(?:rogress|laying)|(?:MouseOu|DragExi|S(?:elec|ubmi)|Rese|Inpu)t|KeyPress|DragEnd|Key(?:Down|Up)|(?:Wait|Seek)ing|(?:MouseU|Dro)p|Scroll|Paste|Focus|Abort|Drag|Play|Load|Blur)|rient)|p(?:reserveA(?:spectRatio|lpha)|ointsAt[X-Z]|anose1)|(?:patternContent|ma(?:sk(?:Content)?|rker)|primitive|gradient|pattern|filter)Units|(?:(?:allowTranspar|baseFrequ)enc|re(?:ferrerPolic|adOnl)|(?:(?:st(?:roke|op)O|floodO|fillO|o)pac|integr|secur)it|visibilit|fontFamil|accessKe|propert|summar)y|(?:gradientT|patternT|t)ransform|(?:[xy]ChannelSelect|lightingCol|textAnch|floodCol|stopCol|operat|htmlF)or|(?:strokeMiterlimi|(?:specularConsta|repeatCou|fontVaria)n|(?:(?:specularE|e)xpon|renderingInt|asc)en|d(?:iffuseConsta|esce)n|(?:fontSizeAdju|lengthAdju|manife)s|baselineShif|onPointerOu|vectorEffec|(?:(?:mar(?:ker|gin)|x)H|accentH|fontW)eigh|markerStar|a(?:utoCorrec|bou)|onFocusOu|intercep|restar|forma|inlis|heigh|lis)t|(?:(?:st(?:rokeDasho|artO)|o)ffs|acceptChars|formTarg|viewTarg|srcS)et|k(?:ernel(?:UnitLength|Matrix)|[1-4])|(?:(?:enableBackgrou|markerE)n|s(?:p(?:readMetho|ee)|ee)|formMetho|(?:markerM|onInval)i|preloa|metho|kin)d|strokeDasharray|(?:onPointerCanc|lab)el|(?:allowFullScre|hidd)en|systemLanguage|(?:(?:o(?:nPointer(?:Ent|Ov)|rd)|allowReord|placehold|frameBord|paintOrd|post)e|repeatDu|d(?:efe|u))r|v(?:Mathematical|ert(?:Origin[XY]|AdvY)|alues|ocab)|(?:pointerEve|keyPoi)nts|(?:strokeLineca|onPointerU|itemPro|useMa|wra|loo)p|h(?:oriz(?:Origin|Adv)X|ttpEquiv)|(?:vI|i)deographic|unicodeRange|mathematical|vAlphabetic|u(?:nicodeBidi|[12])|(?:fontStretc|hig)h|(?:(?:mar(?:ker|gin)W|strokeW)id|azimu)th|(?:xmlnsXl|valueL)ink|mediaGroup|spellCheck|(?:text|m(?:in|ax))Length|(?:unitsPerE|optimu|fro)m|r(?:adioGroup|e(?:sults|f[XY]|l)|ows|[xy])|a(?:rabicForm|l(?:phabetic|t)|sync)|pathLength|innerHTML|xlinkShow|(?:xlinkHr|glyphR)ef|(?:tabInde|(?:sand|b)bo|viewBo)x|(?:(?:href|xml|src)La|kerni)ng|autoPlay|o(?:verflow|pen)|f(?:o(?:ntSize|rm?)|il(?:ter|l))|r(?:e(?:quired|sult|f))?|divisor|p(?:attern|oints)|unicode|d(?:efault|ata|ir)?|i(?:temRef|n2|s)|t(?:arget[XY]|o)|srcDoc|s(?:coped|te(?:m[hv]|p)|pan)|(?:width|size)s|prefix|typeof|itemID|s(?:t(?:roke|art)|hape|cope|rc)|t(?:arget|ype)|(?:stri|la)ng|a(?:ccept|s)|m(?:edia|a(?:sk|x)|in)|x(?:mlns)?|width|value|size|href|k(?:ey)?|end|low|by|i[dn]|y[12]|g[12]|x[12]|f[xy]|[yz])$/;

/* From DOMProperty */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
var isCustomAttribute = RegExp.prototype.test.bind(new RegExp('^(x|data|aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'));

var validAttr = (function (name) {
  return ATTRIBUTE_REGEX.test(name) || isCustomAttribute(name.toLowerCase());
});

// 

function hasInInheritanceChain(child, parent) {
  var target = child;

  while (target) {
    target = Object.getPrototypeOf(target);

    if (target && target === parent) {
      return true;
    }
  }

  return false;
}

// 
/**
 * Creates a broadcast that can be listened to, i.e. simple event emitter
 *
 * @see https://github.com/ReactTraining/react-broadcast
 */

var createBroadcast = function createBroadcast(initialState) {
  var listeners = {};
  var id = 0;
  var state = initialState;

  function publish(nextState) {
    state = nextState;

    // eslint-disable-next-line guard-for-in, no-restricted-syntax
    for (var key in listeners) {
      var listener = listeners[key];
      if (listener === undefined) {
        // eslint-disable-next-line no-continue
        continue;
      }

      listener(state);
    }
  }

  function subscribe(listener) {
    var currentId = id;
    listeners[currentId] = listener;
    id += 1;
    listener(state);
    return currentId;
  }

  function unsubscribe(unsubID) {
    listeners[unsubID] = undefined;
  }

  return { publish: publish, subscribe: subscribe, unsubscribe: unsubscribe };
};

var _contextShape, _ThemeProvider$contex;

// NOTE: DO NOT CHANGE, changing this is a semver major change!
var CHANNEL = '__styled-components__';
var CHANNEL_NEXT = CHANNEL + 'next__';

var CONTEXT_CHANNEL_SHAPE = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.shape({
  getTheme: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
  subscribe: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func,
  unsubscribe: __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func
});

var contextShape = (_contextShape = {}, _contextShape[CHANNEL] = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.func, _contextShape[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _contextShape);

var warnChannelDeprecated = void 0;
if (true) {
  warnChannelDeprecated = once(function () {
    // eslint-disable-next-line no-console
    console.warn('Warning: Usage of `context.' + CHANNEL + '` as a function is deprecated. It will be replaced with the object on `.context.' + CHANNEL_NEXT + '` in a future version.');
  });
}

var isFunction = function isFunction(test) {
  return typeof test === 'function';
};

/**
 * Provide a theme to an entire react component tree via context and event listeners (have to do
 * both context and event emitter as pure components block context updates)
 */

var ThemeProvider = function (_Component) {
  inherits(ThemeProvider, _Component);

  function ThemeProvider() {
    classCallCheck(this, ThemeProvider);

    var _this = possibleConstructorReturn(this, _Component.call(this));

    _this.unsubscribeToOuterId = -1;

    _this.getTheme = _this.getTheme.bind(_this);
    return _this;
  }

  ThemeProvider.prototype.componentWillMount = function componentWillMount() {
    var _this2 = this;

    // If there is a ThemeProvider wrapper anywhere around this theme provider, merge this theme
    // with the outer theme
    var outerContext = this.context[CHANNEL_NEXT];
    if (outerContext !== undefined) {
      this.unsubscribeToOuterId = outerContext.subscribe(function (theme) {
        _this2.outerTheme = theme;

        if (_this2.broadcast !== undefined) {
          _this2.publish(_this2.props.theme);
        }
      });
    }

    this.broadcast = createBroadcast(this.getTheme());
  };

  ThemeProvider.prototype.getChildContext = function getChildContext() {
    var _this3 = this,
        _babelHelpers$extends;

    return _extends({}, this.context, (_babelHelpers$extends = {}, _babelHelpers$extends[CHANNEL_NEXT] = {
      getTheme: this.getTheme,
      subscribe: this.broadcast.subscribe,
      unsubscribe: this.broadcast.unsubscribe
    }, _babelHelpers$extends[CHANNEL] = function (subscriber) {
      if (true) {
        warnChannelDeprecated();
      }

      // Patch the old `subscribe` provide via `CHANNEL` for older clients.
      var unsubscribeId = _this3.broadcast.subscribe(subscriber);
      return function () {
        return _this3.broadcast.unsubscribe(unsubscribeId);
      };
    }, _babelHelpers$extends));
  };

  ThemeProvider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
    if (this.props.theme !== nextProps.theme) {
      this.publish(nextProps.theme);
    }
  };

  ThemeProvider.prototype.componentWillUnmount = function componentWillUnmount() {
    if (this.unsubscribeToOuterId !== -1) {
      this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeToOuterId);
    }
  };

  // Get the theme from the props, supporting both (outerTheme) => {} as well as object notation


  ThemeProvider.prototype.getTheme = function getTheme(passedTheme) {
    var theme = passedTheme || this.props.theme;

    if (isFunction(theme)) {
      var mergedTheme = theme(this.outerTheme);

      if ("development" !== 'production' && (mergedTheme === null || Array.isArray(mergedTheme) || (typeof mergedTheme === 'undefined' ? 'undefined' : _typeof(mergedTheme)) !== 'object')) {
        throw new StyledComponentsError(7);
      }

      return mergedTheme;
    }

    if (theme === null || Array.isArray(theme) || (typeof theme === 'undefined' ? 'undefined' : _typeof(theme)) !== 'object') {
      throw new StyledComponentsError(8);
    }

    return _extends({}, this.outerTheme, theme);
  };

  ThemeProvider.prototype.publish = function publish(theme) {
    this.broadcast.publish(this.getTheme(theme));
  };

  ThemeProvider.prototype.render = function render() {
    if (!this.props.children) {
      return null;
    }

    return __WEBPACK_IMPORTED_MODULE_1_react___default.a.Children.only(this.props.children);
  };

  return ThemeProvider;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);

ThemeProvider.childContextTypes = contextShape;
ThemeProvider.contextTypes = (_ThemeProvider$contex = {}, _ThemeProvider$contex[CHANNEL_NEXT] = CONTEXT_CHANNEL_SHAPE, _ThemeProvider$contex);

var _babelHelpers$extends;

// HACK for generating all static styles without needing to allocate
// an empty execution context every single time...
var STATIC_EXECUTION_CONTEXT = {};

var modifiedContextShape = _extends({}, contextShape, (_babelHelpers$extends = {}, _babelHelpers$extends[CONTEXT_KEY] = __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(StyleSheet), __WEBPACK_IMPORTED_MODULE_4_prop_types___default.a.instanceOf(ServerStyleSheet)]), _babelHelpers$extends));

var identifiers = {};

/* We depend on components having unique IDs */
var generateId = function generateId(ComponentStyle, _displayName, parentComponentId) {
  var displayName = typeof _displayName !== 'string' ? 'sc' : escape(_displayName);

  /**
   * This ensures uniqueness if two components happen to share
   * the same displayName.
   */
  var nr = (identifiers[displayName] || 0) + 1;
  identifiers[displayName] = nr;

  var componentId = displayName + '-' + ComponentStyle.generateName(displayName + nr);

  return parentComponentId !== undefined ? parentComponentId + '-' + componentId : componentId;
};

var warnExtendDeprecated = function warnExtendDeprecated() {};
if (true) {
  warnExtendDeprecated = once(function () {
    // eslint-disable-next-line no-console
    console.warn('Warning: The "extend" API will be removed in the upcoming v4.0 release. Use styled(StyledComponent) instead. You can find more information here: https://github.com/styled-components/styled-components/issues/1546');
  });
}

// $FlowFixMe

var BaseStyledComponent = function (_Component) {
  inherits(BaseStyledComponent, _Component);

  function BaseStyledComponent() {
    var _temp, _this, _ret;

    classCallCheck(this, BaseStyledComponent);

    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return _ret = (_temp = (_this = possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.attrs = {}, _this.state = {
      theme: null,
      generatedClassName: ''
    }, _this.unsubscribeId = -1, _temp), possibleConstructorReturn(_this, _ret);
  }

  BaseStyledComponent.prototype.unsubscribeFromContext = function unsubscribeFromContext() {
    if (this.unsubscribeId !== -1) {
      this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId);
    }
  };

  BaseStyledComponent.prototype.buildExecutionContext = function buildExecutionContext(theme, props) {
    var attrs = this.constructor.attrs;

    var context = _extends({}, props, { theme: theme });
    if (attrs === undefined) {
      return context;
    }

    this.attrs = Object.keys(attrs).reduce(function (acc, key) {
      var attr = attrs[key];

      // eslint-disable-next-line no-param-reassign
      acc[key] = typeof attr === 'function' && !hasInInheritanceChain(attr, __WEBPACK_IMPORTED_MODULE_1_react__["Component"]) ? attr(context) : attr;
      return acc;
    }, {});

    return _extends({}, context, this.attrs);
  };

  BaseStyledComponent.prototype.generateAndInjectStyles = function generateAndInjectStyles(theme, props) {
    var _constructor = this.constructor,
        attrs = _constructor.attrs,
        componentStyle = _constructor.componentStyle,
        warnTooManyClasses = _constructor.warnTooManyClasses;

    var styleSheet = this.context[CONTEXT_KEY] || StyleSheet.master;

    // statically styled-components don't need to build an execution context object,
    // and shouldn't be increasing the number of class names
    if (componentStyle.isStatic && attrs === undefined) {
      return componentStyle.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, styleSheet);
    } else {
      var executionContext = this.buildExecutionContext(theme, props);
      var className = componentStyle.generateAndInjectStyles(executionContext, styleSheet);

      if ("development" !== 'production' && warnTooManyClasses !== undefined) {
        warnTooManyClasses(className);
      }

      return className;
    }
  };

  BaseStyledComponent.prototype.componentWillMount = function componentWillMount() {
    var _this2 = this;

    var componentStyle = this.constructor.componentStyle;

    var styledContext = this.context[CHANNEL_NEXT];

    // If this is a statically-styled component, we don't need to the theme
    // to generate or build styles.
    if (componentStyle.isStatic) {
      var generatedClassName = this.generateAndInjectStyles(STATIC_EXECUTION_CONTEXT, this.props);
      this.setState({ generatedClassName: generatedClassName });
      // If there is a theme in the context, subscribe to the event emitter. This
      // is necessary due to pure components blocking context updates, this circumvents
      // that by updating when an event is emitted
    } else if (styledContext !== undefined) {
      var subscribe = styledContext.subscribe;

      this.unsubscribeId = subscribe(function (nextTheme) {
        // This will be called once immediately
        var theme = determineTheme(_this2.props, nextTheme, _this2.constructor.defaultProps);

        var generatedClassName = _this2.generateAndInjectStyles(theme, _this2.props);

        _this2.setState({ theme: theme, generatedClassName: generatedClassName });
      });
    } else {
      // eslint-disable-next-line react/prop-types
      var theme = this.props.theme || EMPTY_OBJECT;
      var _generatedClassName = this.generateAndInjectStyles(theme, this.props);
      this.setState({ theme: theme, generatedClassName: _generatedClassName });
    }
  };

  BaseStyledComponent.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
    var _this3 = this;

    // If this is a statically-styled component, we don't need to listen to
    // props changes to update styles
    var componentStyle = this.constructor.componentStyle;

    if (componentStyle.isStatic) {
      return;
    }

    this.setState(function (prevState) {
      var theme = determineTheme(nextProps, prevState.theme, _this3.constructor.defaultProps);
      var generatedClassName = _this3.generateAndInjectStyles(theme, nextProps);

      return { theme: theme, generatedClassName: generatedClassName };
    });
  };

  BaseStyledComponent.prototype.componentWillUnmount = function componentWillUnmount() {
    this.unsubscribeFromContext();
  };

  BaseStyledComponent.prototype.render = function render() {
    // eslint-disable-next-line react/prop-types
    var innerRef = this.props.innerRef;
    var generatedClassName = this.state.generatedClassName;
    var _constructor2 = this.constructor,
        styledComponentId = _constructor2.styledComponentId,
        target = _constructor2.target;


    var isTargetTag = isTag(target);

    var className = [
    // eslint-disable-next-line react/prop-types
    this.props.className, styledComponentId, this.attrs.className, generatedClassName].filter(Boolean).join(' ');

    var baseProps = _extends({}, this.attrs, {
      className: className
    });

    if (isStyledComponent(target)) {
      baseProps.innerRef = innerRef;
    } else {
      baseProps.ref = innerRef;
    }

    var propsForElement = baseProps;
    var key = void 0;

    for (key in this.props) {
      // Don't pass through non HTML tags through to HTML elements
      // always omit innerRef
      if (key !== 'innerRef' && key !== 'className' && (!isTargetTag || validAttr(key))) {
        propsForElement[key] = key === 'style' && key in this.attrs ? _extends({}, this.attrs[key], this.props[key]) : this.props[key];
      }
    }

    return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_react__["createElement"])(target, propsForElement);
  };

  return BaseStyledComponent;
}(__WEBPACK_IMPORTED_MODULE_1_react__["Component"]);

var _StyledComponent = (function (ComponentStyle, constructWithOptions) {
  var createStyledComponent = function createStyledComponent(target, options, rules) {
    var _options$isClass = options.isClass,
        isClass = _options$isClass === undefined ? !isTag(target) : _options$isClass,
        _options$displayName = options.displayName,
        displayName = _options$displayName === undefined ? generateDisplayName(target) : _options$displayName,
        _options$componentId = options.componentId,
        componentId = _options$componentId === undefined ? generateId(ComponentStyle, options.displayName, options.parentComponentId) : _options$componentId,
        _options$ParentCompon = options.ParentComponent,
        ParentComponent = _options$ParentCompon === undefined ? BaseStyledComponent : _options$ParentCompon,
        extendingRules = options.rules,
        attrs = options.attrs;


    var styledComponentId = options.displayName && options.componentId ? escape(options.displayName) + '-' + options.componentId : options.componentId || componentId;

    var componentStyle = new ComponentStyle(extendingRules === undefined ? rules : extendingRules.concat(rules), attrs, styledComponentId);

    var StyledComponent = function (_ParentComponent) {
      inherits(StyledComponent, _ParentComponent);

      function StyledComponent() {
        classCallCheck(this, StyledComponent);
        return possibleConstructorReturn(this, _ParentComponent.apply(this, arguments));
      }

      StyledComponent.withComponent = function withComponent(tag) {
        var previousComponentId = options.componentId,
            optionsToCopy = objectWithoutProperties(options, ['componentId']);


        var newComponentId = previousComponentId && previousComponentId + '-' + (isTag(tag) ? tag : escape(getComponentName(tag)));

        var newOptions = _extends({}, optionsToCopy, {
          componentId: newComponentId,
          ParentComponent: StyledComponent
        });

        return createStyledComponent(tag, newOptions, rules);
      };

      createClass(StyledComponent, null, [{
        key: 'extend',
        get: function get$$1() {
          var rulesFromOptions = options.rules,
              parentComponentId = options.componentId,
              optionsToCopy = objectWithoutProperties(options, ['rules', 'componentId']);


          var newRules = rulesFromOptions === undefined ? rules : rulesFromOptions.concat(rules);

          var newOptions = _extends({}, optionsToCopy, {
            rules: newRules,
            parentComponentId: parentComponentId,
            ParentComponent: StyledComponent
          });

          warnExtendDeprecated();

          return constructWithOptions(createStyledComponent, target, newOptions);
        }
      }]);
      return StyledComponent;
    }(ParentComponent);

    StyledComponent.attrs = attrs;
    StyledComponent.componentStyle = componentStyle;
    StyledComponent.contextTypes = modifiedContextShape;
    StyledComponent.displayName = displayName;
    StyledComponent.styledComponentId = styledComponentId;
    StyledComponent.target = target;


    if (true) {
      StyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName);
    }

    if (isClass) {
      __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics___default()(StyledComponent, target, {
        // all SC-specific things should not be hoisted
        attrs: true,
        componentStyle: true,
        displayName: true,
        extend: true,
        styledComponentId: true,
        target: true,
        warnTooManyClasses: true,
        withComponent: true
      });
    }

    return StyledComponent;
  };

  return createStyledComponent;
});

// Source: https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js
function murmurhash(str) {
  var l = str.length | 0,
      h = l | 0,
      i = 0,
      k;

  while (l >= 4) {
    k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;

    k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);
    k ^= k >>> 24;
    k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);

    h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;

    l -= 4;
    ++i;
  }

  switch (l) {
    case 3:
      h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
    case 2:
      h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
    case 1:
      h ^= str.charCodeAt(i) & 0xff;
      h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  }

  h ^= h >>> 13;
  h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);
  h ^= h >>> 15;

  return h >>> 0;
}

// 

var areStylesCacheable = IS_BROWSER;

var isStaticRules = function isStaticRules(rules, attrs) {
  for (var i = 0, len = rules.length; i < len; i += 1) {
    var rule = rules[i];

    // recursive case
    if (Array.isArray(rule) && !isStaticRules(rule)) {
      return false;
    } else if (typeof rule === 'function' && !isStyledComponent(rule)) {
      // functions are allowed to be static if they're just being
      // used to get the classname of a nested styled component
      return false;
    }
  }

  if (attrs !== undefined) {
    // eslint-disable-next-line guard-for-in, no-restricted-syntax
    for (var key in attrs) {
      if (typeof attrs[key] === 'function') {
        return false;
      }
    }
  }

  return true;
};

var isHMREnabled = typeof module !== 'undefined' && module.hot && "development" !== 'production';

/*
 ComponentStyle is all the CSS-specific stuff, not
 the React-specific stuff.
 */
var _ComponentStyle = (function (nameGenerator, flatten, stringifyRules) {
  /* combines hashStr (murmurhash) and nameGenerator for convenience */
  var generateRuleHash = function generateRuleHash(str) {
    return nameGenerator(murmurhash(str));
  };

  var ComponentStyle = function () {
    function ComponentStyle(rules, attrs, componentId) {
      classCallCheck(this, ComponentStyle);

      this.rules = rules;
      this.isStatic = !isHMREnabled && isStaticRules(rules, attrs);
      this.componentId = componentId;

      if (!StyleSheet.master.hasId(componentId)) {
        var placeholder =  true ? ['.' + componentId + ' {}'] : [];

        StyleSheet.master.deferredInject(componentId, placeholder);
      }
    }

    /*
     * Flattens a rule set into valid CSS
     * Hashes it, wraps the whole chunk in a .hash1234 {}
     * Returns the hash to be injected on render()
     * */


    ComponentStyle.prototype.generateAndInjectStyles = function generateAndInjectStyles(executionContext, styleSheet) {
      var isStatic = this.isStatic,
          componentId = this.componentId,
          lastClassName = this.lastClassName;

      if (areStylesCacheable && isStatic && lastClassName !== undefined && styleSheet.hasNameForId(componentId, lastClassName)) {
        return lastClassName;
      }

      var flatCSS = flatten(this.rules, executionContext);
      var name = generateRuleHash(this.componentId + flatCSS.join(''));

      if (!styleSheet.hasNameForId(componentId, name)) {
        styleSheet.inject(this.componentId, stringifyRules(flatCSS, '.' + name), name);
      }

      this.lastClassName = name;
      return name;
    };

    ComponentStyle.generateName = function generateName(str) {
      return generateRuleHash(str);
    };

    return ComponentStyle;
  }();

  return ComponentStyle;
});

// 
// Thanks to ReactDOMFactories for this handy list!

var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr',

// SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];

// 

var _styled = (function (styledComponent, constructWithOptions) {
  var styled = function styled(tag) {
    return constructWithOptions(styledComponent, tag);
  };

  // Shorthands for all valid HTML Elements
  domElements.forEach(function (domElement) {
    styled[domElement] = styled(domElement);
  });

  return styled;
});

// 

var replaceWhitespace = function replaceWhitespace(str) {
  return str.replace(/\s|\\n/g, '');
};

var _keyframes = (function (nameGenerator, stringifyRules, css) {
  return function () {
    var styleSheet = StyleSheet.master;
    var rules = css.apply(undefined, arguments);
    var name = nameGenerator(murmurhash(replaceWhitespace(JSON.stringify(rules))));
    var id = 'sc-keyframes-' + name;

    if (!styleSheet.hasNameForId(id, name)) {
      styleSheet.inject(id, stringifyRules(rules, name, '@keyframes'), name);
    }

    return name;
  };
});

// 

var _injectGlobal = (function (stringifyRules, css) {
  var injectGlobal = function injectGlobal() {
    var styleSheet = StyleSheet.master;
    var rules = css.apply(undefined, arguments);
    var hash = murmurhash(JSON.stringify(rules));
    var id = 'sc-global-' + hash;

    if (!styleSheet.hasId(id)) {
      styleSheet.inject(id, stringifyRules(rules));
    }
  };

  return injectGlobal;
});

// 

var _constructWithOptions = (function (css) {
  var constructWithOptions = function constructWithOptions(componentConstructor, tag) {
    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EMPTY_OBJECT;

    if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_react_is__["isValidElementType"])(tag)) {
      throw new StyledComponentsError(1, String(tag));
    }

    /* This is callable directly as a template function */
    // $FlowFixMe: Not typed to avoid destructuring arguments
    var templateFunction = function templateFunction() {
      return componentConstructor(tag, options, css.apply(undefined, arguments));
    };

    /* If config methods are called, wrap up a new template function and merge options */
    templateFunction.withConfig = function (config) {
      return constructWithOptions(componentConstructor, tag, _extends({}, options, config));
    };
    templateFunction.attrs = function (attrs) {
      return constructWithOptions(componentConstructor, tag, _extends({}, options, {
        attrs: _extends({}, options.attrs || EMPTY_OBJECT, attrs)
      }));
    };

    return templateFunction;
  };

  return constructWithOptions;
});

// 

var withTheme = (function (Component$$1) {
  var isStatelessFunctionalComponent = typeof Component$$1 === 'function' &&
  // $FlowFixMe TODO: flow for prototype
  !(Component$$1.prototype && 'isReactComponent' in Component$$1.prototype);

  // NOTE: We can't pass a ref to a stateless functional component
  var shouldSetInnerRef = isStyledComponent(Component$$1) || isStatelessFunctionalComponent;

  var WithTheme = function (_React$Component) {
    inherits(WithTheme, _React$Component);

    function WithTheme() {
      var _temp, _this, _ret;

      classCallCheck(this, WithTheme);

      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      return _ret = (_temp = (_this = possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = EMPTY_OBJECT, _this.unsubscribeId = -1, _temp), possibleConstructorReturn(_this, _ret);
    }

    // NOTE: This is so that isStyledComponent passes for the innerRef unwrapping


    WithTheme.prototype.componentWillMount = function componentWillMount() {
      var _this2 = this;

      var defaultProps = this.constructor.defaultProps;

      var styledContext = this.context[CHANNEL_NEXT];
      var themeProp = determineTheme(this.props, undefined, defaultProps);
      if (styledContext === undefined && themeProp === undefined && "development" !== 'production') {
        // eslint-disable-next-line no-console
        console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps');
      } else if (styledContext === undefined && themeProp !== undefined) {
        this.setState({ theme: themeProp });
      } else {
        var subscribe = styledContext.subscribe;

        this.unsubscribeId = subscribe(function (nextTheme) {
          var theme = determineTheme(_this2.props, nextTheme, defaultProps);
          _this2.setState({ theme: theme });
        });
      }
    };

    WithTheme.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
      var defaultProps = this.constructor.defaultProps;

      this.setState(function (oldState) {
        var theme = determineTheme(nextProps, oldState.theme, defaultProps);

        return { theme: theme };
      });
    };

    WithTheme.prototype.componentWillUnmount = function componentWillUnmount() {
      if (this.unsubscribeId !== -1) {
        this.context[CHANNEL_NEXT].unsubscribe(this.unsubscribeId);
      }
    };

    WithTheme.prototype.render = function render() {
      var props = _extends({
        theme: this.state.theme
      }, this.props);

      if (!shouldSetInnerRef) {
        props.ref = props.innerRef;
        delete props.innerRef;
      }

      return __WEBPACK_IMPORTED_MODULE_1_react___default.a.createElement(Component$$1, props);
    };

    return WithTheme;
  }(__WEBPACK_IMPORTED_MODULE_1_react___default.a.Component);

  WithTheme.contextTypes = contextShape;
  WithTheme.displayName = 'WithTheme(' + getComponentName(Component$$1) + ')';
  WithTheme.styledComponentId = 'withTheme';


  return __WEBPACK_IMPORTED_MODULE_5_hoist_non_react_statics___default()(WithTheme, Component$$1);
});

// 

/* eslint-disable */
var __DO_NOT_USE_OR_YOU_WILL_BE_HAUNTED_BY_SPOOKY_GHOSTS = {
  StyleSheet: StyleSheet
};

// 

/* Warning if you've imported this file on React Native */
if ("development" !== 'production' && typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
  // eslint-disable-next-line no-console
  console.warn("It looks like you've imported 'styled-components' on React Native.\n" + "Perhaps you're looking to import 'styled-components/native'?\n" + 'Read more about this at https://www.styled-components.com/docs/basics#react-native');
}

/* Warning if there are several instances of styled-components */
if ("development" !== 'production' && "development" !== 'test' && typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Node.js') === -1 && navigator.userAgent.indexOf('jsdom') === -1) {
  window['__styled-components-init__'] = window['__styled-components-init__'] || 0;

  if (window['__styled-components-init__'] === 1) {
    // eslint-disable-next-line no-console
    console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " + 'This may cause dynamic styles not rendering properly, errors happening during rehydration process ' + 'and makes your application bigger without a good reason.\n\n' + 'See https://s-c.sh/2BAXzed for more info.');
  }

  window['__styled-components-init__'] += 1;
}

/* Instantiate singletons */
var ComponentStyle = _ComponentStyle(generateAlphabeticName, flatten, stringifyRules);
var constructWithOptions = _constructWithOptions(css);
var StyledComponent = _StyledComponent(ComponentStyle, constructWithOptions);

/* Instantiate exported singletons */
var keyframes = _keyframes(generateAlphabeticName, stringifyRules, css);
var injectGlobal = _injectGlobal(stringifyRules, css);
var styled = _styled(StyledComponent, constructWithOptions);

/* harmony default export */ __webpack_exports__["default"] = (styled);

//# sourceMappingURL=styled-components.browser.esm.js.map

/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(246), __webpack_require__(383)(module)))

/***/ }),
/* 18 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __reportData = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.activeReport = undefined;
    this.store = {
      FarmSizeReport: {
        hasData: false,
        tables: {},
        charts: {},
        ratios: {}
      },
      FarmHistoryReport: {
        hasData: false,
        tables: {},
        charts: {},
        ratios: {}
      }
    };
    this.listenToMany(_Actions2.default);
  },
  SET_REPORT_PROPS: function SET_REPORT_PROPS(reports) {
    var _this = this;

    _.forOwn(reports, function (report, reportKey) {
      if (report === null) return;
      _this.store[reportKey] = {
        hasData: false,
        tables: {},
        charts: {},
        ratios: {}
      };
      _.forOwn(reports[reportKey], function (table, tableKey) {
        if (table === null) return; // shouldn't be null tho
        _this.store[reportKey].tables[tableKey] = [];
        table.TableRows.forEach(function (row, index) {
          _this.store[reportKey].tables[tableKey].push(row);
        });
      });
    });
  },
  MAP_REPORT_DATA: function MAP_REPORT_DATA(data) {
    var _this2 = this;

    var reportKey;
    var report;

    // loop to get the key and data object (cause backend lazy)
    _.forOwn(data, function (value, key) {
      if (value === null) return;
      reportKey = key;
      report = value;
    });

    this.activeReport = reportKey;
    this.store[reportKey].charts = this._constructChartData(report.Charts);

    var ratios = {};

    _.forOwn(this.store[reportKey].tables, function (rows, table) {
      if (report.Tables[table] === null) return; // shouldn't be null tho
      var constructedRows = _this2._constructReportRowData(rows, report.Tables[table].Data, table);
      _this2.store[reportKey].tables[table] = constructedRows.rows;
      _.forOwn(constructedRows.ratios, function (value, key) {
        ratios[key] = value;
      });
    });

    this.store[reportKey].ratios = ratios;
    this.store[reportKey].hasData = true;
    this.trigger();
  },
  _constructChartData: function _constructChartData(outputList) {
    var charts = {};
    _.forOwn(outputList, function (chart, chartKey) {
      var lengthOfData = 0;
      var convertedChartData = [];

      _.forOwn(chart.ChartData, function (group) {
        if (group === null) return;
        if (group.length > lengthOfData) {
          lengthOfData = group.length;
        }
      });

      var n = 0;
      while (n < lengthOfData) {
        n++;
        convertedChartData.push({});
      }

      _.forOwn(chart.ChartData, function (group) {
        if (group === null) return;
        group.forEach(function (item, index) {
          _.forOwn(item, function (value, key) {
            convertedChartData[index][key] = value;
          });
        });
      });

      chart.ChartData = convertNullToNaN(convertedChartData);
      charts[chartKey] = chart;
    });
    return charts;
  },
  _constructReportRowData: function _constructReportRowData(rows, data, table) {
    var _this3 = this;

    var _data = data || {};
    var ratios = {};
    var ratioFieldIds = ['CowMilkerNumber', 'MilkSolidsKgTotal', 'AreaUsable', 'AreaMilking', 'MilkLitresTotal', 'IncomeTotal'];

    var colLength = 0;

    var rowArr = rows.map(function (row, index) {
      row.cols = [];

      if (row.Props.Cols === null) return row;

      row.Props.Cols.forEach(function (col, index) {
        if (col.FieldId === null) {
          row.cols.push(_this3._mutateColData(col.Value, col));
          return;
        }

        var _arr = _data[col.FieldId] || [];

        if (colLength < _arr.length) {
          colLength = _arr.length;
        }

        _arr.forEach(function (colData, index) {
          row.cols.push({
            props: col,
            value: _this3._mutateColData(colData, col)
          });
        });

        if (_.contains(ratioFieldIds, col.FieldId)) {
          ratios[col.FieldId] = _arr;
        }
      });

      return row;
    });

    return {
      rows: rowArr.map(function (r) {
        return _extends({}, r, { colLength: colLength });
      }),
      ratios: ratios
    };
  },
  _mutateColData: function _mutateColData(rawData, props) {
    if (props.Text) return rawData;
    if (rawData === null) return '-';

    var mutatedData = +rawData;

    if (props.Percent) {
      mutatedData = mutatedData * 100;
    }

    // we used to floor here, effectively cropping the numbers,
    // but the instruction was to no longer do this...

    // leaving this note here in case anything blows up and we need to re-instate:
    // const flooredValue = Math.floor(mutatedData * 100) / 100

    // decimals will be applied in the view...
    if (props.Dynamic) return mutatedData;

    return +mutatedData.toFixed(props.Decimal);
  }
});

function convertNullToNaN(data) {
  return data.map(function (obj) {
    var newObj = obj;
    _.forOwn(obj, function (val, key) {
      if (val === null) {
        newObj[key] = 'NaN';
      }
    });
    return newObj;
  });
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__reportData, '__reportData', 'C:/_repos_windows/dairybase/Frontend/app/stores/__reportData/index.js');

  __REACT_HOT_LOADER__.register(convertNullToNaN, 'convertNullToNaN', 'C:/_repos_windows/dairybase/Frontend/app/stores/__reportData/index.js');
}();

;

/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1029);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GenericCloseBtn = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'button',
      { className: 'GenericCloseBtn', onClick: this.props.onClick },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'close' }),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'close'
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GenericCloseBtn, 'GenericCloseBtn', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_GenericCloseBtn/index.jsx');
}();

;

/***/ }),
/* 20 */
/***/ (function(module, exports) {

module.exports = function (exec) {
  try {
    return !!exec();
  } catch (e) {
    return true;
  }
};


/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _vars = __webpack_require__(407);

var _vars2 = _interopRequireDefault(_vars);

var _mixins = __webpack_require__(406);

var _mixins2 = _interopRequireDefault(_mixins);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = {
  vars: _vars2.default,
  mixins: _mixins2.default
};
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/css/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 22 */
/***/ (function(module, exports) {

module.exports = function (it) {
  return typeof it === 'object' ? it !== null : typeof it === 'function';
};


/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {

var window = __webpack_require__(1394)
var once = __webpack_require__(1395)
var parseHeaders = __webpack_require__(1232)

var messages = {
    "0": "Internal XMLHttpRequest Error",
    "4": "4xx Client Error",
    "5": "5xx Server Error"
}

var XHR = window.XMLHttpRequest || noop
var XDR = "withCredentials" in (new XHR()) ? XHR : window.XDomainRequest

module.exports = createXHR

function createXHR(options, callback) {
    if (typeof options === "string") {
        options = { uri: options }
    }

    options = options || {}
    callback = once(callback)

    var xhr = options.xhr || null

    if (!xhr) {
        if (options.cors || options.useXDR) {
            xhr = new XDR()
        }else{
            xhr = new XHR()
        }
    }

    var uri = xhr.url = options.uri || options.url
    var method = xhr.method = options.method || "GET"
    var body = options.body || options.data
    var headers = xhr.headers = options.headers || {}
    var sync = !!options.sync
    var isJson = false
    var key
    var load = options.response ? loadResponse : loadXhr

    if ("json" in options) {
        isJson = true
        headers["Accept"] = "application/json"
        if (method !== "GET" && method !== "HEAD") {
            headers["Content-Type"] = "application/json"
            body = JSON.stringify(options.json)
        }
    }

    xhr.onreadystatechange = readystatechange
    xhr.onload = load
    xhr.onerror = error
    // IE9 must have onprogress be set to a unique function.
    xhr.onprogress = function () {
        // IE must die
    }
    // hate IE
    xhr.ontimeout = noop
    xhr.open(method, uri, !sync)
                                    //backward compatibility
    if (options.withCredentials || (options.cors && options.withCredentials !== false)) {
        xhr.withCredentials = true
    }

    // Cannot set timeout with sync request
    if (!sync) {
        xhr.timeout = "timeout" in options ? options.timeout : 5000
    }

    if (xhr.setRequestHeader) {
        for(key in headers){
            if(headers.hasOwnProperty(key)){
                xhr.setRequestHeader(key, headers[key])
            }
        }
    } else if (options.headers) {
        throw new Error("Headers cannot be set on an XDomainRequest object")
    }

    if ("responseType" in options) {
        xhr.responseType = options.responseType
    }
    
    if ("beforeSend" in options && 
        typeof options.beforeSend === "function"
    ) {
        options.beforeSend(xhr)
    }

    xhr.send(body)

    return xhr

    function readystatechange() {
        if (xhr.readyState === 4) {
            load()
        }
    }

    function getBody() {
        // Chrome with requestType=blob throws errors arround when even testing access to responseText
        var body = null

        if (xhr.response) {
            body = xhr.response
        } else if (xhr.responseType === 'text' || !xhr.responseType) {
            body = xhr.responseText || xhr.responseXML
        }

        if (isJson) {
            try {
                body = JSON.parse(body)
            } catch (e) {}
        }

        return body
    }

    function getStatusCode() {
        return xhr.status === 1223 ? 204 : xhr.status
    }

    // if we're getting a none-ok statusCode, build & return an error
    function errorFromStatusCode(status) {
        var error = null
        if (status === 0 || (status >= 400 && status < 600)) {
            var message = (typeof body === "string" ? body : false) ||
                messages[String(status).charAt(0)]
            error = new Error(message)
            error.statusCode = status
        }

        return error
    }

    // will load the data & process the response in a special response object
    function loadResponse() {
        var status = getStatusCode()
        var error = errorFromStatusCode(status)
        var response = {
            body: getBody(),
            statusCode: status,
            statusText: xhr.statusText,
            raw: xhr
        }
        if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE
            response.headers = parseHeaders(xhr.getAllResponseHeaders())
        } else {
            response.headers = {}
        }

        callback(error, response, response.body)
    }

    // will load the data and add some response properties to the source xhr
    // and then respond with that
    function loadXhr() {
        var status = getStatusCode()
        var error = errorFromStatusCode(status)

        xhr.status = xhr.statusCode = status
        xhr.body = getBody()
        xhr.headers = parseHeaders(xhr.getAllResponseHeaders())

        callback(error, xhr, xhr.body)
    }

    function error(evt) {
        callback(evt, xhr)
    }
}


function noop() {}


/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _mutateDataWithProps = __webpack_require__(196);

var _mutateDataWithProps2 = _interopRequireDefault(_mutateDataWithProps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var __reportFilters = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.store = {};
    this.listenToMany(_Actions2.default);
  },
  SET_REPORT_FILTERS: function SET_REPORT_FILTERS(blob) {
    var _this = this;

    _dataDefinition2.default.properties.UserReportFilters.Tables.forEach(function (table, index) {
      if (table.MultiRow) {
        var _name = table.TableName;
        _this.store[_name] = [];

        blob.UserReportFilters[_name].forEach(function (row, index) {
          _this.store[_name].push({});
        });
      }
    });

    this.RECEIVE_DATA_UPDATE(blob);
  },
  RECEIVE_DATA_UPDATE: function RECEIVE_DATA_UPDATE(blob) {
    if (typeof blob.UserReportFilters === "undefined" || blob.UserReportFilters === null) return;

    this.store = (0, _mutateDataWithProps2.default)(blob.UserReportFilters, 'UserReportFilters', this.store);
    this.trigger();
  },
  UPDATE_COMPARISON_COUNT: function UPDATE_COMPARISON_COUNT(blob) {
    if (typeof blob.UserReportComparisons === 'undefined' || blob.UserReportComparisons === null) return;

    this.trigger();
  },
  UPDATE_REPORT_FILTER_ELEMENT: function UPDATE_REPORT_FILTER_ELEMENT(newData) {

    var tableRef = this.store[newData.Table];
    var rowRef = tableRef[0];
    var oldFieldValue = rowRef[newData.FieldId].Value;

    var newPostData = {
      "Table": newData.Table,
      "Fields": _defineProperty({}, newData.FieldId, newData.Value)
    };

    var oldData = {
      // reference for error handler
      Field: newData.FieldId,
      // actual state of whole table
      Value: oldFieldValue

      // Send data to server
    };_Actions2.default.POST_NEW_DATA(oldData, newPostData);

    // optimistically set data on local store
    rowRef[newData.FieldId].Value = newData.Value;

    this.trigger();
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__reportFilters, '__reportFilters', 'C:/_repos_windows/dairybase/Frontend/app/stores/__reportFilters/index.js');
}();

;

/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1044);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _Popup = __webpack_require__(157);

var _Popup2 = _interopRequireDefault(_Popup);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DescriptionLabel = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      popupIsActive: false
    };
  },
  _hasDescription: function _hasDescription() {
    return typeof this.props.description === 'string' && this.props.description !== '';
  },
  _togglePopup: function _togglePopup() {
    var _this = this;

    if (this._hasDescription()) {
      this.setState({
        popupIsActive: !this.state.popupIsActive,
        coords: (0, _getDomCoords3.default)(this.label)
      }, function () {
        _this.state.popupIsActive ? document.addEventListener('click', _this._togglePopup) : document.removeEventListener('click', _this._togglePopup);
      });
    }
  },
  render: function render() {
    var _this2 = this;

    var labelClasses = (0, _classnames2.default)({
      DescriptionLabel: true,
      'has-description': this._hasDescription()
    });

    return _react2.default.createElement(
      'div',
      {
        ref: function ref(_ref) {
          return _this2.label = _ref;
        },
        className: labelClasses,
        onClick: this._togglePopup },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        this.props.label
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.popupIsActive,
          className: 'Popup' },
        _react2.default.createElement(_Popup2.default, { coords: this.state.coords, text: this.props.description })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DescriptionLabel, 'DescriptionLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_DescriptionLabel/index.jsx');
}();

;

/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {

var store = __webpack_require__(138)('wks');
var uid = __webpack_require__(103);
var Symbol = __webpack_require__(16).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';

var $exports = module.exports = function (name) {
  return store[name] || (store[name] =
    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};

$exports.store = store;


/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {

// 7.1.15 ToLength
var toInteger = __webpack_require__(60);
var min = Math.min;
module.exports = function (it) {
  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};


/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (items) {
  var fieldLists = [];
  var flatObj = {};
  var stores = {
    'Data': __webpack_require__(13),
    'UserPreference': __webpack_require__(29),
    'Reports': __webpack_require__(24)
  };

  items.forEach(function (item, index) {
    var newItem = [];
    _.forOwn(item.fields, function (value, key) {
      newItem.push(key);
      flatObj[key] = value;
    });
    item.fields = newItem;
    fieldLists.push(item);
  });

  return {
    getInitialState: function getInitialState() {
      return _.cloneDeep(flatObj);
    },
    componentWillMount: function componentWillMount() {
      this._handleNewData();
    },
    componentDidMount: function componentDidMount() {
      var _this = this;

      this.subscriptions = [];
      items.forEach(function (item, index) {
        _this.subscriptions.push({
          store: item.store,
          fn: stores[item.store].listen(_this._handleNewData)
        });
      });
    },
    componentWillUnmount: function componentWillUnmount() {
      this.subscriptions.forEach(function (subscription, index) {
        subscription.fn();
      });
    },
    _handleNewData: function _handleNewData() {
      var stateObj = {};
      fieldLists.forEach(function (item, index) {
        var data = stores[item.store].store;
        item.fields.forEach(function (field, index) {
          if (_.has(data, field)) {
            stateObj[field] = data[field];
          }
        });
      });
      this.setState(stateObj);
    }
  };
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _mutateDataWithProps = __webpack_require__(196);

var _mutateDataWithProps2 = _interopRequireDefault(_mutateDataWithProps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var __user = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.name = '';
    this.dairyBaseGroups = [];
    this.auth = {};
    this.store = {};
    this.listenToMany(_Actions2.default);
  },
  NEW_USER_SESSION: function NEW_USER_SESSION(blob) {
    this.auth.Authorised = true;
    this.name = blob.UserName;
    this.userAuthority = blob.UserAuthority;
    this.industryDataProvider = blob.IndustryDataProvider;
    this.industryDataList = blob.IndustryDataList;
    this.dairyBaseGroups = blob.DairyBaseGroups;
    this.store = (0, _mutateDataWithProps2.default)({ UserPreference: blob.UserPreference }, 'UserPreference', this.store);
    this.trigger();
  },
  RECEIVE_AUTH_UPDATE: function RECEIVE_AUTH_UPDATE(IndustryDataList) {
    this.industryDataList = IndustryDataList;
    this.trigger();
  },
  UPDATE_USER_NAME: function UPDATE_USER_NAME(name) {
    this.name = name === null ? '' : name;
    this.trigger();
  },
  UPDATE_USER_PREFERENCE: function UPDATE_USER_PREFERENCE(key, value) {
    this.store[key].Value = value;
    this.trigger();
  },
  OPTIMISICALLY_UPDATE_USER_PREFERENCE: function OPTIMISICALLY_UPDATE_USER_PREFERENCE(newData) {
    // send the old and new data to request log

    if (typeof this.store[newData.Element] === 'undefined') return console.log(newData.Element, 'not found on store');

    var newPostData = {
      Table: 'UserPreference',
      Data: [{
        Fields: _defineProperty({}, newData.Element, this.store[newData.Element].Type === 'Percent' ? newData.Value / 100 : newData.Value)
      }]
    };

    var oldData = _.cloneDeep(this.store[newData.Element]);
    _Actions2.default.POST_NEW_DATA(oldData, newPostData);

    // optimistically set data on local store
    this.store[newData.Element].Value = newData.Value;
    this.trigger();
  },
  ROLLBACK_FIELD_DATA: function ROLLBACK_FIELD_DATA(oldData) {
    if (typeof this.store[oldData.Element] === 'undefined') return;
    this.store[oldData.Element].Value = oldData.Value;
    this.trigger();
  },
  SESSION_ERROR: function SESSION_ERROR(error) {
    this.auth = error;
    this.trigger();
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__user, '__user', 'C:/_repos_windows/dairybase/Frontend/app/stores/__user/index.js');
}();

;

/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {

// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(20)(function () {
  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});


/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {

var anObject = __webpack_require__(11);
var IE8_DOM_DEFINE = __webpack_require__(321);
var toPrimitive = __webpack_require__(68);
var dP = Object.defineProperty;

exports.f = __webpack_require__(30) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  anObject(O);
  P = toPrimitive(P, true);
  anObject(Attributes);
  if (IE8_DOM_DEFINE) try {
    return dP(O, P, Attributes);
  } catch (e) { /* empty */ }
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  if ('value' in Attributes) O[P] = Attributes.value;
  return O;
};


/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

var invariant = function(condition, format, a, b, c, d, e, f) {
  if (true) {
    if (format === undefined) {
      throw new Error('invariant requires an error message argument');
    }
  }

  if (!condition) {
    var error;
    if (format === undefined) {
      error = new Error(
        'Minified exception occurred; use the non-minified dev environment ' +
        'for the full error message and additional helpful warnings.'
      );
    } else {
      var args = [a, b, c, d, e, f];
      var argIndex = 0;
      error = new Error(
        format.replace(/%s/g, function() { return args[argIndex++]; })
      );
      error.name = 'Invariant Violation';
    }

    error.framesToPop = 1; // we don't care about invariant's own frame
    throw error;
  }
};

module.exports = invariant;


/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

module.exports = {
  addCommas: function addCommas(num) {
    if (typeof num === "string" || typeof num === "number") {
      return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
    } else {
      return num;
    }
  },
  removeCommas: function removeCommas(num) {
    if ((typeof num === "undefined" ? "undefined" : _typeof(num)) === ("string" || "number")) {
      return num.toString().replace(/,/g, "");
    } else {
      return num;
    }
  }
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1033);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      options: this.sortOptions(this.props)
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.setState({
      value: newProps.value,
      options: this.sortOptions(newProps)
    });
  },
  sortOptions: function sortOptions(props) {
    var options = props.options,
        value = props.value;


    if (!options) return options;
    if (options.length === 0) return options;

    var hasOrder = typeof options[0].Order === 'number';
    var orderKey = hasOrder ? 'Order' : 'Id';
    var filteredList = !hasOrder ? options : options.filter(function (item) {
      return item.Id === value || item.Order > 0;
    });

    return _.sortBy(filteredList, orderKey);
  },
  _handleSelect: function _handleSelect(evt) {
    if (!this.props.disabled) {
      this._handleSubmitData(evt.target.value);
    }
  },
  _handleSubmitData: function _handleSubmitData(newValue) {
    this.props.onSubmit(+newValue, this.props.id);
  },
  render: function render() {
    var SelectInput__dropdown = (0, _classnames2.default)({
      'SelectInput__dropdown': true,
      'is-error': this.props.error
    });
    return _react2.default.createElement(
      'div',
      { className: 'SelectInput' },
      _react2.default.createElement(
        'div',
        { className: SelectInput__dropdown },
        this._renderSelectElement(),
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow', width: '9px' })
      )
    );
  },
  _renderSelectElement: function _renderSelectElement() {
    var selectElement;

    var classList = (0, _classnames2.default)({
      "SelectInput__field": true,
      "is-error": this.props.error,
      "is-disabled": this.props.disabled
    });

    if (typeof this.state.value !== "undefined" && this.state.options.length !== 0) {
      selectElement = _react2.default.createElement(
        'select',
        { className: classList,
          disabled: this.props.disabled,
          value: this.state.value,
          onChange: this._handleSelect },
        this.state.options.map(function (option, index) {
          return _react2.default.createElement(
            'option',
            { key: index, value: option.Id },
            option.Title
          );
        })
      );
    } else {
      selectElement = _react2.default.createElement(
        'select',
        { className: 'SelectInput__field is-disabled',
          disabled: true,
          value: '1' },
        _react2.default.createElement(
          'option',
          { value: '1' },
          'waiting for data...'
        )
      );
    }
    return selectElement;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {

// 7.1.13 ToObject(argument)
var defined = __webpack_require__(66);
module.exports = function (it) {
  return Object(defined(it));
};


/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1057);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _commas = __webpack_require__(33);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {
    var value = this.props.value;
    var value = typeof value === "undefined" || value === null ? '-' : value;
    return _react2.default.createElement(
      'span',
      { className: '_output' },
      (0, _commas.addCommas)(value)
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var i = 0;

var POST__editData = module.exports = function (data, callback) {

  _Actions2.default.SET_APP_STATUS("updating");

  (0, _xhr2.default)({
    url: "/" + "api/editor/PostEditData",
    method: "POST",
    json: data,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var data = resp.body;
    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.RECEIVE_DATA_UPDATE(data);
      _Actions2.default.UPDATE_COMPARISON_COUNT(data);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(i, 'i', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__editData/index.js');

  __REACT_HOT_LOADER__.register(POST__editData, 'POST__editData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__editData/index.js');
}();

;

/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var tabManifest = module.exports = [__webpack_require__(434), __webpack_require__(436), __webpack_require__(437), __webpack_require__(429), __webpack_require__(430), __webpack_require__(439), __webpack_require__(433), __webpack_require__(432), __webpack_require__(440), __webpack_require__(438), __webpack_require__(431), __webpack_require__(428), __webpack_require__(435)];
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(tabManifest, 'tabManifest', 'C:/_repos_windows/dairybase/Frontend/app/data/_tabManifest/index.js');
}();

;

/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1078);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  _handleBackgroundClick: function _handleBackgroundClick(evt) {
    if (evt.target === this.modalContainer) {
      this.props.closePortal();
    }
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      {
        className: 'HelpModal',
        ref: function ref(_ref) {
          return _this.modalContainer = _ref;
        },
        onClick: this._handleBackgroundClick },
      _react2.default.createElement(
        'div',
        { className: '_modalBox' },
        _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.closePortal }),
        this.props.children
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var initialStore = {
  groups: [],
  farms: [],
  years: [],
  owners: [],
  actual: [],
  editable: []
};

var __datasetListFilter = module.exports = _reflux2.default.createStore({
  init: function init() {

    this.store = _.cloneDeep(initialStore);
    this.filtering = false;

    this.listenToMany(_Actions2.default);
  },
  CLEAR_DATASETLIST_FILTER: function CLEAR_DATASETLIST_FILTER() {
    this.filtering = false;
    this.store = _.cloneDeep(initialStore);
    this.trigger();
  },
  UPDATE_DATASETLIST_FILTER: function UPDATE_DATASETLIST_FILTER(filter, item) {

    if (_.includes(this.store[filter], item)) {
      this._remove(filter, item);
    } else {
      this._add(filter, item);
    }

    this.filtering = this._checkForFiltering();

    this.trigger();
  },
  _add: function _add(filter, newItem) {
    this.store[filter].push(newItem);
  },
  _remove: function _remove(filter, newItem) {
    this.store[filter] = this.store[filter].filter(function (item, index) {
      return item !== newItem;
    });
  },
  _checkForFiltering: function _checkForFiltering() {
    return _.some(this.store, function (filter, index) {
      return filter.length >= 1;
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(initialStore, 'initialStore', 'C:/_repos_windows/dairybase/Frontend/app/stores/__datasetListFilter/index.js');

  __REACT_HOT_LOADER__.register(__datasetListFilter, '__datasetListFilter', 'C:/_repos_windows/dairybase/Frontend/app/stores/__datasetListFilter/index.js');
}();

;

/***/ }),
/* 41 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var scrollDiv = document.createElement("div");
scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;');
document.body.appendChild(scrollDiv);

// Get the scrollbar width
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;

// Delete the DIV
document.body.removeChild(scrollDiv);

module.exports = function () {
  return scrollbarWidth;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(scrollDiv, 'scrollDiv', 'C:/_repos_windows/dairybase/Frontend/app/utils/_getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(scrollbarWidth, 'scrollbarWidth', 'C:/_repos_windows/dairybase/Frontend/app/utils/_getScrollbarWidth/index.js');
}();

;

/***/ }),
/* 42 */
/***/ (function(module, exports) {

module.exports = function (it) {
  if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  return it;
};


/***/ }),
/* 43 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _checkEditAuth = __webpack_require__(450);

var _checkEditAuth2 = _interopRequireDefault(_checkEditAuth);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = {
  getInitialState: function getInitialState() {
    return {
      editAuthority: false
    };
  },
  componentWillMount: function componentWillMount() {
    this._handlePotentialEditAuthChange();
  },
  componentDidMount: function componentDidMount() {
    this.unsubscribeToAuthMixin = _activeDataset2.default.listen(this._handlePotentialEditAuthChange);
  },
  componentWillUnmount: function componentWillUnmount() {
    this.unsubscribeToAuthMixin();
  },
  _handlePotentialEditAuthChange: function _handlePotentialEditAuthChange() {
    this.setState({
      editAuthority: (0, _checkEditAuth2.default)(this.state.FarmDataSetId || undefined)
    });
  }
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 44 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1020);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _marked = __webpack_require__(181);

var _marked2 = _interopRequireDefault(_marked);

var _help = __webpack_require__(447);

var _help2 = _interopRequireDefault(_help);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

/*
  Component Example:
  <HelpText id="someHelpTextId" className="someTextStyleClass" />
*/

var HelpText = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_help2.default, '_handleTextUpdate')],

  getInitialState: function getInitialState() {
    return _defineProperty({}, this.props.id, {});
  },
  componentWillMount: function componentWillMount() {
    this._handleTextUpdate();
  },
  _handleTextUpdate: function _handleTextUpdate() {
    this.setState(_defineProperty({}, this.props.id, _help2.default.store[this.props.id]));
  },
  render: function render() {
    var markedDescription = '';

    if (typeof this.state[this.props.id] !== 'undefined') {
      markedDescription = (0, _marked2.default)(this.state[this.props.id].Description, { sanitize: true });
    }

    return _react2.default.createElement(
      'div',
      { className: this.props.className },
      _react2.default.createElement('div', { className: 'HelpText__content', dangerouslySetInnerHTML: { __html: markedDescription } })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(HelpText, 'HelpText', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_HelpText/index.jsx');
}();

;

/***/ }),
/* 45 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (nodeRef) {

  return {
    getInitialState: function getInitialState() {
      return {
        permaPortalOpen: false
      };
    },
    componentDidMount: function componentDidMount() {
      this._checkForPortalNode(this.props);
    },
    componentWillReceiveProps: function componentWillReceiveProps(newProps) {
      this._checkForPortalNode(newProps);
    },
    _checkForPortalNode: function _checkForPortalNode(props) {
      if (typeof props[nodeRef] === 'undefined') return;
      this.setState({
        permaPortalOpen: true
      });
    }
  };
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1030);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GenericHelpBtn = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'button',
      { className: 'GenericHelpBtn', onClick: this.props.onClick },
      _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'help' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GenericHelpBtn, 'GenericHelpBtn', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_GenericHelpBtn/index.jsx');
}();

;

/***/ }),
/* 47 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1061);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _requestLog = __webpack_require__(123);

var _requestLog2 = _interopRequireDefault(_requestLog);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _TotalsBanner = __webpack_require__(498);

var _TotalsBanner2 = _interopRequireDefault(_TotalsBanner);

var _copyMessage = __webpack_require__(490);

var _copyMessage2 = _interopRequireDefault(_copyMessage);

var _xhrState = __webpack_require__(491);

var _xhrState2 = _interopRequireDefault(_xhrState);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TabHeader = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  mixins: [(0, _permaPortalMixin2.default)('portalContext'), _reflux2.default.listenTo(_requestLog2.default, '_handleRequestUpdate'), _reflux2.default.listenTo(_activeDataset2.default, '_handleDatasetUpdate')],

  getInitialState: function getInitialState() {
    return {
      reportPortalOpen: false,
      pending: false,
      saved: true,
      error: false,
      datasetEditable: true,
      datasetCopyable: true,
      dataset: undefined
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleDatasetUpdate();
  },
  _handleDatasetUpdate: function _handleDatasetUpdate() {
    var stateObj = {
      saved: _activeDataset2.default.DataSetSaved
    };

    if (_datasetList2.default.store.length >= 1) {
      var activeDatasetDetail = _.find(_datasetList2.default.store, {
        Id: _activeDataset2.default.id
      });
      stateObj.datasetEditable = activeDatasetDetail.EditAuthority;
      stateObj.datasetCopyable = activeDatasetDetail.CopyAuthority;
      stateObj.dataset = activeDatasetDetail;
    }

    this.setState(stateObj);
  },
  _findPendingRequest: function _findPendingRequest() {
    if (_requestLog2.default.store.length < 1) return false;
    return true;
  },
  _findRequestError: function _findRequestError() {
    var isError = false;

    var errorList = _requestLog2.default.store.filter(function (request, index) {
      return request.error;
    });

    if (errorList.length > 0) {
      errorList.forEach(function (error, index) {
        var latestRequest = _.findLast(_requestLog2.default.store, function (request, index) {
          return request.FieldId === error.FieldId;
        });
        if (!latestRequest.error) return;
        isError = true;
      });
    }

    return isError;
  },
  _handleRequestUpdate: function _handleRequestUpdate() {
    this.setState({
      pending: this._findPendingRequest(),
      error: this._findRequestError()
    });
  },
  _handleReportTransition: function _handleReportTransition() {
    this.props.history.push('/reports');
  },
  render: function render() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: this.props.portalContext,
        isOpen: this.state.permaPortalOpen },
      _react2.default.createElement(
        'div',
        {
          className: 'TabHeader__container',
          style: { right: (0, _getScrollbarWidth2.default)() } },
        _react2.default.createElement(
          'div',
          { className: 'TabHeader' },
          _react2.default.createElement(
            'div',
            { className: 'TabHeader__content' },
            _react2.default.createElement(
              'h2',
              { className: '_title' },
              this.props.title
            ),
            _react2.default.createElement(_copyMessage2.default, {
              editable: this.state.datasetEditable,
              copyable: this.state.datasetCopyable,
              dataset: this.state.dataset
            }),
            _react2.default.createElement(_xhrState2.default, {
              editable: this.state.datasetEditable,
              pending: this.state.pending,
              saved: this.state.saved,
              error: this.state.error
            }),
            _react2.default.createElement(
              'div',
              { className: '_reportBtn' },
              _react2.default.createElement(
                'button',
                {
                  className: '_btn',
                  onClick: this._handleReportTransition },
                _react2.default.createElement(
                  'div',
                  { className: '_content' },
                  _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'barchart' }),
                  _react2.default.createElement(
                    'span',
                    { className: '_text' },
                    'Reports'
                  )
                )
              )
            )
          ),
          _react2.default.createElement(_TotalsBanner2.default, { data: this.props.data }),
          _react2.default.createElement(
            'div',
            { className: 'Editor__logo' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' }),
            _react2.default.createElement(
              'div',
              { className: 'Datasets__sublogo' },
              'DairyBase'
            )
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TabHeader, 'TabHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabHeader/index.jsx');
}();

;

/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {

var dP = __webpack_require__(31);
var createDesc = __webpack_require__(99);
module.exports = __webpack_require__(30) ? function (object, key, value) {
  return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
  object[key] = value;
  return object;
};


/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var hide = __webpack_require__(48);
var has = __webpack_require__(52);
var SRC = __webpack_require__(103)('src');
var $toString = __webpack_require__(722);
var TO_STRING = 'toString';
var TPL = ('' + $toString).split(TO_STRING);

__webpack_require__(57).inspectSource = function (it) {
  return $toString.call(it);
};

(module.exports = function (O, key, val, safe) {
  var isFunction = typeof val == 'function';
  if (isFunction) has(val, 'name') || hide(val, 'name', key);
  if (O[key] === val) return;
  if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  if (O === global) {
    O[key] = val;
  } else if (!safe) {
    delete O[key];
    hide(O, key, val);
  } else if (O[key]) {
    O[key] = val;
  } else {
    hide(O, key, val);
  }
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
})(Function.prototype, TO_STRING, function toString() {
  return typeof this == 'function' && this[SRC] || $toString.call(this);
});


/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var fails = __webpack_require__(20);
var defined = __webpack_require__(66);
var quot = /"/g;
// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
var createHTML = function (string, tag, attribute, value) {
  var S = String(defined(string));
  var p1 = '<' + tag;
  if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
  return p1 + '>' + S + '</' + tag + '>';
};
module.exports = function (NAME, exec) {
  var O = {};
  O[NAME] = exec(createHTML);
  $export($export.P + $export.F * fails(function () {
    var test = ''[NAME]('"');
    return test !== test.toLowerCase() || test.split('"').length > 3;
  }), 'String', O);
};


/***/ }),
/* 51 */
/***/ (function(module, exports) {

var g;

// This works in non-strict mode
g = (function() {
	return this;
})();

try {
	// This works if eval is allowed (see CSP)
	g = g || Function("return this")() || (1,eval)("this");
} catch(e) {
	// This works if the window reference is available
	if(typeof window === "object")
		g = window;
}

// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}

module.exports = g;


/***/ }),
/* 52 */
/***/ (function(module, exports) {

var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
  return hasOwnProperty.call(it, key);
};


/***/ }),
/* 53 */
/***/ (function(module, exports, __webpack_require__) {

var pIE = __webpack_require__(137);
var createDesc = __webpack_require__(99);
var toIObject = __webpack_require__(55);
var toPrimitive = __webpack_require__(68);
var has = __webpack_require__(52);
var IE8_DOM_DEFINE = __webpack_require__(321);
var gOPD = Object.getOwnPropertyDescriptor;

exports.f = __webpack_require__(30) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  O = toIObject(O);
  P = toPrimitive(P, true);
  if (IE8_DOM_DEFINE) try {
    return gOPD(O, P);
  } catch (e) { /* empty */ }
  if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
};


/***/ }),
/* 54 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(52);
var toObject = __webpack_require__(35);
var IE_PROTO = __webpack_require__(232)('IE_PROTO');
var ObjectProto = Object.prototype;

module.exports = Object.getPrototypeOf || function (O) {
  O = toObject(O);
  if (has(O, IE_PROTO)) return O[IE_PROTO];
  if (typeof O.constructor == 'function' && O instanceof O.constructor) {
    return O.constructor.prototype;
  } return O instanceof Object ? ObjectProto : null;
};


/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {

// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(136);
var defined = __webpack_require__(66);
module.exports = function (it) {
  return IObject(defined(it));
};


/***/ }),
/* 56 */
/***/ (function(module, exports) {

var toString = {}.toString;

module.exports = function (it) {
  return toString.call(it).slice(8, -1);
};


/***/ }),
/* 57 */
/***/ (function(module, exports) {

var core = module.exports = { version: '2.6.9' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef


/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {

// optional / simple context binding
var aFunction = __webpack_require__(42);
module.exports = function (fn, that, length) {
  aFunction(fn);
  if (that === undefined) return fn;
  switch (length) {
    case 1: return function (a) {
      return fn.call(that, a);
    };
    case 2: return function (a, b) {
      return fn.call(that, a, b);
    };
    case 3: return function (a, b, c) {
      return fn.call(that, a, b, c);
    };
  }
  return function (/* ...args */) {
    return fn.apply(that, arguments);
  };
};


/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var fails = __webpack_require__(20);

module.exports = function (method, arg) {
  return !!method && fails(function () {
    // eslint-disable-next-line no-useless-call
    arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
  });
};


/***/ }),
/* 60 */
/***/ (function(module, exports) {

// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};


/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(141);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _contexts = __webpack_require__(405);

var _portalUtils = __webpack_require__(394);

var _checkDomTargetPath = __webpack_require__(393);

var _checkDomTargetPath2 = _interopRequireDefault(_checkDomTargetPath);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var Portal = function (_React$Component) {
  _inherits(Portal, _React$Component);

  function Portal(props) {
    _classCallCheck(this, Portal);

    var _this = _possibleConstructorReturn(this, (Portal.__proto__ || Object.getPrototypeOf(Portal)).call(this, props));

    _this.setContentRef = function () {
      return _this.__setContentRef__REACT_HOT_LOADER__.apply(_this, arguments);
    };

    _this.setCoords = function () {
      return _this.__setCoords__REACT_HOT_LOADER__.apply(_this, arguments);
    };

    _this.handleClick = function () {
      return _this.__handleClick__REACT_HOT_LOADER__.apply(_this, arguments);
    };

    _this.buttonRef = null;
    _this.contentRef = null;

    _this.state = {
      coordsSet: false
    };

    _this.node = document.createElement('div');

    var __NATIVE__ = window.__NATIVE__;

    if (props.fullscreen) {
      _this.node.className += ' scroll-touch';
      _this.node.style.cssText = '\n        position: ' + (__NATIVE__ ? 'absolute' : 'fixed') + ';\n        z-index: 1;\n        top: 0;\n        height: ' + (__NATIVE__ ? screen.height + 'px' : 'auto') + ';\n        bottom: ' + (__NATIVE__ ? 'auto' : '0') + ';\n        left: 0;\n        right: 0;\n        overflow-y: ' + (props.noscroll ? 'hidden' : 'scroll') + ';\n        background: ' + (props.background || 'rgba(255,255,255,0.9)') + ';\n      ';
    }

    _this.element = props.element || document.body;
    return _this;
  }

  _createClass(Portal, [{
    key: '__setContentRef__REACT_HOT_LOADER__',
    value: function __setContentRef__REACT_HOT_LOADER__(element) {
      this.contentRef = element;
    }
  }, {
    key: '__setCoords__REACT_HOT_LOADER__',
    value: function __setCoords__REACT_HOT_LOADER__() {
      var _props = this.props,
          popup = _props.popup,
          buttonRef = _props.buttonRef,
          position = _props.position,
          fullscreen = _props.fullscreen;
      var coordsSet = this.state.coordsSet;


      if (popup && this.buttonRef === null) {
        this.buttonRef = buttonRef;

        var coords = (0, _portalUtils.getPopupCoords)(buttonRef);

        var _pArr = position || 'top left';
        var positions = _pArr.split(' ');
        var top = positions[0];
        var left = positions[1];

        this.node.style.cssText = '\n        position: absolute;\n        z-index: 1;\n        top: ' + coords[top === 'center' ? 'yCenter' : top] + 'px;\n        left: ' + coords[left === 'center' ? 'xCenter' : left] + 'px;\n      ';
      }
    }
  }, {
    key: 'componentWillMount',
    value: function componentWillMount() {
      console.log('mounted portal');

      var _props2 = this.props,
          fullscreen = _props2.fullscreen,
          isMobile = _props2.isMobile,
          closeOnClick = _props2.closeOnClick;


      if (closeOnClick) {
        document.addEventListener(window.__xchClickEvtString, this.handleClick);
      }

      this.element.appendChild(this.node);
      // add portalId to manager
      // if (fullscreen) {
      //   this.portalId = openPortal({
      //     node: this.element,
      //     isMobile: isMobile,
      //   })
      // }
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      var _props3 = this.props,
          fullscreen = _props3.fullscreen,
          isMobile = _props3.isMobile,
          closeOnClick = _props3.closeOnClick;


      if (closeOnClick) document.removeEventListener(window.__xchClickEvtString, this.handleClick);

      // remove portal id from manager
      this.element.removeChild(this.node);
      // if (fullscreen) {
      //   closePortal({
      //     portalId: this.portalId,
      //     node: this.element,
      //     isMobile: isMobile,
      //   })
      // }
    }
  }, {
    key: '__handleClick__REACT_HOT_LOADER__',
    value: function __handleClick__REACT_HOT_LOADER__(event) {
      var onClose = this.props.onClose;

      var targetIsPopup = (0, _checkDomTargetPath2.default)(event, this.contentRef);

      if (!targetIsPopup) {
        onClose();
      }
    }
  }, {
    key: 'render',
    value: function render() {
      var _props4 = this.props,
          children = _props4.children,
          fullscreen = _props4.fullscreen,
          modal = _props4.modal,
          Children = _props4.Children,
          onToggle = _props4.onToggle,
          onClose = _props4.onClose,
          onOpen = _props4.onOpen,
          popup = _props4.popup,
          align = _props4.align;


      var portalFns = {
        onToggle: onToggle,
        onClose: onClose,
        onOpen: onOpen
      };

      this.setCoords();

      var ChildComponent = children;

      if (typeof children === 'function') {
        ChildComponent = children(portalFns);
      }

      if (Children) {
        ChildComponent = _react2.default.createElement(Children, portalFns);
      }

      var PortalComponent = ChildComponent;

      if (fullscreen) {
        PortalComponent = _react2.default.createElement(
          _contexts.scrollContext.Provider,
          { value: { scrollNode: this.node } },
          ChildComponent
        );

        // prob make a better switch here
        if (modal) {
          PortalComponent = _react2.default.createElement(
            _contexts.scrollContext.Provider,
            { value: { scrollNode: this.node } },
            _react2.default.createElement(
              'div',
              {
                style: {
                  display: 'flex',
                  alignItems: 'center',
                  justifyContent: 'center',
                  minHeight: '100%'
                } },
              ChildComponent
            )
          );
        }
      }

      if (popup && align) {
        var alignArr = align.split(' ');
        var y = alignArr[0];
        var x = alignArr[1];

        var alignment = {
          top: y === 'top' || y === 'center' ? 0 : undefined,
          bottom: y === 'bottom' ? 0 : undefined,
          left: x === 'left' || x === 'center' ? 0 : undefined,
          right: x === 'right' ? 0 : undefined,
          transform: '\n          ' + (x === 'center' ? 'translateX(-50%)' : '') + '\n          ' + (y === 'center' ? 'translateY(-50%)' : '') + '\n        '
        };

        PortalComponent = _react2.default.createElement(
          'div',
          {
            ref: this.setContentRef,
            style: _extends({
              position: 'absolute',
              zIndex: 1
            }, alignment) },
          ChildComponent
        );
      }

      return _reactDom2.default.createPortal(PortalComponent, this.node);
    }
  }]);

  return Portal;
}(_react2.default.Component);

var Door = function (_React$Component2) {
  _inherits(Door, _React$Component2);

  function Door(props) {
    _classCallCheck(this, Door);

    var _this2 = _possibleConstructorReturn(this, (Door.__proto__ || Object.getPrototypeOf(Door)).call(this, props));

    _this2.setButtonRef = function () {
      return _this2.__setButtonRef__REACT_HOT_LOADER__.apply(_this2, arguments);
    };

    _this2.handleToggle = function () {
      return _this2.__handleToggle__REACT_HOT_LOADER__.apply(_this2, arguments);
    };

    _this2.handleOpen = function () {
      return _this2.__handleOpen__REACT_HOT_LOADER__.apply(_this2, arguments);
    };

    _this2.handleClose = function () {
      return _this2.__handleClose__REACT_HOT_LOADER__.apply(_this2, arguments);
    };

    _this2.state = {
      isOpen: props.isOpen,
      buttonRef: null
    };

    _this2.buttonRef = null;
    return _this2;
  }

  _createClass(Door, [{
    key: 'shouldComponentUpdate',
    value: function shouldComponentUpdate(nextProps, nextState) {
      var _props5 = this.props,
          useExternalState = _props5.useExternalState,
          isOpen = _props5.isOpen;

      return !useExternalState || nextProps.isOpen !== this.props.isOpen;
    }
  }, {
    key: '__setButtonRef__REACT_HOT_LOADER__',
    value: function __setButtonRef__REACT_HOT_LOADER__(element) {
      this.buttonRef = element;

      this.setState(function (state, props) {
        return {
          buttonRef: element
        };
      });
    }
  }, {
    key: '__handleToggle__REACT_HOT_LOADER__',
    value: function __handleToggle__REACT_HOT_LOADER__() {
      var isOpen = this.state.isOpen;

      if (isOpen) return this.handleClose();
      return this.handleOpen();
    }
  }, {
    key: '__handleOpen__REACT_HOT_LOADER__',
    value: function __handleOpen__REACT_HOT_LOADER__() {
      this.setState(function (state, props) {
        return {
          isOpen: true
        };
      });
    }
  }, {
    key: '__handleClose__REACT_HOT_LOADER__',
    value: function __handleClose__REACT_HOT_LOADER__() {
      this.setState(function (state, props) {
        return {
          isOpen: false
        };
      });
    }
  }, {
    key: 'render',
    value: function render() {
      var _props6 = this.props,
          Button = _props6.Button,
          onToggle = _props6.onToggle,
          onClose = _props6.onClose,
          onOpen = _props6.onOpen,
          useExternalState = _props6.useExternalState,
          popup = _props6.popup;


      var isOpen = useExternalState ? this.props.isOpen : this.state.isOpen;

      var portalFns = {
        onToggle: useExternalState ? onToggle : this.handleToggle,
        onClose: useExternalState ? onClose : this.handleClose,
        onOpen: useExternalState ? onOpen : this.handleOpen

        // TODO: allow the button to set itself as the ref when using popup?
        // ... pretty sure the ref is only used for popups

      };var _button = null;

      if (Button) {
        _button = _react2.default.createElement(Button, _extends({}, portalFns, { isOpen: isOpen }));

        if (popup) {
          _button = _react2.default.createElement(
            'div',
            { ref: this.setButtonRef },
            _react2.default.createElement(Button, _extends({}, portalFns, { isOpen: isOpen }))
          );
        }
      }

      var _portal = !isOpen ? null : _react2.default.createElement(Portal, _extends({}, this.props, portalFns, {
        isOpen: isOpen,
        buttonRef: this.state.buttonRef
      }));

      return _react2.default.createElement(
        _react2.default.Fragment,
        null,
        _button,
        _portal
      );
    }
  }]);

  return Door;
}(_react2.default.Component);

// const simpleExample = true && (
//   <Portal
//     isOpen // bool - defaults to false, required here to open the portal on mount some child content
//   >
//   </Portal>
// )

// const standardExample = (
//   <Portal
//     element={'someDomNode'} // domNode/ref - optional, defaults to document.body
//     fullscreen // bool - optional that sets up fixed position and scrollcontext
//     background='#fafafa' // string - optional, can be 'none', or a colour, defaults to 'rgba(255,255,255,0.9)'

//     // render props - optional, provide access to the portal's internal state and methods

//     // Button will always render
//     Button={({isOpen, onToggle, onOpen, onClose}) => <button onClick={onOpen} />}

//     // Children will render if the portal is open.
//     Children={({onToggle, onOpen, onClose}) => (
//       <div>
//         <button onClick={onClose} />
//         some child content
//       </div>
//     )} />
// )

// const PopupExample = (
//   <Portal
//     popup // bool - optional that sets up the positioning of the portal based on the Button ref

//     // string - optional, once in popup mode, the portal uses this to set the
//     // absolute coordinates of the child element(s), based on
//     // the options are `${'top' || 'center' || 'bottom'} ${'left' || 'center' || 'right'}`
//     // the default is 'top left'.
//     position="center right"

//     // string - optional, as above, except this creates a new element, wrapping the children
//     // and aligning them relative to the coordinate position above
//     // the default value is also effectively 'top left' (although it isn't actually set)
//     align="bottom center"

//     // the popup portal requires a Button prop as a reference point, although this doesn't
//     // _have_ to be a <button /> or even have a click event (if the portal is always open).
//     Button={(props) => <button onClick={props.onToggle}>popup</button>}>
//       some child content
//   </Portal>
// )


var _default = Door;
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Portal, 'Portal', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/index.js');

  __REACT_HOT_LOADER__.register(Door, 'Door', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function getCoords(elem, reverse) {
  // crossbrowser version

  if (!elem) return {};
  var box = elem.getBoundingClientRect();

  var body = document.body;
  var docEl = document.documentElement;

  var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
  var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;

  var clientTop = docEl.clientTop || body.clientTop || 0;
  var clientLeft = docEl.clientLeft || body.clientLeft || 0;

  var top = box.top + scrollTop - clientTop;
  var bottom = box.bottom + scrollTop - clientTop;
  var left = box.left + scrollLeft - clientLeft;

  if (reverse) return {
    top: Math.round(bottom) - 15,
    left: Math.round(left) + elem.offsetWidth / 2
  };
  return {
    top: Math.round(top) - 15,
    left: Math.round(left) + elem.offsetWidth / 2
  };
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1178);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// a generic handler for data... can wrap any thin API element?

var ColumnWrapper = module.exports = __webpack_require__(1)({
  _renderChildren: function _renderChildren() {
    return _react2.default.Children.map(this.props.children, function (child) {
      return _react2.default.createElement(
        'div',
        { className: '_col' },
        child
      );
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ColumnWrapper' },
      this._renderChildren()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ColumnWrapper, 'ColumnWrapper', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ColumnWrapper/index.jsx');
}();

;

/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1184);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LabelWrapper = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'LabelWrapper' },
      _react2.default.createElement(
        'div',
        { className: '_title' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.label,
          description: this.props.description })
      ),
      this.props.children
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LabelWrapper, 'LabelWrapper', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_LabelWrapper/index.jsx');
}();

;

/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {

// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(58);
var IObject = __webpack_require__(136);
var toObject = __webpack_require__(35);
var toLength = __webpack_require__(27);
var asc = __webpack_require__(216);
module.exports = function (TYPE, $create) {
  var IS_MAP = TYPE == 1;
  var IS_FILTER = TYPE == 2;
  var IS_SOME = TYPE == 3;
  var IS_EVERY = TYPE == 4;
  var IS_FIND_INDEX = TYPE == 6;
  var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  var create = $create || asc;
  return function ($this, callbackfn, that) {
    var O = toObject($this);
    var self = IObject(O);
    var f = ctx(callbackfn, that, 3);
    var length = toLength(self.length);
    var index = 0;
    var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
    var val, res;
    for (;length > index; index++) if (NO_HOLES || index in self) {
      val = self[index];
      res = f(val, index, O);
      if (TYPE) {
        if (IS_MAP) result[index] = res;   // map
        else if (res) switch (TYPE) {
          case 3: return true;             // some
          case 5: return val;              // find
          case 6: return index;            // findIndex
          case 2: result.push(val);        // filter
        } else if (IS_EVERY) return false; // every
      }
    }
    return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  };
};


/***/ }),
/* 66 */
/***/ (function(module, exports) {

// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
  if (it == undefined) throw TypeError("Can't call method on  " + it);
  return it;
};


/***/ }),
/* 67 */
/***/ (function(module, exports, __webpack_require__) {

// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(2);
var core = __webpack_require__(57);
var fails = __webpack_require__(20);
module.exports = function (KEY, exec) {
  var fn = (core.Object || {})[KEY] || Object[KEY];
  var exp = {};
  exp[KEY] = exec(fn);
  $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};


/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {

// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(22);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
  if (!isObject(it)) return it;
  var fn, val;
  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  throw TypeError("Can't convert object to primitive value");
};


/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __datasetGroups = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.store = [];
    this.listenToMany(_Actions2.default);
  },
  UPDATE_GROUP_LIST: function UPDATE_GROUP_LIST(data) {
    this.store = data;
    this.trigger();
  },
  CREATE_GROUP: function CREATE_GROUP(data) {
    this.store.push(data);
    this.trigger();
  },
  DELETE_GROUP: function DELETE_GROUP(groupId) {
    var index = _.findIndex(this.store, { id: groupId });
    this.store.splice(index, 1);
    this.trigger();
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__datasetGroups, '__datasetGroups', 'C:/_repos_windows/dairybase/Frontend/app/stores/__datasetGroups/index.js');
}();

;

/***/ }),
/* 70 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function () {
  return _datasetList2.default.store.filter(function (item, index) {
    return !item.ArchiveStatus && !item.Invisible;
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1058);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Popup = __webpack_require__(157);

var _Popup2 = _interopRequireDefault(_Popup);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      popupIsActive: false
    };
  },
  _handleClassList: function _handleClassList() {
    var classList = {
      OutputTotal: true,
      'has-description': this._hasDescription()
    };

    if (typeof this.props.theme !== 'undefined') {
      classList[this.props.theme] = true;
    }
    return (0, _classnames2.default)(classList);
  },
  componentDidMount: function componentDidMount() {
    this.setState({
      elem: this.label
    });
  },
  _togglePopup: function _togglePopup() {
    var _this = this;

    if (typeof this.props.data.Description === 'string') {
      this.setState({
        popupIsActive: !this.state.popupIsActive,
        coords: (0, _getDomCoords3.default)(this.label)
      }, function () {
        _this.state.popupIsActive ? document.addEventListener('click', _this._togglePopup) : document.removeEventListener('click', _this._togglePopup);
      });
    }
  },
  _hasDescription: function _hasDescription() {
    return typeof this.props.data.Description === 'string';
  },
  render: function render() {
    var _this2 = this;

    // TODO: handle number types (percent etc)
    var classList = this._handleClassList();
    var dataValue = (0, _commas.addCommas)(this.props.data.Value);
    var value = typeof dataValue === 'undefined' || dataValue === null ? '-' : dataValue;

    var altData = typeof this.props.alt === 'undefined' ? '' : _react2.default.createElement(
      'div',
      { className: '_alts' },
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this.props.alt.value
      ),
      _react2.default.createElement(
        'span',
        { className: '_label' },
        this.props.alt.label
      )
    );
    var dollars = this.props.dollars ? '$' : false;
    return _react2.default.createElement(
      'div',
      { className: classList, onClick: this._togglePopup },
      _react2.default.createElement('span', { className: '_bar' }),
      _react2.default.createElement(
        'span',
        { ref: function ref(_ref) {
            return _this2.label = _ref;
          }, className: '_value' },
        dollars,
        value
      ),
      _react2.default.createElement('span', {
        className: '_label',
        dangerouslySetInnerHTML: { __html: this.props.label }
      }),
      _react2.default.createElement(
        'span',
        { className: '_units' },
        this.props.units
      ),
      altData,
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.popupIsActive,
          className: 'Popup' },
        _react2.default.createElement(_Popup2.default, {
          coords: this.state.coords,
          text: this.props.data.Description
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1074);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _select = __webpack_require__(507);

var _select2 = _interopRequireDefault(_select);

var _farmIdSelect = __webpack_require__(506);

var _farmIdSelect2 = _interopRequireDefault(_farmIdSelect);

var _checkCurrentYear = __webpack_require__(448);

var _checkCurrentYear2 = _interopRequireDefault(_checkCurrentYear);

var _POST__createDataset = __webpack_require__(145);

var _POST__createDataset2 = _interopRequireDefault(_POST__createDataset);

var _POST__uploadExcelFile = __webpack_require__(423);

var _POST__uploadExcelFile2 = _interopRequireDefault(_POST__uploadExcelFile);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _UploadRequestModal = __webpack_require__(505);

var _UploadRequestModal2 = _interopRequireDefault(_UploadRequestModal);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getRegionList: function getRegionList(selectedCode) {
    var regionList = _dataDefinition2.default.selectOptions.RegionId;

    if (selectedCode === 'DA0001') return regionList;

    return regionList.filter(function (r) {
      var shortcode = selectedCode.substring(0, 2);
      return r.ShortCode === shortcode;
    });
  },
  getInitialState: function getInitialState() {
    var yearList = _dataDefinition2.default.selectOptions.FinancialYearId;

    var authorisedFarmList = _dataDefinition2.default.selectOptions.FarmId.filter(function (farm) {
      return _.find(_dataDefinition2.default.farmList, { DairyBaseId: farm.Title }).CreateAuthority;
    });

    var authorisedDatasetList = _.filter(_datasetList2.default.store, function (dataset) {
      return dataset.CopyAuthority && !dataset.ArchiveStatus;
    }).map(function (dataset) {
      return {
        Id: dataset.Id,
        Title: dataset.Name
      };
    });

    var da0001 = _.find(authorisedFarmList, { Title: 'DA0001' });

    if (da0001) {
      authorisedFarmList = authorisedFarmList.filter(function (farm) {
        return farm.Title !== 'DA0001';
      }).concat([da0001]);
    }

    var defaultFarm = typeof this.props.prefillFarm !== 'undefined' ? this.props.prefillFarm : authorisedFarmList[0].Title;

    var regionList = this.getRegionList(defaultFarm);
    console.log(this.props.prefillDataset);

    return {
      helpPortalsOpen: {},
      farmList: authorisedFarmList,
      farm: defaultFarm,
      regionList: regionList,
      regionId: regionList[0].Id, // ...set a sensible default here...,
      yearList: yearList,
      year: typeof this.props.prefillYear !== 'undefined' ? yearList[_.findIndex(yearList, { Title: this.props.prefillYear })].Id : yearList[(0, _checkCurrentYear2.default)(yearList)].Id,
      privacyList: _dataDefinition2.default.selectOptions.PrivacySettingId,
      privacy: 3,
      datasetList: authorisedDatasetList,
      dataset: typeof this.props.prefillDataset !== 'undefined' ? this.props.prefillDataset : authorisedDatasetList[0].Id
    };
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  _handleInputChange: function _handleInputChange(evt) {
    var _data = this.state;
    var _id = evt.currentTarget.id;
    var _value = evt.target.value;
    _data[_id] = _value;
    _data.error = false;

    if (_id === 'farm') {
      var newRegionList = this.getRegionList(_value);
      _data['regionList'] = newRegionList;
      _data['regionId'] = newRegionList[0].Id;
    }

    this.setState(_data);
  },
  _handleUpload: function _handleUpload(e) {
    var files;
    if (e.dataTransfer) {
      files = e.dataTransfer.files;
    } else if (e.target) {
      files = e.target.files;
    }
    this.setState({
      file: files[0]
    }, function () {
      this._toggleUploadRequestPortal();
    });
  },
  _handleUploadResponse: function _handleUploadResponse(cancelled) {
    if (cancelled) {
      this._toggleUploadRequestPortal();
      return this.props.callback(true);
    }
    setTimeout(this._toggleUploadRequestPortal, 500);
    if (typeof this.props.callback !== 'undefined') {
      this.props.callback();
    }
  },
  _toggleUploadRequestPortal: function _toggleUploadRequestPortal() {
    this.setState({
      uploadRequestPortalOpen: !this.state.uploadRequestPortalOpen
    });
  },
  _handleBulkUpload: function _handleBulkUpload(e) {
    var files;
    if (e.dataTransfer) {
      files = e.dataTransfer.files;
    } else if (e.target) {
      files = e.target.files;
    }
    this.setState({
      bulkFile: files[0]
    }, function () {
      this._toggleBulkUploadRequestPortal();
    });
  },
  _handleBulkUploadResponse: function _handleBulkUploadResponse() {
    setTimeout(this._toggleBulkUploadRequestPortal, 500);
    if (typeof this.props.bulkCallback !== 'undefined') {
      this.props.bulkCallback();
    }
  },
  _toggleBulkUploadRequestPortal: function _toggleBulkUploadRequestPortal() {
    this.setState({
      bulkUploadRequestPortalOpen: !this.state.bulkUploadRequestPortalOpen
    });
  },
  _toggleCreateRequestPortal: function _toggleCreateRequestPortal() {
    if (typeof this.state.name === 'undefined') return;
    this.setState({
      createRequestPortalOpen: !this.state.createRequestPortalOpen
    });
  },
  _handleCreateResponse: function _handleCreateResponse() {
    setTimeout(this._toggleCreateRequestPortal, 500);
    if (typeof this.props.callback !== 'undefined') {
      this.props.callback();
    }
  },
  render: function render() {
    var classList = (0, _classnames2.default)({
      CreateForm: true,
      'is-error': this.state.error
    });
    return _react2.default.createElement(
      'div',
      { className: classList },
      _react2.default.createElement(
        'label',
        { className: '_field', htmlFor: 'name' },
        _react2.default.createElement(
          'span',
          { className: '_label' },
          'Name:'
        ),
        _react2.default.createElement('input', {
          type: 'text',
          className: '_input',
          id: 'name',
          value: this.state.name,
          placeholder: 'My new dataset...',
          onChange: this._handleInputChange
        })
      ),
      _react2.default.createElement(
        'label',
        { className: '_field is-description', htmlFor: 'description' },
        _react2.default.createElement(
          'span',
          { className: '_label' },
          'Description:'
        ),
        _react2.default.createElement('textarea', {
          className: '_input',
          rows: '3',
          id: 'description',
          value: this.state.description,
          placeholder: 'A description of my dataset...',
          onChange: this._handleInputChange
        })
      ),
      _react2.default.createElement(
        'label',
        { className: '_field is-description', htmlFor: 'farm' },
        _react2.default.createElement(
          'span',
          { className: '_label' },
          'Farm:'
        ),
        _react2.default.createElement(_farmIdSelect2.default, {
          id: 'farm',
          value: this.state.farm,
          options: this.state.farmList,
          handleChange: this._handleInputChange
        })
      ),
      _react2.default.createElement(
        'label',
        { className: '_field is-description', htmlFor: 'regionId' },
        _react2.default.createElement(
          'span',
          { className: '_label' },
          'DFMP Region:'
        ),
        _react2.default.createElement(_select2.default, {
          id: 'regionId',
          value: this.state.regionId,
          options: this.state.regionList,
          handleChange: this._handleInputChange
        })
      ),
      _react2.default.createElement(
        'label',
        { className: '_field is-description', htmlFor: 'year' },
        _react2.default.createElement(
          'span',
          { className: '_label' },
          'Year:'
        ),
        _react2.default.createElement(_select2.default, {
          id: 'year',
          value: this.state.year,
          options: this.state.yearList,
          handleChange: this._handleInputChange
        })
      ),
      _react2.default.createElement(
        'label',
        { className: '_field is-description', htmlFor: 'privacy' },
        _react2.default.createElement(
          'span',
          { className: '_label' },
          'Privacy Setting:',
          _react2.default.createElement(_GenericHelpBtn2.default, {
            offsetLeft: -80,
            offsetTop: -4,
            onClick: this._toggleHelpPortal.bind(this, 'PrivacyHelp')
          })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.helpPortalsOpen['PrivacyHelp'],
            className: 'Overlay--help' },
          _react2.default.createElement(
            _HelpModal2.default,
            {
              closePortal: this._toggleHelpPortal.bind(this, 'PrivacyHelp') },
            _react2.default.createElement(_HelpText2.default, { id: 'PrivacyHelp', className: 'HelpModal__text' })
          )
        ),
        _react2.default.createElement(_select2.default, {
          id: 'privacy',
          value: this.state.privacy,
          options: this.state.privacyList,
          handleChange: this._handleInputChange
        })
      ),
      this.renderPrefillDataset(),
      _react2.default.createElement(
        'button',
        {
          className: '_submitBtn',
          onClick: this._toggleCreateRequestPortal },
        'Create Dataset'
      ),
      this._renderSpreadsheetUpload(),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.createRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleCreateResponse,
          failHandler: this._toggleCreateRequestPortal,
          request: _POST__createDataset2.default,
          data: {
            useActiveDataset: this.props.useActive,
            postData: {
              FarmDataSetId: this.state.dataset,
              Name: this.state.name,
              Description: this.state.description || '',
              DairyBaseId: this.state.farm,
              RegionId: this.state.regionId,
              FinancialYearId: this.state.year,
              PrivacySettingId: this.state.privacy,
              IsActual: false
            }
          },
          pendingText: {
            title: 'Please wait',
            text: 'Creating Dataset...'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset was created.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be created.'
          }
        })
      )
    );
  },
  renderPrefillDataset: function renderPrefillDataset() {
    return this.props.useActive ? null : _react2.default.createElement(
      'label',
      { className: '_field is-description', htmlFor: 'dataset' },
      _react2.default.createElement(
        'span',
        { className: '_label' },
        'Prefill with data from:'
      ),
      _react2.default.createElement(_select2.default, {
        id: 'dataset',
        value: this.state.dataset,
        options: this.state.datasetList,
        handleChange: this._handleInputChange
      })
    );
  },
  _renderSpreadsheetUpload: function _renderSpreadsheetUpload() {
    return _user2.default.userAuthority > 2 || this.props.useActive ? null : _react2.default.createElement(
      'div',
      { className: '_uploadBtn' },
      _react2.default.createElement(
        'h3',
        { className: '_title' },
        'Upload Spreadsheet or Taking Stock xml file:'
      ),
      _react2.default.createElement('input', {
        type: 'file',
        className: '_uploadBtn',
        onChange: this._handleUpload
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.uploadRequestPortalOpen },
        _react2.default.createElement(_UploadRequestModal2.default, {
          successHandler: this._handleUploadResponse,
          failHandler: this._toggleUploadRequestPortal,
          request: _POST__uploadExcelFile2.default,
          data: this.state.file,
          pendingText: {
            title: 'Please wait',
            text: 'Uploading spreadsheet...'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset was created.'
          },
          acceptedText: {
            title: 'Oops, better check first.',
            text: 'The following datasets will be overwritten by this upload, do you want to continue?'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be created.'
          }
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {

var Map = __webpack_require__(343);
var $export = __webpack_require__(2);
var shared = __webpack_require__(138)('metadata');
var store = shared.store || (shared.store = new (__webpack_require__(347))());

var getOrCreateMetadataMap = function (target, targetKey, create) {
  var targetMetadata = store.get(target);
  if (!targetMetadata) {
    if (!create) return undefined;
    store.set(target, targetMetadata = new Map());
  }
  var keyMetadata = targetMetadata.get(targetKey);
  if (!keyMetadata) {
    if (!create) return undefined;
    targetMetadata.set(targetKey, keyMetadata = new Map());
  } return keyMetadata;
};
var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
  var metadataMap = getOrCreateMetadataMap(O, P, false);
  return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
  var metadataMap = getOrCreateMetadataMap(O, P, false);
  return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
  getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function (target, targetKey) {
  var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
  var keys = [];
  if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
  return keys;
};
var toMetaKey = function (it) {
  return it === undefined || typeof it == 'symbol' ? it : String(it);
};
var exp = function (O) {
  $export($export.S, 'Reflect', O);
};

module.exports = {
  store: store,
  map: getOrCreateMetadataMap,
  has: ordinaryHasOwnMetadata,
  get: ordinaryGetOwnMetadata,
  set: ordinaryDefineOwnMetadata,
  keys: ordinaryOwnMetadataKeys,
  key: toMetaKey,
  exp: exp
};


/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

if (__webpack_require__(30)) {
  var LIBRARY = __webpack_require__(81);
  var global = __webpack_require__(16);
  var fails = __webpack_require__(20);
  var $export = __webpack_require__(2);
  var $typed = __webpack_require__(177);
  var $buffer = __webpack_require__(237);
  var ctx = __webpack_require__(58);
  var anInstance = __webpack_require__(94);
  var propertyDesc = __webpack_require__(99);
  var hide = __webpack_require__(48);
  var redefineAll = __webpack_require__(100);
  var toInteger = __webpack_require__(60);
  var toLength = __webpack_require__(27);
  var toIndex = __webpack_require__(341);
  var toAbsoluteIndex = __webpack_require__(102);
  var toPrimitive = __webpack_require__(68);
  var has = __webpack_require__(52);
  var classof = __webpack_require__(113);
  var isObject = __webpack_require__(22);
  var toObject = __webpack_require__(35);
  var isArrayIter = __webpack_require__(223);
  var create = __webpack_require__(96);
  var getPrototypeOf = __webpack_require__(54);
  var gOPN = __webpack_require__(97).f;
  var getIterFn = __webpack_require__(239);
  var uid = __webpack_require__(103);
  var wks = __webpack_require__(26);
  var createArrayMethod = __webpack_require__(65);
  var createArrayIncludes = __webpack_require__(165);
  var speciesConstructor = __webpack_require__(139);
  var ArrayIterators = __webpack_require__(240);
  var Iterators = __webpack_require__(114);
  var $iterDetect = __webpack_require__(170);
  var setSpecies = __webpack_require__(101);
  var arrayFill = __webpack_require__(215);
  var arrayCopyWithin = __webpack_require__(313);
  var $DP = __webpack_require__(31);
  var $GOPD = __webpack_require__(53);
  var dP = $DP.f;
  var gOPD = $GOPD.f;
  var RangeError = global.RangeError;
  var TypeError = global.TypeError;
  var Uint8Array = global.Uint8Array;
  var ARRAY_BUFFER = 'ArrayBuffer';
  var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
  var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
  var PROTOTYPE = 'prototype';
  var ArrayProto = Array[PROTOTYPE];
  var $ArrayBuffer = $buffer.ArrayBuffer;
  var $DataView = $buffer.DataView;
  var arrayForEach = createArrayMethod(0);
  var arrayFilter = createArrayMethod(2);
  var arraySome = createArrayMethod(3);
  var arrayEvery = createArrayMethod(4);
  var arrayFind = createArrayMethod(5);
  var arrayFindIndex = createArrayMethod(6);
  var arrayIncludes = createArrayIncludes(true);
  var arrayIndexOf = createArrayIncludes(false);
  var arrayValues = ArrayIterators.values;
  var arrayKeys = ArrayIterators.keys;
  var arrayEntries = ArrayIterators.entries;
  var arrayLastIndexOf = ArrayProto.lastIndexOf;
  var arrayReduce = ArrayProto.reduce;
  var arrayReduceRight = ArrayProto.reduceRight;
  var arrayJoin = ArrayProto.join;
  var arraySort = ArrayProto.sort;
  var arraySlice = ArrayProto.slice;
  var arrayToString = ArrayProto.toString;
  var arrayToLocaleString = ArrayProto.toLocaleString;
  var ITERATOR = wks('iterator');
  var TAG = wks('toStringTag');
  var TYPED_CONSTRUCTOR = uid('typed_constructor');
  var DEF_CONSTRUCTOR = uid('def_constructor');
  var ALL_CONSTRUCTORS = $typed.CONSTR;
  var TYPED_ARRAY = $typed.TYPED;
  var VIEW = $typed.VIEW;
  var WRONG_LENGTH = 'Wrong length!';

  var $map = createArrayMethod(1, function (O, length) {
    return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
  });

  var LITTLE_ENDIAN = fails(function () {
    // eslint-disable-next-line no-undef
    return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
  });

  var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
    new Uint8Array(1).set({});
  });

  var toOffset = function (it, BYTES) {
    var offset = toInteger(it);
    if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
    return offset;
  };

  var validate = function (it) {
    if (isObject(it) && TYPED_ARRAY in it) return it;
    throw TypeError(it + ' is not a typed array!');
  };

  var allocate = function (C, length) {
    if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
      throw TypeError('It is not a typed array constructor!');
    } return new C(length);
  };

  var speciesFromList = function (O, list) {
    return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
  };

  var fromList = function (C, list) {
    var index = 0;
    var length = list.length;
    var result = allocate(C, length);
    while (length > index) result[index] = list[index++];
    return result;
  };

  var addGetter = function (it, key, internal) {
    dP(it, key, { get: function () { return this._d[internal]; } });
  };

  var $from = function from(source /* , mapfn, thisArg */) {
    var O = toObject(source);
    var aLen = arguments.length;
    var mapfn = aLen > 1 ? arguments[1] : undefined;
    var mapping = mapfn !== undefined;
    var iterFn = getIterFn(O);
    var i, length, values, result, step, iterator;
    if (iterFn != undefined && !isArrayIter(iterFn)) {
      for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
        values.push(step.value);
      } O = values;
    }
    if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
    for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
      result[i] = mapping ? mapfn(O[i], i) : O[i];
    }
    return result;
  };

  var $of = function of(/* ...items */) {
    var index = 0;
    var length = arguments.length;
    var result = allocate(this, length);
    while (length > index) result[index] = arguments[index++];
    return result;
  };

  // iOS Safari 6.x fails here
  var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });

  var $toLocaleString = function toLocaleString() {
    return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
  };

  var proto = {
    copyWithin: function copyWithin(target, start /* , end */) {
      return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
    },
    every: function every(callbackfn /* , thisArg */) {
      return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
    },
    fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
      return arrayFill.apply(validate(this), arguments);
    },
    filter: function filter(callbackfn /* , thisArg */) {
      return speciesFromList(this, arrayFilter(validate(this), callbackfn,
        arguments.length > 1 ? arguments[1] : undefined));
    },
    find: function find(predicate /* , thisArg */) {
      return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
    },
    findIndex: function findIndex(predicate /* , thisArg */) {
      return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
    },
    forEach: function forEach(callbackfn /* , thisArg */) {
      arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
    },
    indexOf: function indexOf(searchElement /* , fromIndex */) {
      return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
    },
    includes: function includes(searchElement /* , fromIndex */) {
      return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
    },
    join: function join(separator) { // eslint-disable-line no-unused-vars
      return arrayJoin.apply(validate(this), arguments);
    },
    lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
      return arrayLastIndexOf.apply(validate(this), arguments);
    },
    map: function map(mapfn /* , thisArg */) {
      return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
    },
    reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
      return arrayReduce.apply(validate(this), arguments);
    },
    reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
      return arrayReduceRight.apply(validate(this), arguments);
    },
    reverse: function reverse() {
      var that = this;
      var length = validate(that).length;
      var middle = Math.floor(length / 2);
      var index = 0;
      var value;
      while (index < middle) {
        value = that[index];
        that[index++] = that[--length];
        that[length] = value;
      } return that;
    },
    some: function some(callbackfn /* , thisArg */) {
      return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
    },
    sort: function sort(comparefn) {
      return arraySort.call(validate(this), comparefn);
    },
    subarray: function subarray(begin, end) {
      var O = validate(this);
      var length = O.length;
      var $begin = toAbsoluteIndex(begin, length);
      return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
        O.buffer,
        O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
        toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
      );
    }
  };

  var $slice = function slice(start, end) {
    return speciesFromList(this, arraySlice.call(validate(this), start, end));
  };

  var $set = function set(arrayLike /* , offset */) {
    validate(this);
    var offset = toOffset(arguments[1], 1);
    var length = this.length;
    var src = toObject(arrayLike);
    var len = toLength(src.length);
    var index = 0;
    if (len + offset > length) throw RangeError(WRONG_LENGTH);
    while (index < len) this[offset + index] = src[index++];
  };

  var $iterators = {
    entries: function entries() {
      return arrayEntries.call(validate(this));
    },
    keys: function keys() {
      return arrayKeys.call(validate(this));
    },
    values: function values() {
      return arrayValues.call(validate(this));
    }
  };

  var isTAIndex = function (target, key) {
    return isObject(target)
      && target[TYPED_ARRAY]
      && typeof key != 'symbol'
      && key in target
      && String(+key) == String(key);
  };
  var $getDesc = function getOwnPropertyDescriptor(target, key) {
    return isTAIndex(target, key = toPrimitive(key, true))
      ? propertyDesc(2, target[key])
      : gOPD(target, key);
  };
  var $setDesc = function defineProperty(target, key, desc) {
    if (isTAIndex(target, key = toPrimitive(key, true))
      && isObject(desc)
      && has(desc, 'value')
      && !has(desc, 'get')
      && !has(desc, 'set')
      // TODO: add validation descriptor w/o calling accessors
      && !desc.configurable
      && (!has(desc, 'writable') || desc.writable)
      && (!has(desc, 'enumerable') || desc.enumerable)
    ) {
      target[key] = desc.value;
      return target;
    } return dP(target, key, desc);
  };

  if (!ALL_CONSTRUCTORS) {
    $GOPD.f = $getDesc;
    $DP.f = $setDesc;
  }

  $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
    getOwnPropertyDescriptor: $getDesc,
    defineProperty: $setDesc
  });

  if (fails(function () { arrayToString.call({}); })) {
    arrayToString = arrayToLocaleString = function toString() {
      return arrayJoin.call(this);
    };
  }

  var $TypedArrayPrototype$ = redefineAll({}, proto);
  redefineAll($TypedArrayPrototype$, $iterators);
  hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
  redefineAll($TypedArrayPrototype$, {
    slice: $slice,
    set: $set,
    constructor: function () { /* noop */ },
    toString: arrayToString,
    toLocaleString: $toLocaleString
  });
  addGetter($TypedArrayPrototype$, 'buffer', 'b');
  addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
  addGetter($TypedArrayPrototype$, 'byteLength', 'l');
  addGetter($TypedArrayPrototype$, 'length', 'e');
  dP($TypedArrayPrototype$, TAG, {
    get: function () { return this[TYPED_ARRAY]; }
  });

  // eslint-disable-next-line max-statements
  module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
    CLAMPED = !!CLAMPED;
    var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
    var GETTER = 'get' + KEY;
    var SETTER = 'set' + KEY;
    var TypedArray = global[NAME];
    var Base = TypedArray || {};
    var TAC = TypedArray && getPrototypeOf(TypedArray);
    var FORCED = !TypedArray || !$typed.ABV;
    var O = {};
    var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
    var getter = function (that, index) {
      var data = that._d;
      return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
    };
    var setter = function (that, index, value) {
      var data = that._d;
      if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
      data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
    };
    var addElement = function (that, index) {
      dP(that, index, {
        get: function () {
          return getter(this, index);
        },
        set: function (value) {
          return setter(this, index, value);
        },
        enumerable: true
      });
    };
    if (FORCED) {
      TypedArray = wrapper(function (that, data, $offset, $length) {
        anInstance(that, TypedArray, NAME, '_d');
        var index = 0;
        var offset = 0;
        var buffer, byteLength, length, klass;
        if (!isObject(data)) {
          length = toIndex(data);
          byteLength = length * BYTES;
          buffer = new $ArrayBuffer(byteLength);
        } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
          buffer = data;
          offset = toOffset($offset, BYTES);
          var $len = data.byteLength;
          if ($length === undefined) {
            if ($len % BYTES) throw RangeError(WRONG_LENGTH);
            byteLength = $len - offset;
            if (byteLength < 0) throw RangeError(WRONG_LENGTH);
          } else {
            byteLength = toLength($length) * BYTES;
            if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
          }
          length = byteLength / BYTES;
        } else if (TYPED_ARRAY in data) {
          return fromList(TypedArray, data);
        } else {
          return $from.call(TypedArray, data);
        }
        hide(that, '_d', {
          b: buffer,
          o: offset,
          l: byteLength,
          e: length,
          v: new $DataView(buffer)
        });
        while (index < length) addElement(that, index++);
      });
      TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
      hide(TypedArrayPrototype, 'constructor', TypedArray);
    } else if (!fails(function () {
      TypedArray(1);
    }) || !fails(function () {
      new TypedArray(-1); // eslint-disable-line no-new
    }) || !$iterDetect(function (iter) {
      new TypedArray(); // eslint-disable-line no-new
      new TypedArray(null); // eslint-disable-line no-new
      new TypedArray(1.5); // eslint-disable-line no-new
      new TypedArray(iter); // eslint-disable-line no-new
    }, true)) {
      TypedArray = wrapper(function (that, data, $offset, $length) {
        anInstance(that, TypedArray, NAME);
        var klass;
        // `ws` module bug, temporarily remove validation length for Uint8Array
        // https://github.com/websockets/ws/pull/645
        if (!isObject(data)) return new Base(toIndex(data));
        if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
          return $length !== undefined
            ? new Base(data, toOffset($offset, BYTES), $length)
            : $offset !== undefined
              ? new Base(data, toOffset($offset, BYTES))
              : new Base(data);
        }
        if (TYPED_ARRAY in data) return fromList(TypedArray, data);
        return $from.call(TypedArray, data);
      });
      arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
        if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
      });
      TypedArray[PROTOTYPE] = TypedArrayPrototype;
      if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
    }
    var $nativeIterator = TypedArrayPrototype[ITERATOR];
    var CORRECT_ITER_NAME = !!$nativeIterator
      && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
    var $iterator = $iterators.values;
    hide(TypedArray, TYPED_CONSTRUCTOR, true);
    hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
    hide(TypedArrayPrototype, VIEW, true);
    hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);

    if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
      dP(TypedArrayPrototype, TAG, {
        get: function () { return NAME; }
      });
    }

    O[NAME] = TypedArray;

    $export($export.G + $export.W + $export.F * (TypedArray != Base), O);

    $export($export.S, NAME, {
      BYTES_PER_ELEMENT: BYTES
    });

    $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
      from: $from,
      of: $of
    });

    if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);

    $export($export.P, NAME, proto);

    setSpecies(NAME);

    $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });

    $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);

    if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;

    $export($export.P + $export.F * fails(function () {
      new TypedArray(1).slice();
    }), NAME, { slice: $slice });

    $export($export.P + $export.F * (fails(function () {
      return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
    }) || !fails(function () {
      TypedArrayPrototype.toLocaleString.call([1, 2]);
    })), NAME, { toLocaleString: $toLocaleString });

    Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
    if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
  };
} else module.exports = function () { /* empty */ };


/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (item, filter) {
  var truthyArray = [];
  filter.groups.forEach(function (group, index) {
    var activeGroup = _.find(_datasetGroups2.default.store, { Id: group });
    truthyArray.push(_.includes(activeGroup.DataSets, item.Id));
  });
  filter.actual.forEach(function (actual, index) {
    truthyArray.push(item.IsActual === actual);
  });
  filter.editable.forEach(function (editable, index) {
    truthyArray.push(item.EditAuthority === editable);
  });
  filter.farms.forEach(function (farm, index) {
    truthyArray.push(item.DairyBaseId === farm);
  });
  filter.owners.forEach(function (owner, index) {
    truthyArray.push(item.OwnerName === owner);
  });
  filter.years.forEach(function (year, index) {
    truthyArray.push(item.FinancialYear === year);
  });
  return truthyArray;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1028);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Item = __webpack_require__(469);

var _Item2 = _interopRequireDefault(_Item);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DatasetList = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListGroups2.default, 'handleGroupUpdate')],

  componentWillMount: function componentWillMount() {
    this.handleGroupUpdate();
  },
  handleGroupUpdate: function handleGroupUpdate() {
    this.setState({
      budgets: _datasetListGroups2.default.store.budgets
    });
  },
  _checkIfSelected: function _checkIfSelected(dataset) {
    var selectedlist = this.props.selectedList;
    if (typeof selectedlist === 'undefined') return false;
    if (_.includes(selectedlist, dataset.Id)) {
      return true;
    }
    return false;
  },
  _renderList: function _renderList() {
    var _this = this;

    var _props = this.props,
        list = _props.list,
        forceBudgetList = _props.forceBudgetList;

    var _list$reduce = list.reduce(function (__obj, dataset, i) {
      var filteredList = __obj.filteredList,
          BudgetCache = __obj.BudgetCache;


      var isBudget = dataset.IsCcModel && !dataset._isOrphan;

      if (isBudget && !forceBudgetList) {
        var cacheRef = BudgetCache[dataset.CcModelSourceId] || [];
        cacheRef.push(dataset);
        BudgetCache[dataset.CcModelSourceId] = cacheRef;
        return __obj;
      }

      filteredList.push(dataset);

      return __obj;
    }, { filteredList: [], BudgetCache: {} }),
        filteredList = _list$reduce.filteredList,
        BudgetCache = _list$reduce.BudgetCache;

    return filteredList.map(function (dataset, index) {
      return _react2.default.createElement(_Item2.default, {
        key: index,
        showBudgets: _this.state.budgets,
        dataset: dataset,
        Budgets: BudgetCache[dataset.Id],
        checkIfSelected: function checkIfSelected(dataset) {
          return _this._checkIfSelected(dataset);
        },
        hasCheckbox: _this.props.hasCheckbox,
        selected: _this._checkIfSelected(dataset),
        emitItemClick: _this.props.emitItemClick
      });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DatasetList' },
      this._renderList()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DatasetList, 'DatasetList', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_DatasetList/index.jsx');
}();

;

/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1032);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var InputNumber = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (this.state.isFocused && !this.props.error) return;
    this.setState({
      value: newProps.value
    });
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.setState({
        isFocused: true
      }, function () {
        setTimeout(function () {
          if (_this.state.isFocused) {
            var input = _this.my_input;
            input.select();
            input.addEventListener('mousewheel', _this._preventScroll);
          }
        }, 30);
      });
    }
  },
  _preventScroll: function _preventScroll(event) {
    event.preventDefault();
  },
  _handleBlur: function _handleBlur() {
    var input = this.my_input;
    input.removeEventListener('mousewheel', this._preventScroll);
    this.setState({
      isFocused: false
    }, function () {
      this._validateData();
    });
  },
  _handleChange: function _handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 13:
        // Enter
        this._validateData();
        break;
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    var _this2 = this;

    this.setState({
      value: this.props.value
    }, function () {
      var input = _this2.my_input;
      input.blur();
    });
  },
  _validateData: function _validateData() {
    var newValue = this.state.value;
    // don't submit anything
    if (+newValue === +this.props.value && !this.props.error || this.props.disabled) {
      return;
    }
    // submit value as 0
    if (typeof newValue === 'undefined' || newValue === null || newValue === '' || typeof +newValue !== 'number') {
      return this.setState({
        value: 0
      }, this._handleSubmitData);
    }
    // valid - submit new value
    return this._handleSubmitData();
  },
  _handleSubmitData: function _handleSubmitData() {
    var _this3 = this;

    var value = +this.state.value;
    console.log(this.props.decimal);
    if (typeof this.props.decimal !== 'undefined') {
      value = value.toFixed(this.props.decimal);
    }
    this.setState({
      value: value
    }, function () {
      _this3.props.onSubmit(value, _this3.props.id);
    });
  },
  render: function render() {
    var _this4 = this;

    var classList = (0, _classnames2.default)({
      InputNumber: true,
      'is-disabled': this.props.disabled,
      'is-focused': this.state.isFocused,
      'is-error': this.props.error
    });

    return _react2.default.createElement(
      'div',
      { ref: function ref(_ref2) {
          return _this4.my_input_wrapper = _ref2;
        }, className: classList },
      _react2.default.createElement('input', {
        ref: function ref(_ref) {
          return _this4.my_input = _ref;
        },
        className: '_input',
        type: 'number',
        disabled: this.props.disabled,
        value: this.state.value,
        onFocus: this._handleFocus,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown
      }),
      this._renderClearErrorBtn(),
      _react2.default.createElement(
        'div',
        { className: '_btn' },
        (0, _commas.addCommas)(this.state.value)
      )
    );
  },
  _renderClearErrorBtn: function _renderClearErrorBtn() {
    return !this.props.error ? null : _react2.default.createElement(
      'button',
      { className: '_clearErrorBtn', onClick: this._handleSubmitData },
      _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(InputNumber, 'InputNumber', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_InputNumber/index.jsx');
}();

;

/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _style = __webpack_require__(499);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  // withRouter: true,
};

var RequestModule = (0, _xchReactClass2.default)(options, {
  getInitialState: function getInitialState() {
    return {
      reqData: {},
      success: false,
      error: false,
      stateTime: new Date().getTime()
    };
  },
  componentWillMount: function componentWillMount() {
    this.props.request(this.handleResponse);
  },
  handleResponse: function handleResponse(data) {
    var _this = this;

    this.setState({
      reqData: data
    }, function () {
      var currentTime = new Date().getTime();
      var length = currentTime - _this.state.stateTime;

      if (data.status === 200) {
        if (length < 2000) {
          return setTimeout(_this.handleSuccess, 2000 - length);
        }

        return _this.handleSuccess();
      }

      if (length < 2000) {
        return setTimeout(function () {
          return _this.setState({ error: true });
        }, 2000 - length);
      }
      return _this.setState({ error: true });
    });
  },
  handleSuccess: function handleSuccess() {
    var _props = this.props,
        skipSuccess = _props.skipSuccess,
        onSuccess = _props.onSuccess,
        portalOnClose = _props.portalOnClose;


    if (skipSuccess) {
      var fn = onSuccess || portalOnClose;
      return fn(this.state.reqData);
    }

    this.setState({ success: true });
  },
  render: function render() {
    var _this2 = this;

    var _props2 = this.props,
        onClose = _props2.onClose,
        onSuccess = _props2.onSuccess,
        portalOnClose = _props2.portalOnClose,
        text = _props2.text,
        request = _props2.request,
        preventCloseWhilePending = _props2.preventCloseWhilePending,
        blueButton = _props2.blueButton;
    var _state = this.state,
        success = _state.success,
        error = _state.error;


    var _text = text || {};
    var textObj = _extends({
      pendingTitle: 'Please wait a moment...',
      pendingDescription: 'Loading data.',
      successTitle: 'Success!',
      successDescription: 'Data has loaded successfully.',
      successButton: 'Continue',
      errorTitle: 'Oops, something went wrong',
      errorDescription: 'Please check your connection.',
      errorButton: 'Try again'
    }, _text);

    var title = textObj.pendingTitle;
    var description = textObj.pendingDescription;
    var button = '';

    var buttonFn = void 0;

    if (this.state.success) {
      title = textObj.successTitle;
      description = textObj.successDescription;
      button = textObj.successButton;
      buttonFn = portalOnClose;
      if (onSuccess) {
        buttonFn = function buttonFn() {
          return onSuccess(_this2.state.reqData);
        };
      }
    }

    if (this.state.error) {
      title = textObj.errorTitle;
      description = textObj.errorDescription;
      button = textObj.errorButton;
      buttonFn = function buttonFn() {
        _this2.setState({ error: false, stateTime: new Date().getTime() }, function () {
          return request(_this2.handleResponse);
        });
      };
    }

    return _react2.default.createElement(
      _style.Root,
      null,
      (!preventCloseWhilePending || success || error) && _react2.default.createElement(
        _style.CloseButton,
        { onClick: onClose || portalOnClose },
        'Close ',
        _react2.default.createElement(_style.CloseIcon, null)
      ),
      _react2.default.createElement(
        _style.Content,
        null,
        _react2.default.createElement(
          _style.Title,
          null,
          title
        ),
        _react2.default.createElement(
          _style.Box,
          null,
          _react2.default.createElement(
            _style.Description,
            null,
            description
          ),
          (success || error) && _react2.default.createElement(
            _style.ButtonBox,
            null,
            _react2.default.createElement(
              _style.Button,
              {
                error: error,
                blueButton: blueButton,
                onClick: buttonFn },
              button
            )
          )
        )
      )
    );
  }
});

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var _this3 = this;

    return _react2.default.createElement(
      _Portal2.default,
      {
        useExternalState: true,
        isOpen: this.props.isOpen,
        fullscreen: true,
        background: '#EDF6F7' },
      function (_ref) {
        var onToggle = _ref.onToggle,
            onOpen = _ref.onOpen,
            onClose = _ref.onClose;
        return _react2.default.createElement(RequestModule, _extends({}, _this3.props, { portalOnClose: onClose }));
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/index.js');

  __REACT_HOT_LOADER__.register(RequestModule, 'RequestModule', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

var _ccProperties = __webpack_require__(441);

var _ccProperties2 = _interopRequireDefault(_ccProperties);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_budgets2.default, 'handleBudgetUpdate')],

  getInitialState: function getInitialState() {
    return {
      budgetObj: undefined,
      editObj: undefined,
      selectedRatio: 0
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleBudgetUpdate();
  },
  handleBudgetUpdate: function handleBudgetUpdate() {
    var budgetId = this.props.match.params.budgetId;


    this.setState({
      budgetObj: _budgets2.default.store.budgetsById[budgetId] || {},
      editObj: _budgets2.default.store.editsById[budgetId] || {},
      selectedRatio: _budgets2.default.store.selectedRatio
    });
  },
  handleSubmit: function handleSubmit(newValue) {
    var _props = this.props,
        FieldKey = _props.FieldKey,
        ratio = _props.ratio,
        FeedRecordIds = _props.FeedRecordIds;
    var editObj = this.state.editObj;


    var _editObj = editObj || {};
    var _budget = _editObj.ScenarioDataset || {};

    var _value = ratio ? this.calcValueOut(newValue) : newValue;

    var newScenarioState = {};

    if (typeof FeedRecordIds === 'undefined') {
      newScenarioState = _extends({}, _budget, _defineProperty({}, FieldKey, _value));
    } else {
      newScenarioState = _extends({}, _budget, {
        CompCalculatorFeeds: _budget.CompCalculatorFeeds.map(function (feed) {
          if (feed.Id === FeedRecordIds.budget) return _extends({}, feed, _defineProperty({}, FieldKey, _value));

          return feed;
        })
      });
    }

    _Actions2.default.UPDATE_BUDGET_STATE(_extends({}, _editObj, {
      ScenarioDataset: newScenarioState
    }));
  },
  getDataObj: function getDataObj() {
    var match = this.props.match;
    var _state = this.state,
        editObj = _state.editObj,
        budgetObj = _state.budgetObj;


    var pathArr = match.path.split('/');
    var isEditor = pathArr.indexOf('editor') > -1;

    var routeObj = isEditor ? {
      SourceDataset: budgetObj.SourceDataset,
      ScenarioDataset: editObj.ScenarioDataset
    } : budgetObj;
    return routeObj || {};
  },
  calcValueIn: function calcValueIn(value) {
    var _props2 = this.props,
        ratio = _props2.ratio,
        IsDifference = _props2.IsDifference,
        FieldKey = _props2.FieldKey;

    // do difference here too...
    // note, will probably have to do the ratio first, then the difference

    var _value = ratio ? this.calcRatio(value) : value;

    if (IsDifference) {
      var _obj = this.getDataObj();

      var Source = _obj.SourceDataset || {};

      var _valueObj = this.getValueObj(Source, true);
      var _sourceValue = _valueObj[FieldKey];

      var SourceValue = ratio ? this.calcRatio(_sourceValue) : _sourceValue;

      return _value - SourceValue;
    }

    return _value;
  },
  calcValueOut: function calcValueOut(newValue) {
    var _props3 = this.props,
        ratio = _props3.ratio,
        FieldKey = _props3.FieldKey,
        IsSource = _props3.IsSource;
    var selectedRatio = this.state.selectedRatio;


    if (!ratio) return newValue;

    var _obj = this.getDataObj();

    var Scenario = _obj.ScenarioDataset || {};
    var Source = _obj.SourceDataset || {};

    var _data = IsSource ? Source : Scenario;

    var MilkSolidsKgTotal = _data.MilkSolidsKgTotal,
        MilkLitresTotal = _data.MilkLitresTotal,
        FertiliserTonnesAppliedTotal = _data.FertiliserTonnesAppliedTotal;


    var _ratio = ratio;

    if (ratio === 'switch') {
      _ratio = selectedRatio === 0 ? 'kgMS' : 'cpl';
    }

    if (_ratio === 'kgMS') {
      return newValue * MilkSolidsKgTotal;
    }
    if (_ratio === 'PerTotalML') {
      return newValue * Source.WaterIrrigationTotalML;
    }
    if (_ratio === 'PerTonneApplied') {
      return newValue * Source.FertiliserTonnesAppliedTotal;
    }
    if (_ratio === 'cpl') {
      return newValue * MilkLitresTotal / 100;
    }
    if (_ratio === '%Change') {
      var _source = this.getValueObj(Source, true)[FieldKey];
      if (_source > 0) {
        var difference = _source / 100 * newValue;
        return _source + difference;
      }

      return null;
    }
  },
  calcRatio: function calcRatio(rawValue) {
    var _props4 = this.props,
        ratio = _props4.ratio,
        FieldKey = _props4.FieldKey,
        IsSource = _props4.IsSource;
    var selectedRatio = this.state.selectedRatio;


    var _obj = this.getDataObj();

    var Scenario = _obj.ScenarioDataset || {};
    var Source = _obj.SourceDataset || {};

    var _data = IsSource ? Source : Scenario;

    var MilkSolidsKgTotal = _data.MilkSolidsKgTotal,
        MilkLitresTotal = _data.MilkLitresTotal,
        FertiliserTonnesAppliedTotal = _data.FertiliserTonnesAppliedTotal;


    var _ratio = ratio;

    if (ratio === 'switch') {
      _ratio = selectedRatio === 0 ? 'kgMS' : 'cpl';
    }

    if (_ratio === 'kgMS') {
      return rawValue / MilkSolidsKgTotal;
    }
    if (_ratio === 'PerTotalML') {
      return rawValue / Source.WaterIrrigationTotalML;
    }
    if (_ratio === 'PerTonneApplied') {
      return rawValue / Source.FertiliserTonnesAppliedTotal;
    }
    if (_ratio === 'cpl') {
      return rawValue * 100 / MilkLitresTotal;
    }
    if (_ratio === '%Change') {
      var _source = this.getValueObj(Source, true)[FieldKey];
      var _scenario = this.getValueObj(Scenario)[FieldKey];

      if (_source > 0) {
        var _difference = _scenario - _source;
        return _difference * 100 / _source;
      }

      return null;
    }
  },
  getDecimal: function getDecimal() {
    var ratio = this.props.ratio;
    var selectedRatio = this.state.selectedRatio;


    if (!ratio) return 0;

    var _ratio = ratio;

    if (ratio === 'switch') {
      _ratio = selectedRatio === 0 ? 'kgMS' : 'cpl';
    }

    if (_ratio === 'kgMS') {
      return 2;
    }
    if (_ratio === 'cpl' || _ratio === '%Change') {
      return 1;
    }

    return 0;
  },
  getValueObj: function getValueObj(dataObj, isSource) {
    var FeedRecordIds = this.props.FeedRecordIds;


    if (typeof FeedRecordIds === 'undefined') {
      return dataObj;
    }

    var feeds = dataObj.CompCalculatorFeeds || [];
    var FeedRecord = _.find(feeds, { Id: FeedRecordIds[isSource ? 'source' : 'budget'] }) || {};

    return FeedRecord;
  },
  render: function render() {
    var _props5 = this.props,
        FieldKey = _props5.FieldKey,
        IsSource = _props5.IsSource;


    var _obj = this.getDataObj();

    var Scenario = _obj.ScenarioDataset || {};
    var Source = _obj.SourceDataset || {};

    var _data = IsSource ? Source : Scenario;
    var _valueObj = this.getValueObj(_data, IsSource);
    var _value = _valueObj[FieldKey];
    var Value = this.calcValueIn(_value);
    var Decimal = this.getDecimal();

    var FieldProps = _ccProperties2.default[FieldKey] || { Label: FieldKey };

    var Label = FieldProps.Label,
        Description = FieldProps.Description;


    return this.props.children({
      Value: Value,
      Decimal: Decimal,
      Label: this.props.Label || Label,
      Description: this.props.Description || Description,
      onSubmit: this.handleSubmit
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/ConnectedCCField/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/ConnectedCCField/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {

// 22.1.3.31 Array.prototype[@@unscopables]
var UNSCOPABLES = __webpack_require__(26)('unscopables');
var ArrayProto = Array.prototype;
if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(48)(ArrayProto, UNSCOPABLES, {});
module.exports = function (key) {
  ArrayProto[UNSCOPABLES][key] = true;
};


/***/ }),
/* 81 */
/***/ (function(module, exports) {

module.exports = false;


/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {

var META = __webpack_require__(103)('meta');
var isObject = __webpack_require__(22);
var has = __webpack_require__(52);
var setDesc = __webpack_require__(31).f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
  return true;
};
var FREEZE = !__webpack_require__(20)(function () {
  return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
  setDesc(it, META, { value: {
    i: 'O' + ++id, // object ID
    w: {}          // weak collections IDs
  } });
};
var fastKey = function (it, create) {
  // return primitive with prefix
  if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  if (!has(it, META)) {
    // can't set metadata to uncaught frozen object
    if (!isExtensible(it)) return 'F';
    // not necessary to add metadata
    if (!create) return 'E';
    // add missing metadata
    setMeta(it);
  // return object ID
  } return it[META].i;
};
var getWeak = function (it, create) {
  if (!has(it, META)) {
    // can't set metadata to uncaught frozen object
    if (!isExtensible(it)) return true;
    // not necessary to add metadata
    if (!create) return false;
    // add missing metadata
    setMeta(it);
  // return hash weak collections IDs
  } return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
  if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  return it;
};
var meta = module.exports = {
  KEY: META,
  NEED: false,
  fastKey: fastKey,
  getWeak: getWeak,
  onFreeze: onFreeze
};


/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";



var TYPED_OK =  (typeof Uint8Array !== 'undefined') &&
                (typeof Uint16Array !== 'undefined') &&
                (typeof Int32Array !== 'undefined');

function _has(obj, key) {
  return Object.prototype.hasOwnProperty.call(obj, key);
}

exports.assign = function (obj /*from1, from2, from3, ...*/) {
  var sources = Array.prototype.slice.call(arguments, 1);
  while (sources.length) {
    var source = sources.shift();
    if (!source) { continue; }

    if (typeof source !== 'object') {
      throw new TypeError(source + 'must be non-object');
    }

    for (var p in source) {
      if (_has(source, p)) {
        obj[p] = source[p];
      }
    }
  }

  return obj;
};


// reduce buffer size, avoiding mem copy
exports.shrinkBuf = function (buf, size) {
  if (buf.length === size) { return buf; }
  if (buf.subarray) { return buf.subarray(0, size); }
  buf.length = size;
  return buf;
};


var fnTyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    if (src.subarray && dest.subarray) {
      dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
      return;
    }
    // Fallback to ordinary array
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    var i, l, len, pos, chunk, result;

    // calculate data length
    len = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      len += chunks[i].length;
    }

    // join chunks
    result = new Uint8Array(len);
    pos = 0;
    for (i = 0, l = chunks.length; i < l; i++) {
      chunk = chunks[i];
      result.set(chunk, pos);
      pos += chunk.length;
    }

    return result;
  }
};

var fnUntyped = {
  arraySet: function (dest, src, src_offs, len, dest_offs) {
    for (var i = 0; i < len; i++) {
      dest[dest_offs + i] = src[src_offs + i];
    }
  },
  // Join array of chunks to single array.
  flattenChunks: function (chunks) {
    return [].concat.apply([], chunks);
  }
};


// Enable/Disable typed arrays use, for testing
//
exports.setTyped = function (on) {
  if (on) {
    exports.Buf8  = Uint8Array;
    exports.Buf16 = Uint16Array;
    exports.Buf32 = Int32Array;
    exports.assign(exports, fnTyped);
  } else {
    exports.Buf8  = Array;
    exports.Buf16 = Array;
    exports.Buf32 = Array;
    exports.assign(exports, fnUntyped);
  }
};

exports.setTyped(TYPED_OK);


/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(1333));
__export(__webpack_require__(1341));
__export(__webpack_require__(1340));


/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {

/*
 * isObject, extend, isFunction, isArguments are taken from undescore/lodash in
 * order to remove the dependency
 */
var isObject = exports.isObject = function(obj) {
    var type = typeof obj;
    return type === 'function' || type === 'object' && !!obj;
};

exports.extend = function(obj) {
    if (!isObject(obj)) {
        return obj;
    }
    var source, prop;
    for (var i = 1, length = arguments.length; i < length; i++) {
        source = arguments[i];
        for (prop in source) {
            obj[prop] = source[prop];
        }
    }
    return obj;
};

exports.isFunction = function(value) {
    return typeof value === 'function';
};

exports.EventEmitter = __webpack_require__(953);

exports.nextTick = function(callback) {
    setTimeout(callback, 0);
};

exports.callbackName = function(string){
    return "on"+string.charAt(0).toUpperCase()+string.slice(1);
};

exports.object = function(keys,vals){
    var o={}, i=0;
    for(;i<keys.length;i++){
        o[keys[i]] = vals[i];
    }
    return o;
};

exports.isArguments = function(value) {
    return value && typeof value == 'object' && typeof value.length == 'number' &&
      (toString.call(value) === '[object Arguments]' || (hasOwnProperty.call(value, 'callee' && !propertyIsEnumerable.call(value, 'callee')))) || false;
};

/***/ }),
/* 86 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _style = __webpack_require__(389);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  // withRouter: true,
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var onClose = this.props.onClose;

    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.CloseButton,
        { onClick: onClose },
        'Close ',
        _react2.default.createElement(_style.CloseIcon, null)
      ),
      this.props.children
    );
  }
});

exports.default = _default;

// eg

var DAStandardPortal = function DAStandardPortal(_ref) {
  var children = _ref.children;
  return _react2.default.createElement(
    'div',
    null,
    children
  );
};

var example = _react2.default.createElement(
  _Portal2.default,
  {
    fullscreen: true,
    background: '#EDF6F7',
    Button: function Button(_ref2) {
      var isOpen = _ref2.isOpen,
          onToggle = _ref2.onToggle,
          onOpen = _ref2.onOpen,
          onClose = _ref2.onClose;
      return _react2.default.createElement(
        'button',
        { onClick: onOpen },
        'portal test'
      );
    } },
  function (_ref3) {
    var onToggle = _ref3.onToggle,
        onOpen = _ref3.onOpen,
        onClose = _ref3.onClose;
    return _react2.default.createElement(
      DAStandardPortal,
      { onClose: onClose },
      'child content'
    );
  }
);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/index.js');

  __REACT_HOT_LOADER__.register(DAStandardPortal, 'DAStandardPortal', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/index.js');

  __REACT_HOT_LOADER__.register(example, 'example', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (datasetId, callback) {
  (0, _xhr2.default)({
    url: "/" + "api/session/PostLoadDataSet",
    method: "POST",
    json: {
      "FarmDataSetId": datasetId
    },
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var data = resp.body;

    if (resp.statusCode === 200) {
      _Actions2.default.REPLACE_ACTIVE_DATASET(data);
    }

    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 88 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _stripCCD = __webpack_require__(257);

var _stripCCD2 = _interopRequireDefault(_stripCCD);

var _calculations = __webpack_require__(446);

var _calculations2 = _interopRequireDefault(_calculations);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __datasetGroups = module.exports = _reflux2.default.createStore({
  init: function init() {
    var editsById = JSON.parse(window.localStorage.getItem('da_cc_editsById'));
    var selectedRatio = JSON.parse(window.localStorage.getItem('da_cc_selectedRatio'));

    this.store = {
      budgetsById: {},
      editsById: editsById || {},
      selectedRatio: selectedRatio || 0
    };
    this.listenToMany(_Actions2.default);
  },
  READ_BUDGET_DATA: function READ_BUDGET_DATA(newBudget) {
    var ScenarioDataset = newBudget.ScenarioDataset;
    var Id = ScenarioDataset.Id,
        Name = ScenarioDataset.Name;

    this.store.budgetsById[Id] = _extends({}, newBudget, {
      ScenarioDataset: _extends({}, ScenarioDataset, { Name: (0, _stripCCD2.default)(Name) })
    });
    this.trigger();
  },
  UPDATE_BUDGET_STATE: function UPDATE_BUDGET_STATE(newState, inputKeys) {
    if (!newState) return;
    var Id = newState.ScenarioDataset.Id;

    var existingState = this.store.editsById[Id] || {};
    var budgetState = this.store.budgetsById[Id] || {};

    var mergedState = _extends({}, existingState, newState);

    var calculatedState = (0, _calculations2.default)(mergedState.ScenarioDataset, budgetState.SourceDataset);

    var updatedState = _extends({}, mergedState, {
      ScenarioDataset: calculatedState
    });

    this.store.editsById[Id] = updatedState;

    window.localStorage.setItem('da_cc_editsById', JSON.stringify(this.store.editsById));
    this.trigger();
  },
  CLOSE_BUDGET_EDITOR: function CLOSE_BUDGET_EDITOR(budgetId) {
    this.store.editsById[budgetId] = undefined;

    window.localStorage.setItem('da_cc_editsById', JSON.stringify(this.store.editsById));

    this.trigger();
  },
  UPDATE_CC_RATIO_SWITCH: function UPDATE_CC_RATIO_SWITCH(newRatioId) {
    this.store.selectedRatio = newRatioId;

    window.localStorage.setItem('da_cc_selectedRatio', newRatioId);

    this.trigger();
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__datasetGroups, '__datasetGroups', 'C:/_repos_windows/dairybase/Frontend/app/stores/__budgets/index.js');
}();

;

/***/ }),
/* 89 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var initialStore = {
  user: true,
  budgets: true,
  other: true,
  industry: true
};

var _default = _reflux2.default.createStore({
  init: function init() {
    this.store = _.cloneDeep(initialStore);
    this.listenToMany(_Actions2.default);
  },
  UPDATE_DATASETLIST_GROUP: function UPDATE_DATASETLIST_GROUP(filter, value) {
    this.store[filter] = value;
    this.trigger();
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(initialStore, 'initialStore', 'C:/_repos_windows/dairybase/Frontend/app/stores/__datasetListGroups/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/stores/__datasetListGroups/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1056);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _EditGroupModal = __webpack_require__(509);

var _EditGroupModal2 = _interopRequireDefault(_EditGroupModal);

var _Header = __webpack_require__(484);

var _Header2 = _interopRequireDefault(_Header);

var _List = __webpack_require__(486);

var _List2 = _interopRequireDefault(_List);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Groups = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetGroups2.default, '_handleGroupListUpdate'), _reflux2.default.listenTo(_datasetListFilter2.default, '_handleGroupListUpdate')],

  getInitialState: function getInitialState() {
    return {
      groupList: [],
      selectedGroup: null,
      editing: false,
      createPortalOpen: false
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleGroupListUpdate();
  },
  _toggleediting: function _toggleediting() {
    this.setState({
      editing: !this.state.editing
    });
  },
  _toggleCreateGroupPortal: function _toggleCreateGroupPortal() {
    // will handle state of editing...
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  _handleGroupListUpdate: function _handleGroupListUpdate() {
    this.setState({
      groupList: _.sortBy(_datasetGroups2.default.store.map(function (group, index) {
        return {
          title: group.Title,
          id: group.Id,
          active: _.includes(_datasetListFilter2.default.store.groups, group.Id)
        };
      }), 'title')
    });
  },
  _handleListItemClick: function _handleListItemClick(groupId) {
    if (this.state.editing) return this._handleEditGroup(groupId);
    _Actions2.default.UPDATE_DATASETLIST_FILTER('groups', groupId);
  },
  _handleEditGroup: function _handleEditGroup(id) {
    this.setState({
      selectedGroup: id
    }, function () {
      this._toggleCreateGroupPortal();
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Groups' },
      _react2.default.createElement(_Header2.default, {
        editing: this.state.editing,
        emitCreateNewGroup: this._handleEditGroup.bind(this, null),
        emitEditToggle: this._toggleediting }),
      _react2.default.createElement(_List2.default, {
        list: this.state.groupList,
        editing: this.state.editing,
        emitListItemClicked: this._handleListItemClick }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.createPortalOpen },
        _react2.default.createElement(_EditGroupModal2.default, {
          group: this.state.selectedGroup,
          emitSuccess: this._toggleCreateGroupPortal,
          toggleModal: this._toggleCreateGroupPortal })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Groups, 'Groups', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Groups/index.jsx');
}();

;

/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _RatioSelector = __webpack_require__(208);

var _RatioSelector2 = _interopRequireDefault(_RatioSelector);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _CCPopup = __webpack_require__(267);

var _CCPopup2 = _interopRequireDefault(_CCPopup);

var _RatioInput = __webpack_require__(207);

var _RatioInput2 = _interopRequireDefault(_RatioInput);

var _style = __webpack_require__(544);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  // withRouter: true,
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var _props = this.props,
        TitleText = _props.TitleText,
        TitleKey = _props.TitleKey,
        FieldKey = _props.FieldKey,
        useChildren = _props.useChildren,
        unit = _props.unit;


    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _ConnectedCCField2.default,
        { FieldKey: TitleKey },
        function (_ref) {
          var Label = _ref.Label,
              Description = _ref.Description;
          return _react2.default.createElement(
            _CCPopup2.default,
            { label: Label, description: Description },
            _react2.default.createElement(
              _style.Title,
              {
                hasDescription: typeof Description === 'string' && Description.length > 1 },
              TitleText || Label,
              ' ',
              _react2.default.createElement(
                _style.Unit,
                null,
                unit
              )
            )
          );
        }
      ),
      FieldKey && _react2.default.createElement(
        _style.OutputField,
        null,
        _react2.default.createElement(
          _RatioSelector2.default,
          null,
          function (_ref2) {
            var ratioKey = _ref2.ratioKey;
            return _react2.default.createElement(
              _ConnectedCCField2.default,
              { FieldKey: FieldKey, ratio: ratioKey },
              function (_ref3) {
                var Value = _ref3.Value,
                    Decimal = _ref3.Decimal;
                return _react2.default.createElement(
                  _style.OutputValue,
                  null,
                  _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal })
                );
              }
            );
          }
        ),
        _react2.default.createElement(_RatioInput2.default, null)
      ),
      this.props.children
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CCPopup = __webpack_require__(267);

var _CCPopup2 = _interopRequireDefault(_CCPopup);

var _CCNumber = __webpack_require__(158);

var _CCNumber2 = _interopRequireDefault(_CCNumber);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _RatioSelector = __webpack_require__(208);

var _RatioSelector2 = _interopRequireDefault(_RatioSelector);

var _SelectInput = __webpack_require__(559);

var _SelectInput2 = _interopRequireDefault(_SelectInput);

var _RatioInput = __webpack_require__(207);

var _RatioInput2 = _interopRequireDefault(_RatioInput);

var _style = __webpack_require__(552);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  // withRouter: true,
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var _props = this.props,
        rows = _props.rows,
        scenarioTable = _props.scenarioTable,
        isSummary = _props.isSummary;


    return _react2.default.createElement(
      _style.Root,
      { scenarioTable: scenarioTable },
      rows.map(function (row, i) {
        var cols = row.cols,
            Label = row.Label,
            Description = row.Description,
            FieldKey = row.FieldKey,
            IsScenario = row.IsScenario,
            IsTotal = row.IsTotal,
            IsHeader = row.IsHeader,
            BorderBottom = row.BorderBottom,
            IsGrey = row.IsGrey,
            Background = row.Background,
            BeforeTotal = row.BeforeTotal,
            Squeezed = row.Squeezed;


        return _react2.default.createElement(
          _style.Row,
          {
            key: i,
            border: BorderBottom,
            scenario: IsScenario,
            scenarioTable: scenarioTable,
            total: IsTotal,
            greenTotal: isSummary && IsTotal,
            header: IsHeader,
            background: Background },
          _react2.default.createElement(
            _ConnectedCCField2.default,
            {
              Label: Label,
              FieldKey: FieldKey || Label,
              Description: Description },
            function (_ref) {
              var Label = _ref.Label,
                  Description = _ref.Description;
              return _react2.default.createElement(
                _style.LabelCol,
                {
                  greyBorder: isSummary && !IsHeader && !IsTotal && !BeforeTotal,
                  isGrey: IsGrey,
                  total: IsTotal,
                  long: isSummary && IsTotal },
                _react2.default.createElement(
                  _CCPopup2.default,
                  { label: Label, description: Description },
                  _react2.default.createElement(
                    _style.LabelText,
                    {
                      hasDescription: typeof Description === 'string' && Description.length > 1 },
                    Label
                  )
                )
              );
            }
          ),
          _react2.default.createElement(
            _style.Inputs,
            { header: IsHeader },
            cols.map(function (col, i) {
              var Label = col.Label,
                  Line2 = col.Line2,
                  IsInput = col.IsInput,
                  IsSource = col.IsSource,
                  IsDifference = col.IsDifference,
                  FieldKey = col.FieldKey,
                  ratio = col.ratio,
                  IsScenario = col.IsScenario;


              if (IsHeader) {
                if (Label === 'switch') {
                  return _react2.default.createElement(
                    _style.InputCol,
                    { key: i, header: true, right: true },
                    _react2.default.createElement(_RatioInput2.default, null)
                  );
                }

                return _react2.default.createElement(
                  _ConnectedCCField2.default,
                  {
                    key: i,
                    Label: Label,
                    FieldKey: FieldKey || Label,
                    Description: Description },
                  function (_ref2) {
                    var Label = _ref2.Label,
                        Description = _ref2.Description;
                    return _react2.default.createElement(
                      _style.InputCol,
                      { header: true, isGrey: IsGrey },
                      _react2.default.createElement(
                        _CCPopup2.default,
                        { label: Label, description: Description },
                        _react2.default.createElement(
                          _style.ColLabel,
                          {
                            hasDescription: typeof Description === 'string' && Description.length > 1 },
                          Label,
                          ' ',
                          Line2 && _react2.default.createElement(
                            'span',
                            null,
                            ' ',
                            _react2.default.createElement('br', null),
                            Line2
                          )
                        )
                      )
                    );
                  }
                );
              }
              if (typeof FieldKey === 'undefined') return _react2.default.createElement(_style.InputCol, { key: i });

              var moveRight = isSummary && cols.length > 3 && (i === 0 || i === 1);
              var padLeft = isSummary && cols.length > 3 ? i === 2 : i === 0;

              return _react2.default.createElement(
                _style.InputCol,
                {
                  key: i,
                  moveRight: moveRight,
                  padLeft: padLeft,
                  padded: isSummary && !IsTotal && !Squeezed,
                  greenBorder: isSummary && IsScenario && !IsTotal && !BeforeTotal,
                  greyBorder: isSummary && !IsScenario && !IsTotal && !BeforeTotal,
                  scenario: IsScenario,
                  scenarioTable: scenarioTable },
                _react2.default.createElement(_CCNumber2.default, {
                  IsInput: IsInput,
                  IsSource: IsSource,
                  IsDifference: IsDifference,
                  isGrey: IsGrey,
                  FieldKey: FieldKey,
                  ratio: ratio
                })
              );
            })
          )
        );
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _commas = __webpack_require__(554);

var _numberParser = __webpack_require__(555);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var value = this.props.value;

    var parsedValue = (0, _numberParser.parseIn)(value, this.props);
    var _renderedValue = parsedValue == null || parsedValue === 'NaN' || parsedValue === 'Infinity' ? '-' : (0, _commas.addCommas)(parsedValue);

    return _renderedValue;
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/NumberOutput/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 94 */
/***/ (function(module, exports) {

module.exports = function (it, Constructor, name, forbiddenField) {
  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
    throw TypeError(name + ': incorrect invocation!');
  } return it;
};


/***/ }),
/* 95 */
/***/ (function(module, exports, __webpack_require__) {

var ctx = __webpack_require__(58);
var call = __webpack_require__(324);
var isArrayIter = __webpack_require__(223);
var anObject = __webpack_require__(11);
var toLength = __webpack_require__(27);
var getIterFn = __webpack_require__(239);
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  var f = ctx(fn, that, entries ? 2 : 1);
  var index = 0;
  var length, step, iterator, result;
  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  // fast case for arrays with default iterator
  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
    if (result === BREAK || result === RETURN) return result;
  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
    result = call(iterator, f, step.value, entries);
    if (result === BREAK || result === RETURN) return result;
  }
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;


/***/ }),
/* 96 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(11);
var dPs = __webpack_require__(330);
var enumBugKeys = __webpack_require__(219);
var IE_PROTO = __webpack_require__(232)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';

// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
  // Thrash, waste and sodomy: IE GC bug
  var iframe = __webpack_require__(218)('iframe');
  var i = enumBugKeys.length;
  var lt = '<';
  var gt = '>';
  var iframeDocument;
  iframe.style.display = 'none';
  __webpack_require__(221).appendChild(iframe);
  iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  // createDict = iframe.contentWindow.Object;
  // html.removeChild(iframe);
  iframeDocument = iframe.contentWindow.document;
  iframeDocument.open();
  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  iframeDocument.close();
  createDict = iframeDocument.F;
  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  return createDict();
};

module.exports = Object.create || function create(O, Properties) {
  var result;
  if (O !== null) {
    Empty[PROTOTYPE] = anObject(O);
    result = new Empty();
    Empty[PROTOTYPE] = null;
    // add "__proto__" for Object.getPrototypeOf polyfill
    result[IE_PROTO] = O;
  } else result = createDict();
  return Properties === undefined ? result : dPs(result, Properties);
};


/***/ }),
/* 97 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
var $keys = __webpack_require__(332);
var hiddenKeys = __webpack_require__(219).concat('length', 'prototype');

exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  return $keys(O, hiddenKeys);
};


/***/ }),
/* 98 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(332);
var enumBugKeys = __webpack_require__(219);

module.exports = Object.keys || function keys(O) {
  return $keys(O, enumBugKeys);
};


/***/ }),
/* 99 */
/***/ (function(module, exports) {

module.exports = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};


/***/ }),
/* 100 */
/***/ (function(module, exports, __webpack_require__) {

var redefine = __webpack_require__(49);
module.exports = function (target, src, safe) {
  for (var key in src) redefine(target, key, src[key], safe);
  return target;
};


/***/ }),
/* 101 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var global = __webpack_require__(16);
var dP = __webpack_require__(31);
var DESCRIPTORS = __webpack_require__(30);
var SPECIES = __webpack_require__(26)('species');

module.exports = function (KEY) {
  var C = global[KEY];
  if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
    configurable: true,
    get: function () { return this; }
  });
};


/***/ }),
/* 102 */
/***/ (function(module, exports, __webpack_require__) {

var toInteger = __webpack_require__(60);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
  index = toInteger(index);
  return index < 0 ? max(index + length, 0) : min(index, length);
};


/***/ }),
/* 103 */
/***/ (function(module, exports) {

var id = 0;
var px = Math.random();
module.exports = function (key) {
  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};


/***/ }),
/* 104 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(22);
module.exports = function (it, TYPE) {
  if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  return it;
};


/***/ }),
/* 105 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.INIT_COORDS = 'dnd-core/INIT_COORDS';
exports.BEGIN_DRAG = 'dnd-core/BEGIN_DRAG';
exports.PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE';
exports.HOVER = 'dnd-core/HOVER';
exports.DROP = 'dnd-core/DROP';
exports.END_DRAG = 'dnd-core/END_DRAG';


/***/ }),
/* 106 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// cheap lodash replacements
Object.defineProperty(exports, "__esModule", { value: true });
function isFunction(input) {
    return typeof input === 'function';
}
exports.isFunction = isFunction;
function noop() {
    // noop
}
exports.noop = noop;
function isObjectLike(input) {
    return typeof input === 'object' && input !== null;
}
function isPlainObject(input) {
    if (!isObjectLike(input)) {
        return false;
    }
    if (Object.getPrototypeOf(input) === null) {
        return true;
    }
    var proto = input;
    while (Object.getPrototypeOf(proto) !== null) {
        proto = Object.getPrototypeOf(proto);
    }
    return Object.getPrototypeOf(input) === proto;
}
exports.isPlainObject = isPlainObject;


/***/ }),
/* 107 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1045);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _columnData = __webpack_require__(479);

var _columnData2 = _interopRequireDefault(_columnData);

var _Col = __webpack_require__(478);

var _Col2 = _interopRequireDefault(_Col);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GroupModal = __webpack_require__(284);

var _GroupModal2 = _interopRequireDefault(_GroupModal);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      groupPortalOpen: false
    };
  },
  _openGroupPortal: function _openGroupPortal(ref) {
    this.setState({
      groupPortalOpen: true,
      coords: (0, _getDomCoords3.default)(this[ref], true)
    });
  },
  _toggleGroupPortal: function _toggleGroupPortal() {
    this.setState({
      groupPortalOpen: !this.state.groupPortalOpen
    });
  },
  _renderColumnHeaders: function _renderColumnHeaders() {
    return _columnData2.default.map(function (column, index) {
      return _react2.default.createElement(_Col2.default, { colData: column, key: index });
    });
  },
  render: function render() {
    var _this = this;

    var nameColClass = this.props.hasCheckbox ? 'DatasetList__column FilterControls__NameColWithCheckbox' : 'DatasetList__column FilterControls__NameCol';

    return _react2.default.createElement(
      'div',
      { className: 'FilterControls' },
      _react2.default.createElement(
        'div',
        { className: 'DatasetList__header' },
        _react2.default.createElement(
          'div',
          { className: nameColClass },
          _react2.default.createElement(
            'span',
            { className: '_title' },
            'Name'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              ref: function ref(_ref) {
                return _this.groupFilterRef = _ref;
              },
              onClick: this._openGroupPortal.bind(this, 'groupFilterRef') },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'folder' }),
              _react2.default.createElement(
                'span',
                { className: '_text' },
                'Filter by Groups'
              )
            )
          ),
          _react2.default.createElement(
            _Portal2.default,
            { context: document.body, isOpen: this.state.groupPortalOpen },
            _react2.default.createElement(
              _GroupModal2.default,
              {
                coords: this.state.coords,
                closePortal: this._toggleGroupPortal },
              _react2.default.createElement(_Groups2.default, null)
            )
          )
        ),
        this._renderColumnHeaders()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 108 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1052);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _OptimisticInputNumber = __webpack_require__(127);

var _OptimisticInputNumber2 = _interopRequireDefault(_OptimisticInputNumber);

var _OptimisticSwitchableInput = __webpack_require__(273);

var _OptimisticSwitchableInput2 = _interopRequireDefault(_OptimisticSwitchableInput);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _OptimisticCheckBox = __webpack_require__(126);

var _OptimisticCheckBox2 = _interopRequireDefault(_OptimisticCheckBox);

var _OptimisticInputSelect = __webpack_require__(202);

var _OptimisticInputSelect2 = _interopRequireDefault(_OptimisticInputSelect);

var _commas = __webpack_require__(33);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _financeCalculations = __webpack_require__(124);

var _financeCalculations2 = _interopRequireDefault(_financeCalculations);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'UserPreference',
    fields: {
      'SwitchFinanceColumn1': {
        Options: [{ Id: 0, Title: "No Data" }],
        Value: 0
      },
      'SwitchFinanceColumn2': {
        Options: [{ Id: 0, Title: "No Data" }],
        Value: 0
      },
      'SwitchFinanceColumn3': {
        Options: [{ Id: 0, Title: "No Data" }],
        Value: 0
      }
    }
  }, {
    store: 'Data',
    fields: {
      'CowMilkerNumber': {},
      'MilkSolidsKgTotal': {},
      'AreaUsable': {},
      'AreaMilking': {},
      'MilkLitresTotal': {}
    }
  }])],

  _renderColumnHeader: function _renderColumnHeader(field) {
    var column = this.state[field];
    return _.find(column.Options, { Id: +column.Value }).Title;
  },
  _renderOutput: function _renderOutput(field, value) {

    var modifiers = {
      CowMilkerNumber: this.state.CowMilkerNumber.Value,
      MilkSolidsKgTotal: this.state.MilkSolidsKgTotal.Value,
      AreaUsable: this.state.AreaUsable.Value,
      AreaMilking: this.state.AreaMilking.Value,
      MilkLitresTotal: this.state.MilkLitresTotal.Value
    };

    var fnMap = ['NotDefined', 'PerCow', 'PerKgMS', 'PerMilkingHa', 'PerUsableHa', 'DollarsPerLitre', 'CentsPerLitre'];

    var selectedRatioId = this.state[field].Value;
    var fnId = fnMap[selectedRatioId];
    var caculation = (0, _financeCalculations2.default)(fnId, modifiers);
    return caculation.fn(value);
  },
  _renderExtraColHeaders: function _renderExtraColHeaders() {
    if (!this.props.header.extraCols) return null;
    return _react2.default.createElement(
      'div',
      { className: '_extraHeaders' },
      this.props.header.extraHeaders.map(function (header, index) {
        var padded = header.padded ? ' is-padded' : '';
        return _react2.default.createElement(
          'h3',
          { key: index, className: '_switchCol is-small' + padded },
          header.text
        );
      })
    );
  },
  _renderExtraCol: function _renderExtraCol(row) {
    if (!row.extraCol) return null;

    return _react2.default.createElement(
      'div',
      { className: '_switchCol' },
      row.extraColData,
      '%'
    );
  },
  _renderSwitchRow: function _renderSwitchRow() {
    if (!this.props.header.switchRow) return;

    return _react2.default.createElement(
      'div',
      { className: 'FinancialTable__row' },
      _react2.default.createElement(
        'div',
        { className: '_switchRow' },
        _react2.default.createElement(_OptimisticCheckBox2.default, {
          data: this.props.header.switch,
          label: 'Enter $ value for Depreciation',
          pendingText: {
            title: 'Please wait',
            text: 'Switching to depreciation'
          },
          successText: {
            title: 'Success!',
            text: 'Depreciation was switched.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Could not switch depreciation.'
          } })
      )
    );
  },
  handleTogglePortal: function handleTogglePortal(key) {
    return this.props.togglePortal(key);
  },
  render: function render() {
    var _this = this;

    var rows = this.props.rows.map(function (row, index) {

      var rowClasses = (0, _classnames2.default)({
        "FinancialTable__row": true,
        "is-total": row.isTotal,
        "is-spaced": row.isSpaced
      });

      var _inputs = row.inputs;

      var rowAvg = _inputs.length === 1 ? +_inputs[0].data.Value : (+_inputs[0].data.Value + +_inputs[1].data.Value) / 2;

      return _react2.default.createElement(
        'div',
        { key: index, className: rowClasses },
        _react2.default.createElement(
          'h4',
          { className: '_title' },
          _react2.default.createElement(_DescriptionLabel2.default, {
            label: row.title,
            description: row.inputs[0].data.Description }),
          typeof row.help === 'undefined' ? null : _react2.default.createElement(
            'div',
            { className: '_helpBtn' },
            _react2.default.createElement(_GenericHelpBtn2.default, { onClick: _this.handleTogglePortal.bind(_this, row.help) })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_inputCol' },
          _react2.default.createElement(
            'span',
            { className: '_units' },
            row.percent ? '%' : '$'
          ),
          _react2.default.createElement(
            'div',
            { className: '_inputs' },
            row.inputs.map(function (input, index) {
              return _react2.default.createElement(
                'div',
                { className: '_input', key: index },
                _react2.default.createElement(_OptimisticSwitchableInput2.default, {
                  editable: input.editable,
                  data: input.data })
              );
            })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_outputCols' },
          _react2.default.createElement(
            'div',
            { className: '_outputs' },
            _this._renderExtraCol(row),
            _react2.default.createElement(
              'div',
              { className: '_switchCol' },
              _this._renderOutput('SwitchFinanceColumn1', rowAvg)
            ),
            _react2.default.createElement(
              'div',
              { className: '_switchCol' },
              _this._renderOutput('SwitchFinanceColumn2', rowAvg)
            ),
            _react2.default.createElement(
              'div',
              { className: '_switchCol' },
              _this._renderOutput('SwitchFinanceColumn3', rowAvg)
            )
          )
        )
      );
    });

    var modifier = this.props.modifier !== "undefined" ? " " + this.props.modifier : "";
    return _react2.default.createElement(
      'div',
      { className: "FinancialTable" + modifier },
      _react2.default.createElement(
        'div',
        { className: 'FinancialTable__header' },
        _react2.default.createElement(
          'h3',
          { className: '_titleCol' },
          this.props.header.title
        ),
        this._renderExtraColHeaders(),
        _react2.default.createElement(
          'h3',
          { className: '_switchCol' },
          this._renderColumnHeader('SwitchFinanceColumn1')
        ),
        _react2.default.createElement(
          'h3',
          { className: '_switchCol' },
          this._renderColumnHeader('SwitchFinanceColumn2')
        ),
        _react2.default.createElement(
          'h3',
          { className: '_switchCol' },
          this._renderColumnHeader('SwitchFinanceColumn3')
        )
      ),
      this._renderSwitchRow(),
      rows
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 109 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1072);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ConfirmationModal = module.exports = __webpack_require__(1)({
  render: function render() {
    var content = this.props.content;
    return _react2.default.createElement(
      'div',
      { className: 'ConfirmationModal' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: 'ConfirmationModal__content' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.cancelHandler }),
          _react2.default.createElement(
            'h2',
            { className: 'ConfirmationModal__title' },
            content.title
          ),
          _react2.default.createElement(
            'p',
            { className: 'ConfirmationModal__text' },
            content.text
          ),
          _react2.default.createElement(
            'div',
            { className: 'ConfirmationModal__actions' },
            _react2.default.createElement(
              'button',
              {
                className: '_btn',
                onClick: this.props.cancelHandler },
              content.btns.cancel
            ),
            _react2.default.createElement(
              'button',
              {
                className: '_btn',
                onClick: this.props.confirmHandler },
              content.btns.confirm
            )
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ConfirmationModal, 'ConfirmationModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_ConfirmationModal/index.jsx');
}();

;

/***/ }),
/* 110 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1135);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var tabular__Header = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.BulkComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    if (!this.state.report.hasData) return null;
    return _react2.default.createElement(
      'div',
      null,
      this.renderContent()
    );
  },
  renderContent: function renderContent() {
    var _this = this;

    var MAX_COLS = this.props.IsLandscape ? 15 : 8;

    return this.state.report.tables.TextTable.map(function (row, index) {
      if (row.Props.Hidden) return null;

      var _cols = row.cols;

      if (_this.props.isPrinting) {
        var startIndex = _this.props.tableSplitIndex * MAX_COLS;
        var endIndex = startIndex + MAX_COLS;

        _cols = row.cols.slice(startIndex, endIndex);
      }

      return _react2.default.createElement(
        'div',
        { key: index, className: 'BulkComparisonReportTable__row' },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            row.Props.Label
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__data' },
          _cols.map(function (col, index) {
            if (col.props.FieldId === 'Name') {
              if (col.value === 'Comparison 1') return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                _this.state.group1
              );
              if (col.value === 'Comparison 2') return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                _this.state.group2
              );
            }
            return _react2.default.createElement(
              'div',
              { key: index, className: '_col' },
              col.value
            );
          })
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(tabular__Header, 'tabular__Header', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Report/_TableHeader/index.jsx');
}();

;

/***/ }),
/* 111 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(1004);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    var _this = this;

    var unit = this.props.unit;


    var noSpecial = !_.includes(unit, 'CO2') && !_.includes(unit, 'N2O');

    if (noSpecial) return _react2.default.createElement(
      'span',
      { className: this.getClasses('unit') },
      unit
    );

    var unitParts = unit.split('2');

    return _react2.default.createElement(
      'span',
      { className: this.getClasses('unit') },
      unitParts.map(function (unitPart, index) {
        var isLast = index === unitParts.length - 1;

        return _react2.default.createElement(
          'span',
          { key: index, className: _this.getClasses('unit') },
          unitPart,
          !isLast && _react2.default.createElement(
            'span',
            { className: _style2.default.sub },
            '2'
          )
        );
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/UnitText/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 112 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1195);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _PrintableReport = __webpack_require__(700);

var _PrintableReport2 = _interopRequireDefault(_PrintableReport);

var _Tabs = __webpack_require__(707);

var _Tabs2 = _interopRequireDefault(_Tabs);

var _PrintModalTemplate = __webpack_require__(705);

var _PrintModalTemplate2 = _interopRequireDefault(_PrintModalTemplate);

var _PrintSelectModalTemplate = __webpack_require__(706);

var _PrintSelectModalTemplate2 = _interopRequireDefault(_PrintSelectModalTemplate);

var _Actions = __webpack_require__(703);

var _Actions2 = _interopRequireDefault(_Actions);

var _ReportHeaderTemplate = __webpack_require__(163);

var _ReportHeaderTemplate2 = _interopRequireDefault(_ReportHeaderTemplate);

var _checkDairyBaseGroups = __webpack_require__(449);

var _checkDairyBaseGroups2 = _interopRequireDefault(_checkDairyBaseGroups);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _CheckBox = __webpack_require__(151);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _DownloadPortal = __webpack_require__(702);

var _DownloadPortal2 = _interopRequireDefault(_DownloadPortal);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate = module.exports = __webpack_require__(1)({
  mixins: [(0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    var localSettings = {
      selectedTabs: window.localStorage.getItem('dairybase_printSettings_' + this.props.reportId + '_selectedTabs'),
      IsLandscape: window.localStorage.getItem('dairybase_printSettings_' + this.props.reportId + '_IsLandscape'),
      IsA3: window.localStorage.getItem('dairybase_printSettings_' + this.props.reportId + '_IsA3')
    };

    var filteredTabs = _.map(this._getPrintTabs(), 'id');
    if (localSettings.selectedTabs !== null) {
      filteredTabs = JSON.parse(localSettings.selectedTabs);
    }

    var IsLandscape = localSettings.IsLandscape;

    if (IsLandscape === null) {
      IsLandscape = this.props.reportId === 3 || this.props.reportId === 4;
    } else {
      IsLandscape = JSON.parse(IsLandscape);
    }

    var IsA3 = localSettings.IsA3;

    if (IsA3 === null) {
      IsA3 = false;
    } else {
      IsA3 = JSON.parse(IsA3);
    }

    var printTabs = this._getPrintTabs();

    var actualChartTabCount = printTabs.filter(function (tab) {
      var isSelected = _.includes(filteredTabs, tab.id);
      var isChart = typeof tab.chartList !== 'undefined';

      return isSelected && isChart;
    }).length;

    return {
      downloadOpen: false,
      activeTabIndex: 0,
      printSelectorPortalOpen: false,
      printPortalOpen: false,
      printMsgPortalOpen: false,
      actualChartTabCount: actualChartTabCount,
      chartsLoaded: 0,
      filteredTabs: filteredTabs,
      IsLandscape: IsLandscape,
      IsA3: IsA3
    };
  },
  _getPrintTabs: function _getPrintTabs() {
    var _this = this;

    var authorisedTabs = this.props.tabs.filter(function (tab) {
      return tab.limitedAccess ? _this.checkTabAuthority(tab) : true;
    });

    return this.props.reportId === 1 ? authorisedTabs : this.props.tabs;
  },
  _changeTab: function _changeTab(index, handler) {
    this.props.emitResetScroll();
    this.setState({
      activeTabIndex: index
    });
  },
  _handlePrintReport: function _handlePrintReport() {
    return this._togglePrintSelectorPortal();
  },
  _handleSelectTab: function _handleSelectTab(tabId) {
    var filteredTabs = this.state.filteredTabs;


    var printTabs = this._getPrintTabs();

    var newTabs = [];
    var actualChartTabCount = this.state.actualChartTabCount;

    if (tabId === 'all') {
      newTabs = filteredTabs.length < printTabs.length ? _.map(printTabs, 'id') : [];
      actualChartTabCount = filteredTabs.length < printTabs.length ? this.props.chartTabCount : 0;

      window.localStorage.setItem('dairybase_printSettings_' + this.props.reportId + '_selectedTabs', JSON.stringify(newTabs));

      return this.setState({
        filteredTabs: newTabs,
        actualChartTabCount: actualChartTabCount
      });
    }

    newTabs = _.xor(filteredTabs, [tabId]);

    if (this.props.reportId === 2) {
      actualChartTabCount = printTabs.filter(function (tab) {
        var isSelected = _.includes(newTabs, tab.id);
        var isChart = typeof tab.chartList !== 'undefined';

        return isSelected && isChart;
      }).length;
    }

    window.localStorage.setItem('dairybase_printSettings_' + this.props.reportId + '_selectedTabs', JSON.stringify(newTabs));

    return this.setState({
      filteredTabs: newTabs,
      actualChartTabCount: actualChartTabCount
    });
  },
  _handleUpdatePaperSize: function _handleUpdatePaperSize(newValue) {
    window.localStorage.setItem('dairybase_printSettings_' + this.props.reportId + '_IsA3', JSON.stringify(newValue));

    this.setState({
      IsA3: newValue
    });
  },
  _handleUpdateOrientation: function _handleUpdateOrientation(newValue) {
    window.localStorage.setItem('dairybase_printSettings_' + this.props.reportId + '_IsLandscape', JSON.stringify(newValue));

    this.setState({
      IsLandscape: newValue
    });
  },
  _handlePrint: function _handlePrint() {
    var _this2 = this;

    this.setState({
      printSelectorPortalOpen: false,
      printPortalOpen: true,
      printMsgPortalOpen: true
    }, function () {
      if (typeof _this2.state.actualChartTabCount === 'undefined' || _this2.state.actualChartTabCount === 0) {
        return setTimeout(function () {
          _this2.openPrintDialogue();
        }, 2000);
      }
    });
  },
  _togglePrintSelectorPortal: function _togglePrintSelectorPortal() {
    this.setState({
      printSelectorPortalOpen: !this.state.printSelectorPortalOpen
    }, function () {
      // if (this.state.printSelectorPortalOpen) {
      //   return this.setState({
      //     filteredTabs: _.map(this._getPrintTabs(), 'id'),
      //   })
      // }
    });
  },
  _togglePrintPortal: function _togglePrintPortal() {
    this.setState({
      printPortalOpen: !this.state.printPortalOpen,
      chartsLoaded: 0
    });
  },
  handleChartsLoaded: function handleChartsLoaded() {
    var _this3 = this;

    if (this.state.printMsgPortalOpen) {
      this.setState({
        chartsLoaded: this.state.chartsLoaded + 1
      }, function () {
        if (_this3.state.actualChartTabCount === _this3.state.chartsLoaded) {
          _this3.openPrintDialogue();
        }
      });
    }
  },
  openPrintDialogue: function openPrintDialogue() {
    this.setState({
      printMsgPortalOpen: false,
      downloadOpen: true
    });
  },
  checkTabAuthority: function checkTabAuthority(tab) {
    return _user2.default.userAuthority <= tab.accessLevel || (0, _checkDairyBaseGroups2.default)(tab.accessGroups);
  },
  render: function render() {
    var _this4 = this;

    var authorisedTabs = this.props.tabs.filter(function (tab) {
      return tab.limitedAccess ? _this4.checkTabAuthority(tab) : true;
    });

    var _activeTab = authorisedTabs[this.state.activeTabIndex];

    var ActiveHeader = _activeTab.handlers.header;
    var ActiveBody = _activeTab.handlers.body;
    var PrintModal = this.props.printModalhandler;

    var zzzProps = _.cloneDeep(this.props);
    zzzProps.activeTab = _activeTab;
    zzzProps.tabKey = _activeTab.id;
    zzzProps.emitChartsLoaded = this.handleChartsLoaded;
    zzzProps.chartsLoaded = this.state.chartsLoaded;
    zzzProps.authorisedTabs = authorisedTabs;

    var printTabs = this._getPrintTabs();

    var _state = this.state,
        IsLandscape = _state.IsLandscape,
        IsA3 = _state.IsA3;


    return _react2.default.createElement(
      'div',
      { className: 'ReportTemplate' },
      _react2.default.createElement(
        _Portal2.default,
        {
          context: this.props.bannerDOMRef,
          isOpen: this.state.permaPortalOpen },
        _react2.default.createElement(
          'div',
          {
            className: 'ReportTemplate__header',
            style: { right: (0, _getScrollbarWidth2.default)() } },
          _react2.default.createElement(
            'div',
            { className: '_bg' },
            _react2.default.createElement(
              'div',
              { className: '_container' },
              _react2.default.createElement(_Actions2.default, {
                reportId: this.props.reportId,
                selectedDatasets: this.props.selectedDatasets,
                emitPrintReport: this._handlePrintReport
              }),
              _react2.default.createElement(_Tabs2.default, {
                tabs: authorisedTabs,
                activeTabIndex: this.state.activeTabIndex,
                emitTabChange: this._changeTab
              }),
              this.renderHeader(ActiveHeader, zzzProps)
            )
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'ReportTemplate__content' },
        _react2.default.createElement(
          'div',
          { className: '_container' },
          _react2.default.createElement(ActiveBody, _extends({}, zzzProps, {
            IsLandscape: IsLandscape,
            IsA3: IsA3,
            ActiveHeader: _react2.default.createElement(ActiveHeader, _extends({}, zzzProps, {
              IsLandscape: IsLandscape,
              IsA3: IsA3
            }))
          }))
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.printSelectorPortalOpen },
        _react2.default.createElement(
          _PrintSelectModalTemplate2.default,
          {
            emitCloseModal: this._togglePrintSelectorPortal },
          this.renderPrintSelector(printTabs)
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        { context: document.body, isOpen: this.state.printPortalOpen },
        _react2.default.createElement(
          'div',
          { id: '__print_this__' },
          _react2.default.createElement(_DownloadPortal2.default, {
            CSSString: this.props.reportId === 6,
            IsLandscape: IsLandscape,
            IsA3: IsA3,
            isOpen: this.state.downloadOpen,
            onClose: function onClose() {
              return _this4.setState({ downloadOpen: false });
            },
            onToggle: function onToggle() {
              return _this4.setState({ downloadOpen: !_this4.state.downloadOpen });
            }
          }),
          _react2.default.createElement(
            _PrintModalTemplate2.default,
            {
              CSSString: this.props.reportId === 6,
              IsLandscape: IsLandscape,
              IsA3: IsA3,
              emitCloseModal: this._togglePrintPortal },
            _react2.default.createElement(PrintModal, _extends({}, zzzProps, {
              IsLandscape: IsLandscape,
              IsA3: IsA3,
              printTabs: printTabs.filter(function (tab) {
                return _.includes(_this4.state.filteredTabs, tab.id);
              })
            }))
          )
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        { context: document.body, isOpen: this.state.printMsgPortalOpen },
        _react2.default.createElement(
          'div',
          { className: 'PrintMsg' },
          _react2.default.createElement(
            'div',
            { className: '_msg' },
            _react2.default.createElement(
              'div',
              null,
              'Generating Printed Report...'
            ),
            _react2.default.createElement(
              'div',
              { style: { paddingTop: '10px', fontSize: '13px' } },
              'This might take some time if you have',
              _react2.default.createElement('br', null),
              ' a lot of columns in your report'
            )
          )
        )
      )
    );
  },
  renderHeader: function renderHeader(ActiveHeader, zzzProps) {
    // don't want a fixed header for bulk/DFMP report

    var _props = this.props,
        IsLandscape = _props.IsLandscape,
        IsA3 = _props.IsA3;

    if (this.props.reportId === 5 || this.props.reportId === 6) return null;
    return this.props.dynamicHeader ? _react2.default.createElement(
      _ReportHeaderTemplate2.default,
      _extends({}, zzzProps, { IsLandscape: IsLandscape, IsA3: IsA3 }),
      _react2.default.createElement(ActiveHeader, _extends({}, zzzProps, { IsLandscape: IsLandscape, IsA3: IsA3 }))
    ) : _react2.default.createElement(ActiveHeader, _extends({}, zzzProps, { IsLandscape: IsLandscape, IsA3: IsA3 }));
  },
  renderPrintSelector: function renderPrintSelector(tabs) {
    var _this5 = this;

    var reportId = this.props.reportId;
    var _state2 = this.state,
        filteredTabs = _state2.filteredTabs,
        IsLandscape = _state2.IsLandscape,
        IsA3 = _state2.IsA3;


    var buttonClass = (0, _classnames2.default)('_submitSelect', {
      disabled: filteredTabs.length === 0
    });

    return _react2.default.createElement(
      'div',
      { className: 'PrintSelector' },
      _react2.default.createElement(
        'div',
        { className: '_selectorTitle' },
        'Select paper size'
      ),
      _react2.default.createElement(
        'div',
        { className: '_selectorList' },
        _react2.default.createElement(_CheckBox2.default, {
          key: 'A4',
          value: !IsA3,
          label: 'A4',
          onSubmit: function onSubmit() {
            return _this5._handleUpdatePaperSize(false);
          }
        }),
        _react2.default.createElement(_CheckBox2.default, {
          key: 'A3',
          value: IsA3,
          label: 'A3',
          onSubmit: function onSubmit() {
            return _this5._handleUpdatePaperSize(true);
          }
        })
      ),
      _react2.default.createElement(
        'div',
        { className: '_selectorTitle' },
        'Select paper orientation'
      ),
      _react2.default.createElement(
        'div',
        { className: '_selectorList' },
        _react2.default.createElement(_CheckBox2.default, {
          key: 'Portrait',
          value: !IsLandscape,
          label: 'Portrait',
          onSubmit: function onSubmit() {
            return _this5._handleUpdateOrientation(false);
          }
        }),
        _react2.default.createElement(_CheckBox2.default, {
          key: 'Landscape',
          value: IsLandscape,
          label: 'Landscape',
          onSubmit: function onSubmit() {
            return _this5._handleUpdateOrientation(true);
          }
        })
      ),
      reportId !== 3 && reportId !== 4 && _react2.default.createElement(
        _react2.default.Fragment,
        null,
        _react2.default.createElement(
          'div',
          { className: '_selectorTitle' },
          'Select report tables to print'
        ),
        _react2.default.createElement(
          'div',
          { className: '_selectorList' },
          tabs.map(function (tab) {
            var isSelected = _.includes(filteredTabs, tab.id);

            return _react2.default.createElement(_CheckBox2.default, {
              key: tab.id,
              value: isSelected,
              label: tab.title,
              onSubmit: function onSubmit() {
                return _this5._handleSelectTab(tab.id);
              }
            });
          }),
          _react2.default.createElement(_CheckBox2.default, {
            key: 'all',
            value: filteredTabs.length === tabs.length,
            label: 'Print all',
            onSubmit: function onSubmit() {
              return _this5._handleSelectTab('all');
            }
          })
        )
      ),
      _react2.default.createElement(
        'button',
        {
          className: buttonClass,
          disabled: filteredTabs.length === 0,
          onClick: this._handlePrint },
        'Print report'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate, 'ReportTemplate', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/index.jsx');
}();

;

/***/ }),
/* 113 */
/***/ (function(module, exports, __webpack_require__) {

// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(56);
var TAG = __webpack_require__(26)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
  try {
    return it[key];
  } catch (e) { /* empty */ }
};

module.exports = function (it) {
  var O, T, B;
  return it === undefined ? 'Undefined' : it === null ? 'Null'
    // @@toStringTag case
    : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
    // builtinTag case
    : ARG ? cof(O)
    // ES3 arguments fallback
    : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};


/***/ }),
/* 114 */
/***/ (function(module, exports) {

module.exports = {};


/***/ }),
/* 115 */
/***/ (function(module, exports, __webpack_require__) {

var def = __webpack_require__(31).f;
var has = __webpack_require__(52);
var TAG = __webpack_require__(26)('toStringTag');

module.exports = function (it, tag, stat) {
  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};


/***/ }),
/* 116 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var defined = __webpack_require__(66);
var fails = __webpack_require__(20);
var spaces = __webpack_require__(235);
var space = '[' + spaces + ']';
var non = '\u200b\u0085';
var ltrim = RegExp('^' + space + space + '*');
var rtrim = RegExp(space + space + '*$');

var exporter = function (KEY, exec, ALIAS) {
  var exp = {};
  var FORCE = fails(function () {
    return !!spaces[KEY]() || non[KEY]() != non;
  });
  var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
  if (ALIAS) exp[ALIAS] = fn;
  $export($export.P + $export.F * FORCE, 'String', exp);
};

// 1 -> String#trimLeft
// 2 -> String#trimRight
// 3 -> String#trim
var trim = exporter.trim = function (string, TYPE) {
  string = String(defined(string));
  if (TYPE & 1) string = string.replace(ltrim, '');
  if (TYPE & 2) string = string.replace(rtrim, '');
  return string;
};

module.exports = exporter;


/***/ }),
/* 117 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// cheap lodash replacements
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * drop-in replacement for _.get
 * @param obj
 * @param path
 * @param defaultValue
 */
function get(obj, path, defaultValue) {
    return path
        .split('.')
        .reduce(function (a, c) { return (a && a[c] ? a[c] : defaultValue || null); }, obj);
}
exports.get = get;
/**
 * drop-in replacement for _.without
 */
function without(items, item) {
    return items.filter(function (i) { return i !== item; });
}
exports.without = without;
/**
 * drop-in replacement for _.isString
 * @param input
 */
function isString(input) {
    return typeof input === 'string';
}
exports.isString = isString;
/**
 * drop-in replacement for _.isString
 * @param input
 */
function isObject(input) {
    return typeof input === 'object';
}
exports.isObject = isObject;
/**
 * repalcement for _.xor
 * @param itemsA
 * @param itemsB
 */
function xor(itemsA, itemsB) {
    var map = new Map();
    var insertItem = function (item) {
        return map.set(item, map.has(item) ? map.get(item) + 1 : 1);
    };
    itemsA.forEach(insertItem);
    itemsB.forEach(insertItem);
    var result = [];
    map.forEach(function (count, key) {
        if (count === 1) {
            result.push(key);
        }
    });
    return result;
}
exports.xor = xor;
/**
 * replacement for _.intersection
 * @param itemsA
 * @param itemsB
 */
function intersection(itemsA, itemsB) {
    return itemsA.filter(function (t) { return itemsB.indexOf(t) > -1; });
}
exports.intersection = intersection;


/***/ }),
/* 118 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
 * @license
 * lodash 3.10.1 (Custom Build) <https://lodash.com/>
 * Build: `lodash modern -d -o ./index.js`
 * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 * Available under MIT license <https://lodash.com/license>
 */
;(function() {

  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  var undefined;

  /** Used as the semantic version number. */
  var VERSION = '3.10.1';

  /** Used to compose bitmasks for wrapper metadata. */
  var BIND_FLAG = 1,
      BIND_KEY_FLAG = 2,
      CURRY_BOUND_FLAG = 4,
      CURRY_FLAG = 8,
      CURRY_RIGHT_FLAG = 16,
      PARTIAL_FLAG = 32,
      PARTIAL_RIGHT_FLAG = 64,
      ARY_FLAG = 128,
      REARG_FLAG = 256;

  /** Used as default options for `_.trunc`. */
  var DEFAULT_TRUNC_LENGTH = 30,
      DEFAULT_TRUNC_OMISSION = '...';

  /** Used to detect when a function becomes hot. */
  var HOT_COUNT = 150,
      HOT_SPAN = 16;

  /** Used as the size to enable large array optimizations. */
  var LARGE_ARRAY_SIZE = 200;

  /** Used to indicate the type of lazy iteratees. */
  var LAZY_FILTER_FLAG = 1,
      LAZY_MAP_FLAG = 2;

  /** Used as the `TypeError` message for "Functions" methods. */
  var FUNC_ERROR_TEXT = 'Expected a function';

  /** Used as the internal argument placeholder. */
  var PLACEHOLDER = '__lodash_placeholder__';

  /** `Object#toString` result references. */
  var argsTag = '[object Arguments]',
      arrayTag = '[object Array]',
      boolTag = '[object Boolean]',
      dateTag = '[object Date]',
      errorTag = '[object Error]',
      funcTag = '[object Function]',
      mapTag = '[object Map]',
      numberTag = '[object Number]',
      objectTag = '[object Object]',
      regexpTag = '[object RegExp]',
      setTag = '[object Set]',
      stringTag = '[object String]',
      weakMapTag = '[object WeakMap]';

  var arrayBufferTag = '[object ArrayBuffer]',
      float32Tag = '[object Float32Array]',
      float64Tag = '[object Float64Array]',
      int8Tag = '[object Int8Array]',
      int16Tag = '[object Int16Array]',
      int32Tag = '[object Int32Array]',
      uint8Tag = '[object Uint8Array]',
      uint8ClampedTag = '[object Uint8ClampedArray]',
      uint16Tag = '[object Uint16Array]',
      uint32Tag = '[object Uint32Array]';

  /** Used to match empty string literals in compiled template source. */
  var reEmptyStringLeading = /\b__p \+= '';/g,
      reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
      reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;

  /** Used to match HTML entities and HTML characters. */
  var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,
      reUnescapedHtml = /[&<>"'`]/g,
      reHasEscapedHtml = RegExp(reEscapedHtml.source),
      reHasUnescapedHtml = RegExp(reUnescapedHtml.source);

  /** Used to match template delimiters. */
  var reEscape = /<%-([\s\S]+?)%>/g,
      reEvaluate = /<%([\s\S]+?)%>/g,
      reInterpolate = /<%=([\s\S]+?)%>/g;

  /** Used to match property names within property paths. */
  var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,
      reIsPlainProp = /^\w*$/,
      rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;

  /**
   * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)
   * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
   */
  var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,
      reHasRegExpChars = RegExp(reRegExpChars.source);

  /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
  var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;

  /** Used to match backslashes in property paths. */
  var reEscapeChar = /\\(\\)?/g;

  /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
  var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;

  /** Used to match `RegExp` flags from their coerced string values. */
  var reFlags = /\w*$/;

  /** Used to detect hexadecimal string values. */
  var reHasHexPrefix = /^0[xX]/;

  /** Used to detect host constructors (Safari > 5). */
  var reIsHostCtor = /^\[object .+?Constructor\]$/;

  /** Used to detect unsigned integer values. */
  var reIsUint = /^\d+$/;

  /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
  var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;

  /** Used to ensure capturing order of template delimiters. */
  var reNoMatch = /($^)/;

  /** Used to match unescaped characters in compiled string literals. */
  var reUnescapedString = /['\n\r\u2028\u2029\\]/g;

  /** Used to match words to create compound words. */
  var reWords = (function() {
    var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]',
        lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';

    return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
  }());

  /** Used to assign default `context` object properties. */
  var contextProps = [
    'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',
    'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',
    'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',
    'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',
    'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'
  ];

  /** Used to make template sourceURLs easier to identify. */
  var templateCounter = -1;

  /** Used to identify `toStringTag` values of typed arrays. */
  var typedArrayTags = {};
  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  typedArrayTags[uint32Tag] = true;
  typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  typedArrayTags[dateTag] = typedArrayTags[errorTag] =
  typedArrayTags[funcTag] = typedArrayTags[mapTag] =
  typedArrayTags[numberTag] = typedArrayTags[objectTag] =
  typedArrayTags[regexpTag] = typedArrayTags[setTag] =
  typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;

  /** Used to identify `toStringTag` values supported by `_.clone`. */
  var cloneableTags = {};
  cloneableTags[argsTag] = cloneableTags[arrayTag] =
  cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =
  cloneableTags[dateTag] = cloneableTags[float32Tag] =
  cloneableTags[float64Tag] = cloneableTags[int8Tag] =
  cloneableTags[int16Tag] = cloneableTags[int32Tag] =
  cloneableTags[numberTag] = cloneableTags[objectTag] =
  cloneableTags[regexpTag] = cloneableTags[stringTag] =
  cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  cloneableTags[errorTag] = cloneableTags[funcTag] =
  cloneableTags[mapTag] = cloneableTags[setTag] =
  cloneableTags[weakMapTag] = false;

  /** Used to map latin-1 supplementary letters to basic latin letters. */
  var deburredLetters = {
    '\xc0': 'A',  '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
    '\xe0': 'a',  '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
    '\xc7': 'C',  '\xe7': 'c',
    '\xd0': 'D',  '\xf0': 'd',
    '\xc8': 'E',  '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
    '\xe8': 'e',  '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
    '\xcC': 'I',  '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
    '\xeC': 'i',  '\xed': 'i', '\xee': 'i', '\xef': 'i',
    '\xd1': 'N',  '\xf1': 'n',
    '\xd2': 'O',  '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
    '\xf2': 'o',  '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
    '\xd9': 'U',  '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
    '\xf9': 'u',  '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
    '\xdd': 'Y',  '\xfd': 'y', '\xff': 'y',
    '\xc6': 'Ae', '\xe6': 'ae',
    '\xde': 'Th', '\xfe': 'th',
    '\xdf': 'ss'
  };

  /** Used to map characters to HTML entities. */
  var htmlEscapes = {
    '&': '&amp;',
    '<': '&lt;',
    '>': '&gt;',
    '"': '&quot;',
    "'": '&#39;',
    '`': '&#96;'
  };

  /** Used to map HTML entities to characters. */
  var htmlUnescapes = {
    '&amp;': '&',
    '&lt;': '<',
    '&gt;': '>',
    '&quot;': '"',
    '&#39;': "'",
    '&#96;': '`'
  };

  /** Used to determine if values are of the language type `Object`. */
  var objectTypes = {
    'function': true,
    'object': true
  };

  /** Used to escape characters for inclusion in compiled regexes. */
  var regexpEscapes = {
    '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34',
    '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39',
    'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46',
    'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66',
    'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78'
  };

  /** Used to escape characters for inclusion in compiled string literals. */
  var stringEscapes = {
    '\\': '\\',
    "'": "'",
    '\n': 'n',
    '\r': 'r',
    '\u2028': 'u2028',
    '\u2029': 'u2029'
  };

  /** Detect free variable `exports`. */
  var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;

  /** Detect free variable `module`. */
  var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;

  /** Detect free variable `global` from Node.js. */
  var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;

  /** Detect free variable `self`. */
  var freeSelf = objectTypes[typeof self] && self && self.Object && self;

  /** Detect free variable `window`. */
  var freeWindow = objectTypes[typeof window] && window && window.Object && window;

  /** Detect the popular CommonJS extension `module.exports`. */
  var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;

  /**
   * Used as a reference to the global object.
   *
   * The `this` value is used if it's the global object to avoid Greasemonkey's
   * restricted `window` object, otherwise the `window` object is used.
   */
  var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;

  /*--------------------------------------------------------------------------*/

  /**
   * The base implementation of `compareAscending` which compares values and
   * sorts them in ascending order without guaranteeing a stable sort.
   *
   * @private
   * @param {*} value The value to compare.
   * @param {*} other The other value to compare.
   * @returns {number} Returns the sort order indicator for `value`.
   */
  function baseCompareAscending(value, other) {
    if (value !== other) {
      var valIsNull = value === null,
          valIsUndef = value === undefined,
          valIsReflexive = value === value;

      var othIsNull = other === null,
          othIsUndef = other === undefined,
          othIsReflexive = other === other;

      if ((value > other && !othIsNull) || !valIsReflexive ||
          (valIsNull && !othIsUndef && othIsReflexive) ||
          (valIsUndef && othIsReflexive)) {
        return 1;
      }
      if ((value < other && !valIsNull) || !othIsReflexive ||
          (othIsNull && !valIsUndef && valIsReflexive) ||
          (othIsUndef && valIsReflexive)) {
        return -1;
      }
    }
    return 0;
  }

  /**
   * The base implementation of `_.findIndex` and `_.findLastIndex` without
   * support for callback shorthands and `this` binding.
   *
   * @private
   * @param {Array} array The array to search.
   * @param {Function} predicate The function invoked per iteration.
   * @param {boolean} [fromRight] Specify iterating from right to left.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseFindIndex(array, predicate, fromRight) {
    var length = array.length,
        index = fromRight ? length : -1;

    while ((fromRight ? index-- : ++index < length)) {
      if (predicate(array[index], index, array)) {
        return index;
      }
    }
    return -1;
  }

  /**
   * The base implementation of `_.indexOf` without support for binary searches.
   *
   * @private
   * @param {Array} array The array to search.
   * @param {*} value The value to search for.
   * @param {number} fromIndex The index to search from.
   * @returns {number} Returns the index of the matched value, else `-1`.
   */
  function baseIndexOf(array, value, fromIndex) {
    if (value !== value) {
      return indexOfNaN(array, fromIndex);
    }
    var index = fromIndex - 1,
        length = array.length;

    while (++index < length) {
      if (array[index] === value) {
        return index;
      }
    }
    return -1;
  }

  /**
   * The base implementation of `_.isFunction` without support for environments
   * with incorrect `typeof` results.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
   */
  function baseIsFunction(value) {
    // Avoid a Chakra JIT bug in compatibility modes of IE 11.
    // See https://github.com/jashkenas/underscore/issues/1621 for more details.
    return typeof value == 'function' || false;
  }

  /**
   * Converts `value` to a string if it's not one. An empty string is returned
   * for `null` or `undefined` values.
   *
   * @private
   * @param {*} value The value to process.
   * @returns {string} Returns the string.
   */
  function baseToString(value) {
    return value == null ? '' : (value + '');
  }

  /**
   * Used by `_.trim` and `_.trimLeft` to get the index of the first character
   * of `string` that is not found in `chars`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @param {string} chars The characters to find.
   * @returns {number} Returns the index of the first character not found in `chars`.
   */
  function charsLeftIndex(string, chars) {
    var index = -1,
        length = string.length;

    while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}
    return index;
  }

  /**
   * Used by `_.trim` and `_.trimRight` to get the index of the last character
   * of `string` that is not found in `chars`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @param {string} chars The characters to find.
   * @returns {number} Returns the index of the last character not found in `chars`.
   */
  function charsRightIndex(string, chars) {
    var index = string.length;

    while (index-- && chars.indexOf(string.charAt(index)) > -1) {}
    return index;
  }

  /**
   * Used by `_.sortBy` to compare transformed elements of a collection and stable
   * sort them in ascending order.
   *
   * @private
   * @param {Object} object The object to compare.
   * @param {Object} other The other object to compare.
   * @returns {number} Returns the sort order indicator for `object`.
   */
  function compareAscending(object, other) {
    return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);
  }

  /**
   * Used by `_.sortByOrder` to compare multiple properties of a value to another
   * and stable sort them.
   *
   * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,
   * a value is sorted in ascending order if its corresponding order is "asc", and
   * descending if "desc".
   *
   * @private
   * @param {Object} object The object to compare.
   * @param {Object} other The other object to compare.
   * @param {boolean[]} orders The order to sort by for each property.
   * @returns {number} Returns the sort order indicator for `object`.
   */
  function compareMultiple(object, other, orders) {
    var index = -1,
        objCriteria = object.criteria,
        othCriteria = other.criteria,
        length = objCriteria.length,
        ordersLength = orders.length;

    while (++index < length) {
      var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
      if (result) {
        if (index >= ordersLength) {
          return result;
        }
        var order = orders[index];
        return result * ((order === 'asc' || order === true) ? 1 : -1);
      }
    }
    // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
    // that causes it, under certain circumstances, to provide the same value for
    // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
    // for more details.
    //
    // This also ensures a stable sort in V8 and other engines.
    // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
    return object.index - other.index;
  }

  /**
   * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
   *
   * @private
   * @param {string} letter The matched letter to deburr.
   * @returns {string} Returns the deburred letter.
   */
  function deburrLetter(letter) {
    return deburredLetters[letter];
  }

  /**
   * Used by `_.escape` to convert characters to HTML entities.
   *
   * @private
   * @param {string} chr The matched character to escape.
   * @returns {string} Returns the escaped character.
   */
  function escapeHtmlChar(chr) {
    return htmlEscapes[chr];
  }

  /**
   * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.
   *
   * @private
   * @param {string} chr The matched character to escape.
   * @param {string} leadingChar The capture group for a leading character.
   * @param {string} whitespaceChar The capture group for a whitespace character.
   * @returns {string} Returns the escaped character.
   */
  function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
    if (leadingChar) {
      chr = regexpEscapes[chr];
    } else if (whitespaceChar) {
      chr = stringEscapes[chr];
    }
    return '\\' + chr;
  }

  /**
   * Used by `_.template` to escape characters for inclusion in compiled string literals.
   *
   * @private
   * @param {string} chr The matched character to escape.
   * @returns {string} Returns the escaped character.
   */
  function escapeStringChar(chr) {
    return '\\' + stringEscapes[chr];
  }

  /**
   * Gets the index at which the first occurrence of `NaN` is found in `array`.
   *
   * @private
   * @param {Array} array The array to search.
   * @param {number} fromIndex The index to search from.
   * @param {boolean} [fromRight] Specify iterating from right to left.
   * @returns {number} Returns the index of the matched `NaN`, else `-1`.
   */
  function indexOfNaN(array, fromIndex, fromRight) {
    var length = array.length,
        index = fromIndex + (fromRight ? 0 : -1);

    while ((fromRight ? index-- : ++index < length)) {
      var other = array[index];
      if (other !== other) {
        return index;
      }
    }
    return -1;
  }

  /**
   * Checks if `value` is object-like.
   *
   * @private
   * @param {*} value The value to check.
   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
   */
  function isObjectLike(value) {
    return !!value && typeof value == 'object';
  }

  /**
   * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
   * character code is whitespace.
   *
   * @private
   * @param {number} charCode The character code to inspect.
   * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
   */
  function isSpace(charCode) {
    return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||
      (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));
  }

  /**
   * Replaces all `placeholder` elements in `array` with an internal placeholder
   * and returns an array of their indexes.
   *
   * @private
   * @param {Array} array The array to modify.
   * @param {*} placeholder The placeholder to replace.
   * @returns {Array} Returns the new array of placeholder indexes.
   */
  function replaceHolders(array, placeholder) {
    var index = -1,
        length = array.length,
        resIndex = -1,
        result = [];

    while (++index < length) {
      if (array[index] === placeholder) {
        array[index] = PLACEHOLDER;
        result[++resIndex] = index;
      }
    }
    return result;
  }

  /**
   * An implementation of `_.uniq` optimized for sorted arrays without support
   * for callback shorthands and `this` binding.
   *
   * @private
   * @param {Array} array The array to inspect.
   * @param {Function} [iteratee] The function invoked per iteration.
   * @returns {Array} Returns the new duplicate-value-free array.
   */
  function sortedUniq(array, iteratee) {
    var seen,
        index = -1,
        length = array.length,
        resIndex = -1,
        result = [];

    while (++index < length) {
      var value = array[index],
          computed = iteratee ? iteratee(value, index, array) : value;

      if (!index || seen !== computed) {
        seen = computed;
        result[++resIndex] = value;
      }
    }
    return result;
  }

  /**
   * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
   * character of `string`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {number} Returns the index of the first non-whitespace character.
   */
  function trimmedLeftIndex(string) {
    var index = -1,
        length = string.length;

    while (++index < length && isSpace(string.charCodeAt(index))) {}
    return index;
  }

  /**
   * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
   * character of `string`.
   *
   * @private
   * @param {string} string The string to inspect.
   * @returns {number} Returns the index of the last non-whitespace character.
   */
  function trimmedRightIndex(string) {
    var index = string.length;

    while (index-- && isSpace(string.charCodeAt(index))) {}
    return index;
  }

  /**
   * Used by `_.unescape` to convert HTML entities to characters.
   *
   * @private
   * @param {string} chr The matched character to unescape.
   * @returns {string} Returns the unescaped character.
   */
  function unescapeHtmlChar(chr) {
    return htmlUnescapes[chr];
  }

  /*--------------------------------------------------------------------------*/

  /**
   * Create a new pristine `lodash` function using the given `context` object.
   *
   * @static
   * @memberOf _
   * @category Utility
   * @param {Object} [context=root] The context object.
   * @returns {Function} Returns a new `lodash` function.
   * @example
   *
   * _.mixin({ 'foo': _.constant('foo') });
   *
   * var lodash = _.runInContext();
   * lodash.mixin({ 'bar': lodash.constant('bar') });
   *
   * _.isFunction(_.foo);
   * // => true
   * _.isFunction(_.bar);
   * // => false
   *
   * lodash.isFunction(lodash.foo);
   * // => false
   * lodash.isFunction(lodash.bar);
   * // => true
   *
   * // using `context` to mock `Date#getTime` use in `_.now`
   * var mock = _.runInContext({
   *   'Date': function() {
   *     return { 'getTime': getTimeMock };
   *   }
   * });
   *
   * // or creating a suped-up `defer` in Node.js
   * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
   */
  function runInContext(context) {
    // Avoid issues with some ES3 environments that attempt to use values, named
    // after built-in constructors like `Object`, for the creation of literals.
    // ES5 clears this up by stating that literals must use built-in constructors.
    // See https://es5.github.io/#x11.1.5 for more details.
    context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;

    /** Native constructor references. */
    var Array = context.Array,
        Date = context.Date,
        Error = context.Error,
        Function = context.Function,
        Math = context.Math,
        Number = context.Number,
        Object = context.Object,
        RegExp = context.RegExp,
        String = context.String,
        TypeError = context.TypeError;

    /** Used for native method references. */
    var arrayProto = Array.prototype,
        objectProto = Object.prototype,
        stringProto = String.prototype;

    /** Used to resolve the decompiled source of functions. */
    var fnToString = Function.prototype.toString;

    /** Used to check objects for own properties. */
    var hasOwnProperty = objectProto.hasOwnProperty;

    /** Used to generate unique IDs. */
    var idCounter = 0;

    /**
     * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
     * of values.
     */
    var objToString = objectProto.toString;

    /** Used to restore the original `_` reference in `_.noConflict`. */
    var oldDash = root._;

    /** Used to detect if a method is native. */
    var reIsNative = RegExp('^' +
      fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
      .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
    );

    /** Native method references. */
    var ArrayBuffer = context.ArrayBuffer,
        clearTimeout = context.clearTimeout,
        parseFloat = context.parseFloat,
        pow = Math.pow,
        propertyIsEnumerable = objectProto.propertyIsEnumerable,
        Set = getNative(context, 'Set'),
        setTimeout = context.setTimeout,
        splice = arrayProto.splice,
        Uint8Array = context.Uint8Array,
        WeakMap = getNative(context, 'WeakMap');

    /* Native method references for those with the same name as other `lodash` methods. */
    var nativeCeil = Math.ceil,
        nativeCreate = getNative(Object, 'create'),
        nativeFloor = Math.floor,
        nativeIsArray = getNative(Array, 'isArray'),
        nativeIsFinite = context.isFinite,
        nativeKeys = getNative(Object, 'keys'),
        nativeMax = Math.max,
        nativeMin = Math.min,
        nativeNow = getNative(Date, 'now'),
        nativeParseInt = context.parseInt,
        nativeRandom = Math.random;

    /** Used as references for `-Infinity` and `Infinity`. */
    var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,
        POSITIVE_INFINITY = Number.POSITIVE_INFINITY;

    /** Used as references for the maximum length and index of an array. */
    var MAX_ARRAY_LENGTH = 4294967295,
        MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
        HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;

    /**
     * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
     * of an array-like value.
     */
    var MAX_SAFE_INTEGER = 9007199254740991;

    /** Used to store function metadata. */
    var metaMap = WeakMap && new WeakMap;

    /** Used to lookup unminified function names. */
    var realNames = {};

    /*------------------------------------------------------------------------*/

    /**
     * Creates a `lodash` object which wraps `value` to enable implicit chaining.
     * Methods that operate on and return arrays, collections, and functions can
     * be chained together. Methods that retrieve a single value or may return a
     * primitive value will automatically end the chain returning the unwrapped
     * value. Explicit chaining may be enabled using `_.chain`. The execution of
     * chained methods is lazy, that is, execution is deferred until `_#value`
     * is implicitly or explicitly called.
     *
     * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
     * fusion is an optimization strategy which merge iteratee calls; this can help
     * to avoid the creation of intermediate data structures and greatly reduce the
     * number of iteratee executions.
     *
     * Chaining is supported in custom builds as long as the `_#value` method is
     * directly or indirectly included in the build.
     *
     * In addition to lodash methods, wrappers have `Array` and `String` methods.
     *
     * The wrapper `Array` methods are:
     * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
     * `splice`, and `unshift`
     *
     * The wrapper `String` methods are:
     * `replace` and `split`
     *
     * The wrapper methods that support shortcut fusion are:
     * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
     * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
     * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
     * and `where`
     *
     * The chainable wrapper methods are:
     * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
     * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
     * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
     * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
     * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
     * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
     * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
     * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
     * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
     * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
     * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
     * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
     * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
     * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
     * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
     * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
     * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
     *
     * The wrapper methods that are **not** chainable by default are:
     * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
     * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
     * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
     * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
     * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
     * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
     * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
     * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
     * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
     * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
     * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
     * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
     * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
     * `unescape`, `uniqueId`, `value`, and `words`
     *
     * The wrapper method `sample` will return a wrapped value when `n` is provided,
     * otherwise an unwrapped value is returned.
     *
     * @name _
     * @constructor
     * @category Chain
     * @param {*} value The value to wrap in a `lodash` instance.
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var wrapped = _([1, 2, 3]);
     *
     * // returns an unwrapped value
     * wrapped.reduce(function(total, n) {
     *   return total + n;
     * });
     * // => 6
     *
     * // returns a wrapped value
     * var squares = wrapped.map(function(n) {
     *   return n * n;
     * });
     *
     * _.isArray(squares);
     * // => false
     *
     * _.isArray(squares.value());
     * // => true
     */
    function lodash(value) {
      if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
        if (value instanceof LodashWrapper) {
          return value;
        }
        if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
          return wrapperClone(value);
        }
      }
      return new LodashWrapper(value);
    }

    /**
     * The function whose prototype all chaining wrappers inherit from.
     *
     * @private
     */
    function baseLodash() {
      // No operation performed.
    }

    /**
     * The base constructor for creating `lodash` wrapper objects.
     *
     * @private
     * @param {*} value The value to wrap.
     * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
     * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
     */
    function LodashWrapper(value, chainAll, actions) {
      this.__wrapped__ = value;
      this.__actions__ = actions || [];
      this.__chain__ = !!chainAll;
    }

    /**
     * An object environment feature flags.
     *
     * @static
     * @memberOf _
     * @type Object
     */
    var support = lodash.support = {};

    /**
     * By default, the template delimiters used by lodash are like those in
     * embedded Ruby (ERB). Change the following template settings to use
     * alternative delimiters.
     *
     * @static
     * @memberOf _
     * @type Object
     */
    lodash.templateSettings = {

      /**
       * Used to detect `data` property values to be HTML-escaped.
       *
       * @memberOf _.templateSettings
       * @type RegExp
       */
      'escape': reEscape,

      /**
       * Used to detect code to be evaluated.
       *
       * @memberOf _.templateSettings
       * @type RegExp
       */
      'evaluate': reEvaluate,

      /**
       * Used to detect `data` property values to inject.
       *
       * @memberOf _.templateSettings
       * @type RegExp
       */
      'interpolate': reInterpolate,

      /**
       * Used to reference the data object in the template text.
       *
       * @memberOf _.templateSettings
       * @type string
       */
      'variable': '',

      /**
       * Used to import variables into the compiled template.
       *
       * @memberOf _.templateSettings
       * @type Object
       */
      'imports': {

        /**
         * A reference to the `lodash` function.
         *
         * @memberOf _.templateSettings.imports
         * @type Function
         */
        '_': lodash
      }
    };

    /*------------------------------------------------------------------------*/

    /**
     * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
     *
     * @private
     * @param {*} value The value to wrap.
     */
    function LazyWrapper(value) {
      this.__wrapped__ = value;
      this.__actions__ = [];
      this.__dir__ = 1;
      this.__filtered__ = false;
      this.__iteratees__ = [];
      this.__takeCount__ = POSITIVE_INFINITY;
      this.__views__ = [];
    }

    /**
     * Creates a clone of the lazy wrapper object.
     *
     * @private
     * @name clone
     * @memberOf LazyWrapper
     * @returns {Object} Returns the cloned `LazyWrapper` object.
     */
    function lazyClone() {
      var result = new LazyWrapper(this.__wrapped__);
      result.__actions__ = arrayCopy(this.__actions__);
      result.__dir__ = this.__dir__;
      result.__filtered__ = this.__filtered__;
      result.__iteratees__ = arrayCopy(this.__iteratees__);
      result.__takeCount__ = this.__takeCount__;
      result.__views__ = arrayCopy(this.__views__);
      return result;
    }

    /**
     * Reverses the direction of lazy iteration.
     *
     * @private
     * @name reverse
     * @memberOf LazyWrapper
     * @returns {Object} Returns the new reversed `LazyWrapper` object.
     */
    function lazyReverse() {
      if (this.__filtered__) {
        var result = new LazyWrapper(this);
        result.__dir__ = -1;
        result.__filtered__ = true;
      } else {
        result = this.clone();
        result.__dir__ *= -1;
      }
      return result;
    }

    /**
     * Extracts the unwrapped value from its lazy wrapper.
     *
     * @private
     * @name value
     * @memberOf LazyWrapper
     * @returns {*} Returns the unwrapped value.
     */
    function lazyValue() {
      var array = this.__wrapped__.value(),
          dir = this.__dir__,
          isArr = isArray(array),
          isRight = dir < 0,
          arrLength = isArr ? array.length : 0,
          view = getView(0, arrLength, this.__views__),
          start = view.start,
          end = view.end,
          length = end - start,
          index = isRight ? end : (start - 1),
          iteratees = this.__iteratees__,
          iterLength = iteratees.length,
          resIndex = 0,
          takeCount = nativeMin(length, this.__takeCount__);

      if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {
        return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);
      }
      var result = [];

      outer:
      while (length-- && resIndex < takeCount) {
        index += dir;

        var iterIndex = -1,
            value = array[index];

        while (++iterIndex < iterLength) {
          var data = iteratees[iterIndex],
              iteratee = data.iteratee,
              type = data.type,
              computed = iteratee(value);

          if (type == LAZY_MAP_FLAG) {
            value = computed;
          } else if (!computed) {
            if (type == LAZY_FILTER_FLAG) {
              continue outer;
            } else {
              break outer;
            }
          }
        }
        result[resIndex++] = value;
      }
      return result;
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates a cache object to store key/value pairs.
     *
     * @private
     * @static
     * @name Cache
     * @memberOf _.memoize
     */
    function MapCache() {
      this.__data__ = {};
    }

    /**
     * Removes `key` and its value from the cache.
     *
     * @private
     * @name delete
     * @memberOf _.memoize.Cache
     * @param {string} key The key of the value to remove.
     * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
     */
    function mapDelete(key) {
      return this.has(key) && delete this.__data__[key];
    }

    /**
     * Gets the cached value for `key`.
     *
     * @private
     * @name get
     * @memberOf _.memoize.Cache
     * @param {string} key The key of the value to get.
     * @returns {*} Returns the cached value.
     */
    function mapGet(key) {
      return key == '__proto__' ? undefined : this.__data__[key];
    }

    /**
     * Checks if a cached value for `key` exists.
     *
     * @private
     * @name has
     * @memberOf _.memoize.Cache
     * @param {string} key The key of the entry to check.
     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
     */
    function mapHas(key) {
      return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
    }

    /**
     * Sets `value` to `key` of the cache.
     *
     * @private
     * @name set
     * @memberOf _.memoize.Cache
     * @param {string} key The key of the value to cache.
     * @param {*} value The value to cache.
     * @returns {Object} Returns the cache object.
     */
    function mapSet(key, value) {
      if (key != '__proto__') {
        this.__data__[key] = value;
      }
      return this;
    }

    /*------------------------------------------------------------------------*/

    /**
     *
     * Creates a cache object to store unique values.
     *
     * @private
     * @param {Array} [values] The values to cache.
     */
    function SetCache(values) {
      var length = values ? values.length : 0;

      this.data = { 'hash': nativeCreate(null), 'set': new Set };
      while (length--) {
        this.push(values[length]);
      }
    }

    /**
     * Checks if `value` is in `cache` mimicking the return signature of
     * `_.indexOf` by returning `0` if the value is found, else `-1`.
     *
     * @private
     * @param {Object} cache The cache to search.
     * @param {*} value The value to search for.
     * @returns {number} Returns `0` if `value` is found, else `-1`.
     */
    function cacheIndexOf(cache, value) {
      var data = cache.data,
          result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];

      return result ? 0 : -1;
    }

    /**
     * Adds `value` to the cache.
     *
     * @private
     * @name push
     * @memberOf SetCache
     * @param {*} value The value to cache.
     */
    function cachePush(value) {
      var data = this.data;
      if (typeof value == 'string' || isObject(value)) {
        data.set.add(value);
      } else {
        data.hash[value] = true;
      }
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates a new array joining `array` with `other`.
     *
     * @private
     * @param {Array} array The array to join.
     * @param {Array} other The other array to join.
     * @returns {Array} Returns the new concatenated array.
     */
    function arrayConcat(array, other) {
      var index = -1,
          length = array.length,
          othIndex = -1,
          othLength = other.length,
          result = Array(length + othLength);

      while (++index < length) {
        result[index] = array[index];
      }
      while (++othIndex < othLength) {
        result[index++] = other[othIndex];
      }
      return result;
    }

    /**
     * Copies the values of `source` to `array`.
     *
     * @private
     * @param {Array} source The array to copy values from.
     * @param {Array} [array=[]] The array to copy values to.
     * @returns {Array} Returns `array`.
     */
    function arrayCopy(source, array) {
      var index = -1,
          length = source.length;

      array || (array = Array(length));
      while (++index < length) {
        array[index] = source[index];
      }
      return array;
    }

    /**
     * A specialized version of `_.forEach` for arrays without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns `array`.
     */
    function arrayEach(array, iteratee) {
      var index = -1,
          length = array.length;

      while (++index < length) {
        if (iteratee(array[index], index, array) === false) {
          break;
        }
      }
      return array;
    }

    /**
     * A specialized version of `_.forEachRight` for arrays without support for
     * callback shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns `array`.
     */
    function arrayEachRight(array, iteratee) {
      var length = array.length;

      while (length--) {
        if (iteratee(array[length], length, array) === false) {
          break;
        }
      }
      return array;
    }

    /**
     * A specialized version of `_.every` for arrays without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {boolean} Returns `true` if all elements pass the predicate check,
     *  else `false`.
     */
    function arrayEvery(array, predicate) {
      var index = -1,
          length = array.length;

      while (++index < length) {
        if (!predicate(array[index], index, array)) {
          return false;
        }
      }
      return true;
    }

    /**
     * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
     * with one argument: (value).
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} comparator The function used to compare values.
     * @param {*} exValue The initial extremum value.
     * @returns {*} Returns the extremum value.
     */
    function arrayExtremum(array, iteratee, comparator, exValue) {
      var index = -1,
          length = array.length,
          computed = exValue,
          result = computed;

      while (++index < length) {
        var value = array[index],
            current = +iteratee(value);

        if (comparator(current, computed)) {
          computed = current;
          result = value;
        }
      }
      return result;
    }

    /**
     * A specialized version of `_.filter` for arrays without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {Array} Returns the new filtered array.
     */
    function arrayFilter(array, predicate) {
      var index = -1,
          length = array.length,
          resIndex = -1,
          result = [];

      while (++index < length) {
        var value = array[index];
        if (predicate(value, index, array)) {
          result[++resIndex] = value;
        }
      }
      return result;
    }

    /**
     * A specialized version of `_.map` for arrays without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns the new mapped array.
     */
    function arrayMap(array, iteratee) {
      var index = -1,
          length = array.length,
          result = Array(length);

      while (++index < length) {
        result[index] = iteratee(array[index], index, array);
      }
      return result;
    }

    /**
     * Appends the elements of `values` to `array`.
     *
     * @private
     * @param {Array} array The array to modify.
     * @param {Array} values The values to append.
     * @returns {Array} Returns `array`.
     */
    function arrayPush(array, values) {
      var index = -1,
          length = values.length,
          offset = array.length;

      while (++index < length) {
        array[offset + index] = values[index];
      }
      return array;
    }

    /**
     * A specialized version of `_.reduce` for arrays without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {*} [accumulator] The initial value.
     * @param {boolean} [initFromArray] Specify using the first element of `array`
     *  as the initial value.
     * @returns {*} Returns the accumulated value.
     */
    function arrayReduce(array, iteratee, accumulator, initFromArray) {
      var index = -1,
          length = array.length;

      if (initFromArray && length) {
        accumulator = array[++index];
      }
      while (++index < length) {
        accumulator = iteratee(accumulator, array[index], index, array);
      }
      return accumulator;
    }

    /**
     * A specialized version of `_.reduceRight` for arrays without support for
     * callback shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {*} [accumulator] The initial value.
     * @param {boolean} [initFromArray] Specify using the last element of `array`
     *  as the initial value.
     * @returns {*} Returns the accumulated value.
     */
    function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
      var length = array.length;
      if (initFromArray && length) {
        accumulator = array[--length];
      }
      while (length--) {
        accumulator = iteratee(accumulator, array[length], length, array);
      }
      return accumulator;
    }

    /**
     * A specialized version of `_.some` for arrays without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {boolean} Returns `true` if any element passes the predicate check,
     *  else `false`.
     */
    function arraySome(array, predicate) {
      var index = -1,
          length = array.length;

      while (++index < length) {
        if (predicate(array[index], index, array)) {
          return true;
        }
      }
      return false;
    }

    /**
     * A specialized version of `_.sum` for arrays without support for callback
     * shorthands and `this` binding..
     *
     * @private
     * @param {Array} array The array to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {number} Returns the sum.
     */
    function arraySum(array, iteratee) {
      var length = array.length,
          result = 0;

      while (length--) {
        result += +iteratee(array[length]) || 0;
      }
      return result;
    }

    /**
     * Used by `_.defaults` to customize its `_.assign` use.
     *
     * @private
     * @param {*} objectValue The destination object property value.
     * @param {*} sourceValue The source object property value.
     * @returns {*} Returns the value to assign to the destination object.
     */
    function assignDefaults(objectValue, sourceValue) {
      return objectValue === undefined ? sourceValue : objectValue;
    }

    /**
     * Used by `_.template` to customize its `_.assign` use.
     *
     * **Note:** This function is like `assignDefaults` except that it ignores
     * inherited property values when checking if a property is `undefined`.
     *
     * @private
     * @param {*} objectValue The destination object property value.
     * @param {*} sourceValue The source object property value.
     * @param {string} key The key associated with the object and source values.
     * @param {Object} object The destination object.
     * @returns {*} Returns the value to assign to the destination object.
     */
    function assignOwnDefaults(objectValue, sourceValue, key, object) {
      return (objectValue === undefined || !hasOwnProperty.call(object, key))
        ? sourceValue
        : objectValue;
    }

    /**
     * A specialized version of `_.assign` for customizing assigned values without
     * support for argument juggling, multiple sources, and `this` binding `customizer`
     * functions.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {Function} customizer The function to customize assigned values.
     * @returns {Object} Returns `object`.
     */
    function assignWith(object, source, customizer) {
      var index = -1,
          props = keys(source),
          length = props.length;

      while (++index < length) {
        var key = props[index],
            value = object[key],
            result = customizer(value, source[key], key, object, source);

        if ((result === result ? (result !== value) : (value === value)) ||
            (value === undefined && !(key in object))) {
          object[key] = result;
        }
      }
      return object;
    }

    /**
     * The base implementation of `_.assign` without support for argument juggling,
     * multiple sources, and `customizer` functions.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @returns {Object} Returns `object`.
     */
    function baseAssign(object, source) {
      return source == null
        ? object
        : baseCopy(source, keys(source), object);
    }

    /**
     * The base implementation of `_.at` without support for string collections
     * and individual key arguments.
     *
     * @private
     * @param {Array|Object} collection The collection to iterate over.
     * @param {number[]|string[]} props The property names or indexes of elements to pick.
     * @returns {Array} Returns the new array of picked elements.
     */
    function baseAt(collection, props) {
      var index = -1,
          isNil = collection == null,
          isArr = !isNil && isArrayLike(collection),
          length = isArr ? collection.length : 0,
          propsLength = props.length,
          result = Array(propsLength);

      while(++index < propsLength) {
        var key = props[index];
        if (isArr) {
          result[index] = isIndex(key, length) ? collection[key] : undefined;
        } else {
          result[index] = isNil ? undefined : collection[key];
        }
      }
      return result;
    }

    /**
     * Copies properties of `source` to `object`.
     *
     * @private
     * @param {Object} source The object to copy properties from.
     * @param {Array} props The property names to copy.
     * @param {Object} [object={}] The object to copy properties to.
     * @returns {Object} Returns `object`.
     */
    function baseCopy(source, props, object) {
      object || (object = {});

      var index = -1,
          length = props.length;

      while (++index < length) {
        var key = props[index];
        object[key] = source[key];
      }
      return object;
    }

    /**
     * The base implementation of `_.callback` which supports specifying the
     * number of arguments to provide to `func`.
     *
     * @private
     * @param {*} [func=_.identity] The value to convert to a callback.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param {number} [argCount] The number of arguments to provide to `func`.
     * @returns {Function} Returns the callback.
     */
    function baseCallback(func, thisArg, argCount) {
      var type = typeof func;
      if (type == 'function') {
        return thisArg === undefined
          ? func
          : bindCallback(func, thisArg, argCount);
      }
      if (func == null) {
        return identity;
      }
      if (type == 'object') {
        return baseMatches(func);
      }
      return thisArg === undefined
        ? property(func)
        : baseMatchesProperty(func, thisArg);
    }

    /**
     * The base implementation of `_.clone` without support for argument juggling
     * and `this` binding `customizer` functions.
     *
     * @private
     * @param {*} value The value to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @param {Function} [customizer] The function to customize cloning values.
     * @param {string} [key] The key of `value`.
     * @param {Object} [object] The object `value` belongs to.
     * @param {Array} [stackA=[]] Tracks traversed source objects.
     * @param {Array} [stackB=[]] Associates clones with source counterparts.
     * @returns {*} Returns the cloned value.
     */
    function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
      var result;
      if (customizer) {
        result = object ? customizer(value, key, object) : customizer(value);
      }
      if (result !== undefined) {
        return result;
      }
      if (!isObject(value)) {
        return value;
      }
      var isArr = isArray(value);
      if (isArr) {
        result = initCloneArray(value);
        if (!isDeep) {
          return arrayCopy(value, result);
        }
      } else {
        var tag = objToString.call(value),
            isFunc = tag == funcTag;

        if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
          result = initCloneObject(isFunc ? {} : value);
          if (!isDeep) {
            return baseAssign(result, value);
          }
        } else {
          return cloneableTags[tag]
            ? initCloneByTag(value, tag, isDeep)
            : (object ? value : {});
        }
      }
      // Check for circular references and return its corresponding clone.
      stackA || (stackA = []);
      stackB || (stackB = []);

      var length = stackA.length;
      while (length--) {
        if (stackA[length] == value) {
          return stackB[length];
        }
      }
      // Add the source value to the stack of traversed objects and associate it with its clone.
      stackA.push(value);
      stackB.push(result);

      // Recursively populate clone (susceptible to call stack limits).
      (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {
        result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
      });
      return result;
    }

    /**
     * The base implementation of `_.create` without support for assigning
     * properties to the created object.
     *
     * @private
     * @param {Object} prototype The object to inherit from.
     * @returns {Object} Returns the new object.
     */
    var baseCreate = (function() {
      function object() {}
      return function(prototype) {
        if (isObject(prototype)) {
          object.prototype = prototype;
          var result = new object;
          object.prototype = undefined;
        }
        return result || {};
      };
    }());

    /**
     * The base implementation of `_.delay` and `_.defer` which accepts an index
     * of where to slice the arguments to provide to `func`.
     *
     * @private
     * @param {Function} func The function to delay.
     * @param {number} wait The number of milliseconds to delay invocation.
     * @param {Object} args The arguments provide to `func`.
     * @returns {number} Returns the timer id.
     */
    function baseDelay(func, wait, args) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      return setTimeout(function() { func.apply(undefined, args); }, wait);
    }

    /**
     * The base implementation of `_.difference` which accepts a single array
     * of values to exclude.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {Array} values The values to exclude.
     * @returns {Array} Returns the new array of filtered values.
     */
    function baseDifference(array, values) {
      var length = array ? array.length : 0,
          result = [];

      if (!length) {
        return result;
      }
      var index = -1,
          indexOf = getIndexOf(),
          isCommon = indexOf == baseIndexOf,
          cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,
          valuesLength = values.length;

      if (cache) {
        indexOf = cacheIndexOf;
        isCommon = false;
        values = cache;
      }
      outer:
      while (++index < length) {
        var value = array[index];

        if (isCommon && value === value) {
          var valuesIndex = valuesLength;
          while (valuesIndex--) {
            if (values[valuesIndex] === value) {
              continue outer;
            }
          }
          result.push(value);
        }
        else if (indexOf(values, value, 0) < 0) {
          result.push(value);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.forEach` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array|Object|string} Returns `collection`.
     */
    var baseEach = createBaseEach(baseForOwn);

    /**
     * The base implementation of `_.forEachRight` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array|Object|string} Returns `collection`.
     */
    var baseEachRight = createBaseEach(baseForOwnRight, true);

    /**
     * The base implementation of `_.every` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {boolean} Returns `true` if all elements pass the predicate check,
     *  else `false`
     */
    function baseEvery(collection, predicate) {
      var result = true;
      baseEach(collection, function(value, index, collection) {
        result = !!predicate(value, index, collection);
        return result;
      });
      return result;
    }

    /**
     * Gets the extremum value of `collection` invoking `iteratee` for each value
     * in `collection` to generate the criterion by which the value is ranked.
     * The `iteratee` is invoked with three arguments: (value, index|key, collection).
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} comparator The function used to compare values.
     * @param {*} exValue The initial extremum value.
     * @returns {*} Returns the extremum value.
     */
    function baseExtremum(collection, iteratee, comparator, exValue) {
      var computed = exValue,
          result = computed;

      baseEach(collection, function(value, index, collection) {
        var current = +iteratee(value, index, collection);
        if (comparator(current, computed) || (current === exValue && current === result)) {
          computed = current;
          result = value;
        }
      });
      return result;
    }

    /**
     * The base implementation of `_.fill` without an iteratee call guard.
     *
     * @private
     * @param {Array} array The array to fill.
     * @param {*} value The value to fill `array` with.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns `array`.
     */
    function baseFill(array, value, start, end) {
      var length = array.length;

      start = start == null ? 0 : (+start || 0);
      if (start < 0) {
        start = -start > length ? 0 : (length + start);
      }
      end = (end === undefined || end > length) ? length : (+end || 0);
      if (end < 0) {
        end += length;
      }
      length = start > end ? 0 : (end >>> 0);
      start >>>= 0;

      while (start < length) {
        array[start++] = value;
      }
      return array;
    }

    /**
     * The base implementation of `_.filter` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {Array} Returns the new filtered array.
     */
    function baseFilter(collection, predicate) {
      var result = [];
      baseEach(collection, function(value, index, collection) {
        if (predicate(value, index, collection)) {
          result.push(value);
        }
      });
      return result;
    }

    /**
     * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
     * without support for callback shorthands and `this` binding, which iterates
     * over `collection` using the provided `eachFunc`.
     *
     * @private
     * @param {Array|Object|string} collection The collection to search.
     * @param {Function} predicate The function invoked per iteration.
     * @param {Function} eachFunc The function to iterate over `collection`.
     * @param {boolean} [retKey] Specify returning the key of the found element
     *  instead of the element itself.
     * @returns {*} Returns the found element or its key, else `undefined`.
     */
    function baseFind(collection, predicate, eachFunc, retKey) {
      var result;
      eachFunc(collection, function(value, key, collection) {
        if (predicate(value, key, collection)) {
          result = retKey ? key : value;
          return false;
        }
      });
      return result;
    }

    /**
     * The base implementation of `_.flatten` with added support for restricting
     * flattening and specifying the start index.
     *
     * @private
     * @param {Array} array The array to flatten.
     * @param {boolean} [isDeep] Specify a deep flatten.
     * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
     * @param {Array} [result=[]] The initial result value.
     * @returns {Array} Returns the new flattened array.
     */
    function baseFlatten(array, isDeep, isStrict, result) {
      result || (result = []);

      var index = -1,
          length = array.length;

      while (++index < length) {
        var value = array[index];
        if (isObjectLike(value) && isArrayLike(value) &&
            (isStrict || isArray(value) || isArguments(value))) {
          if (isDeep) {
            // Recursively flatten arrays (susceptible to call stack limits).
            baseFlatten(value, isDeep, isStrict, result);
          } else {
            arrayPush(result, value);
          }
        } else if (!isStrict) {
          result[result.length] = value;
        }
      }
      return result;
    }

    /**
     * The base implementation of `baseForIn` and `baseForOwn` which iterates
     * over `object` properties returned by `keysFunc` invoking `iteratee` for
     * each property. Iteratee functions may exit iteration early by explicitly
     * returning `false`.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @returns {Object} Returns `object`.
     */
    var baseFor = createBaseFor();

    /**
     * This function is like `baseFor` except that it iterates over properties
     * in the opposite order.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {Function} keysFunc The function to get the keys of `object`.
     * @returns {Object} Returns `object`.
     */
    var baseForRight = createBaseFor(true);

    /**
     * The base implementation of `_.forIn` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Object} Returns `object`.
     */
    function baseForIn(object, iteratee) {
      return baseFor(object, iteratee, keysIn);
    }

    /**
     * The base implementation of `_.forOwn` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Object} Returns `object`.
     */
    function baseForOwn(object, iteratee) {
      return baseFor(object, iteratee, keys);
    }

    /**
     * The base implementation of `_.forOwnRight` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Object} object The object to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Object} Returns `object`.
     */
    function baseForOwnRight(object, iteratee) {
      return baseForRight(object, iteratee, keys);
    }

    /**
     * The base implementation of `_.functions` which creates an array of
     * `object` function property names filtered from those provided.
     *
     * @private
     * @param {Object} object The object to inspect.
     * @param {Array} props The property names to filter.
     * @returns {Array} Returns the new array of filtered property names.
     */
    function baseFunctions(object, props) {
      var index = -1,
          length = props.length,
          resIndex = -1,
          result = [];

      while (++index < length) {
        var key = props[index];
        if (isFunction(object[key])) {
          result[++resIndex] = key;
        }
      }
      return result;
    }

    /**
     * The base implementation of `get` without support for string paths
     * and default values.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array} path The path of the property to get.
     * @param {string} [pathKey] The key representation of path.
     * @returns {*} Returns the resolved value.
     */
    function baseGet(object, path, pathKey) {
      if (object == null) {
        return;
      }
      if (pathKey !== undefined && pathKey in toObject(object)) {
        path = [pathKey];
      }
      var index = 0,
          length = path.length;

      while (object != null && index < length) {
        object = object[path[index++]];
      }
      return (index && index == length) ? object : undefined;
    }

    /**
     * The base implementation of `_.isEqual` without support for `this` binding
     * `customizer` functions.
     *
     * @private
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @param {Function} [customizer] The function to customize comparing values.
     * @param {boolean} [isLoose] Specify performing partial comparisons.
     * @param {Array} [stackA] Tracks traversed `value` objects.
     * @param {Array} [stackB] Tracks traversed `other` objects.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     */
    function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
    }

    /**
     * A specialized version of `baseIsEqual` for arrays and objects which performs
     * deep comparisons and tracks traversed objects enabling objects with circular
     * references to be compared.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Function} [customizer] The function to customize comparing objects.
     * @param {boolean} [isLoose] Specify performing partial comparisons.
     * @param {Array} [stackA=[]] Tracks traversed `value` objects.
     * @param {Array} [stackB=[]] Tracks traversed `other` objects.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
      var objIsArr = isArray(object),
          othIsArr = isArray(other),
          objTag = arrayTag,
          othTag = arrayTag;

      if (!objIsArr) {
        objTag = objToString.call(object);
        if (objTag == argsTag) {
          objTag = objectTag;
        } else if (objTag != objectTag) {
          objIsArr = isTypedArray(object);
        }
      }
      if (!othIsArr) {
        othTag = objToString.call(other);
        if (othTag == argsTag) {
          othTag = objectTag;
        } else if (othTag != objectTag) {
          othIsArr = isTypedArray(other);
        }
      }
      var objIsObj = objTag == objectTag,
          othIsObj = othTag == objectTag,
          isSameTag = objTag == othTag;

      if (isSameTag && !(objIsArr || objIsObj)) {
        return equalByTag(object, other, objTag);
      }
      if (!isLoose) {
        var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
            othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');

        if (objIsWrapped || othIsWrapped) {
          return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
        }
      }
      if (!isSameTag) {
        return false;
      }
      // Assume cyclic values are equal.
      // For more information on detecting circular references see https://es5.github.io/#JO.
      stackA || (stackA = []);
      stackB || (stackB = []);

      var length = stackA.length;
      while (length--) {
        if (stackA[length] == object) {
          return stackB[length] == other;
        }
      }
      // Add `object` and `other` to the stack of traversed objects.
      stackA.push(object);
      stackB.push(other);

      var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);

      stackA.pop();
      stackB.pop();

      return result;
    }

    /**
     * The base implementation of `_.isMatch` without support for callback
     * shorthands and `this` binding.
     *
     * @private
     * @param {Object} object The object to inspect.
     * @param {Array} matchData The propery names, values, and compare flags to match.
     * @param {Function} [customizer] The function to customize comparing objects.
     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
     */
    function baseIsMatch(object, matchData, customizer) {
      var index = matchData.length,
          length = index,
          noCustomizer = !customizer;

      if (object == null) {
        return !length;
      }
      object = toObject(object);
      while (index--) {
        var data = matchData[index];
        if ((noCustomizer && data[2])
              ? data[1] !== object[data[0]]
              : !(data[0] in object)
            ) {
          return false;
        }
      }
      while (++index < length) {
        data = matchData[index];
        var key = data[0],
            objValue = object[key],
            srcValue = data[1];

        if (noCustomizer && data[2]) {
          if (objValue === undefined && !(key in object)) {
            return false;
          }
        } else {
          var result = customizer ? customizer(objValue, srcValue, key) : undefined;
          if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
            return false;
          }
        }
      }
      return true;
    }

    /**
     * The base implementation of `_.map` without support for callback shorthands
     * and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {Array} Returns the new mapped array.
     */
    function baseMap(collection, iteratee) {
      var index = -1,
          result = isArrayLike(collection) ? Array(collection.length) : [];

      baseEach(collection, function(value, key, collection) {
        result[++index] = iteratee(value, key, collection);
      });
      return result;
    }

    /**
     * The base implementation of `_.matches` which does not clone `source`.
     *
     * @private
     * @param {Object} source The object of property values to match.
     * @returns {Function} Returns the new function.
     */
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        var key = matchData[0][0],
            value = matchData[0][1];

        return function(object) {
          if (object == null) {
            return false;
          }
          return object[key] === value && (value !== undefined || (key in toObject(object)));
        };
      }
      return function(object) {
        return baseIsMatch(object, matchData);
      };
    }

    /**
     * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
     *
     * @private
     * @param {string} path The path of the property to get.
     * @param {*} srcValue The value to compare.
     * @returns {Function} Returns the new function.
     */
    function baseMatchesProperty(path, srcValue) {
      var isArr = isArray(path),
          isCommon = isKey(path) && isStrictComparable(srcValue),
          pathKey = (path + '');

      path = toPath(path);
      return function(object) {
        if (object == null) {
          return false;
        }
        var key = pathKey;
        object = toObject(object);
        if ((isArr || !isCommon) && !(key in object)) {
          object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
          if (object == null) {
            return false;
          }
          key = last(path);
          object = toObject(object);
        }
        return object[key] === srcValue
          ? (srcValue !== undefined || (key in object))
          : baseIsEqual(srcValue, object[key], undefined, true);
      };
    }

    /**
     * The base implementation of `_.merge` without support for argument juggling,
     * multiple sources, and `this` binding `customizer` functions.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {Function} [customizer] The function to customize merged values.
     * @param {Array} [stackA=[]] Tracks traversed source objects.
     * @param {Array} [stackB=[]] Associates values with source counterparts.
     * @returns {Object} Returns `object`.
     */
    function baseMerge(object, source, customizer, stackA, stackB) {
      if (!isObject(object)) {
        return object;
      }
      var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
          props = isSrcArr ? undefined : keys(source);

      arrayEach(props || source, function(srcValue, key) {
        if (props) {
          key = srcValue;
          srcValue = source[key];
        }
        if (isObjectLike(srcValue)) {
          stackA || (stackA = []);
          stackB || (stackB = []);
          baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
        }
        else {
          var value = object[key],
              result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
              isCommon = result === undefined;

          if (isCommon) {
            result = srcValue;
          }
          if ((result !== undefined || (isSrcArr && !(key in object))) &&
              (isCommon || (result === result ? (result !== value) : (value === value)))) {
            object[key] = result;
          }
        }
      });
      return object;
    }

    /**
     * A specialized version of `baseMerge` for arrays and objects which performs
     * deep merges and tracks traversed objects enabling objects with circular
     * references to be merged.
     *
     * @private
     * @param {Object} object The destination object.
     * @param {Object} source The source object.
     * @param {string} key The key of the value to merge.
     * @param {Function} mergeFunc The function to merge values.
     * @param {Function} [customizer] The function to customize merged values.
     * @param {Array} [stackA=[]] Tracks traversed source objects.
     * @param {Array} [stackB=[]] Associates values with source counterparts.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
      var length = stackA.length,
          srcValue = source[key];

      while (length--) {
        if (stackA[length] == srcValue) {
          object[key] = stackB[length];
          return;
        }
      }
      var value = object[key],
          result = customizer ? customizer(value, srcValue, key, object, source) : undefined,
          isCommon = result === undefined;

      if (isCommon) {
        result = srcValue;
        if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
          result = isArray(value)
            ? value
            : (isArrayLike(value) ? arrayCopy(value) : []);
        }
        else if (isPlainObject(srcValue) || isArguments(srcValue)) {
          result = isArguments(value)
            ? toPlainObject(value)
            : (isPlainObject(value) ? value : {});
        }
        else {
          isCommon = false;
        }
      }
      // Add the source value to the stack of traversed objects and associate
      // it with its merged value.
      stackA.push(srcValue);
      stackB.push(result);

      if (isCommon) {
        // Recursively merge objects and arrays (susceptible to call stack limits).
        object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
      } else if (result === result ? (result !== value) : (value === value)) {
        object[key] = result;
      }
    }

    /**
     * The base implementation of `_.property` without support for deep paths.
     *
     * @private
     * @param {string} key The key of the property to get.
     * @returns {Function} Returns the new function.
     */
    function baseProperty(key) {
      return function(object) {
        return object == null ? undefined : object[key];
      };
    }

    /**
     * A specialized version of `baseProperty` which supports deep paths.
     *
     * @private
     * @param {Array|string} path The path of the property to get.
     * @returns {Function} Returns the new function.
     */
    function basePropertyDeep(path) {
      var pathKey = (path + '');
      path = toPath(path);
      return function(object) {
        return baseGet(object, path, pathKey);
      };
    }

    /**
     * The base implementation of `_.pullAt` without support for individual
     * index arguments and capturing the removed elements.
     *
     * @private
     * @param {Array} array The array to modify.
     * @param {number[]} indexes The indexes of elements to remove.
     * @returns {Array} Returns `array`.
     */
    function basePullAt(array, indexes) {
      var length = array ? indexes.length : 0;
      while (length--) {
        var index = indexes[length];
        if (index != previous && isIndex(index)) {
          var previous = index;
          splice.call(array, index, 1);
        }
      }
      return array;
    }

    /**
     * The base implementation of `_.random` without support for argument juggling
     * and returning floating-point numbers.
     *
     * @private
     * @param {number} min The minimum possible value.
     * @param {number} max The maximum possible value.
     * @returns {number} Returns the random number.
     */
    function baseRandom(min, max) {
      return min + nativeFloor(nativeRandom() * (max - min + 1));
    }

    /**
     * The base implementation of `_.reduce` and `_.reduceRight` without support
     * for callback shorthands and `this` binding, which iterates over `collection`
     * using the provided `eachFunc`.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {*} accumulator The initial value.
     * @param {boolean} initFromCollection Specify using the first or last element
     *  of `collection` as the initial value.
     * @param {Function} eachFunc The function to iterate over `collection`.
     * @returns {*} Returns the accumulated value.
     */
    function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
      eachFunc(collection, function(value, index, collection) {
        accumulator = initFromCollection
          ? (initFromCollection = false, value)
          : iteratee(accumulator, value, index, collection);
      });
      return accumulator;
    }

    /**
     * The base implementation of `setData` without support for hot loop detection.
     *
     * @private
     * @param {Function} func The function to associate metadata with.
     * @param {*} data The metadata.
     * @returns {Function} Returns `func`.
     */
    var baseSetData = !metaMap ? identity : function(func, data) {
      metaMap.set(func, data);
      return func;
    };

    /**
     * The base implementation of `_.slice` without an iteratee call guard.
     *
     * @private
     * @param {Array} array The array to slice.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns the slice of `array`.
     */
    function baseSlice(array, start, end) {
      var index = -1,
          length = array.length;

      start = start == null ? 0 : (+start || 0);
      if (start < 0) {
        start = -start > length ? 0 : (length + start);
      }
      end = (end === undefined || end > length) ? length : (+end || 0);
      if (end < 0) {
        end += length;
      }
      length = start > end ? 0 : ((end - start) >>> 0);
      start >>>= 0;

      var result = Array(length);
      while (++index < length) {
        result[index] = array[index + start];
      }
      return result;
    }

    /**
     * The base implementation of `_.some` without support for callback shorthands
     * and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {boolean} Returns `true` if any element passes the predicate check,
     *  else `false`.
     */
    function baseSome(collection, predicate) {
      var result;

      baseEach(collection, function(value, index, collection) {
        result = predicate(value, index, collection);
        return !result;
      });
      return !!result;
    }

    /**
     * The base implementation of `_.sortBy` which uses `comparer` to define
     * the sort order of `array` and replaces criteria objects with their
     * corresponding values.
     *
     * @private
     * @param {Array} array The array to sort.
     * @param {Function} comparer The function to define sort order.
     * @returns {Array} Returns `array`.
     */
    function baseSortBy(array, comparer) {
      var length = array.length;

      array.sort(comparer);
      while (length--) {
        array[length] = array[length].value;
      }
      return array;
    }

    /**
     * The base implementation of `_.sortByOrder` without param guards.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
     * @param {boolean[]} orders The sort orders of `iteratees`.
     * @returns {Array} Returns the new sorted array.
     */
    function baseSortByOrder(collection, iteratees, orders) {
      var callback = getCallback(),
          index = -1;

      iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });

      var result = baseMap(collection, function(value) {
        var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });
        return { 'criteria': criteria, 'index': ++index, 'value': value };
      });

      return baseSortBy(result, function(object, other) {
        return compareMultiple(object, other, orders);
      });
    }

    /**
     * The base implementation of `_.sum` without support for callback shorthands
     * and `this` binding.
     *
     * @private
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} iteratee The function invoked per iteration.
     * @returns {number} Returns the sum.
     */
    function baseSum(collection, iteratee) {
      var result = 0;
      baseEach(collection, function(value, index, collection) {
        result += +iteratee(value, index, collection) || 0;
      });
      return result;
    }

    /**
     * The base implementation of `_.uniq` without support for callback shorthands
     * and `this` binding.
     *
     * @private
     * @param {Array} array The array to inspect.
     * @param {Function} [iteratee] The function invoked per iteration.
     * @returns {Array} Returns the new duplicate-value-free array.
     */
    function baseUniq(array, iteratee) {
      var index = -1,
          indexOf = getIndexOf(),
          length = array.length,
          isCommon = indexOf == baseIndexOf,
          isLarge = isCommon && length >= LARGE_ARRAY_SIZE,
          seen = isLarge ? createCache() : null,
          result = [];

      if (seen) {
        indexOf = cacheIndexOf;
        isCommon = false;
      } else {
        isLarge = false;
        seen = iteratee ? [] : result;
      }
      outer:
      while (++index < length) {
        var value = array[index],
            computed = iteratee ? iteratee(value, index, array) : value;

        if (isCommon && value === value) {
          var seenIndex = seen.length;
          while (seenIndex--) {
            if (seen[seenIndex] === computed) {
              continue outer;
            }
          }
          if (iteratee) {
            seen.push(computed);
          }
          result.push(value);
        }
        else if (indexOf(seen, computed, 0) < 0) {
          if (iteratee || isLarge) {
            seen.push(computed);
          }
          result.push(value);
        }
      }
      return result;
    }

    /**
     * The base implementation of `_.values` and `_.valuesIn` which creates an
     * array of `object` property values corresponding to the property names
     * of `props`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array} props The property names to get values for.
     * @returns {Object} Returns the array of property values.
     */
    function baseValues(object, props) {
      var index = -1,
          length = props.length,
          result = Array(length);

      while (++index < length) {
        result[index] = object[props[index]];
      }
      return result;
    }

    /**
     * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
     * and `_.takeWhile` without support for callback shorthands and `this` binding.
     *
     * @private
     * @param {Array} array The array to query.
     * @param {Function} predicate The function invoked per iteration.
     * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Array} Returns the slice of `array`.
     */
    function baseWhile(array, predicate, isDrop, fromRight) {
      var length = array.length,
          index = fromRight ? length : -1;

      while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
      return isDrop
        ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
        : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
    }

    /**
     * The base implementation of `wrapperValue` which returns the result of
     * performing a sequence of actions on the unwrapped `value`, where each
     * successive action is supplied the return value of the previous.
     *
     * @private
     * @param {*} value The unwrapped value.
     * @param {Array} actions Actions to peform to resolve the unwrapped value.
     * @returns {*} Returns the resolved value.
     */
    function baseWrapperValue(value, actions) {
      var result = value;
      if (result instanceof LazyWrapper) {
        result = result.value();
      }
      var index = -1,
          length = actions.length;

      while (++index < length) {
        var action = actions[index];
        result = action.func.apply(action.thisArg, arrayPush([result], action.args));
      }
      return result;
    }

    /**
     * Performs a binary search of `array` to determine the index at which `value`
     * should be inserted into `array` in order to maintain its sort order.
     *
     * @private
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {boolean} [retHighest] Specify returning the highest qualified index.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     */
    function binaryIndex(array, value, retHighest) {
      var low = 0,
          high = array ? array.length : low;

      if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
        while (low < high) {
          var mid = (low + high) >>> 1,
              computed = array[mid];

          if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {
            low = mid + 1;
          } else {
            high = mid;
          }
        }
        return high;
      }
      return binaryIndexBy(array, value, identity, retHighest);
    }

    /**
     * This function is like `binaryIndex` except that it invokes `iteratee` for
     * `value` and each element of `array` to compute their sort ranking. The
     * iteratee is invoked with one argument; (value).
     *
     * @private
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {Function} iteratee The function invoked per iteration.
     * @param {boolean} [retHighest] Specify returning the highest qualified index.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     */
    function binaryIndexBy(array, value, iteratee, retHighest) {
      value = iteratee(value);

      var low = 0,
          high = array ? array.length : 0,
          valIsNaN = value !== value,
          valIsNull = value === null,
          valIsUndef = value === undefined;

      while (low < high) {
        var mid = nativeFloor((low + high) / 2),
            computed = iteratee(array[mid]),
            isDef = computed !== undefined,
            isReflexive = computed === computed;

        if (valIsNaN) {
          var setLow = isReflexive || retHighest;
        } else if (valIsNull) {
          setLow = isReflexive && isDef && (retHighest || computed != null);
        } else if (valIsUndef) {
          setLow = isReflexive && (retHighest || isDef);
        } else if (computed == null) {
          setLow = false;
        } else {
          setLow = retHighest ? (computed <= value) : (computed < value);
        }
        if (setLow) {
          low = mid + 1;
        } else {
          high = mid;
        }
      }
      return nativeMin(high, MAX_ARRAY_INDEX);
    }

    /**
     * A specialized version of `baseCallback` which only supports `this` binding
     * and specifying the number of arguments to provide to `func`.
     *
     * @private
     * @param {Function} func The function to bind.
     * @param {*} thisArg The `this` binding of `func`.
     * @param {number} [argCount] The number of arguments to provide to `func`.
     * @returns {Function} Returns the callback.
     */
    function bindCallback(func, thisArg, argCount) {
      if (typeof func != 'function') {
        return identity;
      }
      if (thisArg === undefined) {
        return func;
      }
      switch (argCount) {
        case 1: return function(value) {
          return func.call(thisArg, value);
        };
        case 3: return function(value, index, collection) {
          return func.call(thisArg, value, index, collection);
        };
        case 4: return function(accumulator, value, index, collection) {
          return func.call(thisArg, accumulator, value, index, collection);
        };
        case 5: return function(value, other, key, object, source) {
          return func.call(thisArg, value, other, key, object, source);
        };
      }
      return function() {
        return func.apply(thisArg, arguments);
      };
    }

    /**
     * Creates a clone of the given array buffer.
     *
     * @private
     * @param {ArrayBuffer} buffer The array buffer to clone.
     * @returns {ArrayBuffer} Returns the cloned array buffer.
     */
    function bufferClone(buffer) {
      var result = new ArrayBuffer(buffer.byteLength),
          view = new Uint8Array(result);

      view.set(new Uint8Array(buffer));
      return result;
    }

    /**
     * Creates an array that is the composition of partially applied arguments,
     * placeholders, and provided arguments into a single array of arguments.
     *
     * @private
     * @param {Array|Object} args The provided arguments.
     * @param {Array} partials The arguments to prepend to those provided.
     * @param {Array} holders The `partials` placeholder indexes.
     * @returns {Array} Returns the new array of composed arguments.
     */
    function composeArgs(args, partials, holders) {
      var holdersLength = holders.length,
          argsIndex = -1,
          argsLength = nativeMax(args.length - holdersLength, 0),
          leftIndex = -1,
          leftLength = partials.length,
          result = Array(leftLength + argsLength);

      while (++leftIndex < leftLength) {
        result[leftIndex] = partials[leftIndex];
      }
      while (++argsIndex < holdersLength) {
        result[holders[argsIndex]] = args[argsIndex];
      }
      while (argsLength--) {
        result[leftIndex++] = args[argsIndex++];
      }
      return result;
    }

    /**
     * This function is like `composeArgs` except that the arguments composition
     * is tailored for `_.partialRight`.
     *
     * @private
     * @param {Array|Object} args The provided arguments.
     * @param {Array} partials The arguments to append to those provided.
     * @param {Array} holders The `partials` placeholder indexes.
     * @returns {Array} Returns the new array of composed arguments.
     */
    function composeArgsRight(args, partials, holders) {
      var holdersIndex = -1,
          holdersLength = holders.length,
          argsIndex = -1,
          argsLength = nativeMax(args.length - holdersLength, 0),
          rightIndex = -1,
          rightLength = partials.length,
          result = Array(argsLength + rightLength);

      while (++argsIndex < argsLength) {
        result[argsIndex] = args[argsIndex];
      }
      var offset = argsIndex;
      while (++rightIndex < rightLength) {
        result[offset + rightIndex] = partials[rightIndex];
      }
      while (++holdersIndex < holdersLength) {
        result[offset + holders[holdersIndex]] = args[argsIndex++];
      }
      return result;
    }

    /**
     * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
     *
     * @private
     * @param {Function} setter The function to set keys and values of the accumulator object.
     * @param {Function} [initializer] The function to initialize the accumulator object.
     * @returns {Function} Returns the new aggregator function.
     */
    function createAggregator(setter, initializer) {
      return function(collection, iteratee, thisArg) {
        var result = initializer ? initializer() : {};
        iteratee = getCallback(iteratee, thisArg, 3);

        if (isArray(collection)) {
          var index = -1,
              length = collection.length;

          while (++index < length) {
            var value = collection[index];
            setter(result, value, iteratee(value, index, collection), collection);
          }
        } else {
          baseEach(collection, function(value, key, collection) {
            setter(result, value, iteratee(value, key, collection), collection);
          });
        }
        return result;
      };
    }

    /**
     * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
     *
     * @private
     * @param {Function} assigner The function to assign values.
     * @returns {Function} Returns the new assigner function.
     */
    function createAssigner(assigner) {
      return restParam(function(object, sources) {
        var index = -1,
            length = object == null ? 0 : sources.length,
            customizer = length > 2 ? sources[length - 2] : undefined,
            guard = length > 2 ? sources[2] : undefined,
            thisArg = length > 1 ? sources[length - 1] : undefined;

        if (typeof customizer == 'function') {
          customizer = bindCallback(customizer, thisArg, 5);
          length -= 2;
        } else {
          customizer = typeof thisArg == 'function' ? thisArg : undefined;
          length -= (customizer ? 1 : 0);
        }
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          customizer = length < 3 ? undefined : customizer;
          length = 1;
        }
        while (++index < length) {
          var source = sources[index];
          if (source) {
            assigner(object, source, customizer);
          }
        }
        return object;
      });
    }

    /**
     * Creates a `baseEach` or `baseEachRight` function.
     *
     * @private
     * @param {Function} eachFunc The function to iterate over a collection.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
     */
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        var length = collection ? getLength(collection) : 0;
        if (!isLength(length)) {
          return eachFunc(collection, iteratee);
        }
        var index = fromRight ? length : -1,
            iterable = toObject(collection);

        while ((fromRight ? index-- : ++index < length)) {
          if (iteratee(iterable[index], index, iterable) === false) {
            break;
          }
        }
        return collection;
      };
    }

    /**
     * Creates a base function for `_.forIn` or `_.forInRight`.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new base function.
     */
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var iterable = toObject(object),
            props = keysFunc(object),
            length = props.length,
            index = fromRight ? length : -1;

        while ((fromRight ? index-- : ++index < length)) {
          var key = props[index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }

    /**
     * Creates a function that wraps `func` and invokes it with the `this`
     * binding of `thisArg`.
     *
     * @private
     * @param {Function} func The function to bind.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @returns {Function} Returns the new bound function.
     */
    function createBindWrapper(func, thisArg) {
      var Ctor = createCtorWrapper(func);

      function wrapper() {
        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
        return fn.apply(thisArg, arguments);
      }
      return wrapper;
    }

    /**
     * Creates a `Set` cache object to optimize linear searches of large arrays.
     *
     * @private
     * @param {Array} [values] The values to cache.
     * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
     */
    function createCache(values) {
      return (nativeCreate && Set) ? new SetCache(values) : null;
    }

    /**
     * Creates a function that produces compound words out of the words in a
     * given string.
     *
     * @private
     * @param {Function} callback The function to combine each word.
     * @returns {Function} Returns the new compounder function.
     */
    function createCompounder(callback) {
      return function(string) {
        var index = -1,
            array = words(deburr(string)),
            length = array.length,
            result = '';

        while (++index < length) {
          result = callback(result, array[index], index);
        }
        return result;
      };
    }

    /**
     * Creates a function that produces an instance of `Ctor` regardless of
     * whether it was invoked as part of a `new` expression or by `call` or `apply`.
     *
     * @private
     * @param {Function} Ctor The constructor to wrap.
     * @returns {Function} Returns the new wrapped function.
     */
    function createCtorWrapper(Ctor) {
      return function() {
        // Use a `switch` statement to work with class constructors.
        // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
        // for more details.
        var args = arguments;
        switch (args.length) {
          case 0: return new Ctor;
          case 1: return new Ctor(args[0]);
          case 2: return new Ctor(args[0], args[1]);
          case 3: return new Ctor(args[0], args[1], args[2]);
          case 4: return new Ctor(args[0], args[1], args[2], args[3]);
          case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
          case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
          case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
        }
        var thisBinding = baseCreate(Ctor.prototype),
            result = Ctor.apply(thisBinding, args);

        // Mimic the constructor's `return` behavior.
        // See https://es5.github.io/#x13.2.2 for more details.
        return isObject(result) ? result : thisBinding;
      };
    }

    /**
     * Creates a `_.curry` or `_.curryRight` function.
     *
     * @private
     * @param {boolean} flag The curry bit flag.
     * @returns {Function} Returns the new curry function.
     */
    function createCurry(flag) {
      function curryFunc(func, arity, guard) {
        if (guard && isIterateeCall(func, arity, guard)) {
          arity = undefined;
        }
        var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
        result.placeholder = curryFunc.placeholder;
        return result;
      }
      return curryFunc;
    }

    /**
     * Creates a `_.defaults` or `_.defaultsDeep` function.
     *
     * @private
     * @param {Function} assigner The function to assign values.
     * @param {Function} customizer The function to customize assigned values.
     * @returns {Function} Returns the new defaults function.
     */
    function createDefaults(assigner, customizer) {
      return restParam(function(args) {
        var object = args[0];
        if (object == null) {
          return object;
        }
        args.push(customizer);
        return assigner.apply(undefined, args);
      });
    }

    /**
     * Creates a `_.max` or `_.min` function.
     *
     * @private
     * @param {Function} comparator The function used to compare values.
     * @param {*} exValue The initial extremum value.
     * @returns {Function} Returns the new extremum function.
     */
    function createExtremum(comparator, exValue) {
      return function(collection, iteratee, thisArg) {
        if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
          iteratee = undefined;
        }
        iteratee = getCallback(iteratee, thisArg, 3);
        if (iteratee.length == 1) {
          collection = isArray(collection) ? collection : toIterable(collection);
          var result = arrayExtremum(collection, iteratee, comparator, exValue);
          if (!(collection.length && result === exValue)) {
            return result;
          }
        }
        return baseExtremum(collection, iteratee, comparator, exValue);
      };
    }

    /**
     * Creates a `_.find` or `_.findLast` function.
     *
     * @private
     * @param {Function} eachFunc The function to iterate over a collection.
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new find function.
     */
    function createFind(eachFunc, fromRight) {
      return function(collection, predicate, thisArg) {
        predicate = getCallback(predicate, thisArg, 3);
        if (isArray(collection)) {
          var index = baseFindIndex(collection, predicate, fromRight);
          return index > -1 ? collection[index] : undefined;
        }
        return baseFind(collection, predicate, eachFunc);
      };
    }

    /**
     * Creates a `_.findIndex` or `_.findLastIndex` function.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new find function.
     */
    function createFindIndex(fromRight) {
      return function(array, predicate, thisArg) {
        if (!(array && array.length)) {
          return -1;
        }
        predicate = getCallback(predicate, thisArg, 3);
        return baseFindIndex(array, predicate, fromRight);
      };
    }

    /**
     * Creates a `_.findKey` or `_.findLastKey` function.
     *
     * @private
     * @param {Function} objectFunc The function to iterate over an object.
     * @returns {Function} Returns the new find function.
     */
    function createFindKey(objectFunc) {
      return function(object, predicate, thisArg) {
        predicate = getCallback(predicate, thisArg, 3);
        return baseFind(object, predicate, objectFunc, true);
      };
    }

    /**
     * Creates a `_.flow` or `_.flowRight` function.
     *
     * @private
     * @param {boolean} [fromRight] Specify iterating from right to left.
     * @returns {Function} Returns the new flow function.
     */
    function createFlow(fromRight) {
      return function() {
        var wrapper,
            length = arguments.length,
            index = fromRight ? length : -1,
            leftIndex = 0,
            funcs = Array(length);

        while ((fromRight ? index-- : ++index < length)) {
          var func = funcs[leftIndex++] = arguments[index];
          if (typeof func != 'function') {
            throw new TypeError(FUNC_ERROR_TEXT);
          }
          if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
            wrapper = new LodashWrapper([], true);
          }
        }
        index = wrapper ? -1 : length;
        while (++index < length) {
          func = funcs[index];

          var funcName = getFuncName(func),
              data = funcName == 'wrapper' ? getData(func) : undefined;

          if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
            wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
          } else {
            wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);
          }
        }
        return function() {
          var args = arguments,
              value = args[0];

          if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
            return wrapper.plant(value).value();
          }
          var index = 0,
              result = length ? funcs[index].apply(this, args) : value;

          while (++index < length) {
            result = funcs[index].call(this, result);
          }
          return result;
        };
      };
    }

    /**
     * Creates a function for `_.forEach` or `_.forEachRight`.
     *
     * @private
     * @param {Function} arrayFunc The function to iterate over an array.
     * @param {Function} eachFunc The function to iterate over a collection.
     * @returns {Function} Returns the new each function.
     */
    function createForEach(arrayFunc, eachFunc) {
      return function(collection, iteratee, thisArg) {
        return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
          ? arrayFunc(collection, iteratee)
          : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
      };
    }

    /**
     * Creates a function for `_.forIn` or `_.forInRight`.
     *
     * @private
     * @param {Function} objectFunc The function to iterate over an object.
     * @returns {Function} Returns the new each function.
     */
    function createForIn(objectFunc) {
      return function(object, iteratee, thisArg) {
        if (typeof iteratee != 'function' || thisArg !== undefined) {
          iteratee = bindCallback(iteratee, thisArg, 3);
        }
        return objectFunc(object, iteratee, keysIn);
      };
    }

    /**
     * Creates a function for `_.forOwn` or `_.forOwnRight`.
     *
     * @private
     * @param {Function} objectFunc The function to iterate over an object.
     * @returns {Function} Returns the new each function.
     */
    function createForOwn(objectFunc) {
      return function(object, iteratee, thisArg) {
        if (typeof iteratee != 'function' || thisArg !== undefined) {
          iteratee = bindCallback(iteratee, thisArg, 3);
        }
        return objectFunc(object, iteratee);
      };
    }

    /**
     * Creates a function for `_.mapKeys` or `_.mapValues`.
     *
     * @private
     * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
     * @returns {Function} Returns the new map function.
     */
    function createObjectMapper(isMapKeys) {
      return function(object, iteratee, thisArg) {
        var result = {};
        iteratee = getCallback(iteratee, thisArg, 3);

        baseForOwn(object, function(value, key, object) {
          var mapped = iteratee(value, key, object);
          key = isMapKeys ? mapped : key;
          value = isMapKeys ? value : mapped;
          result[key] = value;
        });
        return result;
      };
    }

    /**
     * Creates a function for `_.padLeft` or `_.padRight`.
     *
     * @private
     * @param {boolean} [fromRight] Specify padding from the right.
     * @returns {Function} Returns the new pad function.
     */
    function createPadDir(fromRight) {
      return function(string, length, chars) {
        string = baseToString(string);
        return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
      };
    }

    /**
     * Creates a `_.partial` or `_.partialRight` function.
     *
     * @private
     * @param {boolean} flag The partial bit flag.
     * @returns {Function} Returns the new partial function.
     */
    function createPartial(flag) {
      var partialFunc = restParam(function(func, partials) {
        var holders = replaceHolders(partials, partialFunc.placeholder);
        return createWrapper(func, flag, undefined, partials, holders);
      });
      return partialFunc;
    }

    /**
     * Creates a function for `_.reduce` or `_.reduceRight`.
     *
     * @private
     * @param {Function} arrayFunc The function to iterate over an array.
     * @param {Function} eachFunc The function to iterate over a collection.
     * @returns {Function} Returns the new each function.
     */
    function createReduce(arrayFunc, eachFunc) {
      return function(collection, iteratee, accumulator, thisArg) {
        var initFromArray = arguments.length < 3;
        return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))
          ? arrayFunc(collection, iteratee, accumulator, initFromArray)
          : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
      };
    }

    /**
     * Creates a function that wraps `func` and invokes it with optional `this`
     * binding of, partial application, and currying.
     *
     * @private
     * @param {Function|string} func The function or method name to reference.
     * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param {Array} [partials] The arguments to prepend to those provided to the new function.
     * @param {Array} [holders] The `partials` placeholder indexes.
     * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
     * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
     * @param {Array} [argPos] The argument positions of the new function.
     * @param {number} [ary] The arity cap of `func`.
     * @param {number} [arity] The arity of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
      var isAry = bitmask & ARY_FLAG,
          isBind = bitmask & BIND_FLAG,
          isBindKey = bitmask & BIND_KEY_FLAG,
          isCurry = bitmask & CURRY_FLAG,
          isCurryBound = bitmask & CURRY_BOUND_FLAG,
          isCurryRight = bitmask & CURRY_RIGHT_FLAG,
          Ctor = isBindKey ? undefined : createCtorWrapper(func);

      function wrapper() {
        // Avoid `arguments` object use disqualifying optimizations by
        // converting it to an array before providing it to other functions.
        var length = arguments.length,
            index = length,
            args = Array(length);

        while (index--) {
          args[index] = arguments[index];
        }
        if (partials) {
          args = composeArgs(args, partials, holders);
        }
        if (partialsRight) {
          args = composeArgsRight(args, partialsRight, holdersRight);
        }
        if (isCurry || isCurryRight) {
          var placeholder = wrapper.placeholder,
              argsHolders = replaceHolders(args, placeholder);

          length -= argsHolders.length;
          if (length < arity) {
            var newArgPos = argPos ? arrayCopy(argPos) : undefined,
                newArity = nativeMax(arity - length, 0),
                newsHolders = isCurry ? argsHolders : undefined,
                newHoldersRight = isCurry ? undefined : argsHolders,
                newPartials = isCurry ? args : undefined,
                newPartialsRight = isCurry ? undefined : args;

            bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);
            bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);

            if (!isCurryBound) {
              bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
            }
            var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],
                result = createHybridWrapper.apply(undefined, newData);

            if (isLaziable(func)) {
              setData(result, newData);
            }
            result.placeholder = placeholder;
            return result;
          }
        }
        var thisBinding = isBind ? thisArg : this,
            fn = isBindKey ? thisBinding[func] : func;

        if (argPos) {
          args = reorder(args, argPos);
        }
        if (isAry && ary < args.length) {
          args.length = ary;
        }
        if (this && this !== root && this instanceof wrapper) {
          fn = Ctor || createCtorWrapper(func);
        }
        return fn.apply(thisBinding, args);
      }
      return wrapper;
    }

    /**
     * Creates the padding required for `string` based on the given `length`.
     * The `chars` string is truncated if the number of characters exceeds `length`.
     *
     * @private
     * @param {string} string The string to create padding for.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the pad for `string`.
     */
    function createPadding(string, length, chars) {
      var strLength = string.length;
      length = +length;

      if (strLength >= length || !nativeIsFinite(length)) {
        return '';
      }
      var padLength = length - strLength;
      chars = chars == null ? ' ' : (chars + '');
      return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
    }

    /**
     * Creates a function that wraps `func` and invokes it with the optional `this`
     * binding of `thisArg` and the `partials` prepended to those provided to
     * the wrapper.
     *
     * @private
     * @param {Function} func The function to partially apply arguments to.
     * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
     * @param {*} thisArg The `this` binding of `func`.
     * @param {Array} partials The arguments to prepend to those provided to the new function.
     * @returns {Function} Returns the new bound function.
     */
    function createPartialWrapper(func, bitmask, thisArg, partials) {
      var isBind = bitmask & BIND_FLAG,
          Ctor = createCtorWrapper(func);

      function wrapper() {
        // Avoid `arguments` object use disqualifying optimizations by
        // converting it to an array before providing it `func`.
        var argsIndex = -1,
            argsLength = arguments.length,
            leftIndex = -1,
            leftLength = partials.length,
            args = Array(leftLength + argsLength);

        while (++leftIndex < leftLength) {
          args[leftIndex] = partials[leftIndex];
        }
        while (argsLength--) {
          args[leftIndex++] = arguments[++argsIndex];
        }
        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
        return fn.apply(isBind ? thisArg : this, args);
      }
      return wrapper;
    }

    /**
     * Creates a `_.ceil`, `_.floor`, or `_.round` function.
     *
     * @private
     * @param {string} methodName The name of the `Math` method to use when rounding.
     * @returns {Function} Returns the new round function.
     */
    function createRound(methodName) {
      var func = Math[methodName];
      return function(number, precision) {
        precision = precision === undefined ? 0 : (+precision || 0);
        if (precision) {
          precision = pow(10, precision);
          return func(number * precision) / precision;
        }
        return func(number);
      };
    }

    /**
     * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
     *
     * @private
     * @param {boolean} [retHighest] Specify returning the highest qualified index.
     * @returns {Function} Returns the new index function.
     */
    function createSortedIndex(retHighest) {
      return function(array, value, iteratee, thisArg) {
        var callback = getCallback(iteratee);
        return (iteratee == null && callback === baseCallback)
          ? binaryIndex(array, value, retHighest)
          : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
      };
    }

    /**
     * Creates a function that either curries or invokes `func` with optional
     * `this` binding and partially applied arguments.
     *
     * @private
     * @param {Function|string} func The function or method name to reference.
     * @param {number} bitmask The bitmask of flags.
     *  The bitmask may be composed of the following flags:
     *     1 - `_.bind`
     *     2 - `_.bindKey`
     *     4 - `_.curry` or `_.curryRight` of a bound function
     *     8 - `_.curry`
     *    16 - `_.curryRight`
     *    32 - `_.partial`
     *    64 - `_.partialRight`
     *   128 - `_.rearg`
     *   256 - `_.ary`
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param {Array} [partials] The arguments to be partially applied.
     * @param {Array} [holders] The `partials` placeholder indexes.
     * @param {Array} [argPos] The argument positions of the new function.
     * @param {number} [ary] The arity cap of `func`.
     * @param {number} [arity] The arity of `func`.
     * @returns {Function} Returns the new wrapped function.
     */
    function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
      var isBindKey = bitmask & BIND_KEY_FLAG;
      if (!isBindKey && typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var length = partials ? partials.length : 0;
      if (!length) {
        bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
        partials = holders = undefined;
      }
      length -= (holders ? holders.length : 0);
      if (bitmask & PARTIAL_RIGHT_FLAG) {
        var partialsRight = partials,
            holdersRight = holders;

        partials = holders = undefined;
      }
      var data = isBindKey ? undefined : getData(func),
          newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];

      if (data) {
        mergeData(newData, data);
        bitmask = newData[1];
        arity = newData[9];
      }
      newData[9] = arity == null
        ? (isBindKey ? 0 : func.length)
        : (nativeMax(arity - length, 0) || 0);

      if (bitmask == BIND_FLAG) {
        var result = createBindWrapper(newData[0], newData[2]);
      } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
        result = createPartialWrapper.apply(undefined, newData);
      } else {
        result = createHybridWrapper.apply(undefined, newData);
      }
      var setter = data ? baseSetData : setData;
      return setter(result, newData);
    }

    /**
     * A specialized version of `baseIsEqualDeep` for arrays with support for
     * partial deep comparisons.
     *
     * @private
     * @param {Array} array The array to compare.
     * @param {Array} other The other array to compare.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Function} [customizer] The function to customize comparing arrays.
     * @param {boolean} [isLoose] Specify performing partial comparisons.
     * @param {Array} [stackA] Tracks traversed `value` objects.
     * @param {Array} [stackB] Tracks traversed `other` objects.
     * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
     */
    function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
      var index = -1,
          arrLength = array.length,
          othLength = other.length;

      if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
        return false;
      }
      // Ignore non-index properties.
      while (++index < arrLength) {
        var arrValue = array[index],
            othValue = other[index],
            result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;

        if (result !== undefined) {
          if (result) {
            continue;
          }
          return false;
        }
        // Recursively compare arrays (susceptible to call stack limits).
        if (isLoose) {
          if (!arraySome(other, function(othValue) {
                return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
              })) {
            return false;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
          return false;
        }
      }
      return true;
    }

    /**
     * A specialized version of `baseIsEqualDeep` for comparing objects of
     * the same `toStringTag`.
     *
     * **Note:** This function only supports comparing values with tags of
     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {string} tag The `toStringTag` of the objects to compare.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function equalByTag(object, other, tag) {
      switch (tag) {
        case boolTag:
        case dateTag:
          // Coerce dates and booleans to numbers, dates to milliseconds and booleans
          // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
          return +object == +other;

        case errorTag:
          return object.name == other.name && object.message == other.message;

        case numberTag:
          // Treat `NaN` vs. `NaN` as equal.
          return (object != +object)
            ? other != +other
            : object == +other;

        case regexpTag:
        case stringTag:
          // Coerce regexes to strings and treat strings primitives and string
          // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
          return object == (other + '');
      }
      return false;
    }

    /**
     * A specialized version of `baseIsEqualDeep` for objects with support for
     * partial deep comparisons.
     *
     * @private
     * @param {Object} object The object to compare.
     * @param {Object} other The other object to compare.
     * @param {Function} equalFunc The function to determine equivalents of values.
     * @param {Function} [customizer] The function to customize comparing values.
     * @param {boolean} [isLoose] Specify performing partial comparisons.
     * @param {Array} [stackA] Tracks traversed `value` objects.
     * @param {Array} [stackB] Tracks traversed `other` objects.
     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
     */
    function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
      var objProps = keys(object),
          objLength = objProps.length,
          othProps = keys(other),
          othLength = othProps.length;

      if (objLength != othLength && !isLoose) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
          return false;
        }
      }
      var skipCtor = isLoose;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key],
            othValue = other[key],
            result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;

        // Recursively compare objects (susceptible to call stack limits).
        if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
          return false;
        }
        skipCtor || (skipCtor = key == 'constructor');
      }
      if (!skipCtor) {
        var objCtor = object.constructor,
            othCtor = other.constructor;

        // Non `Object` object instances with different constructors are not equal.
        if (objCtor != othCtor &&
            ('constructor' in object && 'constructor' in other) &&
            !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
              typeof othCtor == 'function' && othCtor instanceof othCtor)) {
          return false;
        }
      }
      return true;
    }

    /**
     * Gets the appropriate "callback" function. If the `_.callback` method is
     * customized this function returns the custom method, otherwise it returns
     * the `baseCallback` function. If arguments are provided the chosen function
     * is invoked with them and its result is returned.
     *
     * @private
     * @returns {Function} Returns the chosen function or its result.
     */
    function getCallback(func, thisArg, argCount) {
      var result = lodash.callback || callback;
      result = result === callback ? baseCallback : result;
      return argCount ? result(func, thisArg, argCount) : result;
    }

    /**
     * Gets metadata for `func`.
     *
     * @private
     * @param {Function} func The function to query.
     * @returns {*} Returns the metadata for `func`.
     */
    var getData = !metaMap ? noop : function(func) {
      return metaMap.get(func);
    };

    /**
     * Gets the name of `func`.
     *
     * @private
     * @param {Function} func The function to query.
     * @returns {string} Returns the function name.
     */
    function getFuncName(func) {
      var result = func.name,
          array = realNames[result],
          length = array ? array.length : 0;

      while (length--) {
        var data = array[length],
            otherFunc = data.func;
        if (otherFunc == null || otherFunc == func) {
          return data.name;
        }
      }
      return result;
    }

    /**
     * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
     * customized this function returns the custom method, otherwise it returns
     * the `baseIndexOf` function. If arguments are provided the chosen function
     * is invoked with them and its result is returned.
     *
     * @private
     * @returns {Function|number} Returns the chosen function or its result.
     */
    function getIndexOf(collection, target, fromIndex) {
      var result = lodash.indexOf || indexOf;
      result = result === indexOf ? baseIndexOf : result;
      return collection ? result(collection, target, fromIndex) : result;
    }

    /**
     * Gets the "length" property value of `object`.
     *
     * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
     * that affects Safari on at least iOS 8.1-8.3 ARM64.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {*} Returns the "length" value.
     */
    var getLength = baseProperty('length');

    /**
     * Gets the propery names, values, and compare flags of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the match data of `object`.
     */
    function getMatchData(object) {
      var result = pairs(object),
          length = result.length;

      while (length--) {
        result[length][2] = isStrictComparable(result[length][1]);
      }
      return result;
    }

    /**
     * Gets the native function at `key` of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {string} key The key of the method to get.
     * @returns {*} Returns the function if it's native, else `undefined`.
     */
    function getNative(object, key) {
      var value = object == null ? undefined : object[key];
      return isNative(value) ? value : undefined;
    }

    /**
     * Gets the view, applying any `transforms` to the `start` and `end` positions.
     *
     * @private
     * @param {number} start The start of the view.
     * @param {number} end The end of the view.
     * @param {Array} transforms The transformations to apply to the view.
     * @returns {Object} Returns an object containing the `start` and `end`
     *  positions of the view.
     */
    function getView(start, end, transforms) {
      var index = -1,
          length = transforms.length;

      while (++index < length) {
        var data = transforms[index],
            size = data.size;

        switch (data.type) {
          case 'drop':      start += size; break;
          case 'dropRight': end -= size; break;
          case 'take':      end = nativeMin(end, start + size); break;
          case 'takeRight': start = nativeMax(start, end - size); break;
        }
      }
      return { 'start': start, 'end': end };
    }

    /**
     * Initializes an array clone.
     *
     * @private
     * @param {Array} array The array to clone.
     * @returns {Array} Returns the initialized clone.
     */
    function initCloneArray(array) {
      var length = array.length,
          result = new array.constructor(length);

      // Add array properties assigned by `RegExp#exec`.
      if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
        result.index = array.index;
        result.input = array.input;
      }
      return result;
    }

    /**
     * Initializes an object clone.
     *
     * @private
     * @param {Object} object The object to clone.
     * @returns {Object} Returns the initialized clone.
     */
    function initCloneObject(object) {
      var Ctor = object.constructor;
      if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
        Ctor = Object;
      }
      return new Ctor;
    }

    /**
     * Initializes an object clone based on its `toStringTag`.
     *
     * **Note:** This function only supports cloning values with tags of
     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
     *
     * @private
     * @param {Object} object The object to clone.
     * @param {string} tag The `toStringTag` of the object to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @returns {Object} Returns the initialized clone.
     */
    function initCloneByTag(object, tag, isDeep) {
      var Ctor = object.constructor;
      switch (tag) {
        case arrayBufferTag:
          return bufferClone(object);

        case boolTag:
        case dateTag:
          return new Ctor(+object);

        case float32Tag: case float64Tag:
        case int8Tag: case int16Tag: case int32Tag:
        case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
          var buffer = object.buffer;
          return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);

        case numberTag:
        case stringTag:
          return new Ctor(object);

        case regexpTag:
          var result = new Ctor(object.source, reFlags.exec(object));
          result.lastIndex = object.lastIndex;
      }
      return result;
    }

    /**
     * Invokes the method at `path` on `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the method to invoke.
     * @param {Array} args The arguments to invoke the method with.
     * @returns {*} Returns the result of the invoked method.
     */
    function invokePath(object, path, args) {
      if (object != null && !isKey(path, object)) {
        path = toPath(path);
        object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
        path = last(path);
      }
      var func = object == null ? object : object[path];
      return func == null ? undefined : func.apply(object, args);
    }

    /**
     * Checks if `value` is array-like.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
     */
    function isArrayLike(value) {
      return value != null && isLength(getLength(value));
    }

    /**
     * Checks if `value` is a valid array-like index.
     *
     * @private
     * @param {*} value The value to check.
     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
     */
    function isIndex(value, length) {
      value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
      length = length == null ? MAX_SAFE_INTEGER : length;
      return value > -1 && value % 1 == 0 && value < length;
    }

    /**
     * Checks if the provided arguments are from an iteratee call.
     *
     * @private
     * @param {*} value The potential iteratee value argument.
     * @param {*} index The potential iteratee index or key argument.
     * @param {*} object The potential iteratee object argument.
     * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
     */
    function isIterateeCall(value, index, object) {
      if (!isObject(object)) {
        return false;
      }
      var type = typeof index;
      if (type == 'number'
          ? (isArrayLike(object) && isIndex(index, object.length))
          : (type == 'string' && index in object)) {
        var other = object[index];
        return value === value ? (value === other) : (other !== other);
      }
      return false;
    }

    /**
     * Checks if `value` is a property name and not a property path.
     *
     * @private
     * @param {*} value The value to check.
     * @param {Object} [object] The object to query keys on.
     * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
     */
    function isKey(value, object) {
      var type = typeof value;
      if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {
        return true;
      }
      if (isArray(value)) {
        return false;
      }
      var result = !reIsDeepProp.test(value);
      return result || (object != null && value in toObject(object));
    }

    /**
     * Checks if `func` has a lazy counterpart.
     *
     * @private
     * @param {Function} func The function to check.
     * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
     */
    function isLaziable(func) {
      var funcName = getFuncName(func);
      if (!(funcName in LazyWrapper.prototype)) {
        return false;
      }
      var other = lodash[funcName];
      if (func === other) {
        return true;
      }
      var data = getData(other);
      return !!data && func === data[0];
    }

    /**
     * Checks if `value` is a valid array-like length.
     *
     * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
     */
    function isLength(value) {
      return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
    }

    /**
     * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
     *
     * @private
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` if suitable for strict
     *  equality comparisons, else `false`.
     */
    function isStrictComparable(value) {
      return value === value && !isObject(value);
    }

    /**
     * Merges the function metadata of `source` into `data`.
     *
     * Merging metadata reduces the number of wrappers required to invoke a function.
     * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
     * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
     * augment function arguments, making the order in which they are executed important,
     * preventing the merging of metadata. However, we make an exception for a safe
     * common case where curried functions have `_.ary` and or `_.rearg` applied.
     *
     * @private
     * @param {Array} data The destination metadata.
     * @param {Array} source The source metadata.
     * @returns {Array} Returns `data`.
     */
    function mergeData(data, source) {
      var bitmask = data[1],
          srcBitmask = source[1],
          newBitmask = bitmask | srcBitmask,
          isCommon = newBitmask < ARY_FLAG;

      var isCombo =
        (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||
        (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||
        (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);

      // Exit early if metadata can't be merged.
      if (!(isCommon || isCombo)) {
        return data;
      }
      // Use source `thisArg` if available.
      if (srcBitmask & BIND_FLAG) {
        data[2] = source[2];
        // Set when currying a bound function.
        newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;
      }
      // Compose partial arguments.
      var value = source[3];
      if (value) {
        var partials = data[3];
        data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
        data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
      }
      // Compose partial right arguments.
      value = source[5];
      if (value) {
        partials = data[5];
        data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
        data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
      }
      // Use source `argPos` if available.
      value = source[7];
      if (value) {
        data[7] = arrayCopy(value);
      }
      // Use source `ary` if it's smaller.
      if (srcBitmask & ARY_FLAG) {
        data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
      }
      // Use source `arity` if one is not provided.
      if (data[9] == null) {
        data[9] = source[9];
      }
      // Use source `func` and merge bitmasks.
      data[0] = source[0];
      data[1] = newBitmask;

      return data;
    }

    /**
     * Used by `_.defaultsDeep` to customize its `_.merge` use.
     *
     * @private
     * @param {*} objectValue The destination object property value.
     * @param {*} sourceValue The source object property value.
     * @returns {*} Returns the value to assign to the destination object.
     */
    function mergeDefaults(objectValue, sourceValue) {
      return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
    }

    /**
     * A specialized version of `_.pick` which picks `object` properties specified
     * by `props`.
     *
     * @private
     * @param {Object} object The source object.
     * @param {string[]} props The property names to pick.
     * @returns {Object} Returns the new object.
     */
    function pickByArray(object, props) {
      object = toObject(object);

      var index = -1,
          length = props.length,
          result = {};

      while (++index < length) {
        var key = props[index];
        if (key in object) {
          result[key] = object[key];
        }
      }
      return result;
    }

    /**
     * A specialized version of `_.pick` which picks `object` properties `predicate`
     * returns truthy for.
     *
     * @private
     * @param {Object} object The source object.
     * @param {Function} predicate The function invoked per iteration.
     * @returns {Object} Returns the new object.
     */
    function pickByCallback(object, predicate) {
      var result = {};
      baseForIn(object, function(value, key, object) {
        if (predicate(value, key, object)) {
          result[key] = value;
        }
      });
      return result;
    }

    /**
     * Reorder `array` according to the specified indexes where the element at
     * the first index is assigned as the first element, the element at
     * the second index is assigned as the second element, and so on.
     *
     * @private
     * @param {Array} array The array to reorder.
     * @param {Array} indexes The arranged array indexes.
     * @returns {Array} Returns `array`.
     */
    function reorder(array, indexes) {
      var arrLength = array.length,
          length = nativeMin(indexes.length, arrLength),
          oldArray = arrayCopy(array);

      while (length--) {
        var index = indexes[length];
        array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
      }
      return array;
    }

    /**
     * Sets metadata for `func`.
     *
     * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
     * period of time, it will trip its breaker and transition to an identity function
     * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
     * for more details.
     *
     * @private
     * @param {Function} func The function to associate metadata with.
     * @param {*} data The metadata.
     * @returns {Function} Returns `func`.
     */
    var setData = (function() {
      var count = 0,
          lastCalled = 0;

      return function(key, value) {
        var stamp = now(),
            remaining = HOT_SPAN - (stamp - lastCalled);

        lastCalled = stamp;
        if (remaining > 0) {
          if (++count >= HOT_COUNT) {
            return key;
          }
        } else {
          count = 0;
        }
        return baseSetData(key, value);
      };
    }());

    /**
     * A fallback implementation of `Object.keys` which creates an array of the
     * own enumerable property names of `object`.
     *
     * @private
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     */
    function shimKeys(object) {
      var props = keysIn(object),
          propsLength = props.length,
          length = propsLength && object.length;

      var allowIndexes = !!length && isLength(length) &&
        (isArray(object) || isArguments(object));

      var index = -1,
          result = [];

      while (++index < propsLength) {
        var key = props[index];
        if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * Converts `value` to an array-like object if it's not one.
     *
     * @private
     * @param {*} value The value to process.
     * @returns {Array|Object} Returns the array-like object.
     */
    function toIterable(value) {
      if (value == null) {
        return [];
      }
      if (!isArrayLike(value)) {
        return values(value);
      }
      return isObject(value) ? value : Object(value);
    }

    /**
     * Converts `value` to an object if it's not one.
     *
     * @private
     * @param {*} value The value to process.
     * @returns {Object} Returns the object.
     */
    function toObject(value) {
      return isObject(value) ? value : Object(value);
    }

    /**
     * Converts `value` to property path array if it's not one.
     *
     * @private
     * @param {*} value The value to process.
     * @returns {Array} Returns the property path array.
     */
    function toPath(value) {
      if (isArray(value)) {
        return value;
      }
      var result = [];
      baseToString(value).replace(rePropName, function(match, number, quote, string) {
        result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
      });
      return result;
    }

    /**
     * Creates a clone of `wrapper`.
     *
     * @private
     * @param {Object} wrapper The wrapper to clone.
     * @returns {Object} Returns the cloned wrapper.
     */
    function wrapperClone(wrapper) {
      return wrapper instanceof LazyWrapper
        ? wrapper.clone()
        : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates an array of elements split into groups the length of `size`.
     * If `collection` can't be split evenly, the final chunk will be the remaining
     * elements.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to process.
     * @param {number} [size=1] The length of each chunk.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the new array containing chunks.
     * @example
     *
     * _.chunk(['a', 'b', 'c', 'd'], 2);
     * // => [['a', 'b'], ['c', 'd']]
     *
     * _.chunk(['a', 'b', 'c', 'd'], 3);
     * // => [['a', 'b', 'c'], ['d']]
     */
    function chunk(array, size, guard) {
      if (guard ? isIterateeCall(array, size, guard) : size == null) {
        size = 1;
      } else {
        size = nativeMax(nativeFloor(size) || 1, 1);
      }
      var index = 0,
          length = array ? array.length : 0,
          resIndex = -1,
          result = Array(nativeCeil(length / size));

      while (index < length) {
        result[++resIndex] = baseSlice(array, index, (index += size));
      }
      return result;
    }

    /**
     * Creates an array with all falsey values removed. The values `false`, `null`,
     * `0`, `""`, `undefined`, and `NaN` are falsey.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to compact.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * _.compact([0, 1, false, 2, '', 3]);
     * // => [1, 2, 3]
     */
    function compact(array) {
      var index = -1,
          length = array ? array.length : 0,
          resIndex = -1,
          result = [];

      while (++index < length) {
        var value = array[index];
        if (value) {
          result[++resIndex] = value;
        }
      }
      return result;
    }

    /**
     * Creates an array of unique `array` values not included in the other
     * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {...Array} [values] The arrays of values to exclude.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * _.difference([1, 2, 3], [4, 2]);
     * // => [1, 3]
     */
    var difference = restParam(function(array, values) {
      return (isObjectLike(array) && isArrayLike(array))
        ? baseDifference(array, baseFlatten(values, false, true))
        : [];
    });

    /**
     * Creates a slice of `array` with `n` elements dropped from the beginning.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to drop.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.drop([1, 2, 3]);
     * // => [2, 3]
     *
     * _.drop([1, 2, 3], 2);
     * // => [3]
     *
     * _.drop([1, 2, 3], 5);
     * // => []
     *
     * _.drop([1, 2, 3], 0);
     * // => [1, 2, 3]
     */
    function drop(array, n, guard) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (guard ? isIterateeCall(array, n, guard) : n == null) {
        n = 1;
      }
      return baseSlice(array, n < 0 ? 0 : n);
    }

    /**
     * Creates a slice of `array` with `n` elements dropped from the end.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to drop.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.dropRight([1, 2, 3]);
     * // => [1, 2]
     *
     * _.dropRight([1, 2, 3], 2);
     * // => [1]
     *
     * _.dropRight([1, 2, 3], 5);
     * // => []
     *
     * _.dropRight([1, 2, 3], 0);
     * // => [1, 2, 3]
     */
    function dropRight(array, n, guard) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (guard ? isIterateeCall(array, n, guard) : n == null) {
        n = 1;
      }
      n = length - (+n || 0);
      return baseSlice(array, 0, n < 0 ? 0 : n);
    }

    /**
     * Creates a slice of `array` excluding elements dropped from the end.
     * Elements are dropped until `predicate` returns falsey. The predicate is
     * bound to `thisArg` and invoked with three arguments: (value, index, array).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that match the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.dropRightWhile([1, 2, 3], function(n) {
     *   return n > 1;
     * });
     * // => [1]
     *
     * var users = [
     *   { 'user': 'barney',  'active': true },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': false }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
     * // => ['barney', 'fred']
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.pluck(_.dropRightWhile(users, 'active', false), 'user');
     * // => ['barney']
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.dropRightWhile(users, 'active'), 'user');
     * // => ['barney', 'fred', 'pebbles']
     */
    function dropRightWhile(array, predicate, thisArg) {
      return (array && array.length)
        ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)
        : [];
    }

    /**
     * Creates a slice of `array` excluding elements dropped from the beginning.
     * Elements are dropped until `predicate` returns falsey. The predicate is
     * bound to `thisArg` and invoked with three arguments: (value, index, array).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.dropWhile([1, 2, 3], function(n) {
     *   return n < 3;
     * });
     * // => [3]
     *
     * var users = [
     *   { 'user': 'barney',  'active': false },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': true }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
     * // => ['fred', 'pebbles']
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.pluck(_.dropWhile(users, 'active', false), 'user');
     * // => ['pebbles']
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.dropWhile(users, 'active'), 'user');
     * // => ['barney', 'fred', 'pebbles']
     */
    function dropWhile(array, predicate, thisArg) {
      return (array && array.length)
        ? baseWhile(array, getCallback(predicate, thisArg, 3), true)
        : [];
    }

    /**
     * Fills elements of `array` with `value` from `start` up to, but not
     * including, `end`.
     *
     * **Note:** This method mutates `array`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to fill.
     * @param {*} value The value to fill `array` with.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = [1, 2, 3];
     *
     * _.fill(array, 'a');
     * console.log(array);
     * // => ['a', 'a', 'a']
     *
     * _.fill(Array(3), 2);
     * // => [2, 2, 2]
     *
     * _.fill([4, 6, 8], '*', 1, 2);
     * // => [4, '*', 8]
     */
    function fill(array, value, start, end) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
        start = 0;
        end = length;
      }
      return baseFill(array, value, start, end);
    }

    /**
     * This method is like `_.find` except that it returns the index of the first
     * element `predicate` returns truthy for instead of the element itself.
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to search.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {number} Returns the index of the found element, else `-1`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': false },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': true }
     * ];
     *
     * _.findIndex(users, function(chr) {
     *   return chr.user == 'barney';
     * });
     * // => 0
     *
     * // using the `_.matches` callback shorthand
     * _.findIndex(users, { 'user': 'fred', 'active': false });
     * // => 1
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.findIndex(users, 'active', false);
     * // => 0
     *
     * // using the `_.property` callback shorthand
     * _.findIndex(users, 'active');
     * // => 2
     */
    var findIndex = createFindIndex();

    /**
     * This method is like `_.findIndex` except that it iterates over elements
     * of `collection` from right to left.
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to search.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {number} Returns the index of the found element, else `-1`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'active': true },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': false }
     * ];
     *
     * _.findLastIndex(users, function(chr) {
     *   return chr.user == 'pebbles';
     * });
     * // => 2
     *
     * // using the `_.matches` callback shorthand
     * _.findLastIndex(users, { 'user': 'barney', 'active': true });
     * // => 0
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.findLastIndex(users, 'active', false);
     * // => 2
     *
     * // using the `_.property` callback shorthand
     * _.findLastIndex(users, 'active');
     * // => 0
     */
    var findLastIndex = createFindIndex(true);

    /**
     * Gets the first element of `array`.
     *
     * @static
     * @memberOf _
     * @alias head
     * @category Array
     * @param {Array} array The array to query.
     * @returns {*} Returns the first element of `array`.
     * @example
     *
     * _.first([1, 2, 3]);
     * // => 1
     *
     * _.first([]);
     * // => undefined
     */
    function first(array) {
      return array ? array[0] : undefined;
    }

    /**
     * Flattens a nested array. If `isDeep` is `true` the array is recursively
     * flattened, otherwise it is only flattened a single level.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to flatten.
     * @param {boolean} [isDeep] Specify a deep flatten.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * _.flatten([1, [2, 3, [4]]]);
     * // => [1, 2, 3, [4]]
     *
     * // using `isDeep`
     * _.flatten([1, [2, 3, [4]]], true);
     * // => [1, 2, 3, 4]
     */
    function flatten(array, isDeep, guard) {
      var length = array ? array.length : 0;
      if (guard && isIterateeCall(array, isDeep, guard)) {
        isDeep = false;
      }
      return length ? baseFlatten(array, isDeep) : [];
    }

    /**
     * Recursively flattens a nested array.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to recursively flatten.
     * @returns {Array} Returns the new flattened array.
     * @example
     *
     * _.flattenDeep([1, [2, 3, [4]]]);
     * // => [1, 2, 3, 4]
     */
    function flattenDeep(array) {
      var length = array ? array.length : 0;
      return length ? baseFlatten(array, true) : [];
    }

    /**
     * Gets the index at which the first occurrence of `value` is found in `array`
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons. If `fromIndex` is negative, it is used as the offset
     * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
     * performs a faster binary search.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to search.
     * @param {*} value The value to search for.
     * @param {boolean|number} [fromIndex=0] The index to search from or `true`
     *  to perform a binary search on a sorted array.
     * @returns {number} Returns the index of the matched value, else `-1`.
     * @example
     *
     * _.indexOf([1, 2, 1, 2], 2);
     * // => 1
     *
     * // using `fromIndex`
     * _.indexOf([1, 2, 1, 2], 2, 2);
     * // => 3
     *
     * // performing a binary search
     * _.indexOf([1, 1, 2, 2], 2, true);
     * // => 2
     */
    function indexOf(array, value, fromIndex) {
      var length = array ? array.length : 0;
      if (!length) {
        return -1;
      }
      if (typeof fromIndex == 'number') {
        fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
      } else if (fromIndex) {
        var index = binaryIndex(array, value);
        if (index < length &&
            (value === value ? (value === array[index]) : (array[index] !== array[index]))) {
          return index;
        }
        return -1;
      }
      return baseIndexOf(array, value, fromIndex || 0);
    }

    /**
     * Gets all but the last element of `array`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.initial([1, 2, 3]);
     * // => [1, 2]
     */
    function initial(array) {
      return dropRight(array, 1);
    }

    /**
     * Creates an array of unique values that are included in all of the provided
     * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @returns {Array} Returns the new array of shared values.
     * @example
     * _.intersection([1, 2], [4, 2], [2, 1]);
     * // => [2]
     */
    var intersection = restParam(function(arrays) {
      var othLength = arrays.length,
          othIndex = othLength,
          caches = Array(length),
          indexOf = getIndexOf(),
          isCommon = indexOf == baseIndexOf,
          result = [];

      while (othIndex--) {
        var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
        caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;
      }
      var array = arrays[0],
          index = -1,
          length = array ? array.length : 0,
          seen = caches[0];

      outer:
      while (++index < length) {
        value = array[index];
        if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
          var othIndex = othLength;
          while (--othIndex) {
            var cache = caches[othIndex];
            if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
              continue outer;
            }
          }
          if (seen) {
            seen.push(value);
          }
          result.push(value);
        }
      }
      return result;
    });

    /**
     * Gets the last element of `array`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @returns {*} Returns the last element of `array`.
     * @example
     *
     * _.last([1, 2, 3]);
     * // => 3
     */
    function last(array) {
      var length = array ? array.length : 0;
      return length ? array[length - 1] : undefined;
    }

    /**
     * This method is like `_.indexOf` except that it iterates over elements of
     * `array` from right to left.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to search.
     * @param {*} value The value to search for.
     * @param {boolean|number} [fromIndex=array.length-1] The index to search from
     *  or `true` to perform a binary search on a sorted array.
     * @returns {number} Returns the index of the matched value, else `-1`.
     * @example
     *
     * _.lastIndexOf([1, 2, 1, 2], 2);
     * // => 3
     *
     * // using `fromIndex`
     * _.lastIndexOf([1, 2, 1, 2], 2, 2);
     * // => 1
     *
     * // performing a binary search
     * _.lastIndexOf([1, 1, 2, 2], 2, true);
     * // => 3
     */
    function lastIndexOf(array, value, fromIndex) {
      var length = array ? array.length : 0;
      if (!length) {
        return -1;
      }
      var index = length;
      if (typeof fromIndex == 'number') {
        index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
      } else if (fromIndex) {
        index = binaryIndex(array, value, true) - 1;
        var other = array[index];
        if (value === value ? (value === other) : (other !== other)) {
          return index;
        }
        return -1;
      }
      if (value !== value) {
        return indexOfNaN(array, index, true);
      }
      while (index--) {
        if (array[index] === value) {
          return index;
        }
      }
      return -1;
    }

    /**
     * Removes all provided values from `array` using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * **Note:** Unlike `_.without`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to modify.
     * @param {...*} [values] The values to remove.
     * @returns {Array} Returns `array`.
     * @example
     *
     * var array = [1, 2, 3, 1, 2, 3];
     *
     * _.pull(array, 2, 3);
     * console.log(array);
     * // => [1, 1]
     */
    function pull() {
      var args = arguments,
          array = args[0];

      if (!(array && array.length)) {
        return array;
      }
      var index = 0,
          indexOf = getIndexOf(),
          length = args.length;

      while (++index < length) {
        var fromIndex = 0,
            value = args[index];

        while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
          splice.call(array, fromIndex, 1);
        }
      }
      return array;
    }

    /**
     * Removes elements from `array` corresponding to the given indexes and returns
     * an array of the removed elements. Indexes may be specified as an array of
     * indexes or as individual arguments.
     *
     * **Note:** Unlike `_.at`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to modify.
     * @param {...(number|number[])} [indexes] The indexes of elements to remove,
     *  specified as individual indexes or arrays of indexes.
     * @returns {Array} Returns the new array of removed elements.
     * @example
     *
     * var array = [5, 10, 15, 20];
     * var evens = _.pullAt(array, 1, 3);
     *
     * console.log(array);
     * // => [5, 15]
     *
     * console.log(evens);
     * // => [10, 20]
     */
    var pullAt = restParam(function(array, indexes) {
      indexes = baseFlatten(indexes);

      var result = baseAt(array, indexes);
      basePullAt(array, indexes.sort(baseCompareAscending));
      return result;
    });

    /**
     * Removes all elements from `array` that `predicate` returns truthy for
     * and returns an array of the removed elements. The predicate is bound to
     * `thisArg` and invoked with three arguments: (value, index, array).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * **Note:** Unlike `_.filter`, this method mutates `array`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to modify.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the new array of removed elements.
     * @example
     *
     * var array = [1, 2, 3, 4];
     * var evens = _.remove(array, function(n) {
     *   return n % 2 == 0;
     * });
     *
     * console.log(array);
     * // => [1, 3]
     *
     * console.log(evens);
     * // => [2, 4]
     */
    function remove(array, predicate, thisArg) {
      var result = [];
      if (!(array && array.length)) {
        return result;
      }
      var index = -1,
          indexes = [],
          length = array.length;

      predicate = getCallback(predicate, thisArg, 3);
      while (++index < length) {
        var value = array[index];
        if (predicate(value, index, array)) {
          result.push(value);
          indexes.push(index);
        }
      }
      basePullAt(array, indexes);
      return result;
    }

    /**
     * Gets all but the first element of `array`.
     *
     * @static
     * @memberOf _
     * @alias tail
     * @category Array
     * @param {Array} array The array to query.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.rest([1, 2, 3]);
     * // => [2, 3]
     */
    function rest(array) {
      return drop(array, 1);
    }

    /**
     * Creates a slice of `array` from `start` up to, but not including, `end`.
     *
     * **Note:** This method is used instead of `Array#slice` to support node
     * lists in IE < 9 and to ensure dense arrays are returned.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to slice.
     * @param {number} [start=0] The start position.
     * @param {number} [end=array.length] The end position.
     * @returns {Array} Returns the slice of `array`.
     */
    function slice(array, start, end) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
        start = 0;
        end = length;
      }
      return baseSlice(array, start, end);
    }

    /**
     * Uses a binary search to determine the lowest index at which `value` should
     * be inserted into `array` in order to maintain its sort order. If an iteratee
     * function is provided it is invoked for `value` and each element of `array`
     * to compute their sort ranking. The iteratee is bound to `thisArg` and
     * invoked with one argument; (value).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     * @example
     *
     * _.sortedIndex([30, 50], 40);
     * // => 1
     *
     * _.sortedIndex([4, 4, 5, 5], 5);
     * // => 2
     *
     * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
     *
     * // using an iteratee function
     * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
     *   return this.data[word];
     * }, dict);
     * // => 1
     *
     * // using the `_.property` callback shorthand
     * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
     * // => 1
     */
    var sortedIndex = createSortedIndex();

    /**
     * This method is like `_.sortedIndex` except that it returns the highest
     * index at which `value` should be inserted into `array` in order to
     * maintain its sort order.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The sorted array to inspect.
     * @param {*} value The value to evaluate.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {number} Returns the index at which `value` should be inserted
     *  into `array`.
     * @example
     *
     * _.sortedLastIndex([4, 4, 5, 5], 5);
     * // => 4
     */
    var sortedLastIndex = createSortedIndex(true);

    /**
     * Creates a slice of `array` with `n` elements taken from the beginning.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to take.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.take([1, 2, 3]);
     * // => [1]
     *
     * _.take([1, 2, 3], 2);
     * // => [1, 2]
     *
     * _.take([1, 2, 3], 5);
     * // => [1, 2, 3]
     *
     * _.take([1, 2, 3], 0);
     * // => []
     */
    function take(array, n, guard) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (guard ? isIterateeCall(array, n, guard) : n == null) {
        n = 1;
      }
      return baseSlice(array, 0, n < 0 ? 0 : n);
    }

    /**
     * Creates a slice of `array` with `n` elements taken from the end.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {number} [n=1] The number of elements to take.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.takeRight([1, 2, 3]);
     * // => [3]
     *
     * _.takeRight([1, 2, 3], 2);
     * // => [2, 3]
     *
     * _.takeRight([1, 2, 3], 5);
     * // => [1, 2, 3]
     *
     * _.takeRight([1, 2, 3], 0);
     * // => []
     */
    function takeRight(array, n, guard) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (guard ? isIterateeCall(array, n, guard) : n == null) {
        n = 1;
      }
      n = length - (+n || 0);
      return baseSlice(array, n < 0 ? 0 : n);
    }

    /**
     * Creates a slice of `array` with elements taken from the end. Elements are
     * taken until `predicate` returns falsey. The predicate is bound to `thisArg`
     * and invoked with three arguments: (value, index, array).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.takeRightWhile([1, 2, 3], function(n) {
     *   return n > 1;
     * });
     * // => [2, 3]
     *
     * var users = [
     *   { 'user': 'barney',  'active': true },
     *   { 'user': 'fred',    'active': false },
     *   { 'user': 'pebbles', 'active': false }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
     * // => ['pebbles']
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
     * // => ['fred', 'pebbles']
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.takeRightWhile(users, 'active'), 'user');
     * // => []
     */
    function takeRightWhile(array, predicate, thisArg) {
      return (array && array.length)
        ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)
        : [];
    }

    /**
     * Creates a slice of `array` with elements taken from the beginning. Elements
     * are taken until `predicate` returns falsey. The predicate is bound to
     * `thisArg` and invoked with three arguments: (value, index, array).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to query.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the slice of `array`.
     * @example
     *
     * _.takeWhile([1, 2, 3], function(n) {
     *   return n < 3;
     * });
     * // => [1, 2]
     *
     * var users = [
     *   { 'user': 'barney',  'active': false },
     *   { 'user': 'fred',    'active': false},
     *   { 'user': 'pebbles', 'active': true }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
     * // => ['barney']
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.pluck(_.takeWhile(users, 'active', false), 'user');
     * // => ['barney', 'fred']
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.takeWhile(users, 'active'), 'user');
     * // => []
     */
    function takeWhile(array, predicate, thisArg) {
      return (array && array.length)
        ? baseWhile(array, getCallback(predicate, thisArg, 3))
        : [];
    }

    /**
     * Creates an array of unique values, in order, from all of the provided arrays
     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @returns {Array} Returns the new array of combined values.
     * @example
     *
     * _.union([1, 2], [4, 2], [2, 1]);
     * // => [1, 2, 4]
     */
    var union = restParam(function(arrays) {
      return baseUniq(baseFlatten(arrays, false, true));
    });

    /**
     * Creates a duplicate-free version of an array, using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons, in which only the first occurence of each element
     * is kept. Providing `true` for `isSorted` performs a faster search algorithm
     * for sorted arrays. If an iteratee function is provided it is invoked for
     * each element in the array to generate the criterion by which uniqueness
     * is computed. The `iteratee` is bound to `thisArg` and invoked with three
     * arguments: (value, index, array).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @alias unique
     * @category Array
     * @param {Array} array The array to inspect.
     * @param {boolean} [isSorted] Specify the array is sorted.
     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array} Returns the new duplicate-value-free array.
     * @example
     *
     * _.uniq([2, 1, 2]);
     * // => [2, 1]
     *
     * // using `isSorted`
     * _.uniq([1, 1, 2], true);
     * // => [1, 2]
     *
     * // using an iteratee function
     * _.uniq([1, 2.5, 1.5, 2], function(n) {
     *   return this.floor(n);
     * }, Math);
     * // => [1, 2.5]
     *
     * // using the `_.property` callback shorthand
     * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
     * // => [{ 'x': 1 }, { 'x': 2 }]
     */
    function uniq(array, isSorted, iteratee, thisArg) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      if (isSorted != null && typeof isSorted != 'boolean') {
        thisArg = iteratee;
        iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
        isSorted = false;
      }
      var callback = getCallback();
      if (!(iteratee == null && callback === baseCallback)) {
        iteratee = callback(iteratee, thisArg, 3);
      }
      return (isSorted && getIndexOf() == baseIndexOf)
        ? sortedUniq(array, iteratee)
        : baseUniq(array, iteratee);
    }

    /**
     * This method is like `_.zip` except that it accepts an array of grouped
     * elements and creates an array regrouping the elements to their pre-zip
     * configuration.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array of grouped elements to process.
     * @returns {Array} Returns the new array of regrouped elements.
     * @example
     *
     * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
     * // => [['fred', 30, true], ['barney', 40, false]]
     *
     * _.unzip(zipped);
     * // => [['fred', 'barney'], [30, 40], [true, false]]
     */
    function unzip(array) {
      if (!(array && array.length)) {
        return [];
      }
      var index = -1,
          length = 0;

      array = arrayFilter(array, function(group) {
        if (isArrayLike(group)) {
          length = nativeMax(group.length, length);
          return true;
        }
      });
      var result = Array(length);
      while (++index < length) {
        result[index] = arrayMap(array, baseProperty(index));
      }
      return result;
    }

    /**
     * This method is like `_.unzip` except that it accepts an iteratee to specify
     * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
     * and invoked with four arguments: (accumulator, value, index, group).
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array of grouped elements to process.
     * @param {Function} [iteratee] The function to combine regrouped values.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array} Returns the new array of regrouped elements.
     * @example
     *
     * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
     * // => [[1, 10, 100], [2, 20, 200]]
     *
     * _.unzipWith(zipped, _.add);
     * // => [3, 30, 300]
     */
    function unzipWith(array, iteratee, thisArg) {
      var length = array ? array.length : 0;
      if (!length) {
        return [];
      }
      var result = unzip(array);
      if (iteratee == null) {
        return result;
      }
      iteratee = bindCallback(iteratee, thisArg, 4);
      return arrayMap(result, function(group) {
        return arrayReduce(group, iteratee, undefined, true);
      });
    }

    /**
     * Creates an array excluding all provided values using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {Array} array The array to filter.
     * @param {...*} [values] The values to exclude.
     * @returns {Array} Returns the new array of filtered values.
     * @example
     *
     * _.without([1, 2, 1, 3], 1, 2);
     * // => [3]
     */
    var without = restParam(function(array, values) {
      return isArrayLike(array)
        ? baseDifference(array, values)
        : [];
    });

    /**
     * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
     * of the provided arrays.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {...Array} [arrays] The arrays to inspect.
     * @returns {Array} Returns the new array of values.
     * @example
     *
     * _.xor([1, 2], [4, 2]);
     * // => [1, 4]
     */
    function xor() {
      var index = -1,
          length = arguments.length;

      while (++index < length) {
        var array = arguments[index];
        if (isArrayLike(array)) {
          var result = result
            ? arrayPush(baseDifference(result, array), baseDifference(array, result))
            : array;
        }
      }
      return result ? baseUniq(result) : [];
    }

    /**
     * Creates an array of grouped elements, the first of which contains the first
     * elements of the given arrays, the second of which contains the second elements
     * of the given arrays, and so on.
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {...Array} [arrays] The arrays to process.
     * @returns {Array} Returns the new array of grouped elements.
     * @example
     *
     * _.zip(['fred', 'barney'], [30, 40], [true, false]);
     * // => [['fred', 30, true], ['barney', 40, false]]
     */
    var zip = restParam(unzip);

    /**
     * The inverse of `_.pairs`; this method returns an object composed from arrays
     * of property names and values. Provide either a single two dimensional array,
     * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
     * and one of corresponding values.
     *
     * @static
     * @memberOf _
     * @alias object
     * @category Array
     * @param {Array} props The property names.
     * @param {Array} [values=[]] The property values.
     * @returns {Object} Returns the new object.
     * @example
     *
     * _.zipObject([['fred', 30], ['barney', 40]]);
     * // => { 'fred': 30, 'barney': 40 }
     *
     * _.zipObject(['fred', 'barney'], [30, 40]);
     * // => { 'fred': 30, 'barney': 40 }
     */
    function zipObject(props, values) {
      var index = -1,
          length = props ? props.length : 0,
          result = {};

      if (length && !values && !isArray(props[0])) {
        values = [];
      }
      while (++index < length) {
        var key = props[index];
        if (values) {
          result[key] = values[index];
        } else if (key) {
          result[key[0]] = key[1];
        }
      }
      return result;
    }

    /**
     * This method is like `_.zip` except that it accepts an iteratee to specify
     * how grouped values should be combined. The `iteratee` is bound to `thisArg`
     * and invoked with four arguments: (accumulator, value, index, group).
     *
     * @static
     * @memberOf _
     * @category Array
     * @param {...Array} [arrays] The arrays to process.
     * @param {Function} [iteratee] The function to combine grouped values.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array} Returns the new array of grouped elements.
     * @example
     *
     * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
     * // => [111, 222]
     */
    var zipWith = restParam(function(arrays) {
      var length = arrays.length,
          iteratee = length > 2 ? arrays[length - 2] : undefined,
          thisArg = length > 1 ? arrays[length - 1] : undefined;

      if (length > 2 && typeof iteratee == 'function') {
        length -= 2;
      } else {
        iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;
        thisArg = undefined;
      }
      arrays.length = length;
      return unzipWith(arrays, iteratee, thisArg);
    });

    /*------------------------------------------------------------------------*/

    /**
     * Creates a `lodash` object that wraps `value` with explicit method
     * chaining enabled.
     *
     * @static
     * @memberOf _
     * @category Chain
     * @param {*} value The value to wrap.
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'age': 36 },
     *   { 'user': 'fred',    'age': 40 },
     *   { 'user': 'pebbles', 'age': 1 }
     * ];
     *
     * var youngest = _.chain(users)
     *   .sortBy('age')
     *   .map(function(chr) {
     *     return chr.user + ' is ' + chr.age;
     *   })
     *   .first()
     *   .value();
     * // => 'pebbles is 1'
     */
    function chain(value) {
      var result = lodash(value);
      result.__chain__ = true;
      return result;
    }

    /**
     * This method invokes `interceptor` and returns `value`. The interceptor is
     * bound to `thisArg` and invoked with one argument; (value). The purpose of
     * this method is to "tap into" a method chain in order to perform operations
     * on intermediate results within the chain.
     *
     * @static
     * @memberOf _
     * @category Chain
     * @param {*} value The value to provide to `interceptor`.
     * @param {Function} interceptor The function to invoke.
     * @param {*} [thisArg] The `this` binding of `interceptor`.
     * @returns {*} Returns `value`.
     * @example
     *
     * _([1, 2, 3])
     *  .tap(function(array) {
     *    array.pop();
     *  })
     *  .reverse()
     *  .value();
     * // => [2, 1]
     */
    function tap(value, interceptor, thisArg) {
      interceptor.call(thisArg, value);
      return value;
    }

    /**
     * This method is like `_.tap` except that it returns the result of `interceptor`.
     *
     * @static
     * @memberOf _
     * @category Chain
     * @param {*} value The value to provide to `interceptor`.
     * @param {Function} interceptor The function to invoke.
     * @param {*} [thisArg] The `this` binding of `interceptor`.
     * @returns {*} Returns the result of `interceptor`.
     * @example
     *
     * _('  abc  ')
     *  .chain()
     *  .trim()
     *  .thru(function(value) {
     *    return [value];
     *  })
     *  .value();
     * // => ['abc']
     */
    function thru(value, interceptor, thisArg) {
      return interceptor.call(thisArg, value);
    }

    /**
     * Enables explicit method chaining on the wrapper object.
     *
     * @name chain
     * @memberOf _
     * @category Chain
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 }
     * ];
     *
     * // without explicit chaining
     * _(users).first();
     * // => { 'user': 'barney', 'age': 36 }
     *
     * // with explicit chaining
     * _(users).chain()
     *   .first()
     *   .pick('user')
     *   .value();
     * // => { 'user': 'barney' }
     */
    function wrapperChain() {
      return chain(this);
    }

    /**
     * Executes the chained sequence and returns the wrapped result.
     *
     * @name commit
     * @memberOf _
     * @category Chain
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var array = [1, 2];
     * var wrapped = _(array).push(3);
     *
     * console.log(array);
     * // => [1, 2]
     *
     * wrapped = wrapped.commit();
     * console.log(array);
     * // => [1, 2, 3]
     *
     * wrapped.last();
     * // => 3
     *
     * console.log(array);
     * // => [1, 2, 3]
     */
    function wrapperCommit() {
      return new LodashWrapper(this.value(), this.__chain__);
    }

    /**
     * Creates a new array joining a wrapped array with any additional arrays
     * and/or values.
     *
     * @name concat
     * @memberOf _
     * @category Chain
     * @param {...*} [values] The values to concatenate.
     * @returns {Array} Returns the new concatenated array.
     * @example
     *
     * var array = [1];
     * var wrapped = _(array).concat(2, [3], [[4]]);
     *
     * console.log(wrapped.value());
     * // => [1, 2, 3, [4]]
     *
     * console.log(array);
     * // => [1]
     */
    var wrapperConcat = restParam(function(values) {
      values = baseFlatten(values);
      return this.thru(function(array) {
        return arrayConcat(isArray(array) ? array : [toObject(array)], values);
      });
    });

    /**
     * Creates a clone of the chained sequence planting `value` as the wrapped value.
     *
     * @name plant
     * @memberOf _
     * @category Chain
     * @returns {Object} Returns the new `lodash` wrapper instance.
     * @example
     *
     * var array = [1, 2];
     * var wrapped = _(array).map(function(value) {
     *   return Math.pow(value, 2);
     * });
     *
     * var other = [3, 4];
     * var otherWrapped = wrapped.plant(other);
     *
     * otherWrapped.value();
     * // => [9, 16]
     *
     * wrapped.value();
     * // => [1, 4]
     */
    function wrapperPlant(value) {
      var result,
          parent = this;

      while (parent instanceof baseLodash) {
        var clone = wrapperClone(parent);
        if (result) {
          previous.__wrapped__ = clone;
        } else {
          result = clone;
        }
        var previous = clone;
        parent = parent.__wrapped__;
      }
      previous.__wrapped__ = value;
      return result;
    }

    /**
     * Reverses the wrapped array so the first element becomes the last, the
     * second element becomes the second to last, and so on.
     *
     * **Note:** This method mutates the wrapped array.
     *
     * @name reverse
     * @memberOf _
     * @category Chain
     * @returns {Object} Returns the new reversed `lodash` wrapper instance.
     * @example
     *
     * var array = [1, 2, 3];
     *
     * _(array).reverse().value()
     * // => [3, 2, 1]
     *
     * console.log(array);
     * // => [3, 2, 1]
     */
    function wrapperReverse() {
      var value = this.__wrapped__;

      var interceptor = function(value) {
        return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();
      };
      if (value instanceof LazyWrapper) {
        var wrapped = value;
        if (this.__actions__.length) {
          wrapped = new LazyWrapper(this);
        }
        wrapped = wrapped.reverse();
        wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
        return new LodashWrapper(wrapped, this.__chain__);
      }
      return this.thru(interceptor);
    }

    /**
     * Produces the result of coercing the unwrapped value to a string.
     *
     * @name toString
     * @memberOf _
     * @category Chain
     * @returns {string} Returns the coerced string value.
     * @example
     *
     * _([1, 2, 3]).toString();
     * // => '1,2,3'
     */
    function wrapperToString() {
      return (this.value() + '');
    }

    /**
     * Executes the chained sequence to extract the unwrapped value.
     *
     * @name value
     * @memberOf _
     * @alias run, toJSON, valueOf
     * @category Chain
     * @returns {*} Returns the resolved unwrapped value.
     * @example
     *
     * _([1, 2, 3]).value();
     * // => [1, 2, 3]
     */
    function wrapperValue() {
      return baseWrapperValue(this.__wrapped__, this.__actions__);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates an array of elements corresponding to the given keys, or indexes,
     * of `collection`. Keys may be specified as individual arguments or as arrays
     * of keys.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {...(number|number[]|string|string[])} [props] The property names
     *  or indexes of elements to pick, specified individually or in arrays.
     * @returns {Array} Returns the new array of picked elements.
     * @example
     *
     * _.at(['a', 'b', 'c'], [0, 2]);
     * // => ['a', 'c']
     *
     * _.at(['barney', 'fred', 'pebbles'], 0, 2);
     * // => ['barney', 'pebbles']
     */
    var at = restParam(function(collection, props) {
      return baseAt(collection, baseFlatten(props));
    });

    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` through `iteratee`. The corresponding value
     * of each key is the number of times the key was returned by `iteratee`.
     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
     * (value, index|key, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * _.countBy([4.3, 6.1, 6.4], function(n) {
     *   return Math.floor(n);
     * });
     * // => { '4': 1, '6': 2 }
     *
     * _.countBy([4.3, 6.1, 6.4], function(n) {
     *   return this.floor(n);
     * }, Math);
     * // => { '4': 1, '6': 2 }
     *
     * _.countBy(['one', 'two', 'three'], 'length');
     * // => { '3': 2, '5': 1 }
     */
    var countBy = createAggregator(function(result, value, key) {
      hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);
    });

    /**
     * Checks if `predicate` returns truthy for **all** elements of `collection`.
     * The predicate is bound to `thisArg` and invoked with three arguments:
     * (value, index|key, collection).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @alias all
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {boolean} Returns `true` if all elements pass the predicate check,
     *  else `false`.
     * @example
     *
     * _.every([true, 1, null, 'yes'], Boolean);
     * // => false
     *
     * var users = [
     *   { 'user': 'barney', 'active': false },
     *   { 'user': 'fred',   'active': false }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.every(users, { 'user': 'barney', 'active': false });
     * // => false
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.every(users, 'active', false);
     * // => true
     *
     * // using the `_.property` callback shorthand
     * _.every(users, 'active');
     * // => false
     */
    function every(collection, predicate, thisArg) {
      var func = isArray(collection) ? arrayEvery : baseEvery;
      if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
        predicate = undefined;
      }
      if (typeof predicate != 'function' || thisArg !== undefined) {
        predicate = getCallback(predicate, thisArg, 3);
      }
      return func(collection, predicate);
    }

    /**
     * Iterates over elements of `collection`, returning an array of all elements
     * `predicate` returns truthy for. The predicate is bound to `thisArg` and
     * invoked with three arguments: (value, index|key, collection).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @alias select
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the new filtered array.
     * @example
     *
     * _.filter([4, 5, 6], function(n) {
     *   return n % 2 == 0;
     * });
     * // => [4, 6]
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': true },
     *   { 'user': 'fred',   'age': 40, 'active': false }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
     * // => ['barney']
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.pluck(_.filter(users, 'active', false), 'user');
     * // => ['fred']
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.filter(users, 'active'), 'user');
     * // => ['barney']
     */
    function filter(collection, predicate, thisArg) {
      var func = isArray(collection) ? arrayFilter : baseFilter;
      predicate = getCallback(predicate, thisArg, 3);
      return func(collection, predicate);
    }

    /**
     * Iterates over elements of `collection`, returning the first element
     * `predicate` returns truthy for. The predicate is bound to `thisArg` and
     * invoked with three arguments: (value, index|key, collection).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @alias detect
     * @category Collection
     * @param {Array|Object|string} collection The collection to search.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {*} Returns the matched element, else `undefined`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney',  'age': 36, 'active': true },
     *   { 'user': 'fred',    'age': 40, 'active': false },
     *   { 'user': 'pebbles', 'age': 1,  'active': true }
     * ];
     *
     * _.result(_.find(users, function(chr) {
     *   return chr.age < 40;
     * }), 'user');
     * // => 'barney'
     *
     * // using the `_.matches` callback shorthand
     * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
     * // => 'pebbles'
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.result(_.find(users, 'active', false), 'user');
     * // => 'fred'
     *
     * // using the `_.property` callback shorthand
     * _.result(_.find(users, 'active'), 'user');
     * // => 'barney'
     */
    var find = createFind(baseEach);

    /**
     * This method is like `_.find` except that it iterates over elements of
     * `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to search.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {*} Returns the matched element, else `undefined`.
     * @example
     *
     * _.findLast([1, 2, 3, 4], function(n) {
     *   return n % 2 == 1;
     * });
     * // => 3
     */
    var findLast = createFind(baseEachRight, true);

    /**
     * Performs a deep comparison between each element in `collection` and the
     * source object, returning the first element that has equivalent property
     * values.
     *
     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
     * numbers, `Object` objects, regexes, and strings. Objects are compared by
     * their own, not inherited, enumerable properties. For comparing a single
     * own or inherited property value see `_.matchesProperty`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to search.
     * @param {Object} source The object of property values to match.
     * @returns {*} Returns the matched element, else `undefined`.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': true },
     *   { 'user': 'fred',   'age': 40, 'active': false }
     * ];
     *
     * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
     * // => 'barney'
     *
     * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
     * // => 'fred'
     */
    function findWhere(collection, source) {
      return find(collection, baseMatches(source));
    }

    /**
     * Iterates over elements of `collection` invoking `iteratee` for each element.
     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
     * (value, index|key, collection). Iteratee functions may exit iteration early
     * by explicitly returning `false`.
     *
     * **Note:** As with other "Collections" methods, objects with a "length" property
     * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
     * may be used for object iteration.
     *
     * @static
     * @memberOf _
     * @alias each
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array|Object|string} Returns `collection`.
     * @example
     *
     * _([1, 2]).forEach(function(n) {
     *   console.log(n);
     * }).value();
     * // => logs each value from left to right and returns the array
     *
     * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
     *   console.log(n, key);
     * });
     * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
     */
    var forEach = createForEach(arrayEach, baseEach);

    /**
     * This method is like `_.forEach` except that it iterates over elements of
     * `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @alias eachRight
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array|Object|string} Returns `collection`.
     * @example
     *
     * _([1, 2]).forEachRight(function(n) {
     *   console.log(n);
     * }).value();
     * // => logs each value from right to left and returns the array
     */
    var forEachRight = createForEach(arrayEachRight, baseEachRight);

    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` through `iteratee`. The corresponding value
     * of each key is an array of the elements responsible for generating the key.
     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
     * (value, index|key, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * _.groupBy([4.2, 6.1, 6.4], function(n) {
     *   return Math.floor(n);
     * });
     * // => { '4': [4.2], '6': [6.1, 6.4] }
     *
     * _.groupBy([4.2, 6.1, 6.4], function(n) {
     *   return this.floor(n);
     * }, Math);
     * // => { '4': [4.2], '6': [6.1, 6.4] }
     *
     * // using the `_.property` callback shorthand
     * _.groupBy(['one', 'two', 'three'], 'length');
     * // => { '3': ['one', 'two'], '5': ['three'] }
     */
    var groupBy = createAggregator(function(result, value, key) {
      if (hasOwnProperty.call(result, key)) {
        result[key].push(value);
      } else {
        result[key] = [value];
      }
    });

    /**
     * Checks if `value` is in `collection` using
     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
     * for equality comparisons. If `fromIndex` is negative, it is used as the offset
     * from the end of `collection`.
     *
     * @static
     * @memberOf _
     * @alias contains, include
     * @category Collection
     * @param {Array|Object|string} collection The collection to search.
     * @param {*} target The value to search for.
     * @param {number} [fromIndex=0] The index to search from.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
     * @returns {boolean} Returns `true` if a matching element is found, else `false`.
     * @example
     *
     * _.includes([1, 2, 3], 1);
     * // => true
     *
     * _.includes([1, 2, 3], 1, 2);
     * // => false
     *
     * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
     * // => true
     *
     * _.includes('pebbles', 'eb');
     * // => true
     */
    function includes(collection, target, fromIndex, guard) {
      var length = collection ? getLength(collection) : 0;
      if (!isLength(length)) {
        collection = values(collection);
        length = collection.length;
      }
      if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {
        fromIndex = 0;
      } else {
        fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
      }
      return (typeof collection == 'string' || !isArray(collection) && isString(collection))
        ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)
        : (!!length && getIndexOf(collection, target, fromIndex) > -1);
    }

    /**
     * Creates an object composed of keys generated from the results of running
     * each element of `collection` through `iteratee`. The corresponding value
     * of each key is the last element responsible for generating the key. The
     * iteratee function is bound to `thisArg` and invoked with three arguments:
     * (value, index|key, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns the composed aggregate object.
     * @example
     *
     * var keyData = [
     *   { 'dir': 'left', 'code': 97 },
     *   { 'dir': 'right', 'code': 100 }
     * ];
     *
     * _.indexBy(keyData, 'dir');
     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
     *
     * _.indexBy(keyData, function(object) {
     *   return String.fromCharCode(object.code);
     * });
     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
     *
     * _.indexBy(keyData, function(object) {
     *   return this.fromCharCode(object.code);
     * }, String);
     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
     */
    var indexBy = createAggregator(function(result, value, key) {
      result[key] = value;
    });

    /**
     * Invokes the method at `path` of each element in `collection`, returning
     * an array of the results of each invoked method. Any additional arguments
     * are provided to each invoked method. If `methodName` is a function it is
     * invoked for, and `this` bound to, each element in `collection`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Array|Function|string} path The path of the method to invoke or
     *  the function invoked per iteration.
     * @param {...*} [args] The arguments to invoke the method with.
     * @returns {Array} Returns the array of results.
     * @example
     *
     * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
     * // => [[1, 5, 7], [1, 2, 3]]
     *
     * _.invoke([123, 456], String.prototype.split, '');
     * // => [['1', '2', '3'], ['4', '5', '6']]
     */
    var invoke = restParam(function(collection, path, args) {
      var index = -1,
          isFunc = typeof path == 'function',
          isProp = isKey(path),
          result = isArrayLike(collection) ? Array(collection.length) : [];

      baseEach(collection, function(value) {
        var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);
        result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
      });
      return result;
    });

    /**
     * Creates an array of values by running each element in `collection` through
     * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
     * arguments: (value, index|key, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * Many lodash methods are guarded to work as iteratees for methods like
     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
     *
     * The guarded methods are:
     * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
     * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
     * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
     * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
     * `sum`, `uniq`, and `words`
     *
     * @static
     * @memberOf _
     * @alias collect
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array} Returns the new mapped array.
     * @example
     *
     * function timesThree(n) {
     *   return n * 3;
     * }
     *
     * _.map([1, 2], timesThree);
     * // => [3, 6]
     *
     * _.map({ 'a': 1, 'b': 2 }, timesThree);
     * // => [3, 6] (iteration order is not guaranteed)
     *
     * var users = [
     *   { 'user': 'barney' },
     *   { 'user': 'fred' }
     * ];
     *
     * // using the `_.property` callback shorthand
     * _.map(users, 'user');
     * // => ['barney', 'fred']
     */
    function map(collection, iteratee, thisArg) {
      var func = isArray(collection) ? arrayMap : baseMap;
      iteratee = getCallback(iteratee, thisArg, 3);
      return func(collection, iteratee);
    }

    /**
     * Creates an array of elements split into two groups, the first of which
     * contains elements `predicate` returns truthy for, while the second of which
     * contains elements `predicate` returns falsey for. The predicate is bound
     * to `thisArg` and invoked with three arguments: (value, index|key, collection).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the array of grouped elements.
     * @example
     *
     * _.partition([1, 2, 3], function(n) {
     *   return n % 2;
     * });
     * // => [[1, 3], [2]]
     *
     * _.partition([1.2, 2.3, 3.4], function(n) {
     *   return this.floor(n) % 2;
     * }, Math);
     * // => [[1.2, 3.4], [2.3]]
     *
     * var users = [
     *   { 'user': 'barney',  'age': 36, 'active': false },
     *   { 'user': 'fred',    'age': 40, 'active': true },
     *   { 'user': 'pebbles', 'age': 1,  'active': false }
     * ];
     *
     * var mapper = function(array) {
     *   return _.pluck(array, 'user');
     * };
     *
     * // using the `_.matches` callback shorthand
     * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
     * // => [['pebbles'], ['barney', 'fred']]
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.map(_.partition(users, 'active', false), mapper);
     * // => [['barney', 'pebbles'], ['fred']]
     *
     * // using the `_.property` callback shorthand
     * _.map(_.partition(users, 'active'), mapper);
     * // => [['fred'], ['barney', 'pebbles']]
     */
    var partition = createAggregator(function(result, value, key) {
      result[key ? 0 : 1].push(value);
    }, function() { return [[], []]; });

    /**
     * Gets the property value of `path` from all elements in `collection`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Array|string} path The path of the property to pluck.
     * @returns {Array} Returns the property values.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 }
     * ];
     *
     * _.pluck(users, 'user');
     * // => ['barney', 'fred']
     *
     * var userIndex = _.indexBy(users, 'user');
     * _.pluck(userIndex, 'age');
     * // => [36, 40] (iteration order is not guaranteed)
     */
    function pluck(collection, path) {
      return map(collection, property(path));
    }

    /**
     * Reduces `collection` to a value which is the accumulated result of running
     * each element in `collection` through `iteratee`, where each successive
     * invocation is supplied the return value of the previous. If `accumulator`
     * is not provided the first element of `collection` is used as the initial
     * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
     * (accumulator, value, index|key, collection).
     *
     * Many lodash methods are guarded to work as iteratees for methods like
     * `_.reduce`, `_.reduceRight`, and `_.transform`.
     *
     * The guarded methods are:
     * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,
     * and `sortByOrder`
     *
     * @static
     * @memberOf _
     * @alias foldl, inject
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [accumulator] The initial value.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {*} Returns the accumulated value.
     * @example
     *
     * _.reduce([1, 2], function(total, n) {
     *   return total + n;
     * });
     * // => 3
     *
     * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
     *   result[key] = n * 3;
     *   return result;
     * }, {});
     * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
     */
    var reduce = createReduce(arrayReduce, baseEach);

    /**
     * This method is like `_.reduce` except that it iterates over elements of
     * `collection` from right to left.
     *
     * @static
     * @memberOf _
     * @alias foldr
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [accumulator] The initial value.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {*} Returns the accumulated value.
     * @example
     *
     * var array = [[0, 1], [2, 3], [4, 5]];
     *
     * _.reduceRight(array, function(flattened, other) {
     *   return flattened.concat(other);
     * }, []);
     * // => [4, 5, 2, 3, 0, 1]
     */
    var reduceRight = createReduce(arrayReduceRight, baseEachRight);

    /**
     * The opposite of `_.filter`; this method returns the elements of `collection`
     * that `predicate` does **not** return truthy for.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Array} Returns the new filtered array.
     * @example
     *
     * _.reject([1, 2, 3, 4], function(n) {
     *   return n % 2 == 0;
     * });
     * // => [1, 3]
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': false },
     *   { 'user': 'fred',   'age': 40, 'active': true }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
     * // => ['barney']
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.pluck(_.reject(users, 'active', false), 'user');
     * // => ['fred']
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.reject(users, 'active'), 'user');
     * // => ['barney']
     */
    function reject(collection, predicate, thisArg) {
      var func = isArray(collection) ? arrayFilter : baseFilter;
      predicate = getCallback(predicate, thisArg, 3);
      return func(collection, function(value, index, collection) {
        return !predicate(value, index, collection);
      });
    }

    /**
     * Gets a random element or `n` random elements from a collection.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to sample.
     * @param {number} [n] The number of elements to sample.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {*} Returns the random sample(s).
     * @example
     *
     * _.sample([1, 2, 3, 4]);
     * // => 2
     *
     * _.sample([1, 2, 3, 4], 2);
     * // => [3, 1]
     */
    function sample(collection, n, guard) {
      if (guard ? isIterateeCall(collection, n, guard) : n == null) {
        collection = toIterable(collection);
        var length = collection.length;
        return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
      }
      var index = -1,
          result = toArray(collection),
          length = result.length,
          lastIndex = length - 1;

      n = nativeMin(n < 0 ? 0 : (+n || 0), length);
      while (++index < n) {
        var rand = baseRandom(index, lastIndex),
            value = result[rand];

        result[rand] = result[index];
        result[index] = value;
      }
      result.length = n;
      return result;
    }

    /**
     * Creates an array of shuffled values, using a version of the
     * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to shuffle.
     * @returns {Array} Returns the new shuffled array.
     * @example
     *
     * _.shuffle([1, 2, 3, 4]);
     * // => [4, 1, 3, 2]
     */
    function shuffle(collection) {
      return sample(collection, POSITIVE_INFINITY);
    }

    /**
     * Gets the size of `collection` by returning its length for array-like
     * values or the number of own enumerable properties for objects.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to inspect.
     * @returns {number} Returns the size of `collection`.
     * @example
     *
     * _.size([1, 2, 3]);
     * // => 3
     *
     * _.size({ 'a': 1, 'b': 2 });
     * // => 2
     *
     * _.size('pebbles');
     * // => 7
     */
    function size(collection) {
      var length = collection ? getLength(collection) : 0;
      return isLength(length) ? length : keys(collection).length;
    }

    /**
     * Checks if `predicate` returns truthy for **any** element of `collection`.
     * The function returns as soon as it finds a passing value and does not iterate
     * over the entire collection. The predicate is bound to `thisArg` and invoked
     * with three arguments: (value, index|key, collection).
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @alias any
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {boolean} Returns `true` if any element passes the predicate check,
     *  else `false`.
     * @example
     *
     * _.some([null, 0, 'yes', false], Boolean);
     * // => true
     *
     * var users = [
     *   { 'user': 'barney', 'active': true },
     *   { 'user': 'fred',   'active': false }
     * ];
     *
     * // using the `_.matches` callback shorthand
     * _.some(users, { 'user': 'barney', 'active': false });
     * // => false
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.some(users, 'active', false);
     * // => true
     *
     * // using the `_.property` callback shorthand
     * _.some(users, 'active');
     * // => true
     */
    function some(collection, predicate, thisArg) {
      var func = isArray(collection) ? arraySome : baseSome;
      if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
        predicate = undefined;
      }
      if (typeof predicate != 'function' || thisArg !== undefined) {
        predicate = getCallback(predicate, thisArg, 3);
      }
      return func(collection, predicate);
    }

    /**
     * Creates an array of elements, sorted in ascending order by the results of
     * running each element in a collection through `iteratee`. This method performs
     * a stable sort, that is, it preserves the original sort order of equal elements.
     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
     * (value, index|key, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array} Returns the new sorted array.
     * @example
     *
     * _.sortBy([1, 2, 3], function(n) {
     *   return Math.sin(n);
     * });
     * // => [3, 1, 2]
     *
     * _.sortBy([1, 2, 3], function(n) {
     *   return this.sin(n);
     * }, Math);
     * // => [3, 1, 2]
     *
     * var users = [
     *   { 'user': 'fred' },
     *   { 'user': 'pebbles' },
     *   { 'user': 'barney' }
     * ];
     *
     * // using the `_.property` callback shorthand
     * _.pluck(_.sortBy(users, 'user'), 'user');
     * // => ['barney', 'fred', 'pebbles']
     */
    function sortBy(collection, iteratee, thisArg) {
      if (collection == null) {
        return [];
      }
      if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
        iteratee = undefined;
      }
      var index = -1;
      iteratee = getCallback(iteratee, thisArg, 3);

      var result = baseMap(collection, function(value, key, collection) {
        return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };
      });
      return baseSortBy(result, compareAscending);
    }

    /**
     * This method is like `_.sortBy` except that it can sort by multiple iteratees
     * or property names.
     *
     * If a property name is provided for an iteratee the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If an object is provided for an iteratee the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
     *  The iteratees to sort by, specified as individual values or arrays of values.
     * @returns {Array} Returns the new sorted array.
     * @example
     *
     * var users = [
     *   { 'user': 'fred',   'age': 48 },
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 42 },
     *   { 'user': 'barney', 'age': 34 }
     * ];
     *
     * _.map(_.sortByAll(users, ['user', 'age']), _.values);
     * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
     *
     * _.map(_.sortByAll(users, 'user', function(chr) {
     *   return Math.floor(chr.age / 10);
     * }), _.values);
     * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
     */
    var sortByAll = restParam(function(collection, iteratees) {
      if (collection == null) {
        return [];
      }
      var guard = iteratees[2];
      if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
        iteratees.length = 1;
      }
      return baseSortByOrder(collection, baseFlatten(iteratees), []);
    });

    /**
     * This method is like `_.sortByAll` except that it allows specifying the
     * sort orders of the iteratees to sort by. If `orders` is unspecified, all
     * values are sorted in ascending order. Otherwise, a value is sorted in
     * ascending order if its corresponding order is "asc", and descending if "desc".
     *
     * If a property name is provided for an iteratee the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If an object is provided for an iteratee the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
     * @param {boolean[]} [orders] The sort orders of `iteratees`.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
     * @returns {Array} Returns the new sorted array.
     * @example
     *
     * var users = [
     *   { 'user': 'fred',   'age': 48 },
     *   { 'user': 'barney', 'age': 34 },
     *   { 'user': 'fred',   'age': 42 },
     *   { 'user': 'barney', 'age': 36 }
     * ];
     *
     * // sort by `user` in ascending order and by `age` in descending order
     * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
     * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
     */
    function sortByOrder(collection, iteratees, orders, guard) {
      if (collection == null) {
        return [];
      }
      if (guard && isIterateeCall(iteratees, orders, guard)) {
        orders = undefined;
      }
      if (!isArray(iteratees)) {
        iteratees = iteratees == null ? [] : [iteratees];
      }
      if (!isArray(orders)) {
        orders = orders == null ? [] : [orders];
      }
      return baseSortByOrder(collection, iteratees, orders);
    }

    /**
     * Performs a deep comparison between each element in `collection` and the
     * source object, returning an array of all elements that have equivalent
     * property values.
     *
     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
     * numbers, `Object` objects, regexes, and strings. Objects are compared by
     * their own, not inherited, enumerable properties. For comparing a single
     * own or inherited property value see `_.matchesProperty`.
     *
     * @static
     * @memberOf _
     * @category Collection
     * @param {Array|Object|string} collection The collection to search.
     * @param {Object} source The object of property values to match.
     * @returns {Array} Returns the new filtered array.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
     *   { 'user': 'fred',   'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
     * ];
     *
     * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
     * // => ['barney']
     *
     * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
     * // => ['fred']
     */
    function where(collection, source) {
      return filter(collection, baseMatches(source));
    }

    /*------------------------------------------------------------------------*/

    /**
     * Gets the number of milliseconds that have elapsed since the Unix epoch
     * (1 January 1970 00:00:00 UTC).
     *
     * @static
     * @memberOf _
     * @category Date
     * @example
     *
     * _.defer(function(stamp) {
     *   console.log(_.now() - stamp);
     * }, _.now());
     * // => logs the number of milliseconds it took for the deferred function to be invoked
     */
    var now = nativeNow || function() {
      return new Date().getTime();
    };

    /*------------------------------------------------------------------------*/

    /**
     * The opposite of `_.before`; this method creates a function that invokes
     * `func` once it is called `n` or more times.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {number} n The number of calls before `func` is invoked.
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new restricted function.
     * @example
     *
     * var saves = ['profile', 'settings'];
     *
     * var done = _.after(saves.length, function() {
     *   console.log('done saving!');
     * });
     *
     * _.forEach(saves, function(type) {
     *   asyncSave({ 'type': type, 'complete': done });
     * });
     * // => logs 'done saving!' after the two async saves have completed
     */
    function after(n, func) {
      if (typeof func != 'function') {
        if (typeof n == 'function') {
          var temp = n;
          n = func;
          func = temp;
        } else {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
      }
      n = nativeIsFinite(n = +n) ? n : 0;
      return function() {
        if (--n < 1) {
          return func.apply(this, arguments);
        }
      };
    }

    /**
     * Creates a function that accepts up to `n` arguments ignoring any
     * additional arguments.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to cap arguments for.
     * @param {number} [n=func.length] The arity cap.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Function} Returns the new function.
     * @example
     *
     * _.map(['6', '8', '10'], _.ary(parseInt, 1));
     * // => [6, 8, 10]
     */
    function ary(func, n, guard) {
      if (guard && isIterateeCall(func, n, guard)) {
        n = undefined;
      }
      n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);
      return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
    }

    /**
     * Creates a function that invokes `func`, with the `this` binding and arguments
     * of the created function, while it is called less than `n` times. Subsequent
     * calls to the created function return the result of the last `func` invocation.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {number} n The number of calls at which `func` is no longer invoked.
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new restricted function.
     * @example
     *
     * jQuery('#add').on('click', _.before(5, addContactToList));
     * // => allows adding up to 4 contacts to the list
     */
    function before(n, func) {
      var result;
      if (typeof func != 'function') {
        if (typeof n == 'function') {
          var temp = n;
          n = func;
          func = temp;
        } else {
          throw new TypeError(FUNC_ERROR_TEXT);
        }
      }
      return function() {
        if (--n > 0) {
          result = func.apply(this, arguments);
        }
        if (n <= 1) {
          func = undefined;
        }
        return result;
      };
    }

    /**
     * Creates a function that invokes `func` with the `this` binding of `thisArg`
     * and prepends any additional `_.bind` arguments to those provided to the
     * bound function.
     *
     * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
     * may be used as a placeholder for partially applied arguments.
     *
     * **Note:** Unlike native `Function#bind` this method does not set the "length"
     * property of bound functions.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to bind.
     * @param {*} thisArg The `this` binding of `func`.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new bound function.
     * @example
     *
     * var greet = function(greeting, punctuation) {
     *   return greeting + ' ' + this.user + punctuation;
     * };
     *
     * var object = { 'user': 'fred' };
     *
     * var bound = _.bind(greet, object, 'hi');
     * bound('!');
     * // => 'hi fred!'
     *
     * // using placeholders
     * var bound = _.bind(greet, object, _, '!');
     * bound('hi');
     * // => 'hi fred!'
     */
    var bind = restParam(function(func, thisArg, partials) {
      var bitmask = BIND_FLAG;
      if (partials.length) {
        var holders = replaceHolders(partials, bind.placeholder);
        bitmask |= PARTIAL_FLAG;
      }
      return createWrapper(func, bitmask, thisArg, partials, holders);
    });

    /**
     * Binds methods of an object to the object itself, overwriting the existing
     * method. Method names may be specified as individual arguments or as arrays
     * of method names. If no method names are provided all enumerable function
     * properties, own and inherited, of `object` are bound.
     *
     * **Note:** This method does not set the "length" property of bound functions.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Object} object The object to bind and assign the bound methods to.
     * @param {...(string|string[])} [methodNames] The object method names to bind,
     *  specified as individual method names or arrays of method names.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var view = {
     *   'label': 'docs',
     *   'onClick': function() {
     *     console.log('clicked ' + this.label);
     *   }
     * };
     *
     * _.bindAll(view);
     * jQuery('#docs').on('click', view.onClick);
     * // => logs 'clicked docs' when the element is clicked
     */
    var bindAll = restParam(function(object, methodNames) {
      methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);

      var index = -1,
          length = methodNames.length;

      while (++index < length) {
        var key = methodNames[index];
        object[key] = createWrapper(object[key], BIND_FLAG, object);
      }
      return object;
    });

    /**
     * Creates a function that invokes the method at `object[key]` and prepends
     * any additional `_.bindKey` arguments to those provided to the bound function.
     *
     * This method differs from `_.bind` by allowing bound functions to reference
     * methods that may be redefined or don't yet exist.
     * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
     * for more details.
     *
     * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for partially applied arguments.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Object} object The object the method belongs to.
     * @param {string} key The key of the method.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new bound function.
     * @example
     *
     * var object = {
     *   'user': 'fred',
     *   'greet': function(greeting, punctuation) {
     *     return greeting + ' ' + this.user + punctuation;
     *   }
     * };
     *
     * var bound = _.bindKey(object, 'greet', 'hi');
     * bound('!');
     * // => 'hi fred!'
     *
     * object.greet = function(greeting, punctuation) {
     *   return greeting + 'ya ' + this.user + punctuation;
     * };
     *
     * bound('!');
     * // => 'hiya fred!'
     *
     * // using placeholders
     * var bound = _.bindKey(object, 'greet', _, '!');
     * bound('hi');
     * // => 'hiya fred!'
     */
    var bindKey = restParam(function(object, key, partials) {
      var bitmask = BIND_FLAG | BIND_KEY_FLAG;
      if (partials.length) {
        var holders = replaceHolders(partials, bindKey.placeholder);
        bitmask |= PARTIAL_FLAG;
      }
      return createWrapper(key, bitmask, object, partials, holders);
    });

    /**
     * Creates a function that accepts one or more arguments of `func` that when
     * called either invokes `func` returning its result, if all `func` arguments
     * have been provided, or returns a function that accepts one or more of the
     * remaining `func` arguments, and so on. The arity of `func` may be specified
     * if `func.length` is not sufficient.
     *
     * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
     * may be used as a placeholder for provided arguments.
     *
     * **Note:** This method does not set the "length" property of curried functions.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to curry.
     * @param {number} [arity=func.length] The arity of `func`.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Function} Returns the new curried function.
     * @example
     *
     * var abc = function(a, b, c) {
     *   return [a, b, c];
     * };
     *
     * var curried = _.curry(abc);
     *
     * curried(1)(2)(3);
     * // => [1, 2, 3]
     *
     * curried(1, 2)(3);
     * // => [1, 2, 3]
     *
     * curried(1, 2, 3);
     * // => [1, 2, 3]
     *
     * // using placeholders
     * curried(1)(_, 3)(2);
     * // => [1, 2, 3]
     */
    var curry = createCurry(CURRY_FLAG);

    /**
     * This method is like `_.curry` except that arguments are applied to `func`
     * in the manner of `_.partialRight` instead of `_.partial`.
     *
     * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for provided arguments.
     *
     * **Note:** This method does not set the "length" property of curried functions.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to curry.
     * @param {number} [arity=func.length] The arity of `func`.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Function} Returns the new curried function.
     * @example
     *
     * var abc = function(a, b, c) {
     *   return [a, b, c];
     * };
     *
     * var curried = _.curryRight(abc);
     *
     * curried(3)(2)(1);
     * // => [1, 2, 3]
     *
     * curried(2, 3)(1);
     * // => [1, 2, 3]
     *
     * curried(1, 2, 3);
     * // => [1, 2, 3]
     *
     * // using placeholders
     * curried(3)(1, _)(2);
     * // => [1, 2, 3]
     */
    var curryRight = createCurry(CURRY_RIGHT_FLAG);

    /**
     * Creates a debounced function that delays invoking `func` until after `wait`
     * milliseconds have elapsed since the last time the debounced function was
     * invoked. The debounced function comes with a `cancel` method to cancel
     * delayed invocations. Provide an options object to indicate that `func`
     * should be invoked on the leading and/or trailing edge of the `wait` timeout.
     * Subsequent calls to the debounced function return the result of the last
     * `func` invocation.
     *
     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
     * on the trailing edge of the timeout only if the the debounced function is
     * invoked more than once during the `wait` timeout.
     *
     * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
     * for details over the differences between `_.debounce` and `_.throttle`.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to debounce.
     * @param {number} [wait=0] The number of milliseconds to delay.
     * @param {Object} [options] The options object.
     * @param {boolean} [options.leading=false] Specify invoking on the leading
     *  edge of the timeout.
     * @param {number} [options.maxWait] The maximum time `func` is allowed to be
     *  delayed before it is invoked.
     * @param {boolean} [options.trailing=true] Specify invoking on the trailing
     *  edge of the timeout.
     * @returns {Function} Returns the new debounced function.
     * @example
     *
     * // avoid costly calculations while the window size is in flux
     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
     *
     * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
     * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
     *   'leading': true,
     *   'trailing': false
     * }));
     *
     * // ensure `batchLog` is invoked once after 1 second of debounced calls
     * var source = new EventSource('/stream');
     * jQuery(source).on('message', _.debounce(batchLog, 250, {
     *   'maxWait': 1000
     * }));
     *
     * // cancel a debounced call
     * var todoChanges = _.debounce(batchLog, 1000);
     * Object.observe(models.todo, todoChanges);
     *
     * Object.observe(models, function(changes) {
     *   if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
     *     todoChanges.cancel();
     *   }
     * }, ['delete']);
     *
     * // ...at some point `models.todo` is changed
     * models.todo.completed = true;
     *
     * // ...before 1 second has passed `models.todo` is deleted
     * // which cancels the debounced `todoChanges` call
     * delete models.todo;
     */
    function debounce(func, wait, options) {
      var args,
          maxTimeoutId,
          result,
          stamp,
          thisArg,
          timeoutId,
          trailingCall,
          lastCalled = 0,
          maxWait = false,
          trailing = true;

      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      wait = wait < 0 ? 0 : (+wait || 0);
      if (options === true) {
        var leading = true;
        trailing = false;
      } else if (isObject(options)) {
        leading = !!options.leading;
        maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
        trailing = 'trailing' in options ? !!options.trailing : trailing;
      }

      function cancel() {
        if (timeoutId) {
          clearTimeout(timeoutId);
        }
        if (maxTimeoutId) {
          clearTimeout(maxTimeoutId);
        }
        lastCalled = 0;
        maxTimeoutId = timeoutId = trailingCall = undefined;
      }

      function complete(isCalled, id) {
        if (id) {
          clearTimeout(id);
        }
        maxTimeoutId = timeoutId = trailingCall = undefined;
        if (isCalled) {
          lastCalled = now();
          result = func.apply(thisArg, args);
          if (!timeoutId && !maxTimeoutId) {
            args = thisArg = undefined;
          }
        }
      }

      function delayed() {
        var remaining = wait - (now() - stamp);
        if (remaining <= 0 || remaining > wait) {
          complete(trailingCall, maxTimeoutId);
        } else {
          timeoutId = setTimeout(delayed, remaining);
        }
      }

      function maxDelayed() {
        complete(trailing, timeoutId);
      }

      function debounced() {
        args = arguments;
        stamp = now();
        thisArg = this;
        trailingCall = trailing && (timeoutId || !leading);

        if (maxWait === false) {
          var leadingCall = leading && !timeoutId;
        } else {
          if (!maxTimeoutId && !leading) {
            lastCalled = stamp;
          }
          var remaining = maxWait - (stamp - lastCalled),
              isCalled = remaining <= 0 || remaining > maxWait;

          if (isCalled) {
            if (maxTimeoutId) {
              maxTimeoutId = clearTimeout(maxTimeoutId);
            }
            lastCalled = stamp;
            result = func.apply(thisArg, args);
          }
          else if (!maxTimeoutId) {
            maxTimeoutId = setTimeout(maxDelayed, remaining);
          }
        }
        if (isCalled && timeoutId) {
          timeoutId = clearTimeout(timeoutId);
        }
        else if (!timeoutId && wait !== maxWait) {
          timeoutId = setTimeout(delayed, wait);
        }
        if (leadingCall) {
          isCalled = true;
          result = func.apply(thisArg, args);
        }
        if (isCalled && !timeoutId && !maxTimeoutId) {
          args = thisArg = undefined;
        }
        return result;
      }
      debounced.cancel = cancel;
      return debounced;
    }

    /**
     * Defers invoking the `func` until the current call stack has cleared. Any
     * additional arguments are provided to `func` when it is invoked.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to defer.
     * @param {...*} [args] The arguments to invoke the function with.
     * @returns {number} Returns the timer id.
     * @example
     *
     * _.defer(function(text) {
     *   console.log(text);
     * }, 'deferred');
     * // logs 'deferred' after one or more milliseconds
     */
    var defer = restParam(function(func, args) {
      return baseDelay(func, 1, args);
    });

    /**
     * Invokes `func` after `wait` milliseconds. Any additional arguments are
     * provided to `func` when it is invoked.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to delay.
     * @param {number} wait The number of milliseconds to delay invocation.
     * @param {...*} [args] The arguments to invoke the function with.
     * @returns {number} Returns the timer id.
     * @example
     *
     * _.delay(function(text) {
     *   console.log(text);
     * }, 1000, 'later');
     * // => logs 'later' after one second
     */
    var delay = restParam(function(func, wait, args) {
      return baseDelay(func, wait, args);
    });

    /**
     * Creates a function that returns the result of invoking the provided
     * functions with the `this` binding of the created function, where each
     * successive invocation is supplied the return value of the previous.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {...Function} [funcs] Functions to invoke.
     * @returns {Function} Returns the new function.
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var addSquare = _.flow(_.add, square);
     * addSquare(1, 2);
     * // => 9
     */
    var flow = createFlow();

    /**
     * This method is like `_.flow` except that it creates a function that
     * invokes the provided functions from right to left.
     *
     * @static
     * @memberOf _
     * @alias backflow, compose
     * @category Function
     * @param {...Function} [funcs] Functions to invoke.
     * @returns {Function} Returns the new function.
     * @example
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var addSquare = _.flowRight(square, _.add);
     * addSquare(1, 2);
     * // => 9
     */
    var flowRight = createFlow(true);

    /**
     * Creates a function that memoizes the result of `func`. If `resolver` is
     * provided it determines the cache key for storing the result based on the
     * arguments provided to the memoized function. By default, the first argument
     * provided to the memoized function is coerced to a string and used as the
     * cache key. The `func` is invoked with the `this` binding of the memoized
     * function.
     *
     * **Note:** The cache is exposed as the `cache` property on the memoized
     * function. Its creation may be customized by replacing the `_.memoize.Cache`
     * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
     * method interface of `get`, `has`, and `set`.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to have its output memoized.
     * @param {Function} [resolver] The function to resolve the cache key.
     * @returns {Function} Returns the new memoizing function.
     * @example
     *
     * var upperCase = _.memoize(function(string) {
     *   return string.toUpperCase();
     * });
     *
     * upperCase('fred');
     * // => 'FRED'
     *
     * // modifying the result cache
     * upperCase.cache.set('fred', 'BARNEY');
     * upperCase('fred');
     * // => 'BARNEY'
     *
     * // replacing `_.memoize.Cache`
     * var object = { 'user': 'fred' };
     * var other = { 'user': 'barney' };
     * var identity = _.memoize(_.identity);
     *
     * identity(object);
     * // => { 'user': 'fred' }
     * identity(other);
     * // => { 'user': 'fred' }
     *
     * _.memoize.Cache = WeakMap;
     * var identity = _.memoize(_.identity);
     *
     * identity(object);
     * // => { 'user': 'fred' }
     * identity(other);
     * // => { 'user': 'barney' }
     */
    function memoize(func, resolver) {
      if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var memoized = function() {
        var args = arguments,
            key = resolver ? resolver.apply(this, args) : args[0],
            cache = memoized.cache;

        if (cache.has(key)) {
          return cache.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache.set(key, result);
        return result;
      };
      memoized.cache = new memoize.Cache;
      return memoized;
    }

    /**
     * Creates a function that runs each argument through a corresponding
     * transform function.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to wrap.
     * @param {...(Function|Function[])} [transforms] The functions to transform
     * arguments, specified as individual functions or arrays of functions.
     * @returns {Function} Returns the new function.
     * @example
     *
     * function doubled(n) {
     *   return n * 2;
     * }
     *
     * function square(n) {
     *   return n * n;
     * }
     *
     * var modded = _.modArgs(function(x, y) {
     *   return [x, y];
     * }, square, doubled);
     *
     * modded(1, 2);
     * // => [1, 4]
     *
     * modded(5, 10);
     * // => [25, 20]
     */
    var modArgs = restParam(function(func, transforms) {
      transforms = baseFlatten(transforms);
      if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      var length = transforms.length;
      return restParam(function(args) {
        var index = nativeMin(args.length, length);
        while (index--) {
          args[index] = transforms[index](args[index]);
        }
        return func.apply(this, args);
      });
    });

    /**
     * Creates a function that negates the result of the predicate `func`. The
     * `func` predicate is invoked with the `this` binding and arguments of the
     * created function.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} predicate The predicate to negate.
     * @returns {Function} Returns the new function.
     * @example
     *
     * function isEven(n) {
     *   return n % 2 == 0;
     * }
     *
     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
     * // => [1, 3, 5]
     */
    function negate(predicate) {
      if (typeof predicate != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      return function() {
        return !predicate.apply(this, arguments);
      };
    }

    /**
     * Creates a function that is restricted to invoking `func` once. Repeat calls
     * to the function return the value of the first call. The `func` is invoked
     * with the `this` binding and arguments of the created function.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to restrict.
     * @returns {Function} Returns the new restricted function.
     * @example
     *
     * var initialize = _.once(createApplication);
     * initialize();
     * initialize();
     * // `initialize` invokes `createApplication` once
     */
    function once(func) {
      return before(2, func);
    }

    /**
     * Creates a function that invokes `func` with `partial` arguments prepended
     * to those provided to the new function. This method is like `_.bind` except
     * it does **not** alter the `this` binding.
     *
     * The `_.partial.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for partially applied arguments.
     *
     * **Note:** This method does not set the "length" property of partially
     * applied functions.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to partially apply arguments to.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new partially applied function.
     * @example
     *
     * var greet = function(greeting, name) {
     *   return greeting + ' ' + name;
     * };
     *
     * var sayHelloTo = _.partial(greet, 'hello');
     * sayHelloTo('fred');
     * // => 'hello fred'
     *
     * // using placeholders
     * var greetFred = _.partial(greet, _, 'fred');
     * greetFred('hi');
     * // => 'hi fred'
     */
    var partial = createPartial(PARTIAL_FLAG);

    /**
     * This method is like `_.partial` except that partially applied arguments
     * are appended to those provided to the new function.
     *
     * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
     * builds, may be used as a placeholder for partially applied arguments.
     *
     * **Note:** This method does not set the "length" property of partially
     * applied functions.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to partially apply arguments to.
     * @param {...*} [partials] The arguments to be partially applied.
     * @returns {Function} Returns the new partially applied function.
     * @example
     *
     * var greet = function(greeting, name) {
     *   return greeting + ' ' + name;
     * };
     *
     * var greetFred = _.partialRight(greet, 'fred');
     * greetFred('hi');
     * // => 'hi fred'
     *
     * // using placeholders
     * var sayHelloTo = _.partialRight(greet, 'hello', _);
     * sayHelloTo('fred');
     * // => 'hello fred'
     */
    var partialRight = createPartial(PARTIAL_RIGHT_FLAG);

    /**
     * Creates a function that invokes `func` with arguments arranged according
     * to the specified indexes where the argument value at the first index is
     * provided as the first argument, the argument value at the second index is
     * provided as the second argument, and so on.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to rearrange arguments for.
     * @param {...(number|number[])} indexes The arranged argument indexes,
     *  specified as individual indexes or arrays of indexes.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var rearged = _.rearg(function(a, b, c) {
     *   return [a, b, c];
     * }, 2, 0, 1);
     *
     * rearged('b', 'c', 'a')
     * // => ['a', 'b', 'c']
     *
     * var map = _.rearg(_.map, [1, 0]);
     * map(function(n) {
     *   return n * 3;
     * }, [1, 2, 3]);
     * // => [3, 6, 9]
     */
    var rearg = restParam(function(func, indexes) {
      return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
    });

    /**
     * Creates a function that invokes `func` with the `this` binding of the
     * created function and arguments from `start` and beyond provided as an array.
     *
     * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to apply a rest parameter to.
     * @param {number} [start=func.length-1] The start position of the rest parameter.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var say = _.restParam(function(what, names) {
     *   return what + ' ' + _.initial(names).join(', ') +
     *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
     * });
     *
     * say('hello', 'fred', 'barney', 'pebbles');
     * // => 'hello fred, barney, & pebbles'
     */
    function restParam(func, start) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);
      return function() {
        var args = arguments,
            index = -1,
            length = nativeMax(args.length - start, 0),
            rest = Array(length);

        while (++index < length) {
          rest[index] = args[start + index];
        }
        switch (start) {
          case 0: return func.call(this, rest);
          case 1: return func.call(this, args[0], rest);
          case 2: return func.call(this, args[0], args[1], rest);
        }
        var otherArgs = Array(start + 1);
        index = -1;
        while (++index < start) {
          otherArgs[index] = args[index];
        }
        otherArgs[start] = rest;
        return func.apply(this, otherArgs);
      };
    }

    /**
     * Creates a function that invokes `func` with the `this` binding of the created
     * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
     *
     * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to spread arguments over.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var say = _.spread(function(who, what) {
     *   return who + ' says ' + what;
     * });
     *
     * say(['fred', 'hello']);
     * // => 'fred says hello'
     *
     * // with a Promise
     * var numbers = Promise.all([
     *   Promise.resolve(40),
     *   Promise.resolve(36)
     * ]);
     *
     * numbers.then(_.spread(function(x, y) {
     *   return x + y;
     * }));
     * // => a Promise of 76
     */
    function spread(func) {
      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      return function(array) {
        return func.apply(this, array);
      };
    }

    /**
     * Creates a throttled function that only invokes `func` at most once per
     * every `wait` milliseconds. The throttled function comes with a `cancel`
     * method to cancel delayed invocations. Provide an options object to indicate
     * that `func` should be invoked on the leading and/or trailing edge of the
     * `wait` timeout. Subsequent calls to the throttled function return the
     * result of the last `func` call.
     *
     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
     * on the trailing edge of the timeout only if the the throttled function is
     * invoked more than once during the `wait` timeout.
     *
     * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
     * for details over the differences between `_.throttle` and `_.debounce`.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {Function} func The function to throttle.
     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
     * @param {Object} [options] The options object.
     * @param {boolean} [options.leading=true] Specify invoking on the leading
     *  edge of the timeout.
     * @param {boolean} [options.trailing=true] Specify invoking on the trailing
     *  edge of the timeout.
     * @returns {Function} Returns the new throttled function.
     * @example
     *
     * // avoid excessively updating the position while scrolling
     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
     *
     * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
     * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
     *   'trailing': false
     * }));
     *
     * // cancel a trailing throttled call
     * jQuery(window).on('popstate', throttled.cancel);
     */
    function throttle(func, wait, options) {
      var leading = true,
          trailing = true;

      if (typeof func != 'function') {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      if (options === false) {
        leading = false;
      } else if (isObject(options)) {
        leading = 'leading' in options ? !!options.leading : leading;
        trailing = 'trailing' in options ? !!options.trailing : trailing;
      }
      return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });
    }

    /**
     * Creates a function that provides `value` to the wrapper function as its
     * first argument. Any additional arguments provided to the function are
     * appended to those provided to the wrapper function. The wrapper is invoked
     * with the `this` binding of the created function.
     *
     * @static
     * @memberOf _
     * @category Function
     * @param {*} value The value to wrap.
     * @param {Function} wrapper The wrapper function.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var p = _.wrap(_.escape, function(func, text) {
     *   return '<p>' + func(text) + '</p>';
     * });
     *
     * p('fred, barney, & pebbles');
     * // => '<p>fred, barney, &amp; pebbles</p>'
     */
    function wrap(value, wrapper) {
      wrapper = wrapper == null ? identity : wrapper;
      return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
     * otherwise they are assigned by reference. If `customizer` is provided it is
     * invoked to produce the cloned values. If `customizer` returns `undefined`
     * cloning is handled by the method instead. The `customizer` is bound to
     * `thisArg` and invoked with two argument; (value [, index|key, object]).
     *
     * **Note:** This method is loosely based on the
     * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
     * The enumerable properties of `arguments` objects and objects created by
     * constructors other than `Object` are cloned to plain `Object` objects. An
     * empty object is returned for uncloneable values such as functions, DOM nodes,
     * Maps, Sets, and WeakMaps.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to clone.
     * @param {boolean} [isDeep] Specify a deep clone.
     * @param {Function} [customizer] The function to customize cloning values.
     * @param {*} [thisArg] The `this` binding of `customizer`.
     * @returns {*} Returns the cloned value.
     * @example
     *
     * var users = [
     *   { 'user': 'barney' },
     *   { 'user': 'fred' }
     * ];
     *
     * var shallow = _.clone(users);
     * shallow[0] === users[0];
     * // => true
     *
     * var deep = _.clone(users, true);
     * deep[0] === users[0];
     * // => false
     *
     * // using a customizer callback
     * var el = _.clone(document.body, function(value) {
     *   if (_.isElement(value)) {
     *     return value.cloneNode(false);
     *   }
     * });
     *
     * el === document.body
     * // => false
     * el.nodeName
     * // => BODY
     * el.childNodes.length;
     * // => 0
     */
    function clone(value, isDeep, customizer, thisArg) {
      if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
        isDeep = false;
      }
      else if (typeof isDeep == 'function') {
        thisArg = customizer;
        customizer = isDeep;
        isDeep = false;
      }
      return typeof customizer == 'function'
        ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))
        : baseClone(value, isDeep);
    }

    /**
     * Creates a deep clone of `value`. If `customizer` is provided it is invoked
     * to produce the cloned values. If `customizer` returns `undefined` cloning
     * is handled by the method instead. The `customizer` is bound to `thisArg`
     * and invoked with two argument; (value [, index|key, object]).
     *
     * **Note:** This method is loosely based on the
     * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
     * The enumerable properties of `arguments` objects and objects created by
     * constructors other than `Object` are cloned to plain `Object` objects. An
     * empty object is returned for uncloneable values such as functions, DOM nodes,
     * Maps, Sets, and WeakMaps.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to deep clone.
     * @param {Function} [customizer] The function to customize cloning values.
     * @param {*} [thisArg] The `this` binding of `customizer`.
     * @returns {*} Returns the deep cloned value.
     * @example
     *
     * var users = [
     *   { 'user': 'barney' },
     *   { 'user': 'fred' }
     * ];
     *
     * var deep = _.cloneDeep(users);
     * deep[0] === users[0];
     * // => false
     *
     * // using a customizer callback
     * var el = _.cloneDeep(document.body, function(value) {
     *   if (_.isElement(value)) {
     *     return value.cloneNode(true);
     *   }
     * });
     *
     * el === document.body
     * // => false
     * el.nodeName
     * // => BODY
     * el.childNodes.length;
     * // => 20
     */
    function cloneDeep(value, customizer, thisArg) {
      return typeof customizer == 'function'
        ? baseClone(value, true, bindCallback(customizer, thisArg, 1))
        : baseClone(value, true);
    }

    /**
     * Checks if `value` is greater than `other`.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
     * @example
     *
     * _.gt(3, 1);
     * // => true
     *
     * _.gt(3, 3);
     * // => false
     *
     * _.gt(1, 3);
     * // => false
     */
    function gt(value, other) {
      return value > other;
    }

    /**
     * Checks if `value` is greater than or equal to `other`.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
     * @example
     *
     * _.gte(3, 1);
     * // => true
     *
     * _.gte(3, 3);
     * // => true
     *
     * _.gte(1, 3);
     * // => false
     */
    function gte(value, other) {
      return value >= other;
    }

    /**
     * Checks if `value` is classified as an `arguments` object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isArguments(function() { return arguments; }());
     * // => true
     *
     * _.isArguments([1, 2, 3]);
     * // => false
     */
    function isArguments(value) {
      return isObjectLike(value) && isArrayLike(value) &&
        hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
    }

    /**
     * Checks if `value` is classified as an `Array` object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isArray([1, 2, 3]);
     * // => true
     *
     * _.isArray(function() { return arguments; }());
     * // => false
     */
    var isArray = nativeIsArray || function(value) {
      return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
    };

    /**
     * Checks if `value` is classified as a boolean primitive or object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isBoolean(false);
     * // => true
     *
     * _.isBoolean(null);
     * // => false
     */
    function isBoolean(value) {
      return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);
    }

    /**
     * Checks if `value` is classified as a `Date` object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isDate(new Date);
     * // => true
     *
     * _.isDate('Mon April 23 2012');
     * // => false
     */
    function isDate(value) {
      return isObjectLike(value) && objToString.call(value) == dateTag;
    }

    /**
     * Checks if `value` is a DOM element.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
     * @example
     *
     * _.isElement(document.body);
     * // => true
     *
     * _.isElement('<body>');
     * // => false
     */
    function isElement(value) {
      return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
    }

    /**
     * Checks if `value` is empty. A value is considered empty unless it is an
     * `arguments` object, array, string, or jQuery-like collection with a length
     * greater than `0` or an object with own enumerable properties.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {Array|Object|string} value The value to inspect.
     * @returns {boolean} Returns `true` if `value` is empty, else `false`.
     * @example
     *
     * _.isEmpty(null);
     * // => true
     *
     * _.isEmpty(true);
     * // => true
     *
     * _.isEmpty(1);
     * // => true
     *
     * _.isEmpty([1, 2, 3]);
     * // => false
     *
     * _.isEmpty({ 'a': 1 });
     * // => false
     */
    function isEmpty(value) {
      if (value == null) {
        return true;
      }
      if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||
          (isObjectLike(value) && isFunction(value.splice)))) {
        return !value.length;
      }
      return !keys(value).length;
    }

    /**
     * Performs a deep comparison between two values to determine if they are
     * equivalent. If `customizer` is provided it is invoked to compare values.
     * If `customizer` returns `undefined` comparisons are handled by the method
     * instead. The `customizer` is bound to `thisArg` and invoked with three
     * arguments: (value, other [, index|key]).
     *
     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
     * numbers, `Object` objects, regexes, and strings. Objects are compared by
     * their own, not inherited, enumerable properties. Functions and DOM nodes
     * are **not** supported. Provide a customizer function to extend support
     * for comparing other values.
     *
     * @static
     * @memberOf _
     * @alias eq
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @param {Function} [customizer] The function to customize value comparisons.
     * @param {*} [thisArg] The `this` binding of `customizer`.
     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
     * @example
     *
     * var object = { 'user': 'fred' };
     * var other = { 'user': 'fred' };
     *
     * object == other;
     * // => false
     *
     * _.isEqual(object, other);
     * // => true
     *
     * // using a customizer callback
     * var array = ['hello', 'goodbye'];
     * var other = ['hi', 'goodbye'];
     *
     * _.isEqual(array, other, function(value, other) {
     *   if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
     *     return true;
     *   }
     * });
     * // => true
     */
    function isEqual(value, other, customizer, thisArg) {
      customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
      var result = customizer ? customizer(value, other) : undefined;
      return  result === undefined ? baseIsEqual(value, other, customizer) : !!result;
    }

    /**
     * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
     * `SyntaxError`, `TypeError`, or `URIError` object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
     * @example
     *
     * _.isError(new Error);
     * // => true
     *
     * _.isError(Error);
     * // => false
     */
    function isError(value) {
      return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
    }

    /**
     * Checks if `value` is a finite primitive number.
     *
     * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
     * @example
     *
     * _.isFinite(10);
     * // => true
     *
     * _.isFinite('10');
     * // => false
     *
     * _.isFinite(true);
     * // => false
     *
     * _.isFinite(Object(10));
     * // => false
     *
     * _.isFinite(Infinity);
     * // => false
     */
    function isFinite(value) {
      return typeof value == 'number' && nativeIsFinite(value);
    }

    /**
     * Checks if `value` is classified as a `Function` object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isFunction(_);
     * // => true
     *
     * _.isFunction(/abc/);
     * // => false
     */
    function isFunction(value) {
      // The use of `Object#toString` avoids issues with the `typeof` operator
      // in older versions of Chrome and Safari which return 'function' for regexes
      // and Safari 8 equivalents which return 'object' for typed array constructors.
      return isObject(value) && objToString.call(value) == funcTag;
    }

    /**
     * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
     * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
     * @example
     *
     * _.isObject({});
     * // => true
     *
     * _.isObject([1, 2, 3]);
     * // => true
     *
     * _.isObject(1);
     * // => false
     */
    function isObject(value) {
      // Avoid a V8 JIT bug in Chrome 19-20.
      // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
      var type = typeof value;
      return !!value && (type == 'object' || type == 'function');
    }

    /**
     * Performs a deep comparison between `object` and `source` to determine if
     * `object` contains equivalent property values. If `customizer` is provided
     * it is invoked to compare values. If `customizer` returns `undefined`
     * comparisons are handled by the method instead. The `customizer` is bound
     * to `thisArg` and invoked with three arguments: (value, other, index|key).
     *
     * **Note:** This method supports comparing properties of arrays, booleans,
     * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
     * and DOM nodes are **not** supported. Provide a customizer function to extend
     * support for comparing other values.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {Object} object The object to inspect.
     * @param {Object} source The object of property values to match.
     * @param {Function} [customizer] The function to customize value comparisons.
     * @param {*} [thisArg] The `this` binding of `customizer`.
     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
     * @example
     *
     * var object = { 'user': 'fred', 'age': 40 };
     *
     * _.isMatch(object, { 'age': 40 });
     * // => true
     *
     * _.isMatch(object, { 'age': 36 });
     * // => false
     *
     * // using a customizer callback
     * var object = { 'greeting': 'hello' };
     * var source = { 'greeting': 'hi' };
     *
     * _.isMatch(object, source, function(value, other) {
     *   return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
     * });
     * // => true
     */
    function isMatch(object, source, customizer, thisArg) {
      customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
      return baseIsMatch(object, getMatchData(source), customizer);
    }

    /**
     * Checks if `value` is `NaN`.
     *
     * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
     * which returns `true` for `undefined` and other non-numeric values.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
     * @example
     *
     * _.isNaN(NaN);
     * // => true
     *
     * _.isNaN(new Number(NaN));
     * // => true
     *
     * isNaN(undefined);
     * // => true
     *
     * _.isNaN(undefined);
     * // => false
     */
    function isNaN(value) {
      // An `NaN` primitive is the only value that is not equal to itself.
      // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
      return isNumber(value) && value != +value;
    }

    /**
     * Checks if `value` is a native function.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
     * @example
     *
     * _.isNative(Array.prototype.push);
     * // => true
     *
     * _.isNative(_);
     * // => false
     */
    function isNative(value) {
      if (value == null) {
        return false;
      }
      if (isFunction(value)) {
        return reIsNative.test(fnToString.call(value));
      }
      return isObjectLike(value) && reIsHostCtor.test(value);
    }

    /**
     * Checks if `value` is `null`.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
     * @example
     *
     * _.isNull(null);
     * // => true
     *
     * _.isNull(void 0);
     * // => false
     */
    function isNull(value) {
      return value === null;
    }

    /**
     * Checks if `value` is classified as a `Number` primitive or object.
     *
     * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
     * as numbers, use the `_.isFinite` method.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isNumber(8.4);
     * // => true
     *
     * _.isNumber(NaN);
     * // => true
     *
     * _.isNumber('8.4');
     * // => false
     */
    function isNumber(value) {
      return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);
    }

    /**
     * Checks if `value` is a plain object, that is, an object created by the
     * `Object` constructor or one with a `[[Prototype]]` of `null`.
     *
     * **Note:** This method assumes objects created by the `Object` constructor
     * have no inherited enumerable properties.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     * }
     *
     * _.isPlainObject(new Foo);
     * // => false
     *
     * _.isPlainObject([1, 2, 3]);
     * // => false
     *
     * _.isPlainObject({ 'x': 0, 'y': 0 });
     * // => true
     *
     * _.isPlainObject(Object.create(null));
     * // => true
     */
    function isPlainObject(value) {
      var Ctor;

      // Exit early for non `Object` objects.
      if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||
          (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {
        return false;
      }
      // IE < 9 iterates inherited properties before own properties. If the first
      // iterated property is an object's own property then there are no inherited
      // enumerable properties.
      var result;
      // In most environments an object's own properties are iterated before
      // its inherited properties. If the last iterated property is an object's
      // own property then there are no inherited enumerable properties.
      baseForIn(value, function(subValue, key) {
        result = key;
      });
      return result === undefined || hasOwnProperty.call(value, result);
    }

    /**
     * Checks if `value` is classified as a `RegExp` object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isRegExp(/abc/);
     * // => true
     *
     * _.isRegExp('/abc/');
     * // => false
     */
    function isRegExp(value) {
      return isObject(value) && objToString.call(value) == regexpTag;
    }

    /**
     * Checks if `value` is classified as a `String` primitive or object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isString('abc');
     * // => true
     *
     * _.isString(1);
     * // => false
     */
    function isString(value) {
      return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);
    }

    /**
     * Checks if `value` is classified as a typed array.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
     * @example
     *
     * _.isTypedArray(new Uint8Array);
     * // => true
     *
     * _.isTypedArray([]);
     * // => false
     */
    function isTypedArray(value) {
      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
    }

    /**
     * Checks if `value` is `undefined`.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to check.
     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
     * @example
     *
     * _.isUndefined(void 0);
     * // => true
     *
     * _.isUndefined(null);
     * // => false
     */
    function isUndefined(value) {
      return value === undefined;
    }

    /**
     * Checks if `value` is less than `other`.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
     * @example
     *
     * _.lt(1, 3);
     * // => true
     *
     * _.lt(3, 3);
     * // => false
     *
     * _.lt(3, 1);
     * // => false
     */
    function lt(value, other) {
      return value < other;
    }

    /**
     * Checks if `value` is less than or equal to `other`.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to compare.
     * @param {*} other The other value to compare.
     * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
     * @example
     *
     * _.lte(1, 3);
     * // => true
     *
     * _.lte(3, 3);
     * // => true
     *
     * _.lte(3, 1);
     * // => false
     */
    function lte(value, other) {
      return value <= other;
    }

    /**
     * Converts `value` to an array.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {Array} Returns the converted array.
     * @example
     *
     * (function() {
     *   return _.toArray(arguments).slice(1);
     * }(1, 2, 3));
     * // => [2, 3]
     */
    function toArray(value) {
      var length = value ? getLength(value) : 0;
      if (!isLength(length)) {
        return values(value);
      }
      if (!length) {
        return [];
      }
      return arrayCopy(value);
    }

    /**
     * Converts `value` to a plain object flattening inherited enumerable
     * properties of `value` to own properties of the plain object.
     *
     * @static
     * @memberOf _
     * @category Lang
     * @param {*} value The value to convert.
     * @returns {Object} Returns the converted plain object.
     * @example
     *
     * function Foo() {
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.assign({ 'a': 1 }, new Foo);
     * // => { 'a': 1, 'b': 2 }
     *
     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
     * // => { 'a': 1, 'b': 2, 'c': 3 }
     */
    function toPlainObject(value) {
      return baseCopy(value, keysIn(value));
    }

    /*------------------------------------------------------------------------*/

    /**
     * Recursively merges own enumerable properties of the source object(s), that
     * don't resolve to `undefined` into the destination object. Subsequent sources
     * overwrite property assignments of previous sources. If `customizer` is
     * provided it is invoked to produce the merged values of the destination and
     * source properties. If `customizer` returns `undefined` merging is handled
     * by the method instead. The `customizer` is bound to `thisArg` and invoked
     * with five arguments: (objectValue, sourceValue, key, object, source).
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @param {Function} [customizer] The function to customize assigned values.
     * @param {*} [thisArg] The `this` binding of `customizer`.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var users = {
     *   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
     * };
     *
     * var ages = {
     *   'data': [{ 'age': 36 }, { 'age': 40 }]
     * };
     *
     * _.merge(users, ages);
     * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
     *
     * // using a customizer callback
     * var object = {
     *   'fruits': ['apple'],
     *   'vegetables': ['beet']
     * };
     *
     * var other = {
     *   'fruits': ['banana'],
     *   'vegetables': ['carrot']
     * };
     *
     * _.merge(object, other, function(a, b) {
     *   if (_.isArray(a)) {
     *     return a.concat(b);
     *   }
     * });
     * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
     */
    var merge = createAssigner(baseMerge);

    /**
     * Assigns own enumerable properties of source object(s) to the destination
     * object. Subsequent sources overwrite property assignments of previous sources.
     * If `customizer` is provided it is invoked to produce the assigned values.
     * The `customizer` is bound to `thisArg` and invoked with five arguments:
     * (objectValue, sourceValue, key, object, source).
     *
     * **Note:** This method mutates `object` and is based on
     * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
     *
     * @static
     * @memberOf _
     * @alias extend
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @param {Function} [customizer] The function to customize assigned values.
     * @param {*} [thisArg] The `this` binding of `customizer`.
     * @returns {Object} Returns `object`.
     * @example
     *
     * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
     * // => { 'user': 'fred', 'age': 40 }
     *
     * // using a customizer callback
     * var defaults = _.partialRight(_.assign, function(value, other) {
     *   return _.isUndefined(value) ? other : value;
     * });
     *
     * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
     * // => { 'user': 'barney', 'age': 36 }
     */
    var assign = createAssigner(function(object, source, customizer) {
      return customizer
        ? assignWith(object, source, customizer)
        : baseAssign(object, source);
    });

    /**
     * Creates an object that inherits from the given `prototype` object. If a
     * `properties` object is provided its own enumerable properties are assigned
     * to the created object.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} prototype The object to inherit from.
     * @param {Object} [properties] The properties to assign to the object.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Object} Returns the new object.
     * @example
     *
     * function Shape() {
     *   this.x = 0;
     *   this.y = 0;
     * }
     *
     * function Circle() {
     *   Shape.call(this);
     * }
     *
     * Circle.prototype = _.create(Shape.prototype, {
     *   'constructor': Circle
     * });
     *
     * var circle = new Circle;
     * circle instanceof Circle;
     * // => true
     *
     * circle instanceof Shape;
     * // => true
     */
    function create(prototype, properties, guard) {
      var result = baseCreate(prototype);
      if (guard && isIterateeCall(prototype, properties, guard)) {
        properties = undefined;
      }
      return properties ? baseAssign(result, properties) : result;
    }

    /**
     * Assigns own enumerable properties of source object(s) to the destination
     * object for all destination properties that resolve to `undefined`. Once a
     * property is set, additional values of the same property are ignored.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @example
     *
     * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
     * // => { 'user': 'barney', 'age': 36 }
     */
    var defaults = createDefaults(assign, assignDefaults);

    /**
     * This method is like `_.defaults` except that it recursively assigns
     * default properties.
     *
     * **Note:** This method mutates `object`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The destination object.
     * @param {...Object} [sources] The source objects.
     * @returns {Object} Returns `object`.
     * @example
     *
     * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
     * // => { 'user': { 'name': 'barney', 'age': 36 } }
     *
     */
    var defaultsDeep = createDefaults(merge, mergeDefaults);

    /**
     * This method is like `_.find` except that it returns the key of the first
     * element `predicate` returns truthy for instead of the element itself.
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to search.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
     * @example
     *
     * var users = {
     *   'barney':  { 'age': 36, 'active': true },
     *   'fred':    { 'age': 40, 'active': false },
     *   'pebbles': { 'age': 1,  'active': true }
     * };
     *
     * _.findKey(users, function(chr) {
     *   return chr.age < 40;
     * });
     * // => 'barney' (iteration order is not guaranteed)
     *
     * // using the `_.matches` callback shorthand
     * _.findKey(users, { 'age': 1, 'active': true });
     * // => 'pebbles'
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.findKey(users, 'active', false);
     * // => 'fred'
     *
     * // using the `_.property` callback shorthand
     * _.findKey(users, 'active');
     * // => 'barney'
     */
    var findKey = createFindKey(baseForOwn);

    /**
     * This method is like `_.findKey` except that it iterates over elements of
     * a collection in the opposite order.
     *
     * If a property name is provided for `predicate` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `predicate` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to search.
     * @param {Function|Object|string} [predicate=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
     * @example
     *
     * var users = {
     *   'barney':  { 'age': 36, 'active': true },
     *   'fred':    { 'age': 40, 'active': false },
     *   'pebbles': { 'age': 1,  'active': true }
     * };
     *
     * _.findLastKey(users, function(chr) {
     *   return chr.age < 40;
     * });
     * // => returns `pebbles` assuming `_.findKey` returns `barney`
     *
     * // using the `_.matches` callback shorthand
     * _.findLastKey(users, { 'age': 36, 'active': true });
     * // => 'barney'
     *
     * // using the `_.matchesProperty` callback shorthand
     * _.findLastKey(users, 'active', false);
     * // => 'fred'
     *
     * // using the `_.property` callback shorthand
     * _.findLastKey(users, 'active');
     * // => 'pebbles'
     */
    var findLastKey = createFindKey(baseForOwnRight);

    /**
     * Iterates over own and inherited enumerable properties of an object invoking
     * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
     * with three arguments: (value, key, object). Iteratee functions may exit
     * iteration early by explicitly returning `false`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns `object`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forIn(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
     */
    var forIn = createForIn(baseFor);

    /**
     * This method is like `_.forIn` except that it iterates over properties of
     * `object` in the opposite order.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns `object`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forInRight(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
     */
    var forInRight = createForIn(baseForRight);

    /**
     * Iterates over own enumerable properties of an object invoking `iteratee`
     * for each property. The `iteratee` is bound to `thisArg` and invoked with
     * three arguments: (value, key, object). Iteratee functions may exit iteration
     * early by explicitly returning `false`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns `object`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forOwn(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => logs 'a' and 'b' (iteration order is not guaranteed)
     */
    var forOwn = createForOwn(baseForOwn);

    /**
     * This method is like `_.forOwn` except that it iterates over properties of
     * `object` in the opposite order.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns `object`.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.forOwnRight(new Foo, function(value, key) {
     *   console.log(key);
     * });
     * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
     */
    var forOwnRight = createForOwn(baseForOwnRight);

    /**
     * Creates an array of function property names from all enumerable properties,
     * own and inherited, of `object`.
     *
     * @static
     * @memberOf _
     * @alias methods
     * @category Object
     * @param {Object} object The object to inspect.
     * @returns {Array} Returns the new array of property names.
     * @example
     *
     * _.functions(_);
     * // => ['after', 'ary', 'assign', ...]
     */
    function functions(object) {
      return baseFunctions(object, keysIn(object));
    }

    /**
     * Gets the property value at `path` of `object`. If the resolved value is
     * `undefined` the `defaultValue` is used in its place.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the property to get.
     * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
     * @returns {*} Returns the resolved value.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
     *
     * _.get(object, 'a[0].b.c');
     * // => 3
     *
     * _.get(object, ['a', '0', 'b', 'c']);
     * // => 3
     *
     * _.get(object, 'a.b.c', 'default');
     * // => 'default'
     */
    function get(object, path, defaultValue) {
      var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
      return result === undefined ? defaultValue : result;
    }

    /**
     * Checks if `path` is a direct property.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path to check.
     * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
     * @example
     *
     * var object = { 'a': { 'b': { 'c': 3 } } };
     *
     * _.has(object, 'a');
     * // => true
     *
     * _.has(object, 'a.b.c');
     * // => true
     *
     * _.has(object, ['a', 'b', 'c']);
     * // => true
     */
    function has(object, path) {
      if (object == null) {
        return false;
      }
      var result = hasOwnProperty.call(object, path);
      if (!result && !isKey(path)) {
        path = toPath(path);
        object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
        if (object == null) {
          return false;
        }
        path = last(path);
        result = hasOwnProperty.call(object, path);
      }
      return result || (isLength(object.length) && isIndex(path, object.length) &&
        (isArray(object) || isArguments(object)));
    }

    /**
     * Creates an object composed of the inverted keys and values of `object`.
     * If `object` contains duplicate values, subsequent values overwrite property
     * assignments of previous values unless `multiValue` is `true`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to invert.
     * @param {boolean} [multiValue] Allow multiple values per key.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Object} Returns the new inverted object.
     * @example
     *
     * var object = { 'a': 1, 'b': 2, 'c': 1 };
     *
     * _.invert(object);
     * // => { '1': 'c', '2': 'b' }
     *
     * // with `multiValue`
     * _.invert(object, true);
     * // => { '1': ['a', 'c'], '2': ['b'] }
     */
    function invert(object, multiValue, guard) {
      if (guard && isIterateeCall(object, multiValue, guard)) {
        multiValue = undefined;
      }
      var index = -1,
          props = keys(object),
          length = props.length,
          result = {};

      while (++index < length) {
        var key = props[index],
            value = object[key];

        if (multiValue) {
          if (hasOwnProperty.call(result, value)) {
            result[value].push(key);
          } else {
            result[value] = [key];
          }
        }
        else {
          result[value] = key;
        }
      }
      return result;
    }

    /**
     * Creates an array of the own enumerable property names of `object`.
     *
     * **Note:** Non-object values are coerced to objects. See the
     * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
     * for more details.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.keys(new Foo);
     * // => ['a', 'b'] (iteration order is not guaranteed)
     *
     * _.keys('hi');
     * // => ['0', '1']
     */
    var keys = !nativeKeys ? shimKeys : function(object) {
      var Ctor = object == null ? undefined : object.constructor;
      if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
          (typeof object != 'function' && isArrayLike(object))) {
        return shimKeys(object);
      }
      return isObject(object) ? nativeKeys(object) : [];
    };

    /**
     * Creates an array of the own and inherited enumerable property names of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property names.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.keysIn(new Foo);
     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
     */
    function keysIn(object) {
      if (object == null) {
        return [];
      }
      if (!isObject(object)) {
        object = Object(object);
      }
      var length = object.length;
      length = (length && isLength(length) &&
        (isArray(object) || isArguments(object)) && length) || 0;

      var Ctor = object.constructor,
          index = -1,
          isProto = typeof Ctor == 'function' && Ctor.prototype === object,
          result = Array(length),
          skipIndexes = length > 0;

      while (++index < length) {
        result[index] = (index + '');
      }
      for (var key in object) {
        if (!(skipIndexes && isIndex(key, length)) &&
            !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }

    /**
     * The opposite of `_.mapValues`; this method creates an object with the
     * same values as `object` and keys generated by running each own enumerable
     * property of `object` through `iteratee`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns the new mapped object.
     * @example
     *
     * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
     *   return key + value;
     * });
     * // => { 'a1': 1, 'b2': 2 }
     */
    var mapKeys = createObjectMapper(true);

    /**
     * Creates an object with the same keys as `object` and values generated by
     * running each own enumerable property of `object` through `iteratee`. The
     * iteratee function is bound to `thisArg` and invoked with three arguments:
     * (value, key, object).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to iterate over.
     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
     *  per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Object} Returns the new mapped object.
     * @example
     *
     * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
     *   return n * 3;
     * });
     * // => { 'a': 3, 'b': 6 }
     *
     * var users = {
     *   'fred':    { 'user': 'fred',    'age': 40 },
     *   'pebbles': { 'user': 'pebbles', 'age': 1 }
     * };
     *
     * // using the `_.property` callback shorthand
     * _.mapValues(users, 'age');
     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
     */
    var mapValues = createObjectMapper();

    /**
     * The opposite of `_.pick`; this method creates an object composed of the
     * own and inherited enumerable properties of `object` that are not omitted.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The source object.
     * @param {Function|...(string|string[])} [predicate] The function invoked per
     *  iteration or property names to omit, specified as individual property
     *  names or arrays of property names.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'user': 'fred', 'age': 40 };
     *
     * _.omit(object, 'age');
     * // => { 'user': 'fred' }
     *
     * _.omit(object, _.isNumber);
     * // => { 'user': 'fred' }
     */
    var omit = restParam(function(object, props) {
      if (object == null) {
        return {};
      }
      if (typeof props[0] != 'function') {
        var props = arrayMap(baseFlatten(props), String);
        return pickByArray(object, baseDifference(keysIn(object), props));
      }
      var predicate = bindCallback(props[0], props[1], 3);
      return pickByCallback(object, function(value, key, object) {
        return !predicate(value, key, object);
      });
    });

    /**
     * Creates a two dimensional array of the key-value pairs for `object`,
     * e.g. `[[key1, value1], [key2, value2]]`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the new array of key-value pairs.
     * @example
     *
     * _.pairs({ 'barney': 36, 'fred': 40 });
     * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
     */
    function pairs(object) {
      object = toObject(object);

      var index = -1,
          props = keys(object),
          length = props.length,
          result = Array(length);

      while (++index < length) {
        var key = props[index];
        result[index] = [key, object[key]];
      }
      return result;
    }

    /**
     * Creates an object composed of the picked `object` properties. Property
     * names may be specified as individual arguments or as arrays of property
     * names. If `predicate` is provided it is invoked for each property of `object`
     * picking the properties `predicate` returns truthy for. The predicate is
     * bound to `thisArg` and invoked with three arguments: (value, key, object).
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The source object.
     * @param {Function|...(string|string[])} [predicate] The function invoked per
     *  iteration or property names to pick, specified as individual property
     *  names or arrays of property names.
     * @param {*} [thisArg] The `this` binding of `predicate`.
     * @returns {Object} Returns the new object.
     * @example
     *
     * var object = { 'user': 'fred', 'age': 40 };
     *
     * _.pick(object, 'user');
     * // => { 'user': 'fred' }
     *
     * _.pick(object, _.isString);
     * // => { 'user': 'fred' }
     */
    var pick = restParam(function(object, props) {
      if (object == null) {
        return {};
      }
      return typeof props[0] == 'function'
        ? pickByCallback(object, bindCallback(props[0], props[1], 3))
        : pickByArray(object, baseFlatten(props));
    });

    /**
     * This method is like `_.get` except that if the resolved value is a function
     * it is invoked with the `this` binding of its parent object and its result
     * is returned.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @param {Array|string} path The path of the property to resolve.
     * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
     * @returns {*} Returns the resolved value.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
     *
     * _.result(object, 'a[0].b.c1');
     * // => 3
     *
     * _.result(object, 'a[0].b.c2');
     * // => 4
     *
     * _.result(object, 'a.b.c', 'default');
     * // => 'default'
     *
     * _.result(object, 'a.b.c', _.constant('default'));
     * // => 'default'
     */
    function result(object, path, defaultValue) {
      var result = object == null ? undefined : object[path];
      if (result === undefined) {
        if (object != null && !isKey(path, object)) {
          path = toPath(path);
          object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
          result = object == null ? undefined : object[last(path)];
        }
        result = result === undefined ? defaultValue : result;
      }
      return isFunction(result) ? result.call(object) : result;
    }

    /**
     * Sets the property value of `path` on `object`. If a portion of `path`
     * does not exist it is created.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to augment.
     * @param {Array|string} path The path of the property to set.
     * @param {*} value The value to set.
     * @returns {Object} Returns `object`.
     * @example
     *
     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
     *
     * _.set(object, 'a[0].b.c', 4);
     * console.log(object.a[0].b.c);
     * // => 4
     *
     * _.set(object, 'x[0].y.z', 5);
     * console.log(object.x[0].y.z);
     * // => 5
     */
    function set(object, path, value) {
      if (object == null) {
        return object;
      }
      var pathKey = (path + '');
      path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);

      var index = -1,
          length = path.length,
          lastIndex = length - 1,
          nested = object;

      while (nested != null && ++index < length) {
        var key = path[index];
        if (isObject(nested)) {
          if (index == lastIndex) {
            nested[key] = value;
          } else if (nested[key] == null) {
            nested[key] = isIndex(path[index + 1]) ? [] : {};
          }
        }
        nested = nested[key];
      }
      return object;
    }

    /**
     * An alternative to `_.reduce`; this method transforms `object` to a new
     * `accumulator` object which is the result of running each of its own enumerable
     * properties through `iteratee`, with each invocation potentially mutating
     * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
     * with four arguments: (accumulator, value, key, object). Iteratee functions
     * may exit iteration early by explicitly returning `false`.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Array|Object} object The object to iterate over.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [accumulator] The custom accumulator value.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {*} Returns the accumulated value.
     * @example
     *
     * _.transform([2, 3, 4], function(result, n) {
     *   result.push(n *= n);
     *   return n % 2 == 0;
     * });
     * // => [4, 9]
     *
     * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
     *   result[key] = n * 3;
     * });
     * // => { 'a': 3, 'b': 6 }
     */
    function transform(object, iteratee, accumulator, thisArg) {
      var isArr = isArray(object) || isTypedArray(object);
      iteratee = getCallback(iteratee, thisArg, 4);

      if (accumulator == null) {
        if (isArr || isObject(object)) {
          var Ctor = object.constructor;
          if (isArr) {
            accumulator = isArray(object) ? new Ctor : [];
          } else {
            accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
          }
        } else {
          accumulator = {};
        }
      }
      (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {
        return iteratee(accumulator, value, index, object);
      });
      return accumulator;
    }

    /**
     * Creates an array of the own enumerable property values of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property values.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.values(new Foo);
     * // => [1, 2] (iteration order is not guaranteed)
     *
     * _.values('hi');
     * // => ['h', 'i']
     */
    function values(object) {
      return baseValues(object, keys(object));
    }

    /**
     * Creates an array of the own and inherited enumerable property values
     * of `object`.
     *
     * **Note:** Non-object values are coerced to objects.
     *
     * @static
     * @memberOf _
     * @category Object
     * @param {Object} object The object to query.
     * @returns {Array} Returns the array of property values.
     * @example
     *
     * function Foo() {
     *   this.a = 1;
     *   this.b = 2;
     * }
     *
     * Foo.prototype.c = 3;
     *
     * _.valuesIn(new Foo);
     * // => [1, 2, 3] (iteration order is not guaranteed)
     */
    function valuesIn(object) {
      return baseValues(object, keysIn(object));
    }

    /*------------------------------------------------------------------------*/

    /**
     * Checks if `n` is between `start` and up to but not including, `end`. If
     * `end` is not specified it is set to `start` with `start` then set to `0`.
     *
     * @static
     * @memberOf _
     * @category Number
     * @param {number} n The number to check.
     * @param {number} [start=0] The start of the range.
     * @param {number} end The end of the range.
     * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
     * @example
     *
     * _.inRange(3, 2, 4);
     * // => true
     *
     * _.inRange(4, 8);
     * // => true
     *
     * _.inRange(4, 2);
     * // => false
     *
     * _.inRange(2, 2);
     * // => false
     *
     * _.inRange(1.2, 2);
     * // => true
     *
     * _.inRange(5.2, 4);
     * // => false
     */
    function inRange(value, start, end) {
      start = +start || 0;
      if (end === undefined) {
        end = start;
        start = 0;
      } else {
        end = +end || 0;
      }
      return value >= nativeMin(start, end) && value < nativeMax(start, end);
    }

    /**
     * Produces a random number between `min` and `max` (inclusive). If only one
     * argument is provided a number between `0` and the given number is returned.
     * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
     * number is returned instead of an integer.
     *
     * @static
     * @memberOf _
     * @category Number
     * @param {number} [min=0] The minimum possible value.
     * @param {number} [max=1] The maximum possible value.
     * @param {boolean} [floating] Specify returning a floating-point number.
     * @returns {number} Returns the random number.
     * @example
     *
     * _.random(0, 5);
     * // => an integer between 0 and 5
     *
     * _.random(5);
     * // => also an integer between 0 and 5
     *
     * _.random(5, true);
     * // => a floating-point number between 0 and 5
     *
     * _.random(1.2, 5.2);
     * // => a floating-point number between 1.2 and 5.2
     */
    function random(min, max, floating) {
      if (floating && isIterateeCall(min, max, floating)) {
        max = floating = undefined;
      }
      var noMin = min == null,
          noMax = max == null;

      if (floating == null) {
        if (noMax && typeof min == 'boolean') {
          floating = min;
          min = 1;
        }
        else if (typeof max == 'boolean') {
          floating = max;
          noMax = true;
        }
      }
      if (noMin && noMax) {
        max = 1;
        noMax = false;
      }
      min = +min || 0;
      if (noMax) {
        max = min;
        min = 0;
      } else {
        max = +max || 0;
      }
      if (floating || min % 1 || max % 1) {
        var rand = nativeRandom();
        return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);
      }
      return baseRandom(min, max);
    }

    /*------------------------------------------------------------------------*/

    /**
     * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the camel cased string.
     * @example
     *
     * _.camelCase('Foo Bar');
     * // => 'fooBar'
     *
     * _.camelCase('--foo-bar');
     * // => 'fooBar'
     *
     * _.camelCase('__foo_bar__');
     * // => 'fooBar'
     */
    var camelCase = createCompounder(function(result, word, index) {
      word = word.toLowerCase();
      return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);
    });

    /**
     * Capitalizes the first character of `string`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to capitalize.
     * @returns {string} Returns the capitalized string.
     * @example
     *
     * _.capitalize('fred');
     * // => 'Fred'
     */
    function capitalize(string) {
      string = baseToString(string);
      return string && (string.charAt(0).toUpperCase() + string.slice(1));
    }

    /**
     * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
     * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to deburr.
     * @returns {string} Returns the deburred string.
     * @example
     *
     * _.deburr('déjà vu');
     * // => 'deja vu'
     */
    function deburr(string) {
      string = baseToString(string);
      return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
    }

    /**
     * Checks if `string` ends with the given target string.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to search.
     * @param {string} [target] The string to search for.
     * @param {number} [position=string.length] The position to search from.
     * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
     * @example
     *
     * _.endsWith('abc', 'c');
     * // => true
     *
     * _.endsWith('abc', 'b');
     * // => false
     *
     * _.endsWith('abc', 'b', 2);
     * // => true
     */
    function endsWith(string, target, position) {
      string = baseToString(string);
      target = (target + '');

      var length = string.length;
      position = position === undefined
        ? length
        : nativeMin(position < 0 ? 0 : (+position || 0), length);

      position -= target.length;
      return position >= 0 && string.indexOf(target, position) == position;
    }

    /**
     * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
     * their corresponding HTML entities.
     *
     * **Note:** No other characters are escaped. To escape additional characters
     * use a third-party library like [_he_](https://mths.be/he).
     *
     * Though the ">" character is escaped for symmetry, characters like
     * ">" and "/" don't need escaping in HTML and have no special meaning
     * unless they're part of a tag or unquoted attribute value.
     * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
     * (under "semi-related fun fact") for more details.
     *
     * Backticks are escaped because in Internet Explorer < 9, they can break out
     * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
     * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
     * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
     * for more details.
     *
     * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
     * to reduce XSS vectors.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to escape.
     * @returns {string} Returns the escaped string.
     * @example
     *
     * _.escape('fred, barney, & pebbles');
     * // => 'fred, barney, &amp; pebbles'
     */
    function escape(string) {
      // Reset `lastIndex` because in IE < 9 `String#replace` does not.
      string = baseToString(string);
      return (string && reHasUnescapedHtml.test(string))
        ? string.replace(reUnescapedHtml, escapeHtmlChar)
        : string;
    }

    /**
     * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
     * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to escape.
     * @returns {string} Returns the escaped string.
     * @example
     *
     * _.escapeRegExp('[lodash](https://lodash.com/)');
     * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
     */
    function escapeRegExp(string) {
      string = baseToString(string);
      return (string && reHasRegExpChars.test(string))
        ? string.replace(reRegExpChars, escapeRegExpChar)
        : (string || '(?:)');
    }

    /**
     * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the kebab cased string.
     * @example
     *
     * _.kebabCase('Foo Bar');
     * // => 'foo-bar'
     *
     * _.kebabCase('fooBar');
     * // => 'foo-bar'
     *
     * _.kebabCase('__foo_bar__');
     * // => 'foo-bar'
     */
    var kebabCase = createCompounder(function(result, word, index) {
      return result + (index ? '-' : '') + word.toLowerCase();
    });

    /**
     * Pads `string` on the left and right sides if it's shorter than `length`.
     * Padding characters are truncated if they can't be evenly divided by `length`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to pad.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padded string.
     * @example
     *
     * _.pad('abc', 8);
     * // => '  abc   '
     *
     * _.pad('abc', 8, '_-');
     * // => '_-abc_-_'
     *
     * _.pad('abc', 3);
     * // => 'abc'
     */
    function pad(string, length, chars) {
      string = baseToString(string);
      length = +length;

      var strLength = string.length;
      if (strLength >= length || !nativeIsFinite(length)) {
        return string;
      }
      var mid = (length - strLength) / 2,
          leftLength = nativeFloor(mid),
          rightLength = nativeCeil(mid);

      chars = createPadding('', rightLength, chars);
      return chars.slice(0, leftLength) + string + chars;
    }

    /**
     * Pads `string` on the left side if it's shorter than `length`. Padding
     * characters are truncated if they exceed `length`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to pad.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padded string.
     * @example
     *
     * _.padLeft('abc', 6);
     * // => '   abc'
     *
     * _.padLeft('abc', 6, '_-');
     * // => '_-_abc'
     *
     * _.padLeft('abc', 3);
     * // => 'abc'
     */
    var padLeft = createPadDir();

    /**
     * Pads `string` on the right side if it's shorter than `length`. Padding
     * characters are truncated if they exceed `length`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to pad.
     * @param {number} [length=0] The padding length.
     * @param {string} [chars=' '] The string used as padding.
     * @returns {string} Returns the padded string.
     * @example
     *
     * _.padRight('abc', 6);
     * // => 'abc   '
     *
     * _.padRight('abc', 6, '_-');
     * // => 'abc_-_'
     *
     * _.padRight('abc', 3);
     * // => 'abc'
     */
    var padRight = createPadDir(true);

    /**
     * Converts `string` to an integer of the specified radix. If `radix` is
     * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
     * in which case a `radix` of `16` is used.
     *
     * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
     * of `parseInt`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} string The string to convert.
     * @param {number} [radix] The radix to interpret `value` by.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {number} Returns the converted integer.
     * @example
     *
     * _.parseInt('08');
     * // => 8
     *
     * _.map(['6', '08', '10'], _.parseInt);
     * // => [6, 8, 10]
     */
    function parseInt(string, radix, guard) {
      // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
      // Chrome fails to trim leading <BOM> whitespace characters.
      // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
      if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
        radix = 0;
      } else if (radix) {
        radix = +radix;
      }
      string = trim(string);
      return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
    }

    /**
     * Repeats the given string `n` times.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to repeat.
     * @param {number} [n=0] The number of times to repeat the string.
     * @returns {string} Returns the repeated string.
     * @example
     *
     * _.repeat('*', 3);
     * // => '***'
     *
     * _.repeat('abc', 2);
     * // => 'abcabc'
     *
     * _.repeat('abc', 0);
     * // => ''
     */
    function repeat(string, n) {
      var result = '';
      string = baseToString(string);
      n = +n;
      if (n < 1 || !string || !nativeIsFinite(n)) {
        return result;
      }
      // Leverage the exponentiation by squaring algorithm for a faster repeat.
      // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
      do {
        if (n % 2) {
          result += string;
        }
        n = nativeFloor(n / 2);
        string += string;
      } while (n);

      return result;
    }

    /**
     * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the snake cased string.
     * @example
     *
     * _.snakeCase('Foo Bar');
     * // => 'foo_bar'
     *
     * _.snakeCase('fooBar');
     * // => 'foo_bar'
     *
     * _.snakeCase('--foo-bar');
     * // => 'foo_bar'
     */
    var snakeCase = createCompounder(function(result, word, index) {
      return result + (index ? '_' : '') + word.toLowerCase();
    });

    /**
     * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to convert.
     * @returns {string} Returns the start cased string.
     * @example
     *
     * _.startCase('--foo-bar');
     * // => 'Foo Bar'
     *
     * _.startCase('fooBar');
     * // => 'Foo Bar'
     *
     * _.startCase('__foo_bar__');
     * // => 'Foo Bar'
     */
    var startCase = createCompounder(function(result, word, index) {
      return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
    });

    /**
     * Checks if `string` starts with the given target string.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to search.
     * @param {string} [target] The string to search for.
     * @param {number} [position=0] The position to search from.
     * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
     * @example
     *
     * _.startsWith('abc', 'a');
     * // => true
     *
     * _.startsWith('abc', 'b');
     * // => false
     *
     * _.startsWith('abc', 'b', 1);
     * // => true
     */
    function startsWith(string, target, position) {
      string = baseToString(string);
      position = position == null
        ? 0
        : nativeMin(position < 0 ? 0 : (+position || 0), string.length);

      return string.lastIndexOf(target, position) == position;
    }

    /**
     * Creates a compiled template function that can interpolate data properties
     * in "interpolate" delimiters, HTML-escape interpolated data properties in
     * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
     * properties may be accessed as free variables in the template. If a setting
     * object is provided it takes precedence over `_.templateSettings` values.
     *
     * **Note:** In the development build `_.template` utilizes
     * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
     * for easier debugging.
     *
     * For more information on precompiling templates see
     * [lodash's custom builds documentation](https://lodash.com/custom-builds).
     *
     * For more information on Chrome extension sandboxes see
     * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The template string.
     * @param {Object} [options] The options object.
     * @param {RegExp} [options.escape] The HTML "escape" delimiter.
     * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
     * @param {Object} [options.imports] An object to import into the template as free variables.
     * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
     * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
     * @param {string} [options.variable] The data object variable name.
     * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
     * @returns {Function} Returns the compiled template function.
     * @example
     *
     * // using the "interpolate" delimiter to create a compiled template
     * var compiled = _.template('hello <%= user %>!');
     * compiled({ 'user': 'fred' });
     * // => 'hello fred!'
     *
     * // using the HTML "escape" delimiter to escape data property values
     * var compiled = _.template('<b><%- value %></b>');
     * compiled({ 'value': '<script>' });
     * // => '<b>&lt;script&gt;</b>'
     *
     * // using the "evaluate" delimiter to execute JavaScript and generate HTML
     * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
     * compiled({ 'users': ['fred', 'barney'] });
     * // => '<li>fred</li><li>barney</li>'
     *
     * // using the internal `print` function in "evaluate" delimiters
     * var compiled = _.template('<% print("hello " + user); %>!');
     * compiled({ 'user': 'barney' });
     * // => 'hello barney!'
     *
     * // using the ES delimiter as an alternative to the default "interpolate" delimiter
     * var compiled = _.template('hello ${ user }!');
     * compiled({ 'user': 'pebbles' });
     * // => 'hello pebbles!'
     *
     * // using custom template delimiters
     * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
     * var compiled = _.template('hello {{ user }}!');
     * compiled({ 'user': 'mustache' });
     * // => 'hello mustache!'
     *
     * // using backslashes to treat delimiters as plain text
     * var compiled = _.template('<%= "\\<%- value %\\>" %>');
     * compiled({ 'value': 'ignored' });
     * // => '<%- value %>'
     *
     * // using the `imports` option to import `jQuery` as `jq`
     * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
     * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
     * compiled({ 'users': ['fred', 'barney'] });
     * // => '<li>fred</li><li>barney</li>'
     *
     * // using the `sourceURL` option to specify a custom sourceURL for the template
     * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
     * compiled(data);
     * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
     *
     * // using the `variable` option to ensure a with-statement isn't used in the compiled template
     * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
     * compiled.source;
     * // => function(data) {
     * //   var __t, __p = '';
     * //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
     * //   return __p;
     * // }
     *
     * // using the `source` property to inline compiled templates for meaningful
     * // line numbers in error messages and a stack trace
     * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
     *   var JST = {\
     *     "main": ' + _.template(mainText).source + '\
     *   };\
     * ');
     */
    function template(string, options, otherOptions) {
      // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
      // and Laura Doktorova's doT.js (https://github.com/olado/doT).
      var settings = lodash.templateSettings;

      if (otherOptions && isIterateeCall(string, options, otherOptions)) {
        options = otherOptions = undefined;
      }
      string = baseToString(string);
      options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);

      var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),
          importsKeys = keys(imports),
          importsValues = baseValues(imports, importsKeys);

      var isEscaping,
          isEvaluating,
          index = 0,
          interpolate = options.interpolate || reNoMatch,
          source = "__p += '";

      // Compile the regexp to match each delimiter.
      var reDelimiters = RegExp(
        (options.escape || reNoMatch).source + '|' +
        interpolate.source + '|' +
        (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
        (options.evaluate || reNoMatch).source + '|$'
      , 'g');

      // Use a sourceURL for easier debugging.
      var sourceURL = '//# sourceURL=' +
        ('sourceURL' in options
          ? options.sourceURL
          : ('lodash.templateSources[' + (++templateCounter) + ']')
        ) + '\n';

      string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
        interpolateValue || (interpolateValue = esTemplateValue);

        // Escape characters that can't be included in string literals.
        source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);

        // Replace delimiters with snippets.
        if (escapeValue) {
          isEscaping = true;
          source += "' +\n__e(" + escapeValue + ") +\n'";
        }
        if (evaluateValue) {
          isEvaluating = true;
          source += "';\n" + evaluateValue + ";\n__p += '";
        }
        if (interpolateValue) {
          source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
        }
        index = offset + match.length;

        // The JS engine embedded in Adobe products requires returning the `match`
        // string in order to produce the correct `offset` value.
        return match;
      });

      source += "';\n";

      // If `variable` is not specified wrap a with-statement around the generated
      // code to add the data object to the top of the scope chain.
      var variable = options.variable;
      if (!variable) {
        source = 'with (obj) {\n' + source + '\n}\n';
      }
      // Cleanup code by stripping empty strings.
      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
        .replace(reEmptyStringMiddle, '$1')
        .replace(reEmptyStringTrailing, '$1;');

      // Frame code as the function body.
      source = 'function(' + (variable || 'obj') + ') {\n' +
        (variable
          ? ''
          : 'obj || (obj = {});\n'
        ) +
        "var __t, __p = ''" +
        (isEscaping
           ? ', __e = _.escape'
           : ''
        ) +
        (isEvaluating
          ? ', __j = Array.prototype.join;\n' +
            "function print() { __p += __j.call(arguments, '') }\n"
          : ';\n'
        ) +
        source +
        'return __p\n}';

      var result = attempt(function() {
        return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
      });

      // Provide the compiled function's source by its `toString` method or
      // the `source` property as a convenience for inlining compiled templates.
      result.source = source;
      if (isError(result)) {
        throw result;
      }
      return result;
    }

    /**
     * Removes leading and trailing whitespace or specified characters from `string`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to trim.
     * @param {string} [chars=whitespace] The characters to trim.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {string} Returns the trimmed string.
     * @example
     *
     * _.trim('  abc  ');
     * // => 'abc'
     *
     * _.trim('-_-abc-_-', '_-');
     * // => 'abc'
     *
     * _.map(['  foo  ', '  bar  '], _.trim);
     * // => ['foo', 'bar']
     */
    function trim(string, chars, guard) {
      var value = string;
      string = baseToString(string);
      if (!string) {
        return string;
      }
      if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
        return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
      }
      chars = (chars + '');
      return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
    }

    /**
     * Removes leading whitespace or specified characters from `string`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to trim.
     * @param {string} [chars=whitespace] The characters to trim.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {string} Returns the trimmed string.
     * @example
     *
     * _.trimLeft('  abc  ');
     * // => 'abc  '
     *
     * _.trimLeft('-_-abc-_-', '_-');
     * // => 'abc-_-'
     */
    function trimLeft(string, chars, guard) {
      var value = string;
      string = baseToString(string);
      if (!string) {
        return string;
      }
      if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
        return string.slice(trimmedLeftIndex(string));
      }
      return string.slice(charsLeftIndex(string, (chars + '')));
    }

    /**
     * Removes trailing whitespace or specified characters from `string`.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to trim.
     * @param {string} [chars=whitespace] The characters to trim.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {string} Returns the trimmed string.
     * @example
     *
     * _.trimRight('  abc  ');
     * // => '  abc'
     *
     * _.trimRight('-_-abc-_-', '_-');
     * // => '-_-abc'
     */
    function trimRight(string, chars, guard) {
      var value = string;
      string = baseToString(string);
      if (!string) {
        return string;
      }
      if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
        return string.slice(0, trimmedRightIndex(string) + 1);
      }
      return string.slice(0, charsRightIndex(string, (chars + '')) + 1);
    }

    /**
     * Truncates `string` if it's longer than the given maximum string length.
     * The last characters of the truncated string are replaced with the omission
     * string which defaults to "...".
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to truncate.
     * @param {Object|number} [options] The options object or maximum string length.
     * @param {number} [options.length=30] The maximum string length.
     * @param {string} [options.omission='...'] The string to indicate text is omitted.
     * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {string} Returns the truncated string.
     * @example
     *
     * _.trunc('hi-diddly-ho there, neighborino');
     * // => 'hi-diddly-ho there, neighbo...'
     *
     * _.trunc('hi-diddly-ho there, neighborino', 24);
     * // => 'hi-diddly-ho there, n...'
     *
     * _.trunc('hi-diddly-ho there, neighborino', {
     *   'length': 24,
     *   'separator': ' '
     * });
     * // => 'hi-diddly-ho there,...'
     *
     * _.trunc('hi-diddly-ho there, neighborino', {
     *   'length': 24,
     *   'separator': /,? +/
     * });
     * // => 'hi-diddly-ho there...'
     *
     * _.trunc('hi-diddly-ho there, neighborino', {
     *   'omission': ' [...]'
     * });
     * // => 'hi-diddly-ho there, neig [...]'
     */
    function trunc(string, options, guard) {
      if (guard && isIterateeCall(string, options, guard)) {
        options = undefined;
      }
      var length = DEFAULT_TRUNC_LENGTH,
          omission = DEFAULT_TRUNC_OMISSION;

      if (options != null) {
        if (isObject(options)) {
          var separator = 'separator' in options ? options.separator : separator;
          length = 'length' in options ? (+options.length || 0) : length;
          omission = 'omission' in options ? baseToString(options.omission) : omission;
        } else {
          length = +options || 0;
        }
      }
      string = baseToString(string);
      if (length >= string.length) {
        return string;
      }
      var end = length - omission.length;
      if (end < 1) {
        return omission;
      }
      var result = string.slice(0, end);
      if (separator == null) {
        return result + omission;
      }
      if (isRegExp(separator)) {
        if (string.slice(end).search(separator)) {
          var match,
              newEnd,
              substring = string.slice(0, end);

          if (!separator.global) {
            separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
          }
          separator.lastIndex = 0;
          while ((match = separator.exec(substring))) {
            newEnd = match.index;
          }
          result = result.slice(0, newEnd == null ? end : newEnd);
        }
      } else if (string.indexOf(separator, end) != end) {
        var index = result.lastIndexOf(separator);
        if (index > -1) {
          result = result.slice(0, index);
        }
      }
      return result + omission;
    }

    /**
     * The inverse of `_.escape`; this method converts the HTML entities
     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
     * corresponding characters.
     *
     * **Note:** No other HTML entities are unescaped. To unescape additional HTML
     * entities use a third-party library like [_he_](https://mths.be/he).
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to unescape.
     * @returns {string} Returns the unescaped string.
     * @example
     *
     * _.unescape('fred, barney, &amp; pebbles');
     * // => 'fred, barney, & pebbles'
     */
    function unescape(string) {
      string = baseToString(string);
      return (string && reHasEscapedHtml.test(string))
        ? string.replace(reEscapedHtml, unescapeHtmlChar)
        : string;
    }

    /**
     * Splits `string` into an array of its words.
     *
     * @static
     * @memberOf _
     * @category String
     * @param {string} [string=''] The string to inspect.
     * @param {RegExp|string} [pattern] The pattern to match words.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Array} Returns the words of `string`.
     * @example
     *
     * _.words('fred, barney, & pebbles');
     * // => ['fred', 'barney', 'pebbles']
     *
     * _.words('fred, barney, & pebbles', /[^, ]+/g);
     * // => ['fred', 'barney', '&', 'pebbles']
     */
    function words(string, pattern, guard) {
      if (guard && isIterateeCall(string, pattern, guard)) {
        pattern = undefined;
      }
      string = baseToString(string);
      return string.match(pattern || reWords) || [];
    }

    /*------------------------------------------------------------------------*/

    /**
     * Attempts to invoke `func`, returning either the result or the caught error
     * object. Any additional arguments are provided to `func` when it is invoked.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Function} func The function to attempt.
     * @returns {*} Returns the `func` result or error object.
     * @example
     *
     * // avoid throwing errors for invalid selectors
     * var elements = _.attempt(function(selector) {
     *   return document.querySelectorAll(selector);
     * }, '>_>');
     *
     * if (_.isError(elements)) {
     *   elements = [];
     * }
     */
    var attempt = restParam(function(func, args) {
      try {
        return func.apply(undefined, args);
      } catch(e) {
        return isError(e) ? e : new Error(e);
      }
    });

    /**
     * Creates a function that invokes `func` with the `this` binding of `thisArg`
     * and arguments of the created function. If `func` is a property name the
     * created callback returns the property value for a given element. If `func`
     * is an object the created callback returns `true` for elements that contain
     * the equivalent object properties, otherwise it returns `false`.
     *
     * @static
     * @memberOf _
     * @alias iteratee
     * @category Utility
     * @param {*} [func=_.identity] The value to convert to a callback.
     * @param {*} [thisArg] The `this` binding of `func`.
     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
     * @returns {Function} Returns the callback.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 }
     * ];
     *
     * // wrap to create custom callback shorthands
     * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
     *   var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
     *   if (!match) {
     *     return callback(func, thisArg);
     *   }
     *   return function(object) {
     *     return match[2] == 'gt'
     *       ? object[match[1]] > match[3]
     *       : object[match[1]] < match[3];
     *   };
     * });
     *
     * _.filter(users, 'age__gt36');
     * // => [{ 'user': 'fred', 'age': 40 }]
     */
    function callback(func, thisArg, guard) {
      if (guard && isIterateeCall(func, thisArg, guard)) {
        thisArg = undefined;
      }
      return isObjectLike(func)
        ? matches(func)
        : baseCallback(func, thisArg);
    }

    /**
     * Creates a function that returns `value`.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {*} value The value to return from the new function.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var object = { 'user': 'fred' };
     * var getter = _.constant(object);
     *
     * getter() === object;
     * // => true
     */
    function constant(value) {
      return function() {
        return value;
      };
    }

    /**
     * This method returns the first argument provided to it.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {*} value Any value.
     * @returns {*} Returns `value`.
     * @example
     *
     * var object = { 'user': 'fred' };
     *
     * _.identity(object) === object;
     * // => true
     */
    function identity(value) {
      return value;
    }

    /**
     * Creates a function that performs a deep comparison between a given object
     * and `source`, returning `true` if the given object has equivalent property
     * values, else `false`.
     *
     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
     * numbers, `Object` objects, regexes, and strings. Objects are compared by
     * their own, not inherited, enumerable properties. For comparing a single
     * own or inherited property value see `_.matchesProperty`.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Object} source The object of property values to match.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36, 'active': true },
     *   { 'user': 'fred',   'age': 40, 'active': false }
     * ];
     *
     * _.filter(users, _.matches({ 'age': 40, 'active': false }));
     * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
     */
    function matches(source) {
      return baseMatches(baseClone(source, true));
    }

    /**
     * Creates a function that compares the property value of `path` on a given
     * object to `value`.
     *
     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
     * numbers, `Object` objects, regexes, and strings. Objects are compared by
     * their own, not inherited, enumerable properties.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Array|string} path The path of the property to get.
     * @param {*} srcValue The value to match.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var users = [
     *   { 'user': 'barney' },
     *   { 'user': 'fred' }
     * ];
     *
     * _.find(users, _.matchesProperty('user', 'fred'));
     * // => { 'user': 'fred' }
     */
    function matchesProperty(path, srcValue) {
      return baseMatchesProperty(path, baseClone(srcValue, true));
    }

    /**
     * Creates a function that invokes the method at `path` on a given object.
     * Any additional arguments are provided to the invoked method.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Array|string} path The path of the method to invoke.
     * @param {...*} [args] The arguments to invoke the method with.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var objects = [
     *   { 'a': { 'b': { 'c': _.constant(2) } } },
     *   { 'a': { 'b': { 'c': _.constant(1) } } }
     * ];
     *
     * _.map(objects, _.method('a.b.c'));
     * // => [2, 1]
     *
     * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
     * // => [1, 2]
     */
    var method = restParam(function(path, args) {
      return function(object) {
        return invokePath(object, path, args);
      };
    });

    /**
     * The opposite of `_.method`; this method creates a function that invokes
     * the method at a given path on `object`. Any additional arguments are
     * provided to the invoked method.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Object} object The object to query.
     * @param {...*} [args] The arguments to invoke the method with.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var array = _.times(3, _.constant),
     *     object = { 'a': array, 'b': array, 'c': array };
     *
     * _.map(['a[2]', 'c[0]'], _.methodOf(object));
     * // => [2, 0]
     *
     * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
     * // => [2, 0]
     */
    var methodOf = restParam(function(object, args) {
      return function(path) {
        return invokePath(object, path, args);
      };
    });

    /**
     * Adds all own enumerable function properties of a source object to the
     * destination object. If `object` is a function then methods are added to
     * its prototype as well.
     *
     * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
     * avoid conflicts caused by modifying the original.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Function|Object} [object=lodash] The destination object.
     * @param {Object} source The object of functions to add.
     * @param {Object} [options] The options object.
     * @param {boolean} [options.chain=true] Specify whether the functions added
     *  are chainable.
     * @returns {Function|Object} Returns `object`.
     * @example
     *
     * function vowels(string) {
     *   return _.filter(string, function(v) {
     *     return /[aeiou]/i.test(v);
     *   });
     * }
     *
     * _.mixin({ 'vowels': vowels });
     * _.vowels('fred');
     * // => ['e']
     *
     * _('fred').vowels().value();
     * // => ['e']
     *
     * _.mixin({ 'vowels': vowels }, { 'chain': false });
     * _('fred').vowels();
     * // => ['e']
     */
    function mixin(object, source, options) {
      if (options == null) {
        var isObj = isObject(source),
            props = isObj ? keys(source) : undefined,
            methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;

        if (!(methodNames ? methodNames.length : isObj)) {
          methodNames = false;
          options = source;
          source = object;
          object = this;
        }
      }
      if (!methodNames) {
        methodNames = baseFunctions(source, keys(source));
      }
      var chain = true,
          index = -1,
          isFunc = isFunction(object),
          length = methodNames.length;

      if (options === false) {
        chain = false;
      } else if (isObject(options) && 'chain' in options) {
        chain = options.chain;
      }
      while (++index < length) {
        var methodName = methodNames[index],
            func = source[methodName];

        object[methodName] = func;
        if (isFunc) {
          object.prototype[methodName] = (function(func) {
            return function() {
              var chainAll = this.__chain__;
              if (chain || chainAll) {
                var result = object(this.__wrapped__),
                    actions = result.__actions__ = arrayCopy(this.__actions__);

                actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
                result.__chain__ = chainAll;
                return result;
              }
              return func.apply(object, arrayPush([this.value()], arguments));
            };
          }(func));
        }
      }
      return object;
    }

    /**
     * Reverts the `_` variable to its previous value and returns a reference to
     * the `lodash` function.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @returns {Function} Returns the `lodash` function.
     * @example
     *
     * var lodash = _.noConflict();
     */
    function noConflict() {
      root._ = oldDash;
      return this;
    }

    /**
     * A no-operation function that returns `undefined` regardless of the
     * arguments it receives.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @example
     *
     * var object = { 'user': 'fred' };
     *
     * _.noop(object) === undefined;
     * // => true
     */
    function noop() {
      // No operation performed.
    }

    /**
     * Creates a function that returns the property value at `path` on a
     * given object.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Array|string} path The path of the property to get.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var objects = [
     *   { 'a': { 'b': { 'c': 2 } } },
     *   { 'a': { 'b': { 'c': 1 } } }
     * ];
     *
     * _.map(objects, _.property('a.b.c'));
     * // => [2, 1]
     *
     * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
     * // => [1, 2]
     */
    function property(path) {
      return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
    }

    /**
     * The opposite of `_.property`; this method creates a function that returns
     * the property value at a given path on `object`.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {Object} object The object to query.
     * @returns {Function} Returns the new function.
     * @example
     *
     * var array = [0, 1, 2],
     *     object = { 'a': array, 'b': array, 'c': array };
     *
     * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
     * // => [2, 0]
     *
     * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
     * // => [2, 0]
     */
    function propertyOf(object) {
      return function(path) {
        return baseGet(object, toPath(path), path + '');
      };
    }

    /**
     * Creates an array of numbers (positive and/or negative) progressing from
     * `start` up to, but not including, `end`. If `end` is not specified it is
     * set to `start` with `start` then set to `0`. If `end` is less than `start`
     * a zero-length range is created unless a negative `step` is specified.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {number} [start=0] The start of the range.
     * @param {number} end The end of the range.
     * @param {number} [step=1] The value to increment or decrement by.
     * @returns {Array} Returns the new array of numbers.
     * @example
     *
     * _.range(4);
     * // => [0, 1, 2, 3]
     *
     * _.range(1, 5);
     * // => [1, 2, 3, 4]
     *
     * _.range(0, 20, 5);
     * // => [0, 5, 10, 15]
     *
     * _.range(0, -4, -1);
     * // => [0, -1, -2, -3]
     *
     * _.range(1, 4, 0);
     * // => [1, 1, 1]
     *
     * _.range(0);
     * // => []
     */
    function range(start, end, step) {
      if (step && isIterateeCall(start, end, step)) {
        end = step = undefined;
      }
      start = +start || 0;
      step = step == null ? 1 : (+step || 0);

      if (end == null) {
        end = start;
        start = 0;
      } else {
        end = +end || 0;
      }
      // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
      // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
      var index = -1,
          length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
          result = Array(length);

      while (++index < length) {
        result[index] = start;
        start += step;
      }
      return result;
    }

    /**
     * Invokes the iteratee function `n` times, returning an array of the results
     * of each invocation. The `iteratee` is bound to `thisArg` and invoked with
     * one argument; (index).
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {number} n The number of times to invoke `iteratee`.
     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {Array} Returns the array of results.
     * @example
     *
     * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));
     * // => [3, 6, 4]
     *
     * _.times(3, function(n) {
     *   mage.castSpell(n);
     * });
     * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
     *
     * _.times(3, function(n) {
     *   this.cast(n);
     * }, mage);
     * // => also invokes `mage.castSpell(n)` three times
     */
    function times(n, iteratee, thisArg) {
      n = nativeFloor(n);

      // Exit early to avoid a JSC JIT bug in Safari 8
      // where `Array(0)` is treated as `Array(1)`.
      if (n < 1 || !nativeIsFinite(n)) {
        return [];
      }
      var index = -1,
          result = Array(nativeMin(n, MAX_ARRAY_LENGTH));

      iteratee = bindCallback(iteratee, thisArg, 1);
      while (++index < n) {
        if (index < MAX_ARRAY_LENGTH) {
          result[index] = iteratee(index);
        } else {
          iteratee(index);
        }
      }
      return result;
    }

    /**
     * Generates a unique ID. If `prefix` is provided the ID is appended to it.
     *
     * @static
     * @memberOf _
     * @category Utility
     * @param {string} [prefix] The value to prefix the ID with.
     * @returns {string} Returns the unique ID.
     * @example
     *
     * _.uniqueId('contact_');
     * // => 'contact_104'
     *
     * _.uniqueId();
     * // => '105'
     */
    function uniqueId(prefix) {
      var id = ++idCounter;
      return baseToString(prefix) + id;
    }

    /*------------------------------------------------------------------------*/

    /**
     * Adds two numbers.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {number} augend The first number to add.
     * @param {number} addend The second number to add.
     * @returns {number} Returns the sum.
     * @example
     *
     * _.add(6, 4);
     * // => 10
     */
    function add(augend, addend) {
      return (+augend || 0) + (+addend || 0);
    }

    /**
     * Calculates `n` rounded up to `precision`.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {number} n The number to round up.
     * @param {number} [precision=0] The precision to round up to.
     * @returns {number} Returns the rounded up number.
     * @example
     *
     * _.ceil(4.006);
     * // => 5
     *
     * _.ceil(6.004, 2);
     * // => 6.01
     *
     * _.ceil(6040, -2);
     * // => 6100
     */
    var ceil = createRound('ceil');

    /**
     * Calculates `n` rounded down to `precision`.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {number} n The number to round down.
     * @param {number} [precision=0] The precision to round down to.
     * @returns {number} Returns the rounded down number.
     * @example
     *
     * _.floor(4.006);
     * // => 4
     *
     * _.floor(0.046, 2);
     * // => 0.04
     *
     * _.floor(4060, -2);
     * // => 4000
     */
    var floor = createRound('floor');

    /**
     * Gets the maximum value of `collection`. If `collection` is empty or falsey
     * `-Infinity` is returned. If an iteratee function is provided it is invoked
     * for each value in `collection` to generate the criterion by which the value
     * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
     * arguments: (value, index, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {*} Returns the maximum value.
     * @example
     *
     * _.max([4, 2, 8, 6]);
     * // => 8
     *
     * _.max([]);
     * // => -Infinity
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 }
     * ];
     *
     * _.max(users, function(chr) {
     *   return chr.age;
     * });
     * // => { 'user': 'fred', 'age': 40 }
     *
     * // using the `_.property` callback shorthand
     * _.max(users, 'age');
     * // => { 'user': 'fred', 'age': 40 }
     */
    var max = createExtremum(gt, NEGATIVE_INFINITY);

    /**
     * Gets the minimum value of `collection`. If `collection` is empty or falsey
     * `Infinity` is returned. If an iteratee function is provided it is invoked
     * for each value in `collection` to generate the criterion by which the value
     * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
     * arguments: (value, index, collection).
     *
     * If a property name is provided for `iteratee` the created `_.property`
     * style callback returns the property value of the given element.
     *
     * If a value is also provided for `thisArg` the created `_.matchesProperty`
     * style callback returns `true` for elements that have a matching property
     * value, else `false`.
     *
     * If an object is provided for `iteratee` the created `_.matches` style
     * callback returns `true` for elements that have the properties of the given
     * object, else `false`.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {*} Returns the minimum value.
     * @example
     *
     * _.min([4, 2, 8, 6]);
     * // => 2
     *
     * _.min([]);
     * // => Infinity
     *
     * var users = [
     *   { 'user': 'barney', 'age': 36 },
     *   { 'user': 'fred',   'age': 40 }
     * ];
     *
     * _.min(users, function(chr) {
     *   return chr.age;
     * });
     * // => { 'user': 'barney', 'age': 36 }
     *
     * // using the `_.property` callback shorthand
     * _.min(users, 'age');
     * // => { 'user': 'barney', 'age': 36 }
     */
    var min = createExtremum(lt, POSITIVE_INFINITY);

    /**
     * Calculates `n` rounded to `precision`.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {number} n The number to round.
     * @param {number} [precision=0] The precision to round to.
     * @returns {number} Returns the rounded number.
     * @example
     *
     * _.round(4.006);
     * // => 4
     *
     * _.round(4.006, 2);
     * // => 4.01
     *
     * _.round(4060, -2);
     * // => 4100
     */
    var round = createRound('round');

    /**
     * Gets the sum of the values in `collection`.
     *
     * @static
     * @memberOf _
     * @category Math
     * @param {Array|Object|string} collection The collection to iterate over.
     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
     * @param {*} [thisArg] The `this` binding of `iteratee`.
     * @returns {number} Returns the sum.
     * @example
     *
     * _.sum([4, 6]);
     * // => 10
     *
     * _.sum({ 'a': 4, 'b': 6 });
     * // => 10
     *
     * var objects = [
     *   { 'n': 4 },
     *   { 'n': 6 }
     * ];
     *
     * _.sum(objects, function(object) {
     *   return object.n;
     * });
     * // => 10
     *
     * // using the `_.property` callback shorthand
     * _.sum(objects, 'n');
     * // => 10
     */
    function sum(collection, iteratee, thisArg) {
      if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
        iteratee = undefined;
      }
      iteratee = getCallback(iteratee, thisArg, 3);
      return iteratee.length == 1
        ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee)
        : baseSum(collection, iteratee);
    }

    /*------------------------------------------------------------------------*/

    // Ensure wrappers are instances of `baseLodash`.
    lodash.prototype = baseLodash.prototype;

    LodashWrapper.prototype = baseCreate(baseLodash.prototype);
    LodashWrapper.prototype.constructor = LodashWrapper;

    LazyWrapper.prototype = baseCreate(baseLodash.prototype);
    LazyWrapper.prototype.constructor = LazyWrapper;

    // Add functions to the `Map` cache.
    MapCache.prototype['delete'] = mapDelete;
    MapCache.prototype.get = mapGet;
    MapCache.prototype.has = mapHas;
    MapCache.prototype.set = mapSet;

    // Add functions to the `Set` cache.
    SetCache.prototype.push = cachePush;

    // Assign cache to `_.memoize`.
    memoize.Cache = MapCache;

    // Add functions that return wrapped values when chaining.
    lodash.after = after;
    lodash.ary = ary;
    lodash.assign = assign;
    lodash.at = at;
    lodash.before = before;
    lodash.bind = bind;
    lodash.bindAll = bindAll;
    lodash.bindKey = bindKey;
    lodash.callback = callback;
    lodash.chain = chain;
    lodash.chunk = chunk;
    lodash.compact = compact;
    lodash.constant = constant;
    lodash.countBy = countBy;
    lodash.create = create;
    lodash.curry = curry;
    lodash.curryRight = curryRight;
    lodash.debounce = debounce;
    lodash.defaults = defaults;
    lodash.defaultsDeep = defaultsDeep;
    lodash.defer = defer;
    lodash.delay = delay;
    lodash.difference = difference;
    lodash.drop = drop;
    lodash.dropRight = dropRight;
    lodash.dropRightWhile = dropRightWhile;
    lodash.dropWhile = dropWhile;
    lodash.fill = fill;
    lodash.filter = filter;
    lodash.flatten = flatten;
    lodash.flattenDeep = flattenDeep;
    lodash.flow = flow;
    lodash.flowRight = flowRight;
    lodash.forEach = forEach;
    lodash.forEachRight = forEachRight;
    lodash.forIn = forIn;
    lodash.forInRight = forInRight;
    lodash.forOwn = forOwn;
    lodash.forOwnRight = forOwnRight;
    lodash.functions = functions;
    lodash.groupBy = groupBy;
    lodash.indexBy = indexBy;
    lodash.initial = initial;
    lodash.intersection = intersection;
    lodash.invert = invert;
    lodash.invoke = invoke;
    lodash.keys = keys;
    lodash.keysIn = keysIn;
    lodash.map = map;
    lodash.mapKeys = mapKeys;
    lodash.mapValues = mapValues;
    lodash.matches = matches;
    lodash.matchesProperty = matchesProperty;
    lodash.memoize = memoize;
    lodash.merge = merge;
    lodash.method = method;
    lodash.methodOf = methodOf;
    lodash.mixin = mixin;
    lodash.modArgs = modArgs;
    lodash.negate = negate;
    lodash.omit = omit;
    lodash.once = once;
    lodash.pairs = pairs;
    lodash.partial = partial;
    lodash.partialRight = partialRight;
    lodash.partition = partition;
    lodash.pick = pick;
    lodash.pluck = pluck;
    lodash.property = property;
    lodash.propertyOf = propertyOf;
    lodash.pull = pull;
    lodash.pullAt = pullAt;
    lodash.range = range;
    lodash.rearg = rearg;
    lodash.reject = reject;
    lodash.remove = remove;
    lodash.rest = rest;
    lodash.restParam = restParam;
    lodash.set = set;
    lodash.shuffle = shuffle;
    lodash.slice = slice;
    lodash.sortBy = sortBy;
    lodash.sortByAll = sortByAll;
    lodash.sortByOrder = sortByOrder;
    lodash.spread = spread;
    lodash.take = take;
    lodash.takeRight = takeRight;
    lodash.takeRightWhile = takeRightWhile;
    lodash.takeWhile = takeWhile;
    lodash.tap = tap;
    lodash.throttle = throttle;
    lodash.thru = thru;
    lodash.times = times;
    lodash.toArray = toArray;
    lodash.toPlainObject = toPlainObject;
    lodash.transform = transform;
    lodash.union = union;
    lodash.uniq = uniq;
    lodash.unzip = unzip;
    lodash.unzipWith = unzipWith;
    lodash.values = values;
    lodash.valuesIn = valuesIn;
    lodash.where = where;
    lodash.without = without;
    lodash.wrap = wrap;
    lodash.xor = xor;
    lodash.zip = zip;
    lodash.zipObject = zipObject;
    lodash.zipWith = zipWith;

    // Add aliases.
    lodash.backflow = flowRight;
    lodash.collect = map;
    lodash.compose = flowRight;
    lodash.each = forEach;
    lodash.eachRight = forEachRight;
    lodash.extend = assign;
    lodash.iteratee = callback;
    lodash.methods = functions;
    lodash.object = zipObject;
    lodash.select = filter;
    lodash.tail = rest;
    lodash.unique = uniq;

    // Add functions to `lodash.prototype`.
    mixin(lodash, lodash);

    /*------------------------------------------------------------------------*/

    // Add functions that return unwrapped values when chaining.
    lodash.add = add;
    lodash.attempt = attempt;
    lodash.camelCase = camelCase;
    lodash.capitalize = capitalize;
    lodash.ceil = ceil;
    lodash.clone = clone;
    lodash.cloneDeep = cloneDeep;
    lodash.deburr = deburr;
    lodash.endsWith = endsWith;
    lodash.escape = escape;
    lodash.escapeRegExp = escapeRegExp;
    lodash.every = every;
    lodash.find = find;
    lodash.findIndex = findIndex;
    lodash.findKey = findKey;
    lodash.findLast = findLast;
    lodash.findLastIndex = findLastIndex;
    lodash.findLastKey = findLastKey;
    lodash.findWhere = findWhere;
    lodash.first = first;
    lodash.floor = floor;
    lodash.get = get;
    lodash.gt = gt;
    lodash.gte = gte;
    lodash.has = has;
    lodash.identity = identity;
    lodash.includes = includes;
    lodash.indexOf = indexOf;
    lodash.inRange = inRange;
    lodash.isArguments = isArguments;
    lodash.isArray = isArray;
    lodash.isBoolean = isBoolean;
    lodash.isDate = isDate;
    lodash.isElement = isElement;
    lodash.isEmpty = isEmpty;
    lodash.isEqual = isEqual;
    lodash.isError = isError;
    lodash.isFinite = isFinite;
    lodash.isFunction = isFunction;
    lodash.isMatch = isMatch;
    lodash.isNaN = isNaN;
    lodash.isNative = isNative;
    lodash.isNull = isNull;
    lodash.isNumber = isNumber;
    lodash.isObject = isObject;
    lodash.isPlainObject = isPlainObject;
    lodash.isRegExp = isRegExp;
    lodash.isString = isString;
    lodash.isTypedArray = isTypedArray;
    lodash.isUndefined = isUndefined;
    lodash.kebabCase = kebabCase;
    lodash.last = last;
    lodash.lastIndexOf = lastIndexOf;
    lodash.lt = lt;
    lodash.lte = lte;
    lodash.max = max;
    lodash.min = min;
    lodash.noConflict = noConflict;
    lodash.noop = noop;
    lodash.now = now;
    lodash.pad = pad;
    lodash.padLeft = padLeft;
    lodash.padRight = padRight;
    lodash.parseInt = parseInt;
    lodash.random = random;
    lodash.reduce = reduce;
    lodash.reduceRight = reduceRight;
    lodash.repeat = repeat;
    lodash.result = result;
    lodash.round = round;
    lodash.runInContext = runInContext;
    lodash.size = size;
    lodash.snakeCase = snakeCase;
    lodash.some = some;
    lodash.sortedIndex = sortedIndex;
    lodash.sortedLastIndex = sortedLastIndex;
    lodash.startCase = startCase;
    lodash.startsWith = startsWith;
    lodash.sum = sum;
    lodash.template = template;
    lodash.trim = trim;
    lodash.trimLeft = trimLeft;
    lodash.trimRight = trimRight;
    lodash.trunc = trunc;
    lodash.unescape = unescape;
    lodash.uniqueId = uniqueId;
    lodash.words = words;

    // Add aliases.
    lodash.all = every;
    lodash.any = some;
    lodash.contains = includes;
    lodash.eq = isEqual;
    lodash.detect = find;
    lodash.foldl = reduce;
    lodash.foldr = reduceRight;
    lodash.head = first;
    lodash.include = includes;
    lodash.inject = reduce;

    mixin(lodash, (function() {
      var source = {};
      baseForOwn(lodash, function(func, methodName) {
        if (!lodash.prototype[methodName]) {
          source[methodName] = func;
        }
      });
      return source;
    }()), false);

    /*------------------------------------------------------------------------*/

    // Add functions capable of returning wrapped and unwrapped values when chaining.
    lodash.sample = sample;

    lodash.prototype.sample = function(n) {
      if (!this.__chain__ && n == null) {
        return sample(this.value());
      }
      return this.thru(function(value) {
        return sample(value, n);
      });
    };

    /*------------------------------------------------------------------------*/

    /**
     * The semantic version number.
     *
     * @static
     * @memberOf _
     * @type string
     */
    lodash.VERSION = VERSION;

    // Assign default placeholders.
    arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
      lodash[methodName].placeholder = lodash;
    });

    // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
    arrayEach(['drop', 'take'], function(methodName, index) {
      LazyWrapper.prototype[methodName] = function(n) {
        var filtered = this.__filtered__;
        if (filtered && !index) {
          return new LazyWrapper(this);
        }
        n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);

        var result = this.clone();
        if (filtered) {
          result.__takeCount__ = nativeMin(result.__takeCount__, n);
        } else {
          result.__views__.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });
        }
        return result;
      };

      LazyWrapper.prototype[methodName + 'Right'] = function(n) {
        return this.reverse()[methodName](n).reverse();
      };
    });

    // Add `LazyWrapper` methods that accept an `iteratee` value.
    arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
      var type = index + 1,
          isFilter = type != LAZY_MAP_FLAG;

      LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {
        var result = this.clone();
        result.__iteratees__.push({ 'iteratee': getCallback(iteratee, thisArg, 1), 'type': type });
        result.__filtered__ = result.__filtered__ || isFilter;
        return result;
      };
    });

    // Add `LazyWrapper` methods for `_.first` and `_.last`.
    arrayEach(['first', 'last'], function(methodName, index) {
      var takeName = 'take' + (index ? 'Right' : '');

      LazyWrapper.prototype[methodName] = function() {
        return this[takeName](1).value()[0];
      };
    });

    // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
    arrayEach(['initial', 'rest'], function(methodName, index) {
      var dropName = 'drop' + (index ? '' : 'Right');

      LazyWrapper.prototype[methodName] = function() {
        return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
      };
    });

    // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
    arrayEach(['pluck', 'where'], function(methodName, index) {
      var operationName = index ? 'filter' : 'map',
          createCallback = index ? baseMatches : property;

      LazyWrapper.prototype[methodName] = function(value) {
        return this[operationName](createCallback(value));
      };
    });

    LazyWrapper.prototype.compact = function() {
      return this.filter(identity);
    };

    LazyWrapper.prototype.reject = function(predicate, thisArg) {
      predicate = getCallback(predicate, thisArg, 1);
      return this.filter(function(value) {
        return !predicate(value);
      });
    };

    LazyWrapper.prototype.slice = function(start, end) {
      start = start == null ? 0 : (+start || 0);

      var result = this;
      if (result.__filtered__ && (start > 0 || end < 0)) {
        return new LazyWrapper(result);
      }
      if (start < 0) {
        result = result.takeRight(-start);
      } else if (start) {
        result = result.drop(start);
      }
      if (end !== undefined) {
        end = (+end || 0);
        result = end < 0 ? result.dropRight(-end) : result.take(end - start);
      }
      return result;
    };

    LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {
      return this.reverse().takeWhile(predicate, thisArg).reverse();
    };

    LazyWrapper.prototype.toArray = function() {
      return this.take(POSITIVE_INFINITY);
    };

    // Add `LazyWrapper` methods to `lodash.prototype`.
    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
      var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),
          retUnwrapped = /^(?:first|last)$/.test(methodName),
          lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];

      if (!lodashFunc) {
        return;
      }
      lodash.prototype[methodName] = function() {
        var args = retUnwrapped ? [1] : arguments,
            chainAll = this.__chain__,
            value = this.__wrapped__,
            isHybrid = !!this.__actions__.length,
            isLazy = value instanceof LazyWrapper,
            iteratee = args[0],
            useLazy = isLazy || isArray(value);

        if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
          // Avoid lazy use if the iteratee has a "length" value other than `1`.
          isLazy = useLazy = false;
        }
        var interceptor = function(value) {
          return (retUnwrapped && chainAll)
            ? lodashFunc(value, 1)[0]
            : lodashFunc.apply(undefined, arrayPush([value], args));
        };

        var action = { 'func': thru, 'args': [interceptor], 'thisArg': undefined },
            onlyLazy = isLazy && !isHybrid;

        if (retUnwrapped && !chainAll) {
          if (onlyLazy) {
            value = value.clone();
            value.__actions__.push(action);
            return func.call(value);
          }
          return lodashFunc.call(undefined, this.value())[0];
        }
        if (!retUnwrapped && useLazy) {
          value = onlyLazy ? value : new LazyWrapper(this);
          var result = func.apply(value, args);
          result.__actions__.push(action);
          return new LodashWrapper(result, chainAll);
        }
        return this.thru(interceptor);
      };
    });

    // Add `Array` and `String` methods to `lodash.prototype`.
    arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {
      var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],
          chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
          retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);

      lodash.prototype[methodName] = function() {
        var args = arguments;
        if (retUnwrapped && !this.__chain__) {
          return func.apply(this.value(), args);
        }
        return this[chainName](function(value) {
          return func.apply(value, args);
        });
      };
    });

    // Map minified function names to their real names.
    baseForOwn(LazyWrapper.prototype, function(func, methodName) {
      var lodashFunc = lodash[methodName];
      if (lodashFunc) {
        var key = lodashFunc.name,
            names = realNames[key] || (realNames[key] = []);

        names.push({ 'name': methodName, 'func': lodashFunc });
      }
    });

    realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];

    // Add functions to the lazy wrapper.
    LazyWrapper.prototype.clone = lazyClone;
    LazyWrapper.prototype.reverse = lazyReverse;
    LazyWrapper.prototype.value = lazyValue;

    // Add chaining functions to the `lodash` wrapper.
    lodash.prototype.chain = wrapperChain;
    lodash.prototype.commit = wrapperCommit;
    lodash.prototype.concat = wrapperConcat;
    lodash.prototype.plant = wrapperPlant;
    lodash.prototype.reverse = wrapperReverse;
    lodash.prototype.toString = wrapperToString;
    lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;

    // Add function aliases to the `lodash` wrapper.
    lodash.prototype.collect = lodash.prototype.map;
    lodash.prototype.head = lodash.prototype.first;
    lodash.prototype.select = lodash.prototype.filter;
    lodash.prototype.tail = lodash.prototype.rest;

    return lodash;
  }

  /*--------------------------------------------------------------------------*/

  // Export lodash.
  var _ = runInContext();

  // Some AMD build optimizers like r.js check for condition patterns like the following:
  if (true) {
    // Expose lodash to the global object when an AMD loader is present to avoid
    // errors in cases where lodash is loaded by a script tag and not intended
    // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for
    // more details.
    root._ = _;

    // Define as an anonymous module so, through path mapping, it can be
    // referenced as the "underscore" module.
    !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
      return _;
    }.call(exports, __webpack_require__, exports, module),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  }
  // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
  else if (freeExports && freeModule) {
    // Export for Node.js or RingoJS.
    if (moduleExports) {
      (freeModule.exports = _)._ = _;
    }
    // Export for Rhino with CommonJS support.
    else {
      freeExports._ = _;
    }
  }
  else {
    // Export for a browser or Rhino.
    root._ = _;
  }
}.call(this));

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1393)(module), __webpack_require__(51)))

/***/ }),
/* 119 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function getDecoratedComponent(instanceRef) {
    var currentRef = instanceRef.current;
    if (currentRef == null) {
        return null;
    }
    else if (currentRef.decoratedRef) {
        // go through the private field in decorateHandler to avoid the invariant hit
        return currentRef.decoratedRef.current;
    }
    else {
        return currentRef;
    }
}
exports.getDecoratedComponent = getDecoratedComponent;
function isClassComponent(Component) {
    return (Component &&
        Component.prototype &&
        typeof Component.prototype.render === 'function');
}
exports.isClassComponent = isClassComponent;
function isRefForwardingComponent(C) {
    return (C && C.$$typeof && C.$$typeof.toString() === 'Symbol(react.forward_ref)');
}
exports.isRefForwardingComponent = isRefForwardingComponent;
function isRefable(C) {
    return isClassComponent(C) || isRefForwardingComponent(C);
}
exports.isRefable = isRefable;
function checkDecoratorArguments(functionName, signature) {
    var args = [];
    for (var _i = 2; _i < arguments.length; _i++) {
        args[_i - 2] = arguments[_i];
    }
    if (true) {
        for (var i = 0; i < args.length; i++) {
            var arg = args[i];
            if (arg && arg.prototype && arg.prototype.render) {
                // eslint-disable-next-line no-console
                console.error('You seem to be applying the arguments in the wrong order. ' +
                    ("It should be " + functionName + "(" + signature + ")(Component), not the other way around. ") +
                    'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#you-seem-to-be-applying-the-arguments-in-the-wrong-order');
                return;
            }
        }
    }
}
exports.checkDecoratorArguments = checkDecoratorArguments;


/***/ }),
/* 120 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
// suppress the useLayoutEffect warning on server side.
exports.useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react_1.useLayoutEffect : react_1.useEffect;


/***/ }),
/* 121 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (data, callback) {
  (0, _xhr2.default)({
    url: "/" + "api/session/PostSaveActiveDataset",
    method: "POST",
    json: data,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {
    if (resp.statusCode === 200 || resp.statusCode === 201) {
      _Actions2.default.SAVE_DATASET(resp.body);
    }
    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 122 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  UserReportSingles: [{
    AreaUnit: { Options: [{}] },
    MilkUnit: { Options: [{}] },
    FinanceKpiRatio: { Options: [{}] },
    FinanceRatio1: { Options: [{}] },
    FinanceRatio2: { Options: [{}] },
    FinanceRatio3: { Options: [{}] },
    FinanceRatio4: { Options: [{}] },
    FinanceRatio5: { Options: [{}] }
  }],
  UserReportComparisons: [{
    AreaUnit: { Options: [{}] },
    FinChartAxis: { Options: [{}] },
    FinChartFilter: { Options: [{}] },
    FinanceKpiRatio: { Options: [{}] },
    FinanceRatio: { Options: [{}] },
    Grp1DataSource: { Options: [{}] },
    Grp2DataSource: { Options: [{}] },
    Grp1AggregationMethod: { Options: [{}] },
    Grp2AggregationMethod: { Options: [{}] },
    Grp1Count: { Options: [{}] },
    Grp1Concentrate: { Options: [{}] },
    Grp1CalvingPattern: { Options: [{}] },
    Grp1FarmSizeFrom: { Options: [{}] },
    Grp1FarmSizeTo: { Options: [{}] },
    Grp1FinYearFrom: { Options: [{}] },
    Grp1FinYearTo: { Options: [{}] },
    Grp1GrazedFeed: { Options: [{}] },
    Grp1Irrigation: { Options: [{}] },
    Grp1RegionSelect: { Options: [{}] },
    Grp1RegionType: { Options: [{}] },
    Grp1Statistic: { Options: [{}] },
    Grp2Count: { Options: [{}] },
    Grp2Concentrate: { Options: [{}] },
    Grp2CalvingPattern: { Options: [{}] },
    Grp2FarmSizeFrom: { Options: [{}] },
    Grp2FarmSizeTo: { Options: [{}] },
    Grp2FinYearFrom: { Options: [{}] },
    Grp2FinYearTo: { Options: [{}] },
    Grp2GrazedFeed: { Options: [{}] },
    Grp2Irrigation: { Options: [{}] },
    Grp2RegionSelect: { Options: [{}] },
    Grp2RegionType: { Options: [{}] },
    Grp2Statistic: { Options: [{}] },
    MilkUnit: { Options: [{}] }
  }],
  UserReportFarmSizes: [{
    ChartKpi: { Options: [{}] },
    Grp1Count: { Options: [{}] },
    Grp1Concentrate: { Options: [{}] },
    Grp1CalvingPattern: { Options: [{}] },
    Grp1DataSource: { Options: [{}] },
    Grp1FarmSizeFrom: { Options: [{}] },
    Grp1FarmSizeTo: { Options: [{}] },
    Grp1FinYearFrom: { Options: [{}] },
    Grp1FinYearTo: { Options: [{}] },
    Grp1GrazedFeed: { Options: [{}] },
    Grp1Irrigation: { Options: [{}] },
    Grp1RegionSelect: { Options: [{}] },
    Grp1RegionType: { Options: [{}] },
    Grp1Statistic: { Options: [{}] },
    Grp2Count: { Options: [{}] },
    Grp2Concentrate: { Options: [{}] },
    Grp2CalvingPattern: { Options: [{}] },
    Grp2DataSource: { Options: [{}] },
    Grp2FarmSizeFrom: { Options: [{}] },
    Grp2FarmSizeTo: { Options: [{}] },
    Grp2FinYearFrom: { Options: [{}] },
    Grp2FinYearTo: { Options: [{}] },
    Grp2GrazedFeed: { Options: [{}] },
    Grp2Irrigation: { Options: [{}] },
    Grp2RegionSelect: { Options: [{}] },
    Grp2RegionType: { Options: [{}] },
    Grp2Statistic: { Options: [{}] }
  }],
  'UserReportFarmHistories': [{
    ChartKpi: { Options: [{}] },
    Grp1Count: { Options: [{}] },
    Grp1Concentrate: { Options: [{}] },
    Grp1CalvingPattern: { Options: [{}] },
    Grp1DataSource: { Options: [{}] },
    Grp1FarmSizeFrom: { Options: [{}] },
    Grp1FarmSizeTo: { Options: [{}] },
    Grp1FinYearFrom: { Options: [{}] },
    Grp1FinYearTo: { Options: [{}] },
    Grp1GrazedFeed: { Options: [{}] },
    Grp1Irrigation: { Options: [{}] },
    Grp1RegionSelect: { Options: [{}] },
    Grp1RegionType: { Options: [{}] },
    Grp1Statistic: { Options: [{}] },
    Grp2Count: { Options: [{}] },
    Grp2Concentrate: { Options: [{}] },
    Grp2CalvingPattern: { Options: [{}] },
    Grp2DataSource: { Options: [{}] },
    Grp2FarmSizeFrom: { Options: [{}] },
    Grp2FarmSizeTo: { Options: [{}] },
    Grp2FinYearFrom: { Options: [{}] },
    Grp2FinYearTo: { Options: [{}] },
    Grp2GrazedFeed: { Options: [{}] },
    Grp2Irrigation: { Options: [{}] },
    Grp2RegionSelect: { Options: [{}] },
    Grp2RegionType: { Options: [{}] },
    Grp2Statistic: { Options: [{}] }
  }],
  'UserReportBulkComparisons': [{
    AreaUnit: { Options: [{}] },
    FinChartAxis: { Options: [{}] },
    FinChartFilter: { Options: [{}] },
    FinanceKpiRatio: { Options: [{}] },
    FinanceRatio: { Options: [{}] },
    GrpDataSource: { Options: [{}] },
    GrpAggregationMethod: { Options: [{}] },
    GrpCount: { Options: [{}] },
    GrpConcentrate: { Options: [{}] },
    GrpCalvingPattern: { Options: [{}] },
    GrpFarmSizeFrom: { Options: [{}] },
    GrpFarmSizeTo: { Options: [{}] },
    GrpFinYearFrom: { Options: [{}] },
    GrpFinYearTo: { Options: [{}] },
    GrpGrazedFeed: { Options: [{}] },
    GrpIrrigation: { Options: [{}] },
    GrpRegionSelect: { Options: [{}] },
    GrpRegionType: { Options: [{}] },
    GrpStatistic: { Options: [{}] },
    MilkUnit: { Options: [{}] }
  }],
  'UserReportFarmClients': [{
    DairyBaseId: { Options: [{}] },
    DataSourceId: { Options: [{}] },
    FinanceRatioId: { Options: [{}] },
    FinancialYearId: { Options: [{}] },
    UserReportFarmClientId: { Options: [{}] },
    UserSession: { Options: [{}] },
    UserSessionId: { Options: [{}] }
  }]
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 123 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var i = 0;

var __requestLog = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.store = [];
    this.listenToMany(_Actions2.default);
  },
  POST_NEW_DATA: function POST_NEW_DATA(oldData, newData, fromDataset) {
    var _this = this;

    // TODO: remove all errors from list when a new pending request comes in...
    i++;
    this.store.push({
      FieldId: oldData.FieldId,
      cachedData: oldData,
      error: false,
      timestamp: Date.now()
    });

    var requestRef = this.store[this.store.length - 1];
    if (fromDataset) _Actions2.default.SET_DATASET_UNSAVED();
    this.trigger();

    (0, _POST__editData2.default)(newData, function (resp) {

      if (resp.statusCode === 200 || resp.statusCode === 201) {
        _this._handleSuccess(requestRef);
      } else {
        _this._handleError(requestRef);
      }
    });
  },
  _handleSuccess: function _handleSuccess(requestRef) {

    this.store = this.store.filter(function (request) {
      // field matches our requestRef
      if (requestRef.FieldId === request.FieldId) {
        // reject timestamps that are the same or earlier.
        return request.timestamp > requestRef.timestamp;
      }
      // include everything else
      return true;
    });

    this.trigger();
  },
  _handleError: function _handleError(requestRef) {
    requestRef.error = true;
    this._handleDataRollback(requestRef.cachedData);
    this.trigger();
  },
  _handleDataRollback: function _handleDataRollback(oldData) {
    var requestList = this.store.filter(function (request) {
      return request.FieldId === oldData.FieldId;
    });

    var lastKnownState = _.findLast(requestList, function (request) {
      return request.error === true;
    });

    _Actions2.default.ROLLBACK_FIELD_DATA({
      'Element': oldData.FieldId,
      'Value': lastKnownState.cachedData.Value
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(i, 'i', 'C:/_repos_windows/dairybase/Frontend/app/stores/__requestLog/index.js');

  __REACT_HOT_LOADER__.register(__requestLog, '__requestLog', 'C:/_repos_windows/dairybase/Frontend/app/stores/__requestLog/index.js');
}();

;

/***/ }),
/* 124 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _commas = __webpack_require__(33);

var _NaNtoDash = __webpack_require__(147);

var _NaNtoDash2 = _interopRequireDefault(_NaNtoDash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (id, modifiers) {
  var calculations = [{
    Id: 'NotDefined',
    Name: 'null',
    fn: function fn(value) {
      return null;
    }
  }, {
    Id: 'RawValue',
    Name: 'Raw Value',
    fn: function fn(value) {
      return (0, _commas.addCommas)(value);
    }
  }, {
    Id: 'PerCow',
    Name: 'Per Cow',
    fn: function fn(value) {
      var calculatedValue = (0, _NaNtoDash2.default)((+value / +modifiers.CowMilkerNumber).toFixed(0));
      return (0, _commas.addCommas)(calculatedValue);
    }
  }, {
    Id: 'PerKgMS',
    Name: 'Per Kg MS',
    fn: function fn(value) {
      var calculatedValue = (0, _NaNtoDash2.default)((+value / +modifiers.MilkSolidsKgTotal).toFixed(2));
      return (0, _commas.addCommas)(calculatedValue);
    }
  }, {
    Id: 'PerMilkingHa',
    Name: 'Per Milking ha',
    fn: function fn(value) {
      var calculatedValue = (0, _NaNtoDash2.default)((+value / +modifiers.AreaMilking).toFixed(0));
      return (0, _commas.addCommas)(calculatedValue);
    }
  }, {
    Id: 'PerUsableHa',
    Name: 'Per Usable ha',
    fn: function fn(value) {
      var calculatedValue = (0, _NaNtoDash2.default)((+value / +modifiers.AreaUsable).toFixed(0));
      return (0, _commas.addCommas)(calculatedValue);
    }
  }, {
    Id: 'DollarsPerLitre',
    Name: 'Dollars Per Litre',
    fn: function fn(value) {
      var calculatedValue = (0, _NaNtoDash2.default)((+value / +modifiers.MilkLitresTotal).toFixed(2));
      return (0, _commas.addCommas)(calculatedValue);
    }
  }, {
    Id: 'CentsPerLitre',
    cents: true,
    Name: 'Cents Per Litre',
    fn: function fn(value) {
      return (0, _NaNtoDash2.default)((+value * 100 / +modifiers.MilkLitresTotal).toFixed(1));
    }
  }, {
    Id: 'PercentOfIncome',
    Name: '% of Income',
    fn: function fn(value) {
      return (0, _NaNtoDash2.default)((value / +modifiers.IncomeTotal * 100).toFixed(1));
    }
  }];
  return _.find(calculations, { Id: id });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 125 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames3 = __webpack_require__(7);

var _classnames4 = _interopRequireDefault(_classnames3);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _xchSpinner = __webpack_require__(200);

var _xchSpinner2 = _interopRequireDefault(_xchSpinner);

var _style = __webpack_require__(965);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var CheckBox = module.exports = __webpack_require__(1)({
  _handleSubmitData: function _handleSubmitData() {
    if (this.props.disabled) return;
    this.props.onSubmit(+this.props.value ? 0 : 1, this.props.id);
  },
  render: function render() {
    var _classnames, _classnames2;

    var InputSwitchbox = (0, _classnames4.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['root'], true), _defineProperty(_classnames, _style2.default['is-error'], this.props.error), _classnames));

    var checkClasses = (0, _classnames4.default)((_classnames2 = {}, _defineProperty(_classnames2, _style2.default['_box'], true), _defineProperty(_classnames2, _style2.default['is-checked'], this.props.value), _defineProperty(_classnames2, _style2.default['is-pending'], this.props.pending), _defineProperty(_classnames2, _style2.default['is-disabled'], this.props.disabled), _classnames2));

    return _react2.default.createElement(
      'div',
      { className: InputSwitchbox },
      _react2.default.createElement(
        'div',
        { className: checkClasses, onClick: this._handleSubmitData },
        this.renderIcon()
      )
    );
  },
  renderIcon: function renderIcon() {
    if (this.props.pending) return _react2.default.createElement(
      'div',
      { className: _style2.default.spinner },
      _react2.default.createElement(_xchSpinner2.default, null)
    );

    return !this.props.value ? null : _react2.default.createElement(_Icon2.default, { id: 'tick',
      className: _style2.default.icon });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(CheckBox, 'CheckBox', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/xch-CheckBox/index.jsx');
}();

;

/***/ }),
/* 126 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1021);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _CheckBox = __webpack_require__(151);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

// NOTE: not actually optimistic...

var OptimisticCheckbox = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  getInitialState: function getInitialState() {
    return {
      postData: {
        fieldId: this.props.data.FieldId,
        table: this.props.data.Table,
        rowId: undefined
      }
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    var checkForUndefined = function checkForUndefined() {
      return typeof _activeDataset2.default.store[newProps.data.FieldId] === 'undefined' ? false : true;
    };

    this.setState({
      postData: {
        fieldId: newProps.data.FieldId,
        table: newProps.data.Table,
        rowId: checkForUndefined() ? _activeDataset2.default.store[newProps.data.FieldId].RowId : undefined
      }
    });
  },
  _handleSubmitData: function _handleSubmitData(newValue) {
    var _this = this;

    this.setState({
      postValue: newValue
    }, function () {
      _this._toggleRequestPortal();
    });
  },
  _toggleRequestPortal: function _toggleRequestPortal() {
    this.setState({
      requestPortalOpen: !this.state.requestPortalOpen
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_CheckBox2.default, {
        id: this.props.data.FieldId,
        label: this.props.label,
        description: this.props.data.Description,
        value: this.props.data.Value,
        onSubmit: this._handleSubmitData,
        disabled: !this.state.editAuthority }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.requestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleRequestPortal,
          failHandler: this._toggleRequestPortal,
          request: _POST__editData2.default,
          data: {
            Table: this.state.postData.table,
            Data: [{
              RowId: this.state.postData.rowId,
              Fields: _defineProperty({}, this.state.postData.fieldId, this.state.postValue)
            }]
          },
          pendingText: this.props.pendingText,
          successText: this.props.successText,
          failText: this.props.failText })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(OptimisticCheckbox, 'OptimisticCheckbox', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_OptimisticCheckBox/index.jsx');
}();

;

/***/ }),
/* 127 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1022);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _requestLog = __webpack_require__(123);

var _requestLog2 = _interopRequireDefault(_requestLog);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _fieldErrorMixin = __webpack_require__(194);

var _fieldErrorMixin2 = _interopRequireDefault(_fieldErrorMixin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var OptimisticInputNumber = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, _fieldErrorMixin2.default],

  _handleSubmitData: function _handleSubmitData(newValue) {
    // passed validation? Set the new data in store:
    _Actions2.default.UPDATE_DATA_ELEMENT({
      'Table': this.props.data.Table,
      'Element': this.props.data.FieldId,
      'Value': newValue
    });
  },
  render: function render() {
    return _react2.default.createElement(_InputNumber2.default, {
      id: this.props.data.FieldId,
      value: this.props.data.Value,
      decimal: this.props.data.Decimal,
      onSubmit: this._handleSubmitData,
      disabled: !this.state.editAuthority,
      error: this.props.data.error });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(OptimisticInputNumber, 'OptimisticInputNumber', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_OptimisticInputNumber/index.jsx');
}();

;

/***/ }),
/* 128 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1048);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Item = __webpack_require__(481);

var _Item2 = _interopRequireDefault(_Item);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterList = module.exports = __webpack_require__(1)({
  _renderList: function _renderList() {
    var _this = this;

    return this.props.list.map(function (item, index) {
      return _react2.default.createElement(_Item2.default, {
        key: index,
        item: item,
        emitItemClicked: _this.props.emitListItemClicked });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'FilterList' },
      this._renderList()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterList, 'FilterList', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilterList/index.jsx');
}();

;

/***/ }),
/* 129 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _CCWarningIcon = __webpack_require__(285);

var _CCWarningIcon2 = _interopRequireDefault(_CCWarningIcon);

var _CCHelpIcon = __webpack_require__(545);

var _CCHelpIcon2 = _interopRequireDefault(_CCHelpIcon);

var _style = __webpack_require__(547);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var _props = this.props,
        warning = _props.warning,
        text = _props.text,
        children = _props.children;

    return _react2.default.createElement(
      _Portal2.default,
      {
        fullscreen: true,
        background: '#EDF6F7',
        Button: function Button(_ref) {
          var onToggle = _ref.onToggle;
          return _react2.default.createElement(
            _style.Button,
            { onClick: onToggle },
            warning ? _react2.default.createElement(_CCWarningIcon2.default, null) : _react2.default.createElement(_CCHelpIcon2.default, null)
          );
        } },
      function (_ref2) {
        var onToggle = _ref2.onToggle,
            onOpen = _ref2.onOpen,
            onClose = _ref2.onClose;
        return _react2.default.createElement(
          _DAStandardPortal2.default,
          { onClose: onClose },
          _react2.default.createElement(
            _style.Root,
            null,
            _react2.default.createElement(
              _style.Content,
              null,
              _react2.default.createElement(
                _style.Header,
                null,
                warning ? _react2.default.createElement(_CCWarningIcon2.default, null) : _react2.default.createElement(_CCHelpIcon2.default, null)
              ),
              _react2.default.createElement(
                _style.Box,
                { warning: warning },
                text,
                children
              )
            )
          )
        );
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 130 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.InputCol = exports.Inputs = exports.LabelCol = exports.Row = exports.Banner = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'EditorStyle__Root'
})(['padding:10px;position:relative;z-index:1;']);

var Banner = exports.Banner = _styledComponents2.default.div.withConfig({
  displayName: 'EditorStyle__Banner'
})(['padding:10px;background:#edf6f7;']);

var Row = exports.Row = _styledComponents2.default.div.withConfig({
  displayName: 'EditorStyle__Row'
})(['display:flex;justify-content:space-between;align-items:center;padding-top:10px;padding-bottom:10px;', ''], function (props) {
  return props.scenario && '\n    background: ' + _css.mixins.opacity('#C3DC93', 25) + ';\n    border-top: 1px solid #C3DC93;\n    border-bottom: 1px solid #C3DC93;\n  ';
});

var LabelCol = exports.LabelCol = _styledComponents2.default.div.withConfig({
  displayName: 'EditorStyle__LabelCol'
})(['width:182px;padding-right:10px;padding-left:10px;']);

var Inputs = exports.Inputs = _styledComponents2.default.div.withConfig({
  displayName: 'EditorStyle__Inputs'
})(['display:flex;justify-content:flex-end;align-items:center;']);

var InputCol = exports.InputCol = _styledComponents2.default.div.withConfig({
  displayName: 'EditorStyle__InputCol'
})(['width:110px;padding-right:10px;']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/EditorStyle/index.js');

  __REACT_HOT_LOADER__.register(Banner, 'Banner', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/EditorStyle/index.js');

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/EditorStyle/index.js');

  __REACT_HOT_LOADER__.register(LabelCol, 'LabelCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/EditorStyle/index.js');

  __REACT_HOT_LOADER__.register(Inputs, 'Inputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/EditorStyle/index.js');

  __REACT_HOT_LOADER__.register(InputCol, 'InputCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/EditorStyle/index.js');
}();

;

/***/ }),
/* 131 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _decimals = __webpack_require__(195);

var _decimals2 = _interopRequireDefault(_decimals);

var _TableHeader2 = __webpack_require__(110);

var _TableHeader3 = _interopRequireDefault(_TableHeader2);

var _ReportHeaderTemplate = __webpack_require__(629);

var _ReportHeaderTemplate2 = _interopRequireDefault(_ReportHeaderTemplate);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReportTable = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_user2.default, '_handleUserPrefUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      },
      ratio: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleUserPrefUpdate();
  },
  _handleUserPrefUpdate: function _handleUserPrefUpdate() {
    var ratio = _user2.default.store['BulkComparisonFinanceRatioId'] || {};

    this.setState({
      ratio: ratio
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.BulkComparisonReport;
    if (typeof report === 'undefined') return;
    this.setState({
      report: report
    });
  },
  render: function render() {
    var _this = this;

    var ComparisonReport__tableWrapper = (0, _classnames2.default)({
      ComparisonReport__tableWrapper: true,
      'menu-open': this.props.menuOpen
    });

    var _props = this.props,
        selectedDatasets = _props.selectedDatasets,
        selectedFilters = _props.selectedFilters,
        IsLandscape = _props.IsLandscape;


    var MAX_COLS = IsLandscape ? 15 : 8;

    var colLength = selectedDatasets.length + selectedFilters.length;
    var renderNumber = Math.ceil(colLength / MAX_COLS);

    var tableArray = [];

    for (var i = 0; i < renderNumber; i++) {
      tableArray.push(i + 1);
    }

    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        style: { marginTop: 0 },
        className: '\n          ' + ComparisonReport__tableWrapper + '\n          ' + (this.props.activeTab.id === 'cash' ? ' __condenseRows__ ' : ' ') + '\n        ' },
      this.props.isPrinting ? tableArray.map(function (id, i) {
        return _react2.default.createElement(
          _react2.default.Fragment,
          { key: id },
          _react2.default.createElement(
            _ReportHeaderTemplate2.default,
            _extends({}, _this.props, { isSplit: i > 0 }),
            _react2.default.createElement(_TableHeader3.default, {
              isPrinting: true,
              tableSplitIndex: i,
              IsLandscape: IsLandscape
            })
          ),
          _react2.default.createElement(
            'div',
            { className: 'ComparisonReportTable' },
            _this._renderRows(i)
          )
        );
      }) : _react2.default.createElement(
        _react2.default.Fragment,
        null,
        _react2.default.createElement(
          _ReportHeaderTemplate2.default,
          this.props,
          _react2.default.createElement(_TableHeader3.default, { IsLandscape: IsLandscape })
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable' },
          this._renderRows(0)
        )
      )
    );
  },
  _renderRows: function _renderRows(i) {
    var _this2 = this;

    var MAX_COLS = this.props.IsLandscape ? 15 : 8;

    return this.state.report.tables[this.props.activeTab.table].map(function (row, index) {
      // 0    1     2
      // 0-7, 8-15, 16-...
      var startIndex = i * MAX_COLS;
      var endIndex = startIndex + MAX_COLS;

      var printCols = row.cols.slice(startIndex, endIndex);

      var _cols = _this2.props.isPrinting ? printCols : row.cols;

      var isHeading = row.Props.Hierachy === 1 && _cols.length === 0;

      var BulkComparisonReportTable__row = (0, _classnames2.default)({
        BulkComparisonReportTable__row: true,
        'is-total': row.Props.Hierachy === 5,
        'is-heading': isHeading
      });

      var _colArr = [];
      if (isHeading) {
        var colLength = row.colLength;

        var _maxColLength = _this2.props.isPrinting ? MAX_COLS : colLength;
        for (var step = 0; step < _maxColLength; step++) {
          // Runs 5 times, with values of step 0 through 4.
          _colArr.push(step);
        }
      }
      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: BulkComparisonReportTable__row + ' is-h' + row.Props.Hierachy },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: row.Props.Label,
              description: row.Props.Description
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__data' },
          isHeading && _cols.length === 0 && _colArr.map(function (c) {
            return _react2.default.createElement('div', { key: c, style: { width: '80px' } });
          }),
          _cols.map(function (col, index) {
            return _this2._renderValueRatios(col, index);
          })
        )
      );
    });
  },
  _renderValueRatios: function _renderValueRatios(baseValue, index) {
    if (baseValue.props.Dynamic) {
      var fnMap = ['NotDefined', 'PercentOfIncome', 'PerCow', 'PerKgMS', 'PerMilkingHa', 'PerUsableHa', 'DollarsPerLitre', 'CentsPerLitre', 'RawValue'];

      var selectedRatioId = this.state.ratio.Value;

      var fnId = fnMap[selectedRatioId];
      var caculation = (0, _decimals2.default)(fnId);
      var value = caculation.fn(baseValue.value);

      return _react2.default.createElement(
        'div',
        { key: index, className: '_col' },
        value
      );
    }

    return _react2.default.createElement(
      'div',
      { key: index, className: '_col' },
      (0, _commas.addCommas)(baseValue.value),
      baseValue.props.Percent ? '%' : null
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReportTable, 'ComparisonReportTable', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Report/_Table/index.jsx');
}();

;

/***/ }),
/* 132 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1143);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var tabular__Header = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    if (!this.state.report.hasData) return null;
    return _react2.default.createElement(
      'div',
      null,
      this.renderContent()
    );
  },
  renderContent: function renderContent() {
    var _this = this;

    return this.state.report.tables.TextTable.map(function (row, index) {
      if (row.Props.Hidden) return null;
      return _react2.default.createElement(
        'div',
        { key: index, className: 'ComparisonReportTable__row' },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            row.Props.Label
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__data' },
          row.cols.map(function (col, index) {
            if (col.props.FieldId === 'Name') {
              if (col.value === 'Comparison 1') return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                _this.state.group1
              );
              if (col.value === 'Comparison 2') return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                _this.state.group2
              );
            }
            return _react2.default.createElement(
              'div',
              { key: index, className: '_col' },
              col.value
            );
          })
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(tabular__Header, 'tabular__Header', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_TableHeader/index.jsx');
}();

;

/***/ }),
/* 133 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _decimals = __webpack_require__(195);

var _decimals2 = _interopRequireDefault(_decimals);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReportTable = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleReportFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      },
      ratio: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleReportFilterUpdate();
  },
  _handleReportFilterUpdate: function _handleReportFilterUpdate() {
    var financeRatios = _reportFilters2.default.store.UserReportComparisons[0];
    this.setState({
      ratio: financeRatios['FinanceRatio']
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;
    this.setState({
      report: report
    });
  },
  render: function render() {
    var ComparisonReport__tableWrapper = (0, _classnames2.default)({
      ComparisonReport__tableWrapper: true,
      'menu-open': this.props.menuOpen
    });

    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        style: { marginTop: this.props.headingHeight },
        className: '\n          ' + ComparisonReport__tableWrapper + '\n          ' + (this.props.activeTab.id === 'cash' ? ' __condenseRows__ ' : ' ') + '\n        ' },
      _react2.default.createElement(
        'div',
        { className: 'ComparisonReportTable' },
        this._renderRows()
      )
    );
  },
  _renderRows: function _renderRows() {
    var _this = this;

    return this.state.report.tables[this.props.activeTab.table].map(function (row, index) {
      var isHeading = row.Props.Hierachy === 1 && row.cols.length === 0;
      var ComparisonReportTable__row = (0, _classnames2.default)({
        ComparisonReportTable__row: true,
        'is-total': row.Props.Hierachy === 5,
        'is-heading': isHeading
      });

      var _colArr = [];

      if (isHeading) {
        var colLength = row.colLength;
        // const _maxColLength = this.props.isPrinting ? MAX_COLS : colLength

        for (var step = 0; step < colLength; step++) {
          // Runs 5 times, with values of step 0 through 4.
          _colArr.push(step);
        }
      }

      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: ComparisonReportTable__row + ' is-h' + row.Props.Hierachy },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: row.Props.Label,
              description: row.Props.Description
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__data' },
          isHeading && _colArr.map(function (c) {
            return _react2.default.createElement('div', { key: c, style: { width: '80px' } });
          }),
          row.cols.map(function (col, index) {
            return _this._renderValueRatios(col, index);
          })
        )
      );
    });
  },
  _renderValueRatios: function _renderValueRatios(baseValue, index) {
    if (baseValue.props.Dynamic) {
      var fnMap = ['NotDefined', 'PercentOfIncome', 'PerCow', 'PerKgMS', 'PerMilkingHa', 'PerUsableHa', 'DollarsPerLitre', 'CentsPerLitre', 'RawValue'];

      var selectedRatioId = this.state.ratio.Value;
      var fnId = fnMap[selectedRatioId];
      var caculation = (0, _decimals2.default)(fnId);
      var value = caculation.fn(baseValue.value);

      return _react2.default.createElement(
        'div',
        { key: index, className: '_col' },
        value
      );
    }

    return _react2.default.createElement(
      'div',
      { key: index, className: '_col' },
      (0, _commas.addCommas)(baseValue.value),
      baseValue.props.Percent ? '%' : null
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReportTable, 'ComparisonReportTable', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_Table/index.jsx');
}();

;

/***/ }),
/* 134 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1183);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterModalTemplate = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'FilterModalTemplate' },
      _react2.default.createElement(
        'div',
        { className: 'FilterModalTemplate__Header' },
        _react2.default.createElement(
          'h2',
          { className: '_title' },
          this.props.title
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'FilterModalTemplate__List' },
        this.props.children
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterModalTemplate, 'FilterModalTemplate', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_FilterModalTemplate/index.jsx');
}();

;

/***/ }),
/* 135 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 21.2.5.3 get RegExp.prototype.flags
var anObject = __webpack_require__(11);
module.exports = function () {
  var that = anObject(this);
  var result = '';
  if (that.global) result += 'g';
  if (that.ignoreCase) result += 'i';
  if (that.multiline) result += 'm';
  if (that.unicode) result += 'u';
  if (that.sticky) result += 'y';
  return result;
};


/***/ }),
/* 136 */
/***/ (function(module, exports, __webpack_require__) {

// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(56);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  return cof(it) == 'String' ? it.split('') : Object(it);
};


/***/ }),
/* 137 */
/***/ (function(module, exports) {

exports.f = {}.propertyIsEnumerable;


/***/ }),
/* 138 */
/***/ (function(module, exports, __webpack_require__) {

var core = __webpack_require__(57);
var global = __webpack_require__(16);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});

(module.exports = function (key, value) {
  return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
  version: core.version,
  mode: __webpack_require__(81) ? 'pure' : 'global',
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
});


/***/ }),
/* 139 */
/***/ (function(module, exports, __webpack_require__) {

// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var anObject = __webpack_require__(11);
var aFunction = __webpack_require__(42);
var SPECIES = __webpack_require__(26)('species');
module.exports = function (O, D) {
  var C = anObject(O).constructor;
  var S;
  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};


/***/ }),
/* 140 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/


/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;

function toObject(val) {
	if (val === null || val === undefined) {
		throw new TypeError('Object.assign cannot be called with null or undefined');
	}

	return Object(val);
}

function shouldUseNative() {
	try {
		if (!Object.assign) {
			return false;
		}

		// Detect buggy property enumeration order in older V8 versions.

		// https://bugs.chromium.org/p/v8/issues/detail?id=4118
		var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
		test1[5] = 'de';
		if (Object.getOwnPropertyNames(test1)[0] === '5') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test2 = {};
		for (var i = 0; i < 10; i++) {
			test2['_' + String.fromCharCode(i)] = i;
		}
		var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
			return test2[n];
		});
		if (order2.join('') !== '0123456789') {
			return false;
		}

		// https://bugs.chromium.org/p/v8/issues/detail?id=3056
		var test3 = {};
		'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
			test3[letter] = letter;
		});
		if (Object.keys(Object.assign({}, test3)).join('') !==
				'abcdefghijklmnopqrst') {
			return false;
		}

		return true;
	} catch (err) {
		// We don't expect any of the above to throw, but better to be safe.
		return false;
	}
}

module.exports = shouldUseNative() ? Object.assign : function (target, source) {
	var from;
	var to = toObject(target);
	var symbols;

	for (var s = 1; s < arguments.length; s++) {
		from = Object(arguments[s]);

		for (var key in from) {
			if (hasOwnProperty.call(from, key)) {
				to[key] = from[key];
			}
		}

		if (getOwnPropertySymbols) {
			symbols = getOwnPropertySymbols(from);
			for (var i = 0; i < symbols.length; i++) {
				if (propIsEnumerable.call(from, symbols[i])) {
					to[symbols[i]] = from[symbols[i]];
				}
			}
		}
	}

	return to;
};


/***/ }),
/* 141 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


function checkDCE() {
  /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
  if (
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
  ) {
    return;
  }
  if (true) {
    // This branch is unreachable because this function is only called
    // in production, but the condition is true only in development.
    // Therefore if the branch is still here, dead code elimination wasn't
    // properly applied.
    // Don't change the message. React DevTools relies on it. Also make sure
    // this message doesn't occur elsewhere in this function, or it will cause
    // a false positive.
    throw new Error('^_^');
  }
  try {
    // Verify that the code above has been dead code eliminated (DCE'd).
    __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
  } catch (err) {
    // DevTools shouldn't crash React, no matter what.
    // We should still report in case we break this code.
    console.error(err);
  }
}

if (false) {
  // DCE check should happen before ReactDOM bundle executes so that
  // DevTools can report bad minification during injection.
  checkDCE();
  module.exports = require('./cjs/react-dom.production.min.js');
} else {
  module.exports = __webpack_require__(1359);
}


/***/ }),
/* 142 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {
  module.exports = require('./cjs/react-is.production.min.js');
} else {
  module.exports = __webpack_require__(1364);
}


/***/ }),
/* 143 */
/***/ (function(module, exports) {

//

module.exports = function shallowEqual(objA, objB, compare, compareContext) {
  var ret = compare ? compare.call(compareContext, objA, objB) : void 0;

  if (ret !== void 0) {
    return !!ret;
  }

  if (objA === objB) {
    return true;
  }

  if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) {
    return false;
  }

  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  }

  var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);

  // Test for A's keys different from B.
  for (var idx = 0; idx < keysA.length; idx++) {
    var key = keysA[idx];

    if (!bHasOwnProperty(key)) {
      return false;
    }

    var valueA = objA[key];
    var valueB = objB[key];

    ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;

    if (ret === false || (ret === void 0 && valueA !== valueB)) {
      return false;
    }
  }

  return true;
};


/***/ }),
/* 144 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createBudget = module.exports = function (data, callback) {
  var URL = 'api/session/PostCreateCompCalculatorDataSet';

  (0, _xhr2.default)({
    url: "/" + URL,
    method: 'POST',
    json: data,
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {
    var data = resp.body;

    if (resp.statusCode === 200) {
      _Actions2.default.UPDATE_DATASET_LIST(data.DataSetList);
      // Actions.READ_BUDGET_DATA(data.CompCalculatorOutput)
      // Actions.REPLACE_ACTIVE_DATASET(data)
    }

    if (typeof callback !== 'undefined') {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createBudget, 'POST__createBudget', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__createBudget/index.js');
}();

;

/***/ }),
/* 145 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createDataset = module.exports = function (data, callback) {
  var URL = "api/session/";

  if (data.useActiveDataset) {
    URL += "PostCreateFromActiveDataSet";
  } else {
    URL += "PostCreateDataSet";
  }

  (0, _xhr2.default)({
    url: "/" + URL,
    method: "POST",
    json: data.postData,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var data = resp.body;

    if (resp.statusCode === 200) {

      _Actions2.default.UPDATE_DATASET_LIST(data.DataSetList);
      _Actions2.default.REPLACE_ACTIVE_DATASET(data);
    }

    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createDataset, 'POST__createDataset', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__createDataset/index.js');
}();

;

/***/ }),
/* 146 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__generateReport = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + "api/report/PostGenerateReport",
    method: "POST",
    json: data,
    timeout: 40000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    if (resp.statusCode === 200) {
      // if (data.ReportId === 5) {
      //   window.location = __HOST__ + 'api/file/GetReturnInputFileFromServer?filename=' + resp.body.FileName;
      // } else {
      // }
      _Actions2.default.MAP_REPORT_DATA(resp.body);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__generateReport, 'POST__generateReport', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__generateReport/index.js');
}();

;

/***/ }),
/* 147 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (value) {
  if (!isFinite(value)) return '-';
  return value;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 148 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (textId, list) {
  var FarmAuthList = _dataDefinition2.default.selectOptions.FarmId;
  var lookup = _.find(FarmAuthList, { Title: textId });
  return typeof lookup === 'undefined' ? false : true;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 149 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (hex) {
  var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
  return result ? {
    r: parseInt(result[1], 16),
    g: parseInt(result[2], 16),
    b: parseInt(result[3], 16),
    rgb: parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ',' + parseInt(result[3], 16)
  } : null;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 150 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _POST__createBudget = __webpack_require__(144);

var _POST__createBudget2 = _interopRequireDefault(_POST__createBudget);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _CCTextInput = __webpack_require__(256);

var _CCTextInput2 = _interopRequireDefault(_CCTextInput);

var _getYearId = __webpack_require__(464);

var _getYearId2 = _interopRequireDefault(_getYearId);

var _style = __webpack_require__(462);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilteringDatasetList = __webpack_require__(155);

var _FilteringDatasetList2 = _interopRequireDefault(_FilteringDatasetList);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _Portal3 = __webpack_require__(5);

var _Portal4 = _interopRequireDefault(_Portal3);

var _FilterBar = __webpack_require__(289);

var _FilterBar2 = _interopRequireDefault(_FilterBar);

var _SelectInput = __webpack_require__(460);

var _SelectInput2 = _interopRequireDefault(_SelectInput);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = (0, _xchReactClass2.default)({
  // withRouter: true,
}, {
  mixins: [_reflux2.default.listenTo(_datasetList2.default, '_handleNewData'), (0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      Name: this.props.Name || 'New Budget',
      Description: '',
      FinancialYearId: (0, _getYearId2.default)(),
      list: [],
      createBudgetPending: false,
      datasetId: this.props.datasetId || this.props.copyId
    };
  },
  componentWillMount: function componentWillMount() {
    if (_datasetList2.default.store.length >= 1) {
      this._handleNewData();
    }
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      list: (0, _filterVisibleDatasets2.default)()
    });
  },
  _handleItemClick: function _handleItemClick(dataset) {
    console.log(dataset.Id);
    this.setState({
      // createBudgetPending: true,
      datasetId: dataset.Id
    });
  },
  render: function render() {
    var _this = this;

    var _props = this.props,
        Button = _props.Button,
        useFont = _props.useFont,
        successFn = _props.successFn,
        copyId = _props.copyId,
        sourceId = _props.sourceId;
    var datasetId = this.state.datasetId;


    var DefaultButton = function DefaultButton(_ref) {
      var onOpen = _ref.onOpen;
      return _react2.default.createElement(
        _style.CreateButton,
        { useFont: useFont, onClick: onOpen },
        _react2.default.createElement(_style.CalculatorIcon, null),
        'Create ',
        useFont ? 'new budget' : 'Budget'
      );
    };
    var _CreateButtonFn = Button || DefaultButton;

    var yearList = _dataDefinition2.default.selectOptions.FinancialYearId || [];

    var startingYearId = (0, _getYearId2.default)();

    var futureYearList = yearList.filter(function (year) {
      return year.Id >= startingYearId;
    });

    var _sourceId = sourceId || datasetId;
    var _source = _.find(this.state.list, { Id: _sourceId }) || {};
    var _sourceYear = _.find(yearList, { Id: _source.FinancialYearId }) || {}; // sourceYear.Title

    return _react2.default.createElement(
      _Portal2.default,
      { fullscreen: true, background: '#EDF6F7', Button: _CreateButtonFn },
      function (_ref2) {
        var onToggle = _ref2.onToggle,
            onOpen = _ref2.onOpen,
            onClose = _ref2.onClose;
        return _react2.default.createElement(
          _DAStandardPortal2.default,
          { onClose: onClose },
          _react2.default.createElement(
            _style.Root,
            { small: datasetId },
            _react2.default.createElement(
              _style.Title,
              null,
              'Create a new budget'
            ),
            _react2.default.createElement(
              _style.Content,
              null,
              _react2.default.createElement(
                _style.Text,
                null,
                datasetId ? _react2.default.createElement(
                  _style.SubHeaderLeft,
                  null,
                  datasetId && !_this.props.datasetId && _react2.default.createElement(
                    _style.BackButton,
                    {
                      onClick: function onClick() {
                        return _this.setState({ datasetId: undefined });
                      } },
                    _react2.default.createElement(
                      _style.BackButtonContent,
                      null,
                      _react2.default.createElement(_style.BackIcon, null),
                      'Back'
                    )
                  ),
                  _react2.default.createElement(
                    _style.SourceText,
                    null,
                    'Source Dataset:',
                    ' ',
                    _react2.default.createElement(
                      'span',
                      {
                        style: {
                          display: 'inline-block',
                          marginLeft: '8px'
                        } },
                      _source.Name,
                      ' - ',
                      _source.DairyBaseId,
                      ' -',
                      ' ',
                      _sourceYear.Title
                    )
                  )
                ) : 'Start by selecting a year of history - this will be used as the source data for your budget.'
              ),
              datasetId ? _react2.default.createElement(
                'div',
                null,
                _react2.default.createElement(
                  _style.SubHeader,
                  null,
                  _react2.default.createElement(
                    _style.Inputs,
                    null,
                    _react2.default.createElement(
                      _style.YearLabel,
                      null,
                      'Budget Year'
                    ),
                    _react2.default.createElement(_SelectInput2.default, {
                      options: futureYearList,
                      value: _this.state.FinancialYearId,
                      onSubmit: function onSubmit(newValue) {
                        return _this.setState({
                          FinancialYearId: newValue
                        });
                      }
                    }),
                    _react2.default.createElement(
                      _style.YearLabel,
                      null,
                      'Budget Name'
                    ),
                    _react2.default.createElement(_CCTextInput2.default, {
                      id: 'Name',
                      value: _this.state.Name,
                      onSubmit: function onSubmit(newValue) {
                        return _this.setState({ Name: newValue });
                      }
                    }),
                    _react2.default.createElement(
                      _style.YearLabel,
                      null,
                      'Budget Description'
                    ),
                    _react2.default.createElement(_style.InputTextArea, {
                      rows: '3',
                      id: 'description',
                      value: _this.state.Description,
                      placeholder: 'A short description of this budget...',
                      onChange: function onChange(evt) {
                        return _this.setState({ Description: evt.target.value });
                      }
                    })
                  )
                )
              ) : _react2.default.createElement(
                'div',
                null,
                _react2.default.createElement(
                  'div',
                  {
                    style: {
                      position: 'sticky',
                      zIndex: 10,
                      top: 0,
                      marginRight: '-15px',
                      paddingBottom: '20px'
                    } },
                  _react2.default.createElement(_FilterBar2.default, null)
                ),
                _react2.default.createElement(_FilteringDatasetList2.default, {
                  extraFilter: function extraFilter(list) {
                    return list.filter(function (d) {
                      return d.IsActual;
                    });
                  },
                  list: _this.state.list,
                  emitItemClick: _this._handleItemClick
                })
              )
            ),
            datasetId && _react2.default.createElement(
              _style.Submit,
              null,
              _react2.default.createElement(
                _style.SubmitButton,
                {
                  onClick: function onClick() {
                    return _this.setState({ createBudgetPending: true });
                  } },
                'Create Budget'
              )
            )
          ),
          _react2.default.createElement(_DARequestPortal2.default, {
            isOpen: _this.state.createBudgetPending,
            onSuccess: function onSuccess(data) {
              if (_this.props.tidyUp) onClose();
              var budgetId = data.body.CompCalculatorOutput.ScenarioDataset.Id;

              _this.props.history.push('/budget/' + budgetId + '/editor');
              _this.setState({ createBudgetPending: false });
            },
            onClose: function onClose() {
              return _this.setState({ createBudgetPending: false });
            },
            request: function request(callback) {
              return (0, _POST__createBudget2.default)({
                _isBudgetCopy: copyId ? true : undefined,
                FarmDataSetId: _this.state.datasetId,
                FinancialYearId: _this.state.FinancialYearId,
                Name: _this.state.Name
              }, callback);
            },
            text: {
              pendingTitle: 'Please wait a moment...',
              pendingDescription: 'Generating new budget dataset.',
              successTitle: 'Success!',
              successDescription: 'Your budget dataset has been created.',
              successButton: 'Launch budget editor',
              errorTitle: 'Oops, something went wrong',
              errorDescription: 'Connection timed out.'
            }
          })
        );
      }
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 151 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1027);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var CheckBox = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: +this.props.value
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (+newProps.value !== +this.props.value) {
      this.setState({
        value: +newProps.value
      });
    }
  },
  _handleSubmitData: function _handleSubmitData() {
    if (this.props.disabled) return;
    this.props.onSubmit(+this.props.value ? 0 : 1, this.props.id);
  },
  render: function render() {

    var InputSwitchbox = (0, _classnames2.default)({
      'InputSwitchbox': true,
      'is-error': this.props.error
    });

    var checkClasses = (0, _classnames2.default)({
      '_box': true,
      'is-checked': +this.props.value,
      'is-disabled': this.props.disabled
    });

    return _react2.default.createElement(
      'label',
      { className: InputSwitchbox },
      _react2.default.createElement(
        'div',
        { className: checkClasses, onClick: this._handleSubmitData },
        _react2.default.createElement('div', { className: '_check' })
      ),
      _react2.default.createElement(
        'span',
        { className: '_title' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.label,
          description: this.props.description })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(CheckBox, 'CheckBox', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_CheckBox/index.jsx');
}();

;

/***/ }),
/* 152 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1039);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var InputNumber = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (this.state.isFocused && !this.props.error) return;
    this.setState({
      value: newProps.value
    });
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.setState({
        isFocused: true
      }, function () {
        setTimeout(function () {
          if (_this.state.isFocused) {
            var input = _this.my_input;
            input.select();
            input.addEventListener('mousewheel', _this._preventScroll);
          }
        }, 30);
      });
    }
  },
  _preventScroll: function _preventScroll(event) {
    event.preventDefault();
  },
  _handleBlur: function _handleBlur() {
    var input = this.my_input;
    input.removeEventListener('mousewheel', this._preventScroll);
    this.setState({
      isFocused: false
    }, function () {
      this._validateData();
    });
  },
  _handleChange: function _handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 13:
        // Enter
        this._validateData();
        break;
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    this.setState({
      isFocused: false,
      value: this.props.value
    });
  },
  _validateData: function _validateData() {
    // Maybe validate character length etc here?

    var newValue = this.state.value;
    if (newValue === this.props.value && !this.props.error || this.props.disabled) {
      // not valid?
      return;
    }

    // is valid
    return this._handleSubmitData();
  },
  _handleSubmitData: function _handleSubmitData() {
    // Send data out to smart handler
    this.props.onSubmit(this.state.value, this.props.id);
  },
  render: function render() {
    var _this2 = this;

    var classList = (0, _classnames2.default)({
      InputText: true,
      'is-disabled': this.props.disabled,
      'is-focused': this.state.isFocused,
      'is-error': this.props.error
    });

    return _react2.default.createElement(
      'div',
      { ref: function ref(_ref2) {
          return _this2.my_input_wrapper = _ref2;
        }, className: classList },
      _react2.default.createElement('input', {
        ref: function ref(_ref) {
          return _this2.my_input = _ref;
        },
        className: '_input',
        type: 'text',
        disabled: this.props.disabled,
        value: this.state.value,
        onFocus: this._handleFocus,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(InputNumber, 'InputNumber', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_TextInput/index.jsx');
}();

;

/***/ }),
/* 153 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1040);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Popup = __webpack_require__(157);

var _Popup2 = _interopRequireDefault(_Popup);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var PopupButton = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      popupIsActive: false
    };
  },
  _hasDescription: function _hasDescription() {
    return typeof this.props.description === 'string' && this.props.description !== '';
  },
  _togglePopup: function _togglePopup() {
    var _this = this;

    if (this._hasDescription()) {
      this.setState({
        popupIsActive: !this.state.popupIsActive,
        coords: (0, _getDomCoords3.default)(this.label)
      }, function () {
        _this.state.popupIsActive ? document.addEventListener('click', _this._togglePopup) : document.removeEventListener('click', _this._togglePopup);
      });
    }
  },
  render: function render() {
    var _this2 = this;

    return _react2.default.createElement(
      'button',
      {
        ref: function ref(_ref) {
          return _this2.label = _ref;
        },
        className: 'PopupButton',
        onClick: this._togglePopup },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        this.props.children
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.popupIsActive,
          className: 'Popup' },
        _react2.default.createElement(_Popup2.default, { coords: this.state.coords, text: this.props.description })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(PopupButton, 'PopupButton', 'C:/_repos_windows/dairybase/Frontend/app/views/global/PopupButton/index.jsx');
}();

;

/***/ }),
/* 154 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1046);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _Item = __webpack_require__(480);

var _Item2 = _interopRequireDefault(_Item);

var _getAllDatasetFilters = __webpack_require__(266);

var _getAllDatasetFilters2 = _interopRequireDefault(_getAllDatasetFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterHeader = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, "_handleNewFilter")],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _clearFilter: function _clearFilter() {
    _Actions2.default.CLEAR_DATASETLIST_FILTER();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      list: (0, _getAllDatasetFilters2.default)(),
      filtering: _datasetListFilter2.default.filtering
    });
  },
  render: function render() {
    return !this.state.filtering ? null : _react2.default.createElement(
      'div',
      { className: 'FilterHeader' },
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(
          'h3',
          { className: '_intro' },
          'Filtered datasets:'
        ),
        _react2.default.createElement(
          'div',
          { className: '_filters' },
          this._renderFilters()
        )
      ),
      _react2.default.createElement(
        'button',
        { className: '_btn', onClick: this._clearFilter },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' }),
          _react2.default.createElement(
            'span',
            { className: '_text' },
            'clear filter'
          )
        )
      )
    );
  },
  _renderFilters: function _renderFilters() {
    return this.state.list.map(function (filter, index) {
      return _react2.default.createElement(_Item2.default, {
        key: index,
        title: filter.title,
        id: filter.id,
        filter: filter.filter });
    });
  }
});

module.exports = FilterHeader;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterHeader, 'FilterHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilterHeader/index.jsx');
}();

;

/***/ }),
/* 155 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1051);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _RecentlyOpen = __webpack_require__(483);

var _RecentlyOpen2 = _interopRequireDefault(_RecentlyOpen);

var _FilteredList = __webpack_require__(482);

var _FilteredList2 = _interopRequireDefault(_FilteredList);

var _UnfilteredList = __webpack_require__(198);

var _UnfilteredList2 = _interopRequireDefault(_UnfilteredList);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _GroupFilters = __webpack_require__(197);

var _GroupFilters2 = _interopRequireDefault(_GroupFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetList2.default, '_handleNewData'), _reflux2.default.listenTo(_activeDataset2.default, '_handleDatasetUpdate'), _reflux2.default.listenTo(_datasetListGroups2.default, '_handleNewData')],

  getInitialState: function getInitialState() {
    return {
      unfilteredList: [],
      list: [],
      recentlyOpen: [],
      activeDatasetId: 1
    };
  },
  componentWillMount: function componentWillMount() {
    if (_datasetList2.default.store.length >= 1) {
      this._handleNewData();
      this._handleDatasetUpdate();
    }
  },
  _handleDatasetUpdate: function _handleDatasetUpdate() {
    this.setState({
      activeDatasetId: _activeDataset2.default.id
    });
  },
  _handleNewData: function _handleNewData() {
    var listGroups = _datasetListGroups2.default.store;
    var visibleList = (0, _filterVisibleDatasets2.default)();

    this.setState({
      unfilteredList: visibleList,
      recentlyOpen: visibleList,
      list: visibleList.filter(function (item) {
        var user = item.OwnerName;
        var _budgets = item._budgets,
            _isOrphan = item._isOrphan;

        var itemHasBudgets = (_budgets && _budgets.length > 0 || _isOrphan) && listGroups.budgets;

        if (item.IsCcModel) {
          return listGroups.budgets;
        }

        if (item.IsThisOwner) {
          return listGroups.user || itemHasBudgets;
        }

        if (item.SystemDataSet) {
          return listGroups.industry || itemHasBudgets;
        }

        return listGroups.other || itemHasBudgets;
      })
    });
  },
  render: function render() {
    var _this = this;

    var _state = this.state,
        list = _state.list,
        recentlyOpen = _state.recentlyOpen;
    var extraFilter = this.props.extraFilter;

    var _list = extraFilter ? extraFilter(list) : list;
    var _recentlyOpenList = extraFilter ? extraFilter(recentlyOpen).filter(function (d) {
      return d.Id === _this.state.activeDatasetId;
    }) : recentlyOpen;

    return _react2.default.createElement(
      'div',
      { className: 'FilteringDatasetList' },
      _react2.default.createElement(
        'div',
        { className: '_insideFilter' },
        _react2.default.createElement(_GroupFilters2.default, { onSelectDataset: this.props.emitItemClick })
      ),
      _react2.default.createElement(_RecentlyOpen2.default, {
        list: _recentlyOpenList,
        activeDatasetId: this.state.activeDatasetId,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        hasCheckbox: this.props.hasCheckbox
      }),
      _react2.default.createElement(_FilteredList2.default, {
        list: _list,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        hasCheckbox: this.props.hasCheckbox
      }),
      _react2.default.createElement(_UnfilteredList2.default, {
        list: _list,
        listComponent: _DatasetList2.default,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        hasCheckbox: this.props.hasCheckbox
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilteringDatasetList/index.jsx');
}();

;

/***/ }),
/* 156 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        className: 'RequestModal__Portal',
        isOpen: this.props.isOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this.props.successHandler,
        failHandler: this.props.failHandler,
        request: this.props.request,
        GET: this.props.GET,
        data: this.props.data,
        pendingText: this.props.pendingText,
        successText: this.props.successText,
        failText: this.props.failText })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/RequestPortal/index.js');
}();

;

/***/ }),
/* 157 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1081);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _velocityAnimate = __webpack_require__(186);

var _velocityAnimate2 = _interopRequireDefault(_velocityAnimate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Popup = module.exports = __webpack_require__(1)({
  componentDidMount: function componentDidMount() {
    (0, _velocityAnimate2.default)(this.popup, {
      translateY: ['-100%', '-60%'],
      scale: [1.0, 0.4]
    }, {
      easing: [0.42, 0.23, 0.03, 1.35],
      duration: 250
    });
  },
  createMarkup: function createMarkup() {
    return { __html: this.props.text };
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      {
        ref: function ref(_ref2) {
          return _this.popup = _ref2;
        },
        className: '_popup',
        style: {
          top: this.props.coords.top,
          left: this.props.coords.left
        } },
      _react2.default.createElement(
        'div',
        { ref: function ref(_ref) {
            return _this.content = _ref;
          }, className: '_content' },
        _react2.default.createElement('p', {
          className: 'DescriptionLabel__text',
          dangerouslySetInnerHTML: this.createMarkup()
        })
      ),
      _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'curvedtriangledown' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Popup, 'Popup', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_Popup/index.jsx');
}();

;

/***/ }),
/* 158 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _NumberInput = __webpack_require__(549);

var _NumberInput2 = _interopRequireDefault(_NumberInput);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  // withRouter: true,
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var _props = this.props,
        FieldKey = _props.FieldKey,
        IsInput = _props.IsInput,
        IsSource = _props.IsSource,
        IsDifference = _props.IsDifference,
        ratio = _props.ratio,
        FeedRecordIds = _props.FeedRecordIds,
        isGrey = _props.isGrey;

    // extra optional props for input:
    // onFocus={}
    // onBlur={}
    // readOnly={}
    // percent={}
    // autofocus={}
    // frontUnit={}
    // backUnit={}
    // CustomStyle={}

    return _react2.default.createElement(
      _ConnectedCCField2.default,
      {
        FeedRecordIds: FeedRecordIds,
        IsSource: IsSource,
        FieldKey: FieldKey,
        IsDifference: IsDifference,
        ratio: ratio },
      function (_ref) {
        var Value = _ref.Value,
            onSubmit = _ref.onSubmit,
            Decimal = _ref.Decimal,
            disabled = _ref.disabled,
            error = _ref.error;
        return _react2.default.createElement(_NumberInput2.default, {
          value: Value,
          decimal: Decimal,
          percent: false,
          onSubmit: onSubmit,
          disabled: disabled,
          readOnly: !IsInput,
          error: error,
          isGrey: isGrey
        });
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 159 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1147);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _TableHeader = __webpack_require__(300);

var _TableHeader2 = _interopRequireDefault(_TableHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartHeader = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      ratio: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  componentDidMount: function componentDidMount() {
    this._onHeadingHeightChange();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportFarmClients[0];
    var ratio = filters.FinanceRatioId;
    this.setState({
      ratio: _.find(ratio.Options, { Id: ratio.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var _this = this;

    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    }, function () {
      _this._onHeadingHeightChange();
    });
  },
  _onHeadingHeightChange: function _onHeadingHeightChange() {
    var _this2 = this;

    setTimeout(function () {
      var headingHeight = _this2.TableHeader.offsetHeight;
      _this2.props.emitHeadingHeightChange(headingHeight);
    }, 0);
  },
  _onClick: function _onClick() {
    if (this.props.isPrinting) return;
    this.props.emitToggleMenu(this._onHeadingHeightChange);
  },
  render: function render() {
    var _this3 = this;

    var DFMPBulkReportHeaderTemplate = (0, _classnames2.default)({
      DFMPBulkReportHeaderTemplate: true,
      'menu-open': this.props.menuOpen,
      isPrinting: this.props.isPrinting,
      isSplit: this.props.isSplit
    });
    return _react2.default.createElement(
      'div',
      {
        className: DFMPBulkReportHeaderTemplate,
        ref: function ref(_ref) {
          return _this3.TableHeader = _ref;
        } },
      _react2.default.createElement(
        'div',
        { className: 'Legend__Header' },
        this.renderRation()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__content' },
        _react2.default.createElement(_TableHeader2.default, this.props)
      )
    );
  },
  renderRation: function renderRation() {
    return this.props.ratio ? _react2.default.createElement(
      'div',
      { className: '_ratio', key: 1 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        ' Selected Financial Ratio: '
      ),
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this.state.ratio
      )
    ) : _react2.default.createElement(
      'div',
      { className: '_ratio', key: 2 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        'Report Detail'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartHeader, 'ChartHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/ReportHeaderTemplate/index.jsx');
}();

;

/***/ }),
/* 160 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { key: this.props.tabKey, className: 'SingleReport__tableHeadings' },
      _react2.default.createElement('div', { className: 'SingleReport__MapHeader' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_MapHeader/index.jsx');
}();

;

/***/ }),
/* 161 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1168);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var index = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      filterRequestPortalOpen: false,
      filterRequestFields: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.SingleDataSetReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  _onFilterChange: function _onFilterChange(newValue, fieldId) {
    this.setState({
      filterRequestFields: _defineProperty({}, fieldId, newValue),
      filterRequestPortalOpen: true
    });
  },
  _toggleFilterRequestPortal: function _toggleFilterRequestPortal() {
    this.setState({
      filterRequestPortalOpen: !this.state.filterRequestPortalOpen
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      { key: this.props.tabKey, className: 'SingleReport__tableHeadings' },
      this._renderHeadings()
    );
  },
  _renderHeadings: function _renderHeadings() {
    var _this = this;

    var row = this.state.report.tables.TextTable[0];
    var filters = !this.props.activeTab.balanceSheet ? this.props.filters : _.take(this.props.filters, 3);
    return _react2.default.createElement(
      'div',
      { className: 'SingleReportTable__row is-heading' },
      _react2.default.createElement(
        'div',
        { className: 'SingleReportTable__label' },
        _react2.default.createElement(
          'div',
          { className: '_hierachy' },
          row.Props.Hierachy
        ),
        _react2.default.createElement(
          'div',
          { className: '_label' },
          row.Props.Label
        ),
        _react2.default.createElement(
          'div',
          { className: '_unit' },
          row.Props.Unit
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'SingleReportTable__data is-calculated-data' },
        _react2.default.createElement(
          'div',
          { className: '_col' },
          this.props.activeTab.balanceSheet ? 'Opening' : 'Value'
        ),
        !this.props.activeTab.balanceSheet ? null : _react2.default.createElement(
          'div',
          { className: '_col' },
          'Closing'
        ),
        !this.props.activeTab.balanceSheet ? null : _react2.default.createElement(
          'div',
          { className: '_col' },
          'Average'
        ),
        filters.map(function (filter, index) {
          return _react2.default.createElement(
            'div',
            { key: index, className: 'SelectableReportHeader' },
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'span',
                { className: '_text' },
                _.find(filter.Options, { Id: filter.Value }).Title
              ),
              _react2.default.createElement(_Icon2.default, { id: 'downarrow', className: '_icon' })
            ),
            _react2.default.createElement(_InputSelect2.default, {
              value: filter.Value,
              id: filter.FieldId,
              options: filter.Options,
              onSubmit: _this._onFilterChange
            })
          );
        })
      ),
      this._renderFilterRequestPortal()
    );
  },
  _renderFilterRequestPortal: function _renderFilterRequestPortal() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.filterRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._toggleFilterRequestPortal,
        failHandler: this._toggleFilterRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: 'UserReportSingles',
          Fields: this.state.filterRequestFields
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        }
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_CalculatedHeader/index.jsx');
}();

;

/***/ }),
/* 162 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _financeCalculations = __webpack_require__(124);

var _financeCalculations2 = _interopRequireDefault(_financeCalculations);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Table = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.SingleDataSetReport;
    if (typeof report === 'undefined') return;
    this.setState({
      report: report
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        className: 'SingleReport__tableWrapper\n          ' + (this.props.activeTab.id === 'cash' ? '__condenseRows__' : '') + '\n        ',
        style: { marginTop: this.props.headingHeight } },
      _react2.default.createElement(
        'div',
        { key: this.props.tabKey, className: 'SingleReportTable' },
        this._renderRows()
      )
    );
  },
  _renderRows: function _renderRows() {
    var _this = this;

    return this.state.report.tables[this.props.activeTab.table].map(function (row, index) {
      var isSummary = _this.props.activeTab.summary && index === 0;
      var isHeading = row.Props.Hierachy === 1 && row.cols.length === 0;

      var SingleReportTable__row = (0, _classnames2.default)({
        SingleReportTable__row: true,
        'is-summary': isSummary,
        'is-total': row.Props.Hierachy === 5,
        'is-row-heading': isHeading && !isSummary
      });

      var SingleReportTable__data = (0, _classnames2.default)({
        SingleReportTable__data: true,
        'is-calculated-data': true,
        'is-summary': _this.props.activeTab.summary && index === 0
      });

      var _colArr = [];

      if (isHeading) {
        var colLength = row.colLength;
        // const _maxColLength = this.props.isPrinting ? MAX_COLS : colLength

        for (var step = 0; step < colLength; step++) {
          // Runs 5 times, with values of step 0 through 4.
          _colArr.push(step);
        }
      }

      var noRatioLastRow = _this.props.activeTab.balanceSheet && index === _this.state.report.tables[_this.props.activeTab.table].length - 1;

      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: SingleReportTable__row + ' is-h' + row.Props.Hierachy },
        _react2.default.createElement(
          'div',
          { className: 'SingleReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: row.Props.Label,
              description: row.Props.Description
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: SingleReportTable__data },
          row.cols.map(function (col, index) {
            if (col.props !== undefined) {
              var isAvg = index === row.cols.length - 1 && !noRatioLastRow;
              return _this._renderValueRatios(col, isAvg, index);
            } else {
              return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                col
              );
            }
          })
        )
      );
    });
  },
  _renderValueRatios: function _renderValueRatios(baseValue, isAvg, index) {
    var _this2 = this;

    var baseColHTML = _react2.default.createElement(
      'div',
      { key: 'basevalue00_' + index, className: '_col' },
      baseValue.props.Text || typeof baseValue.value !== 'number' ? baseValue.value : (0, _commas.addCommas)(baseValue.value.toFixed(baseValue.props.Decimal)),
      baseValue.props.Percent ? '%' : null
    );

    if (!isAvg) return baseColHTML;

    var filters = !this.props.activeTab.balanceSheet ? this.props.filters : _.take(this.props.filters, 3);

    var colHTML = filters.map(function (col, index) {
      var fnMap = ['NotDefined', 'PercentOfIncome', 'PerCow', 'PerKgMS', 'PerUsableHa', 'PerMilkingHa', 'DollarsPerLitre', 'CentsPerLitre', 'NotDefined'];

      var modifiers = {};
      _.forOwn(_this2.state.report.ratios, function (value, key) {
        modifiers[key] = value[0];
      });

      var selectedRatioId = col.Value;
      var fnId = fnMap[selectedRatioId];
      var caculation = (0, _financeCalculations2.default)(fnId, modifiers);
      var value = caculation.fn(baseValue.value);
      return _react2.default.createElement(
        'div',
        { key: index, className: '_col' },
        value
      );
    });

    colHTML.unshift(baseColHTML);

    return baseValue.props.Dynamic ? colHTML : baseColHTML;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Table, 'Table', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_Table/index.jsx');
}();

;

/***/ }),
/* 163 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1177);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartHeader = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      ratio: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  componentDidMount: function componentDidMount() {
    this._onHeadingHeightChange();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var ratio = filters.FinanceRatio;
    this.setState({
      ratio: _.find(ratio.Options, { Id: ratio.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var _this = this;

    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    }, function () {
      _this._onHeadingHeightChange();
    });
  },
  _onHeadingHeightChange: function _onHeadingHeightChange() {
    var _this2 = this;

    setTimeout(function () {
      var headingHeight = _this2.TableHeader.offsetHeight;
      _this2.props.emitHeadingHeightChange(headingHeight);
    }, 0);
  },
  _onClick: function _onClick() {
    if (this.props.isPrinting) return;
    this.props.emitToggleMenu(this._onHeadingHeightChange);
  },
  render: function render() {
    var _this3 = this;

    var ReportHeaderTemplate = (0, _classnames2.default)({
      ReportHeaderTemplate: true,
      'menu-open': this.props.menuOpen
    });
    return _react2.default.createElement(
      'div',
      {
        className: ReportHeaderTemplate,
        ref: function ref(_ref) {
          return _this3.TableHeader = _ref;
        } },
      _react2.default.createElement(
        'div',
        { className: 'Legend__Header' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._onClick },
          this.props.menuOpen ? 'collapse' : 'expand'
        ),
        this.renderRation()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__content' },
        this.props.children
      )
    );
  },
  renderRation: function renderRation() {
    return this.props.ratio ? _react2.default.createElement(
      'div',
      { className: '_ratio', key: 1 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        ' Selected Financial Ratio: '
      ),
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this.state.ratio
      )
    ) : _react2.default.createElement(
      'div',
      { className: '_ratio', key: 2 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        'Report Detail'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartHeader, 'ChartHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/ReportHeaderTemplate/index.jsx');
}();

;

/***/ }),
/* 164 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1188);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Steps = __webpack_require__(701);

var _Steps2 = _interopRequireDefault(_Steps);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate = module.exports = __webpack_require__(1)({

  mixins: [(0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    var initialStepId = this.props.initialStepId;

    return {
      activeStepId: initialStepId || 'datasets',
      printPortalOpen: true
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (newProps.reportLoaded) return this._changeStep('report');
  },
  _changeStep: function _changeStep(id) {
    this.props.emitResetScroll();
    this.setState({
      activeStepId: id
    });
  },
  render: function render() {

    var scrollbarWidth = (0, _getScrollbarWidth2.default)();

    var _activeStep = _.find(this.props.steps, { id: this.state.activeStepId });
    var ActiveStepHandler = _activeStep.handler;

    var zzzProps = _.cloneDeep(this.props);
    zzzProps.activeStep = _activeStep;
    zzzProps.emitChangeStep = this._changeStep;
    zzzProps.key = _activeStep.id;

    return _react2.default.createElement(
      'div',
      { className: 'ReportStepTemplate' },
      _react2.default.createElement(
        _Portal2.default,
        {
          context: this.props.bannerDOMRef,
          isOpen: this.state.permaPortalOpen },
        _react2.default.createElement(
          'div',
          { className: 'ReportStepTemplate__header', style: { right: scrollbarWidth } },
          _react2.default.createElement(
            'div',
            { className: '_container' },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Steps2.default, {
                steps: this.props.steps,
                approvedStep: this.props.approvedStep,
                activeStepId: this.state.activeStepId,
                emitStepChange: this._changeStep })
            )
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'ReportStepTemplate__content' },
        _react2.default.createElement(
          'div',
          { className: '_container' },
          _react2.default.createElement(ActiveStepHandler, zzzProps)
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate, 'ReportTemplate', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportStepTemplate/index.jsx');
}();

;

/***/ }),
/* 165 */
/***/ (function(module, exports, __webpack_require__) {

// false -> Array#indexOf
// true  -> Array#includes
var toIObject = __webpack_require__(55);
var toLength = __webpack_require__(27);
var toAbsoluteIndex = __webpack_require__(102);
module.exports = function (IS_INCLUDES) {
  return function ($this, el, fromIndex) {
    var O = toIObject($this);
    var length = toLength(O.length);
    var index = toAbsoluteIndex(fromIndex, length);
    var value;
    // Array#includes uses SameValueZero equality algorithm
    // eslint-disable-next-line no-self-compare
    if (IS_INCLUDES && el != el) while (length > index) {
      value = O[index++];
      // eslint-disable-next-line no-self-compare
      if (value != value) return true;
    // Array#indexOf ignores holes, Array#includes - not
    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
      if (O[index] === el) return IS_INCLUDES || index || 0;
    } return !IS_INCLUDES && -1;
  };
};


/***/ }),
/* 166 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var global = __webpack_require__(16);
var $export = __webpack_require__(2);
var redefine = __webpack_require__(49);
var redefineAll = __webpack_require__(100);
var meta = __webpack_require__(82);
var forOf = __webpack_require__(95);
var anInstance = __webpack_require__(94);
var isObject = __webpack_require__(22);
var fails = __webpack_require__(20);
var $iterDetect = __webpack_require__(170);
var setToStringTag = __webpack_require__(115);
var inheritIfRequired = __webpack_require__(222);

module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  var Base = global[NAME];
  var C = Base;
  var ADDER = IS_MAP ? 'set' : 'add';
  var proto = C && C.prototype;
  var O = {};
  var fixMethod = function (KEY) {
    var fn = proto[KEY];
    redefine(proto, KEY,
      KEY == 'delete' ? function (a) {
        return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
      } : KEY == 'has' ? function has(a) {
        return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
      } : KEY == 'get' ? function get(a) {
        return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
      } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
        : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
    );
  };
  if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
    new C().entries().next();
  }))) {
    // create collection constructor
    C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
    redefineAll(C.prototype, methods);
    meta.NEED = true;
  } else {
    var instance = new C();
    // early implementations not supports chaining
    var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
    // V8 ~  Chromium 40- weak-collections throws on primitives, but should return false
    var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
    // most early implementations doesn't supports iterables, most modern - not close it correctly
    var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
    // for early implementations -0 and +0 not the same
    var BUGGY_ZERO = !IS_WEAK && fails(function () {
      // V8 ~ Chromium 42- fails only with 5+ elements
      var $instance = new C();
      var index = 5;
      while (index--) $instance[ADDER](index, index);
      return !$instance.has(-0);
    });
    if (!ACCEPT_ITERABLES) {
      C = wrapper(function (target, iterable) {
        anInstance(target, C, NAME);
        var that = inheritIfRequired(new Base(), target, C);
        if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
        return that;
      });
      C.prototype = proto;
      proto.constructor = C;
    }
    if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
      fixMethod('delete');
      fixMethod('has');
      IS_MAP && fixMethod('get');
    }
    if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
    // weak collections should not contains .clear method
    if (IS_WEAK && proto.clear) delete proto.clear;
  }

  setToStringTag(C, NAME);

  O[NAME] = C;
  $export($export.G + $export.W + $export.F * (C != Base), O);

  if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);

  return C;
};


/***/ }),
/* 167 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

__webpack_require__(344);
var redefine = __webpack_require__(49);
var hide = __webpack_require__(48);
var fails = __webpack_require__(20);
var defined = __webpack_require__(66);
var wks = __webpack_require__(26);
var regexpExec = __webpack_require__(230);

var SPECIES = wks('species');

var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  // #replace needs built-in support for named groups.
  // #match works fine because it just return the exec results, even if it has
  // a "grops" property.
  var re = /./;
  re.exec = function () {
    var result = [];
    result.groups = { a: '7' };
    return result;
  };
  return ''.replace(re, '$<a>') !== '7';
});

var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  var re = /(?:)/;
  var originalExec = re.exec;
  re.exec = function () { return originalExec.apply(this, arguments); };
  var result = 'ab'.split(re);
  return result.length === 2 && result[0] === 'a' && result[1] === 'b';
})();

module.exports = function (KEY, length, exec) {
  var SYMBOL = wks(KEY);

  var DELEGATES_TO_SYMBOL = !fails(function () {
    // String methods call symbol-named RegEp methods
    var O = {};
    O[SYMBOL] = function () { return 7; };
    return ''[KEY](O) != 7;
  });

  var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
    // Symbol-named RegExp methods call .exec
    var execCalled = false;
    var re = /a/;
    re.exec = function () { execCalled = true; return null; };
    if (KEY === 'split') {
      // RegExp[@@split] doesn't call the regex's exec method, but first creates
      // a new one. We need to return the patched regex when creating the new one.
      re.constructor = {};
      re.constructor[SPECIES] = function () { return re; };
    }
    re[SYMBOL]('');
    return !execCalled;
  }) : undefined;

  if (
    !DELEGATES_TO_SYMBOL ||
    !DELEGATES_TO_EXEC ||
    (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
    (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  ) {
    var nativeRegExpMethod = /./[SYMBOL];
    var fns = exec(
      defined,
      SYMBOL,
      ''[KEY],
      function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
        if (regexp.exec === regexpExec) {
          if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
            // The native String method already delegates to @@method (this
            // polyfilled function), leasing to infinite recursion.
            // We avoid it by directly calling the native @@method method.
            return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
          }
          return { done: true, value: nativeMethod.call(str, regexp, arg2) };
        }
        return { done: false };
      }
    );
    var strfn = fns[0];
    var rxfn = fns[1];

    redefine(String.prototype, KEY, strfn);
    hide(RegExp.prototype, SYMBOL, length == 2
      // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
      // 21.2.5.11 RegExp.prototype[@@split](string, limit)
      ? function (string, arg) { return rxfn.call(string, this, arg); }
      // 21.2.5.6 RegExp.prototype[@@match](string)
      // 21.2.5.9 RegExp.prototype[@@search](string)
      : function (string) { return rxfn.call(string, this); }
    );
  }
};


/***/ }),
/* 168 */
/***/ (function(module, exports, __webpack_require__) {

// 7.2.2 IsArray(argument)
var cof = __webpack_require__(56);
module.exports = Array.isArray || function isArray(arg) {
  return cof(arg) == 'Array';
};


/***/ }),
/* 169 */
/***/ (function(module, exports, __webpack_require__) {

// 7.2.8 IsRegExp(argument)
var isObject = __webpack_require__(22);
var cof = __webpack_require__(56);
var MATCH = __webpack_require__(26)('match');
module.exports = function (it) {
  var isRegExp;
  return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
};


/***/ }),
/* 170 */
/***/ (function(module, exports, __webpack_require__) {

var ITERATOR = __webpack_require__(26)('iterator');
var SAFE_CLOSING = false;

try {
  var riter = [7][ITERATOR]();
  riter['return'] = function () { SAFE_CLOSING = true; };
  // eslint-disable-next-line no-throw-literal
  Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }

module.exports = function (exec, skipClosing) {
  if (!skipClosing && !SAFE_CLOSING) return false;
  var safe = false;
  try {
    var arr = [7];
    var iter = arr[ITERATOR]();
    iter.next = function () { return { done: safe = true }; };
    arr[ITERATOR] = function () { return iter; };
    exec(arr);
  } catch (e) { /* empty */ }
  return safe;
};


/***/ }),
/* 171 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// Forced replacement prototype accessors methods
module.exports = __webpack_require__(81) || !__webpack_require__(20)(function () {
  var K = Math.random();
  // In FF throws only define methods
  // eslint-disable-next-line no-undef, no-useless-call
  __defineSetter__.call(null, K, function () { /* empty */ });
  delete __webpack_require__(16)[K];
});


/***/ }),
/* 172 */
/***/ (function(module, exports) {

exports.f = Object.getOwnPropertySymbols;


/***/ }),
/* 173 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var classof = __webpack_require__(113);
var builtinExec = RegExp.prototype.exec;

 // `RegExpExec` abstract operation
// https://tc39.github.io/ecma262/#sec-regexpexec
module.exports = function (R, S) {
  var exec = R.exec;
  if (typeof exec === 'function') {
    var result = exec.call(R, S);
    if (typeof result !== 'object') {
      throw new TypeError('RegExp exec method returned something other than an Object or null');
    }
    return result;
  }
  if (classof(R) !== 'RegExp') {
    throw new TypeError('RegExp#exec called on incompatible receiver');
  }
  return builtinExec.call(R, S);
};


/***/ }),
/* 174 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(2);
var aFunction = __webpack_require__(42);
var ctx = __webpack_require__(58);
var forOf = __webpack_require__(95);

module.exports = function (COLLECTION) {
  $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
    var mapFn = arguments[1];
    var mapping, A, n, cb;
    aFunction(this);
    mapping = mapFn !== undefined;
    if (mapping) aFunction(mapFn);
    if (source == undefined) return new this();
    A = [];
    if (mapping) {
      n = 0;
      cb = ctx(mapFn, arguments[2], 2);
      forOf(source, false, function (nextItem) {
        A.push(cb(nextItem, n++));
      });
    } else {
      forOf(source, false, A.push, A);
    }
    return new this(A);
  } });
};


/***/ }),
/* 175 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(2);

module.exports = function (COLLECTION) {
  $export($export.S, COLLECTION, { of: function of() {
    var length = arguments.length;
    var A = new Array(length);
    while (length--) A[length] = arguments[length];
    return new this(A);
  } });
};


/***/ }),
/* 176 */
/***/ (function(module, exports, __webpack_require__) {

var toInteger = __webpack_require__(60);
var defined = __webpack_require__(66);
// true  -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
  return function (that, pos) {
    var s = String(defined(that));
    var i = toInteger(pos);
    var l = s.length;
    var a, b;
    if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
    a = s.charCodeAt(i);
    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
      ? TO_STRING ? s.charAt(i) : a
      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  };
};


/***/ }),
/* 177 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var hide = __webpack_require__(48);
var uid = __webpack_require__(103);
var TYPED = uid('typed_array');
var VIEW = uid('view');
var ABV = !!(global.ArrayBuffer && global.DataView);
var CONSTR = ABV;
var i = 0;
var l = 9;
var Typed;

var TypedArrayConstructors = (
  'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
).split(',');

while (i < l) {
  if (Typed = global[TypedArrayConstructors[i++]]) {
    hide(Typed.prototype, TYPED, true);
    hide(Typed.prototype, VIEW, true);
  } else CONSTR = false;
}

module.exports = {
  ABV: ABV,
  CONSTR: CONSTR,
  TYPED: TYPED,
  VIEW: VIEW
};


/***/ }),
/* 178 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var navigator = global.navigator;

module.exports = navigator && navigator.userAgent || '';


/***/ }),
/* 179 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var beginDrag_1 = __importDefault(__webpack_require__(928));
var publishDragSource_1 = __importDefault(__webpack_require__(933));
var hover_1 = __importDefault(__webpack_require__(931));
var drop_1 = __importDefault(__webpack_require__(929));
var endDrag_1 = __importDefault(__webpack_require__(930));
__export(__webpack_require__(105));
function createDragDropActions(manager) {
    return {
        beginDrag: beginDrag_1.default(manager),
        publishDragSource: publishDragSource_1.default(manager),
        hover: hover_1.default(manager),
        drop: drop_1.default(manager),
        endDrag: endDrag_1.default(manager),
    };
}
exports.default = createDragDropActions;


/***/ }),
/* 180 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ADD_SOURCE = 'dnd-core/ADD_SOURCE';
exports.ADD_TARGET = 'dnd-core/ADD_TARGET';
exports.REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE';
exports.REMOVE_TARGET = 'dnd-core/REMOVE_TARGET';
function addSource(sourceId) {
    return {
        type: exports.ADD_SOURCE,
        payload: {
            sourceId: sourceId,
        },
    };
}
exports.addSource = addSource;
function addTarget(targetId) {
    return {
        type: exports.ADD_TARGET,
        payload: {
            targetId: targetId,
        },
    };
}
exports.addTarget = addTarget;
function removeSource(sourceId) {
    return {
        type: exports.REMOVE_SOURCE,
        payload: {
            sourceId: sourceId,
        },
    };
}
exports.removeSource = removeSource;
function removeTarget(targetId) {
    return {
        type: exports.REMOVE_TARGET,
        payload: {
            targetId: targetId,
        },
    };
}
exports.removeTarget = removeTarget;


/***/ }),
/* 181 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global) {/**
 * marked - a markdown parser
 * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/chjj/marked
 */

;(function() {

/**
 * Block-Level Grammar
 */

var block = {
  newline: /^\n+/,
  code: /^( {4}[^\n]+\n*)+/,
  fences: noop,
  hr: /^( *[-*_]){3,} *(?:\n+|$)/,
  heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
  nptable: noop,
  lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
  blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
  list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
  html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
  table: noop,
  paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
  text: /^[^\n]+/
};

block.bullet = /(?:[*+-]|\d+\.)/;
block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
block.item = replace(block.item, 'gm')
  (/bull/g, block.bullet)
  ();

block.list = replace(block.list)
  (/bull/g, block.bullet)
  ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
  ('def', '\\n+(?=' + block.def.source + ')')
  ();

block.blockquote = replace(block.blockquote)
  ('def', block.def)
  ();

block._tag = '(?!(?:'
  + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
  + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
  + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';

block.html = replace(block.html)
  ('comment', /<!--[\s\S]*?-->/)
  ('closed', /<(tag)[\s\S]+?<\/\1>/)
  ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
  (/tag/g, block._tag)
  ();

block.paragraph = replace(block.paragraph)
  ('hr', block.hr)
  ('heading', block.heading)
  ('lheading', block.lheading)
  ('blockquote', block.blockquote)
  ('tag', '<' + block._tag)
  ('def', block.def)
  ();

/**
 * Normal Block Grammar
 */

block.normal = merge({}, block);

/**
 * GFM Block Grammar
 */

block.gfm = merge({}, block.normal, {
  fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,
  paragraph: /^/
});

block.gfm.paragraph = replace(block.paragraph)
  ('(?!', '(?!'
    + block.gfm.fences.source.replace('\\1', '\\2') + '|'
    + block.list.source.replace('\\1', '\\3') + '|')
  ();

/**
 * GFM + Tables Block Grammar
 */

block.tables = merge({}, block.gfm, {
  nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
  table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
});

/**
 * Block Lexer
 */

function Lexer(options) {
  this.tokens = [];
  this.tokens.links = {};
  this.options = options || marked.defaults;
  this.rules = block.normal;

  if (this.options.gfm) {
    if (this.options.tables) {
      this.rules = block.tables;
    } else {
      this.rules = block.gfm;
    }
  }
}

/**
 * Expose Block Rules
 */

Lexer.rules = block;

/**
 * Static Lex Method
 */

Lexer.lex = function(src, options) {
  var lexer = new Lexer(options);
  return lexer.lex(src);
};

/**
 * Preprocessing
 */

Lexer.prototype.lex = function(src) {
  src = src
    .replace(/\r\n|\r/g, '\n')
    .replace(/\t/g, '    ')
    .replace(/\u00a0/g, ' ')
    .replace(/\u2424/g, '\n');

  return this.token(src, true);
};

/**
 * Lexing
 */

Lexer.prototype.token = function(src, top, bq) {
  var src = src.replace(/^ +$/gm, '')
    , next
    , loose
    , cap
    , bull
    , b
    , item
    , space
    , i
    , l;

  while (src) {
    // newline
    if (cap = this.rules.newline.exec(src)) {
      src = src.substring(cap[0].length);
      if (cap[0].length > 1) {
        this.tokens.push({
          type: 'space'
        });
      }
    }

    // code
    if (cap = this.rules.code.exec(src)) {
      src = src.substring(cap[0].length);
      cap = cap[0].replace(/^ {4}/gm, '');
      this.tokens.push({
        type: 'code',
        text: !this.options.pedantic
          ? cap.replace(/\n+$/, '')
          : cap
      });
      continue;
    }

    // fences (gfm)
    if (cap = this.rules.fences.exec(src)) {
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: 'code',
        lang: cap[2],
        text: cap[3]
      });
      continue;
    }

    // heading
    if (cap = this.rules.heading.exec(src)) {
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: 'heading',
        depth: cap[1].length,
        text: cap[2]
      });
      continue;
    }

    // table no leading pipe (gfm)
    if (top && (cap = this.rules.nptable.exec(src))) {
      src = src.substring(cap[0].length);

      item = {
        type: 'table',
        header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
        cells: cap[3].replace(/\n$/, '').split('\n')
      };

      for (i = 0; i < item.align.length; i++) {
        if (/^ *-+: *$/.test(item.align[i])) {
          item.align[i] = 'right';
        } else if (/^ *:-+: *$/.test(item.align[i])) {
          item.align[i] = 'center';
        } else if (/^ *:-+ *$/.test(item.align[i])) {
          item.align[i] = 'left';
        } else {
          item.align[i] = null;
        }
      }

      for (i = 0; i < item.cells.length; i++) {
        item.cells[i] = item.cells[i].split(/ *\| */);
      }

      this.tokens.push(item);

      continue;
    }

    // lheading
    if (cap = this.rules.lheading.exec(src)) {
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: 'heading',
        depth: cap[2] === '=' ? 1 : 2,
        text: cap[1]
      });
      continue;
    }

    // hr
    if (cap = this.rules.hr.exec(src)) {
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: 'hr'
      });
      continue;
    }

    // blockquote
    if (cap = this.rules.blockquote.exec(src)) {
      src = src.substring(cap[0].length);

      this.tokens.push({
        type: 'blockquote_start'
      });

      cap = cap[0].replace(/^ *> ?/gm, '');

      // Pass `top` to keep the current
      // "toplevel" state. This is exactly
      // how markdown.pl works.
      this.token(cap, top, true);

      this.tokens.push({
        type: 'blockquote_end'
      });

      continue;
    }

    // list
    if (cap = this.rules.list.exec(src)) {
      src = src.substring(cap[0].length);
      bull = cap[2];

      this.tokens.push({
        type: 'list_start',
        ordered: bull.length > 1
      });

      // Get each top-level item.
      cap = cap[0].match(this.rules.item);

      next = false;
      l = cap.length;
      i = 0;

      for (; i < l; i++) {
        item = cap[i];

        // Remove the list item's bullet
        // so it is seen as the next token.
        space = item.length;
        item = item.replace(/^ *([*+-]|\d+\.) +/, '');

        // Outdent whatever the
        // list item contains. Hacky.
        if (~item.indexOf('\n ')) {
          space -= item.length;
          item = !this.options.pedantic
            ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
            : item.replace(/^ {1,4}/gm, '');
        }

        // Determine whether the next list item belongs here.
        // Backpedal if it does not belong in this list.
        if (this.options.smartLists && i !== l - 1) {
          b = block.bullet.exec(cap[i + 1])[0];
          if (bull !== b && !(bull.length > 1 && b.length > 1)) {
            src = cap.slice(i + 1).join('\n') + src;
            i = l - 1;
          }
        }

        // Determine whether item is loose or not.
        // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
        // for discount behavior.
        loose = next || /\n\n(?!\s*$)/.test(item);
        if (i !== l - 1) {
          next = item.charAt(item.length - 1) === '\n';
          if (!loose) loose = next;
        }

        this.tokens.push({
          type: loose
            ? 'loose_item_start'
            : 'list_item_start'
        });

        // Recurse.
        this.token(item, false, bq);

        this.tokens.push({
          type: 'list_item_end'
        });
      }

      this.tokens.push({
        type: 'list_end'
      });

      continue;
    }

    // html
    if (cap = this.rules.html.exec(src)) {
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: this.options.sanitize
          ? 'paragraph'
          : 'html',
        pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',
        text: cap[0]
      });
      continue;
    }

    // def
    if ((!bq && top) && (cap = this.rules.def.exec(src))) {
      src = src.substring(cap[0].length);
      this.tokens.links[cap[1].toLowerCase()] = {
        href: cap[2],
        title: cap[3]
      };
      continue;
    }

    // table (gfm)
    if (top && (cap = this.rules.table.exec(src))) {
      src = src.substring(cap[0].length);

      item = {
        type: 'table',
        header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
        align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
        cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
      };

      for (i = 0; i < item.align.length; i++) {
        if (/^ *-+: *$/.test(item.align[i])) {
          item.align[i] = 'right';
        } else if (/^ *:-+: *$/.test(item.align[i])) {
          item.align[i] = 'center';
        } else if (/^ *:-+ *$/.test(item.align[i])) {
          item.align[i] = 'left';
        } else {
          item.align[i] = null;
        }
      }

      for (i = 0; i < item.cells.length; i++) {
        item.cells[i] = item.cells[i]
          .replace(/^ *\| *| *\| *$/g, '')
          .split(/ *\| */);
      }

      this.tokens.push(item);

      continue;
    }

    // top-level paragraph
    if (top && (cap = this.rules.paragraph.exec(src))) {
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: 'paragraph',
        text: cap[1].charAt(cap[1].length - 1) === '\n'
          ? cap[1].slice(0, -1)
          : cap[1]
      });
      continue;
    }

    // text
    if (cap = this.rules.text.exec(src)) {
      // Top-level should never reach here.
      src = src.substring(cap[0].length);
      this.tokens.push({
        type: 'text',
        text: cap[0]
      });
      continue;
    }

    if (src) {
      throw new
        Error('Infinite loop on byte: ' + src.charCodeAt(0));
    }
  }

  return this.tokens;
};

/**
 * Inline-Level Grammar
 */

var inline = {
  escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
  autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
  url: noop,
  tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
  link: /^!?\[(inside)\]\(href\)/,
  reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
  nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
  strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
  em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
  code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
  br: /^ {2,}\n(?!\s*$)/,
  del: noop,
  text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
};

inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;

inline.link = replace(inline.link)
  ('inside', inline._inside)
  ('href', inline._href)
  ();

inline.reflink = replace(inline.reflink)
  ('inside', inline._inside)
  ();

/**
 * Normal Inline Grammar
 */

inline.normal = merge({}, inline);

/**
 * Pedantic Inline Grammar
 */

inline.pedantic = merge({}, inline.normal, {
  strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
  em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
});

/**
 * GFM Inline Grammar
 */

inline.gfm = merge({}, inline.normal, {
  escape: replace(inline.escape)('])', '~|])')(),
  url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
  del: /^~~(?=\S)([\s\S]*?\S)~~/,
  text: replace(inline.text)
    (']|', '~]|')
    ('|', '|https?://|')
    ()
});

/**
 * GFM + Line Breaks Inline Grammar
 */

inline.breaks = merge({}, inline.gfm, {
  br: replace(inline.br)('{2,}', '*')(),
  text: replace(inline.gfm.text)('{2,}', '*')()
});

/**
 * Inline Lexer & Compiler
 */

function InlineLexer(links, options) {
  this.options = options || marked.defaults;
  this.links = links;
  this.rules = inline.normal;
  this.renderer = this.options.renderer || new Renderer;
  this.renderer.options = this.options;

  if (!this.links) {
    throw new
      Error('Tokens array requires a `links` property.');
  }

  if (this.options.gfm) {
    if (this.options.breaks) {
      this.rules = inline.breaks;
    } else {
      this.rules = inline.gfm;
    }
  } else if (this.options.pedantic) {
    this.rules = inline.pedantic;
  }
}

/**
 * Expose Inline Rules
 */

InlineLexer.rules = inline;

/**
 * Static Lexing/Compiling Method
 */

InlineLexer.output = function(src, links, options) {
  var inline = new InlineLexer(links, options);
  return inline.output(src);
};

/**
 * Lexing/Compiling
 */

InlineLexer.prototype.output = function(src) {
  var out = ''
    , link
    , text
    , href
    , cap;

  while (src) {
    // escape
    if (cap = this.rules.escape.exec(src)) {
      src = src.substring(cap[0].length);
      out += cap[1];
      continue;
    }

    // autolink
    if (cap = this.rules.autolink.exec(src)) {
      src = src.substring(cap[0].length);
      if (cap[2] === '@') {
        text = cap[1].charAt(6) === ':'
          ? this.mangle(cap[1].substring(7))
          : this.mangle(cap[1]);
        href = this.mangle('mailto:') + text;
      } else {
        text = escape(cap[1]);
        href = text;
      }
      out += this.renderer.link(href, null, text);
      continue;
    }

    // url (gfm)
    if (!this.inLink && (cap = this.rules.url.exec(src))) {
      src = src.substring(cap[0].length);
      text = escape(cap[1]);
      href = text;
      out += this.renderer.link(href, null, text);
      continue;
    }

    // tag
    if (cap = this.rules.tag.exec(src)) {
      if (!this.inLink && /^<a /i.test(cap[0])) {
        this.inLink = true;
      } else if (this.inLink && /^<\/a>/i.test(cap[0])) {
        this.inLink = false;
      }
      src = src.substring(cap[0].length);
      out += this.options.sanitize
        ? escape(cap[0])
        : cap[0];
      continue;
    }

    // link
    if (cap = this.rules.link.exec(src)) {
      src = src.substring(cap[0].length);
      this.inLink = true;
      out += this.outputLink(cap, {
        href: cap[2],
        title: cap[3]
      });
      this.inLink = false;
      continue;
    }

    // reflink, nolink
    if ((cap = this.rules.reflink.exec(src))
        || (cap = this.rules.nolink.exec(src))) {
      src = src.substring(cap[0].length);
      link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
      link = this.links[link.toLowerCase()];
      if (!link || !link.href) {
        out += cap[0].charAt(0);
        src = cap[0].substring(1) + src;
        continue;
      }
      this.inLink = true;
      out += this.outputLink(cap, link);
      this.inLink = false;
      continue;
    }

    // strong
    if (cap = this.rules.strong.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.strong(this.output(cap[2] || cap[1]));
      continue;
    }

    // em
    if (cap = this.rules.em.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.em(this.output(cap[2] || cap[1]));
      continue;
    }

    // code
    if (cap = this.rules.code.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.codespan(escape(cap[2], true));
      continue;
    }

    // br
    if (cap = this.rules.br.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.br();
      continue;
    }

    // del (gfm)
    if (cap = this.rules.del.exec(src)) {
      src = src.substring(cap[0].length);
      out += this.renderer.del(this.output(cap[1]));
      continue;
    }

    // text
    if (cap = this.rules.text.exec(src)) {
      src = src.substring(cap[0].length);
      out += escape(this.smartypants(cap[0]));
      continue;
    }

    if (src) {
      throw new
        Error('Infinite loop on byte: ' + src.charCodeAt(0));
    }
  }

  return out;
};

/**
 * Compile Link
 */

InlineLexer.prototype.outputLink = function(cap, link) {
  var href = escape(link.href)
    , title = link.title ? escape(link.title) : null;

  return cap[0].charAt(0) !== '!'
    ? this.renderer.link(href, title, this.output(cap[1]))
    : this.renderer.image(href, title, escape(cap[1]));
};

/**
 * Smartypants Transformations
 */

InlineLexer.prototype.smartypants = function(text) {
  if (!this.options.smartypants) return text;
  return text
    // em-dashes
    .replace(/--/g, '\u2014')
    // opening singles
    .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
    // closing singles & apostrophes
    .replace(/'/g, '\u2019')
    // opening doubles
    .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
    // closing doubles
    .replace(/"/g, '\u201d')
    // ellipses
    .replace(/\.{3}/g, '\u2026');
};

/**
 * Mangle Links
 */

InlineLexer.prototype.mangle = function(text) {
  var out = ''
    , l = text.length
    , i = 0
    , ch;

  for (; i < l; i++) {
    ch = text.charCodeAt(i);
    if (Math.random() > 0.5) {
      ch = 'x' + ch.toString(16);
    }
    out += '&#' + ch + ';';
  }

  return out;
};

/**
 * Renderer
 */

function Renderer(options) {
  this.options = options || {};
}

Renderer.prototype.code = function(code, lang, escaped) {
  if (this.options.highlight) {
    var out = this.options.highlight(code, lang);
    if (out != null && out !== code) {
      escaped = true;
      code = out;
    }
  }

  if (!lang) {
    return '<pre><code>'
      + (escaped ? code : escape(code, true))
      + '\n</code></pre>';
  }

  return '<pre><code class="'
    + this.options.langPrefix
    + escape(lang, true)
    + '">'
    + (escaped ? code : escape(code, true))
    + '\n</code></pre>\n';
};

Renderer.prototype.blockquote = function(quote) {
  return '<blockquote>\n' + quote + '</blockquote>\n';
};

Renderer.prototype.html = function(html) {
  return html;
};

Renderer.prototype.heading = function(text, level, raw) {
  return '<h'
    + level
    + ' id="'
    + this.options.headerPrefix
    + raw.toLowerCase().replace(/[^\w]+/g, '-')
    + '">'
    + text
    + '</h'
    + level
    + '>\n';
};

Renderer.prototype.hr = function() {
  return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
};

Renderer.prototype.list = function(body, ordered) {
  var type = ordered ? 'ol' : 'ul';
  return '<' + type + '>\n' + body + '</' + type + '>\n';
};

Renderer.prototype.listitem = function(text) {
  return '<li>' + text + '</li>\n';
};

Renderer.prototype.paragraph = function(text) {
  return '<p>' + text + '</p>\n';
};

Renderer.prototype.table = function(header, body) {
  return '<table>\n'
    + '<thead>\n'
    + header
    + '</thead>\n'
    + '<tbody>\n'
    + body
    + '</tbody>\n'
    + '</table>\n';
};

Renderer.prototype.tablerow = function(content) {
  return '<tr>\n' + content + '</tr>\n';
};

Renderer.prototype.tablecell = function(content, flags) {
  var type = flags.header ? 'th' : 'td';
  var tag = flags.align
    ? '<' + type + ' style="text-align:' + flags.align + '">'
    : '<' + type + '>';
  return tag + content + '</' + type + '>\n';
};

// span level renderer
Renderer.prototype.strong = function(text) {
  return '<strong>' + text + '</strong>';
};

Renderer.prototype.em = function(text) {
  return '<em>' + text + '</em>';
};

Renderer.prototype.codespan = function(text) {
  return '<code>' + text + '</code>';
};

Renderer.prototype.br = function() {
  return this.options.xhtml ? '<br/>' : '<br>';
};

Renderer.prototype.del = function(text) {
  return '<del>' + text + '</del>';
};

Renderer.prototype.link = function(href, title, text) {
  if (this.options.sanitize) {
    try {
      var prot = decodeURIComponent(unescape(href))
        .replace(/[^\w:]/g, '')
        .toLowerCase();
    } catch (e) {
      return '';
    }
    if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
      return '';
    }
  }
  var out = '<a href="' + href + '"';
  if (title) {
    out += ' title="' + title + '"';
  }
  out += '>' + text + '</a>';
  return out;
};

Renderer.prototype.image = function(href, title, text) {
  var out = '<img src="' + href + '" alt="' + text + '"';
  if (title) {
    out += ' title="' + title + '"';
  }
  out += this.options.xhtml ? '/>' : '>';
  return out;
};

/**
 * Parsing & Compiling
 */

function Parser(options) {
  this.tokens = [];
  this.token = null;
  this.options = options || marked.defaults;
  this.options.renderer = this.options.renderer || new Renderer;
  this.renderer = this.options.renderer;
  this.renderer.options = this.options;
}

/**
 * Static Parse Method
 */

Parser.parse = function(src, options, renderer) {
  var parser = new Parser(options, renderer);
  return parser.parse(src);
};

/**
 * Parse Loop
 */

Parser.prototype.parse = function(src) {
  this.inline = new InlineLexer(src.links, this.options, this.renderer);
  this.tokens = src.reverse();

  var out = '';
  while (this.next()) {
    out += this.tok();
  }

  return out;
};

/**
 * Next Token
 */

Parser.prototype.next = function() {
  return this.token = this.tokens.pop();
};

/**
 * Preview Next Token
 */

Parser.prototype.peek = function() {
  return this.tokens[this.tokens.length - 1] || 0;
};

/**
 * Parse Text Tokens
 */

Parser.prototype.parseText = function() {
  var body = this.token.text;

  while (this.peek().type === 'text') {
    body += '\n' + this.next().text;
  }

  return this.inline.output(body);
};

/**
 * Parse Current Token
 */

Parser.prototype.tok = function() {
  switch (this.token.type) {
    case 'space': {
      return '';
    }
    case 'hr': {
      return this.renderer.hr();
    }
    case 'heading': {
      return this.renderer.heading(
        this.inline.output(this.token.text),
        this.token.depth,
        this.token.text);
    }
    case 'code': {
      return this.renderer.code(this.token.text,
        this.token.lang,
        this.token.escaped);
    }
    case 'table': {
      var header = ''
        , body = ''
        , i
        , row
        , cell
        , flags
        , j;

      // header
      cell = '';
      for (i = 0; i < this.token.header.length; i++) {
        flags = { header: true, align: this.token.align[i] };
        cell += this.renderer.tablecell(
          this.inline.output(this.token.header[i]),
          { header: true, align: this.token.align[i] }
        );
      }
      header += this.renderer.tablerow(cell);

      for (i = 0; i < this.token.cells.length; i++) {
        row = this.token.cells[i];

        cell = '';
        for (j = 0; j < row.length; j++) {
          cell += this.renderer.tablecell(
            this.inline.output(row[j]),
            { header: false, align: this.token.align[j] }
          );
        }

        body += this.renderer.tablerow(cell);
      }
      return this.renderer.table(header, body);
    }
    case 'blockquote_start': {
      var body = '';

      while (this.next().type !== 'blockquote_end') {
        body += this.tok();
      }

      return this.renderer.blockquote(body);
    }
    case 'list_start': {
      var body = ''
        , ordered = this.token.ordered;

      while (this.next().type !== 'list_end') {
        body += this.tok();
      }

      return this.renderer.list(body, ordered);
    }
    case 'list_item_start': {
      var body = '';

      while (this.next().type !== 'list_item_end') {
        body += this.token.type === 'text'
          ? this.parseText()
          : this.tok();
      }

      return this.renderer.listitem(body);
    }
    case 'loose_item_start': {
      var body = '';

      while (this.next().type !== 'list_item_end') {
        body += this.tok();
      }

      return this.renderer.listitem(body);
    }
    case 'html': {
      var html = !this.token.pre && !this.options.pedantic
        ? this.inline.output(this.token.text)
        : this.token.text;
      return this.renderer.html(html);
    }
    case 'paragraph': {
      return this.renderer.paragraph(this.inline.output(this.token.text));
    }
    case 'text': {
      return this.renderer.paragraph(this.parseText());
    }
  }
};

/**
 * Helpers
 */

function escape(html, encode) {
  return html
    .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
    .replace(/</g, '&lt;')
    .replace(/>/g, '&gt;')
    .replace(/"/g, '&quot;')
    .replace(/'/g, '&#39;');
}

function unescape(html) {
  return html.replace(/&([#\w]+);/g, function(_, n) {
    n = n.toLowerCase();
    if (n === 'colon') return ':';
    if (n.charAt(0) === '#') {
      return n.charAt(1) === 'x'
        ? String.fromCharCode(parseInt(n.substring(2), 16))
        : String.fromCharCode(+n.substring(1));
    }
    return '';
  });
}

function replace(regex, opt) {
  regex = regex.source;
  opt = opt || '';
  return function self(name, val) {
    if (!name) return new RegExp(regex, opt);
    val = val.source || val;
    val = val.replace(/(^|[^\[])\^/g, '$1');
    regex = regex.replace(name, val);
    return self;
  };
}

function noop() {}
noop.exec = noop;

function merge(obj) {
  var i = 1
    , target
    , key;

  for (; i < arguments.length; i++) {
    target = arguments[i];
    for (key in target) {
      if (Object.prototype.hasOwnProperty.call(target, key)) {
        obj[key] = target[key];
      }
    }
  }

  return obj;
}


/**
 * Marked
 */

function marked(src, opt, callback) {
  if (callback || typeof opt === 'function') {
    if (!callback) {
      callback = opt;
      opt = null;
    }

    opt = merge({}, marked.defaults, opt || {});

    var highlight = opt.highlight
      , tokens
      , pending
      , i = 0;

    try {
      tokens = Lexer.lex(src, opt)
    } catch (e) {
      return callback(e);
    }

    pending = tokens.length;

    var done = function(err) {
      if (err) {
        opt.highlight = highlight;
        return callback(err);
      }

      var out;

      try {
        out = Parser.parse(tokens, opt);
      } catch (e) {
        err = e;
      }

      opt.highlight = highlight;

      return err
        ? callback(err)
        : callback(null, out);
    };

    if (!highlight || highlight.length < 3) {
      return done();
    }

    delete opt.highlight;

    if (!pending) return done();

    for (; i < tokens.length; i++) {
      (function(token) {
        if (token.type !== 'code') {
          return --pending || done();
        }
        return highlight(token.text, token.lang, function(err, code) {
          if (err) return done(err);
          if (code == null || code === token.text) {
            return --pending || done();
          }
          token.text = code;
          token.escaped = true;
          --pending || done();
        });
      })(tokens[i]);
    }

    return;
  }
  try {
    if (opt) opt = merge({}, marked.defaults, opt);
    return Parser.parse(Lexer.lex(src, opt), opt);
  } catch (e) {
    e.message += '\nPlease report this to https://github.com/chjj/marked.';
    if ((opt || marked.defaults).silent) {
      return '<p>An error occured:</p><pre>'
        + escape(e.message + '', true)
        + '</pre>';
    }
    throw e;
  }
}

/**
 * Options
 */

marked.options =
marked.setOptions = function(opt) {
  merge(marked.defaults, opt);
  return marked;
};

marked.defaults = {
  gfm: true,
  tables: true,
  breaks: false,
  pedantic: false,
  sanitize: false,
  smartLists: false,
  silent: false,
  highlight: null,
  langPrefix: 'lang-',
  smartypants: false,
  headerPrefix: '',
  renderer: new Renderer,
  xhtml: false
};

/**
 * Expose
 */

marked.Parser = Parser;
marked.parser = Parser.parse;

marked.Renderer = Renderer;

marked.Lexer = Lexer;
marked.lexer = Lexer.lex;

marked.InlineLexer = InlineLexer;
marked.inlineLexer = InlineLexer.output;

marked.parse = marked;

if (true) {
  module.exports = marked;
} else if (typeof define === 'function' && define.amd) {
  define(function() { return marked; });
} else {
  this.marked = marked;
}

}).call(function() {
  return this || (typeof window !== 'undefined' ? window : global);
}());

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 182 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var printWarning = function() {};

if (true) {
  var ReactPropTypesSecret = __webpack_require__(365);
  var loggedTypeFailures = {};
  var has = Function.call.bind(Object.prototype.hasOwnProperty);

  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };
}

/**
 * Assert that the values match with the type specs.
 * Error messages are memorized and will only be shown once.
 *
 * @param {object} typeSpecs Map of name to a ReactPropType
 * @param {object} values Runtime values that need to be type-checked
 * @param {string} location e.g. "prop", "context", "child context"
 * @param {string} componentName Name of the component for error messages.
 * @param {?Function} getStack Returns the component stack.
 * @private
 */
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
  if (true) {
    for (var typeSpecName in typeSpecs) {
      if (has(typeSpecs, typeSpecName)) {
        var error;
        // Prop type validation may throw. In case they do, we don't want to
        // fail the render phase where it didn't fail before. So we log it.
        // After these have been cleaned up, we'll let them throw.
        try {
          // This is intentionally an invariant that gets caught. It's the same
          // behavior as without this statement except with a better message.
          if (typeof typeSpecs[typeSpecName] !== 'function') {
            var err = Error(
              (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
              'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
            );
            err.name = 'Invariant Violation';
            throw err;
          }
          error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
        } catch (ex) {
          error = ex;
        }
        if (error && !(error instanceof Error)) {
          printWarning(
            (componentName || 'React class') + ': type specification of ' +
            location + ' `' + typeSpecName + '` is invalid; the type checker ' +
            'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
            'You may have forgotten to pass an argument to the type checker ' +
            'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
            'shape all require an argument).'
          );
        }
        if (error instanceof Error && !(error.message in loggedTypeFailures)) {
          // Only monitor this failure once because there tends to be a lot of the
          // same error.
          loggedTypeFailures[error.message] = true;

          var stack = getStack ? getStack() : '';

          printWarning(
            'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
          );
        }
      }
    }
  }
}

/**
 * Resets warning cache when testing.
 *
 * @private
 */
checkPropTypes.resetWarningCache = function() {
  if (true) {
    loggedTypeFailures = {};
  }
}

module.exports = checkPropTypes;


/***/ }),
/* 183 */
/***/ (function(module, exports, __webpack_require__) {

/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

if (true) {
  var ReactIs = __webpack_require__(142);

  // By explicitly using `prop-types` you are opting into new development behavior.
  // http://fb.me/prop-types-in-prod
  var throwOnDirectAccess = true;
  module.exports = __webpack_require__(1233)(ReactIs.isElement, throwOnDirectAccess);
} else {
  // By explicitly using `prop-types` you are opting into new production behavior.
  // http://fb.me/prop-types-in-prod
  module.exports = require('./factoryWithThrowingShims')();
}


/***/ }),
/* 184 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function registerTarget(type, target, manager) {
    var registry = manager.getRegistry();
    var targetId = registry.addTarget(type, target);
    return [targetId, function () { return registry.removeTarget(targetId); }];
}
exports.registerTarget = registerTarget;
function registerSource(type, source, manager) {
    var registry = manager.getRegistry();
    var sourceId = registry.addSource(type, source);
    return [sourceId, function () { return registry.removeSource(sourceId); }];
}
exports.registerSource = registerSource;


/***/ }),
/* 185 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MemoryRouter", function() { return MemoryRouter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Prompt", function() { return Prompt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Redirect", function() { return Redirect; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Route", function() { return Route; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Router", function() { return Router; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StaticRouter", function() { return StaticRouter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Switch", function() { return Switch; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "generatePath", function() { return generatePath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return matchPath; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return withRouter; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__RouterContext", function() { return context; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_create_react_context__ = __webpack_require__(919);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_create_react_context___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_create_react_context__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__ = __webpack_require__(254);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(183);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tiny_warning__ = __webpack_require__(253);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_history__ = __webpack_require__(358);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_tiny_invariant__ = __webpack_require__(252);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_path_to_regexp__ = __webpack_require__(1366);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_path_to_regexp__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_is__ = __webpack_require__(142);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_react_is___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_react_is__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__ = __webpack_require__(255);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_hoist_non_react_statics__ = __webpack_require__(242);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_hoist_non_react_statics___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_hoist_non_react_statics__);













// TODO: Replace with React.createContext once we can assume React 16+

var createNamedContext = function createNamedContext(name) {
  var context = __WEBPACK_IMPORTED_MODULE_0_create_react_context___default()();
  context.Provider.displayName = name + ".Provider";
  context.Consumer.displayName = name + ".Consumer";
  return context;
};

var context =
/*#__PURE__*/
createNamedContext('Router');

/**
 * The public API for putting history on context.
 */

var Router =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Router, _React$Component);

  Router.computeRootMatch = function computeRootMatch(pathname) {
    return {
      path: "/",
      url: "/",
      params: {},
      isExact: pathname === "/"
    };
  };

  function Router(props) {
    var _this;

    _this = _React$Component.call(this, props) || this;
    _this.state = {
      location: props.history.location
    }; // This is a bit of a hack. We have to start listening for location
    // changes here in the constructor in case there are any <Redirect>s
    // on the initial render. If there are, they will replace/push when
    // they mount and since cDM fires in children before parents, we may
    // get a new location before the <Router> is mounted.

    _this._isMounted = false;
    _this._pendingLocation = null;

    if (!props.staticContext) {
      _this.unlisten = props.history.listen(function (location) {
        if (_this._isMounted) {
          _this.setState({
            location: location
          });
        } else {
          _this._pendingLocation = location;
        }
      });
    }

    return _this;
  }

  var _proto = Router.prototype;

  _proto.componentDidMount = function componentDidMount() {
    this._isMounted = true;

    if (this._pendingLocation) {
      this.setState({
        location: this._pendingLocation
      });
    }
  };

  _proto.componentWillUnmount = function componentWillUnmount() {
    if (this.unlisten) this.unlisten();
  };

  _proto.render = function render() {
    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(context.Provider, {
      children: this.props.children || null,
      value: {
        history: this.props.history,
        location: this.state.location,
        match: Router.computeRootMatch(this.state.location.pathname),
        staticContext: this.props.staticContext
      }
    });
  };

  return Router;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);

if (true) {
  Router.propTypes = {
    children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node,
    history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
    staticContext: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
  };

  Router.prototype.componentDidUpdate = function (prevProps) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(prevProps.history === this.props.history, "You cannot change <Router history>") : void 0;
  };
}

/**
 * The public API for a <Router> that stores location in memory.
 */

var MemoryRouter =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(MemoryRouter, _React$Component);

  function MemoryRouter() {
    var _this;

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
    _this.history = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_history__["a" /* createMemoryHistory */])(_this.props);
    return _this;
  }

  var _proto = MemoryRouter.prototype;

  _proto.render = function render() {
    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Router, {
      history: this.history,
      children: this.props.children
    });
  };

  return MemoryRouter;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);

if (true) {
  MemoryRouter.propTypes = {
    initialEntries: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.array,
    initialIndex: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
    getUserConfirmation: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
    keyLength: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.number,
    children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node
  };

  MemoryRouter.prototype.componentDidMount = function () {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!this.props.history, "<MemoryRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { MemoryRouter as Router }`.") : void 0;
  };
}

var Lifecycle =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Lifecycle, _React$Component);

  function Lifecycle() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = Lifecycle.prototype;

  _proto.componentDidMount = function componentDidMount() {
    if (this.props.onMount) this.props.onMount.call(this, this);
  };

  _proto.componentDidUpdate = function componentDidUpdate(prevProps) {
    if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
  };

  _proto.componentWillUnmount = function componentWillUnmount() {
    if (this.props.onUnmount) this.props.onUnmount.call(this, this);
  };

  _proto.render = function render() {
    return null;
  };

  return Lifecycle;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);

/**
 * The public API for prompting the user before navigating away from a screen.
 */

function Prompt(_ref) {
  var message = _ref.message,
      _ref$when = _ref.when,
      when = _ref$when === void 0 ? true : _ref$when;
  return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(context.Consumer, null, function (context$$1) {
    !context$$1 ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__["a" /* default */])(false, "You should not use <Prompt> outside a <Router>") : invariant(false) : void 0;
    if (!when || context$$1.staticContext) return null;
    var method = context$$1.history.block;
    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Lifecycle, {
      onMount: function onMount(self) {
        self.release = method(message);
      },
      onUpdate: function onUpdate(self, prevProps) {
        if (prevProps.message !== message) {
          self.release();
          self.release = method(message);
        }
      },
      onUnmount: function onUnmount(self) {
        self.release();
      },
      message: message
    });
  });
}

if (true) {
  var messageType = __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string]);
  Prompt.propTypes = {
    when: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
    message: messageType.isRequired
  };
}

var cache = {};
var cacheLimit = 10000;
var cacheCount = 0;

function compilePath(path) {
  if (cache[path]) return cache[path];
  var generator = __WEBPACK_IMPORTED_MODULE_7_path_to_regexp___default.a.compile(path);

  if (cacheCount < cacheLimit) {
    cache[path] = generator;
    cacheCount++;
  }

  return generator;
}
/**
 * Public API for generating a URL pathname from a path and parameters.
 */


function generatePath(path, params) {
  if (path === void 0) {
    path = "/";
  }

  if (params === void 0) {
    params = {};
  }

  return path === "/" ? path : compilePath(path)(params, {
    pretty: true
  });
}

/**
 * The public API for navigating programmatically with a component.
 */

function Redirect(_ref) {
  var computedMatch = _ref.computedMatch,
      to = _ref.to,
      _ref$push = _ref.push,
      push = _ref$push === void 0 ? false : _ref$push;
  return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(context.Consumer, null, function (context$$1) {
    !context$$1 ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__["a" /* default */])(false, "You should not use <Redirect> outside a <Router>") : invariant(false) : void 0;
    var history = context$$1.history,
        staticContext = context$$1.staticContext;
    var method = push ? history.push : history.replace;
    var location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_history__["b" /* createLocation */])(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, to, {
      pathname: generatePath(to.pathname, computedMatch.params)
    }) : to); // When rendering in a static context,
    // set the new location immediately.

    if (staticContext) {
      method(location);
      return null;
    }

    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Lifecycle, {
      onMount: function onMount() {
        method(location);
      },
      onUpdate: function onUpdate(self, prevProps) {
        if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_history__["c" /* locationsAreEqual */])(prevProps.to, location)) {
          method(location);
        }
      },
      to: to
    });
  });
}

if (true) {
  Redirect.propTypes = {
    push: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
    from: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
    to: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object]).isRequired
  };
}

var cache$1 = {};
var cacheLimit$1 = 10000;
var cacheCount$1 = 0;

function compilePath$1(path, options) {
  var cacheKey = "" + options.end + options.strict + options.sensitive;
  var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
  if (pathCache[path]) return pathCache[path];
  var keys = [];
  var regexp = __WEBPACK_IMPORTED_MODULE_7_path_to_regexp___default()(path, keys, options);
  var result = {
    regexp: regexp,
    keys: keys
  };

  if (cacheCount$1 < cacheLimit$1) {
    pathCache[path] = result;
    cacheCount$1++;
  }

  return result;
}
/**
 * Public API for matching a URL pathname to a path.
 */


function matchPath(pathname, options) {
  if (options === void 0) {
    options = {};
  }

  if (typeof options === "string") options = {
    path: options
  };
  var _options = options,
      path = _options.path,
      _options$exact = _options.exact,
      exact = _options$exact === void 0 ? false : _options$exact,
      _options$strict = _options.strict,
      strict = _options$strict === void 0 ? false : _options$strict,
      _options$sensitive = _options.sensitive,
      sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
  var paths = [].concat(path);
  return paths.reduce(function (matched, path) {
    if (matched) return matched;

    var _compilePath = compilePath$1(path, {
      end: exact,
      strict: strict,
      sensitive: sensitive
    }),
        regexp = _compilePath.regexp,
        keys = _compilePath.keys;

    var match = regexp.exec(pathname);
    if (!match) return null;
    var url = match[0],
        values = match.slice(1);
    var isExact = pathname === url;
    if (exact && !isExact) return null;
    return {
      path: path,
      // the path used to match
      url: path === "/" && url === "" ? "/" : url,
      // the matched portion of the URL
      isExact: isExact,
      // whether or not we matched exactly
      params: keys.reduce(function (memo, key, index) {
        memo[key.name] = values[index];
        return memo;
      }, {})
    };
  }, null);
}

function isEmptyChildren(children) {
  return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 0;
}
/**
 * The public API for matching a single path and rendering.
 */


var Route =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Route, _React$Component);

  function Route() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = Route.prototype;

  _proto.render = function render() {
    var _this = this;

    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(context.Consumer, null, function (context$$1) {
      !context$$1 ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__["a" /* default */])(false, "You should not use <Route> outside a <Router>") : invariant(false) : void 0;
      var location = _this.props.location || context$$1.location;
      var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
      : _this.props.path ? matchPath(location.pathname, _this.props) : context$$1.match;

      var props = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, context$$1, {
        location: location,
        match: match
      });

      var _this$props = _this.props,
          children = _this$props.children,
          component = _this$props.component,
          render = _this$props.render; // Preact uses an empty array as children by
      // default, so use null if that's the case.

      if (Array.isArray(children) && children.length === 0) {
        children = null;
      }

      if (typeof children === "function") {
        children = children(props);

        if (children === undefined) {
          if (true) {
            var path = _this.props.path;
             true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(false, "You returned `undefined` from the `children` function of " + ("<Route" + (path ? " path=\"" + path + "\"" : "") + ">, but you ") + "should have returned a React element or `null`") : void 0;
          }

          children = null;
        }
      }

      return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(context.Provider, {
        value: props
      }, children && !isEmptyChildren(children) ? children : props.match ? component ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component, props) : render ? render(props) : null : null);
    });
  };

  return Route;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);

if (true) {
  Route.propTypes = {
    children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]),
    component: function component(props, propName) {
      if (props[propName] && !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9_react_is__["isValidElementType"])(props[propName])) {
        return new Error("Invalid prop 'component' supplied to 'Route': the prop is not a valid React component");
      }
    },
    exact: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
    location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
    path: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.arrayOf(__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string)]),
    render: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
    sensitive: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
    strict: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool
  };

  Route.prototype.componentDidMount = function () {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.component), "You should not use <Route component> and <Route children> in the same route; <Route component> will be ignored") : void 0;
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(this.props.children && !isEmptyChildren(this.props.children) && this.props.render), "You should not use <Route render> and <Route children> in the same route; <Route render> will be ignored") : void 0;
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored") : void 0;
  };

  Route.prototype.componentDidUpdate = function (prevProps) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(this.props.location && !prevProps.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') : void 0;
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(!this.props.location && prevProps.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') : void 0;
  };
}

function addLeadingSlash(path) {
  return path.charAt(0) === "/" ? path : "/" + path;
}

function addBasename(basename, location) {
  if (!basename) return location;
  return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, location, {
    pathname: addLeadingSlash(basename) + location.pathname
  });
}

function stripBasename(basename, location) {
  if (!basename) return location;
  var base = addLeadingSlash(basename);
  if (location.pathname.indexOf(base) !== 0) return location;
  return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, location, {
    pathname: location.pathname.substr(base.length)
  });
}

function createURL(location) {
  return typeof location === "string" ? location : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_history__["d" /* createPath */])(location);
}

function staticHandler(methodName) {
  return function () {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__["a" /* default */])(false, "You cannot %s with <StaticRouter>", methodName) : invariant(false);
  };
}

function noop() {}
/**
 * The public top-level API for a "static" <Router>, so-called because it
 * can't actually change the current location. Instead, it just records
 * location changes in a context object. Useful mainly in testing and
 * server-rendering scenarios.
 */


var StaticRouter =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(StaticRouter, _React$Component);

  function StaticRouter() {
    var _this;

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;

    _this.handlePush = function (location) {
      return _this.navigateTo(location, "PUSH");
    };

    _this.handleReplace = function (location) {
      return _this.navigateTo(location, "REPLACE");
    };

    _this.handleListen = function () {
      return noop;
    };

    _this.handleBlock = function () {
      return noop;
    };

    return _this;
  }

  var _proto = StaticRouter.prototype;

  _proto.navigateTo = function navigateTo(location, action) {
    var _this$props = this.props,
        _this$props$basename = _this$props.basename,
        basename = _this$props$basename === void 0 ? "" : _this$props$basename,
        context = _this$props.context;
    context.action = action;
    context.location = addBasename(basename, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_history__["b" /* createLocation */])(location));
    context.url = createURL(context.location);
  };

  _proto.render = function render() {
    var _this$props2 = this.props,
        _this$props2$basename = _this$props2.basename,
        basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
        _this$props2$context = _this$props2.context,
        context = _this$props2$context === void 0 ? {} : _this$props2$context,
        _this$props2$location = _this$props2.location,
        location = _this$props2$location === void 0 ? "/" : _this$props2$location,
        rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(_this$props2, ["basename", "context", "location"]);

    var history = {
      createHref: function createHref(path) {
        return addLeadingSlash(basename + createURL(path));
      },
      action: "POP",
      location: stripBasename(basename, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5_history__["b" /* createLocation */])(location)),
      push: this.handlePush,
      replace: this.handleReplace,
      go: staticHandler("go"),
      goBack: staticHandler("goBack"),
      goForward: staticHandler("goForward"),
      listen: this.handleListen,
      block: this.handleBlock
    };
    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Router, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, rest, {
      history: history,
      staticContext: context
    }));
  };

  return StaticRouter;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);

if (true) {
  StaticRouter.propTypes = {
    basename: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
    context: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object,
    location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object])
  };

  StaticRouter.prototype.componentDidMount = function () {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!this.props.history, "<StaticRouter> ignores the history prop. To use a custom history, " + "use `import { Router }` instead of `import { StaticRouter as Router }`.") : void 0;
  };
}

/**
 * The public API for rendering the first <Route> that matches.
 */

var Switch =
/*#__PURE__*/
function (_React$Component) {
  __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_inheritsLoose__["a" /* default */])(Switch, _React$Component);

  function Switch() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = Switch.prototype;

  _proto.render = function render() {
    var _this = this;

    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(context.Consumer, null, function (context$$1) {
      !context$$1 ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6_tiny_invariant__["a" /* default */])(false, "You should not use <Switch> outside a <Router>") : invariant(false) : void 0;
      var location = _this.props.location || context$$1.location;
      var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
      // here because toArray adds keys to all child elements and we do not want
      // to trigger an unmount/remount for two <Route>s that render the same
      // component at different URLs.

      __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.forEach(_this.props.children, function (child) {
        if (match == null && __WEBPACK_IMPORTED_MODULE_2_react___default.a.isValidElement(child)) {
          element = child;
          var path = child.props.path || child.props.from;
          match = path ? matchPath(location.pathname, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, child.props, {
            path: path
          })) : context$$1.match;
        }
      });
      return match ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.cloneElement(element, {
        location: location,
        computedMatch: match
      }) : null;
    });
  };

  return Switch;
}(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);

if (true) {
  Switch.propTypes = {
    children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node,
    location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
  };

  Switch.prototype.componentDidUpdate = function (prevProps) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(this.props.location && !prevProps.location), '<Switch> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.') : void 0;
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_warning__["a" /* default */])(!(!this.props.location && prevProps.location), '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.') : void 0;
  };
}

/**
 * A public higher-order component to access the imperative API
 */

function withRouter(Component) {
  var C = function C(props) {
    var wrappedComponentRef = props.wrappedComponentRef,
        remainingProps = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_10__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(props, ["wrappedComponentRef"]);

    return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Route, {
      children: function children(routeComponentProps) {
        return __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(Component, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__babel_runtime_helpers_esm_extends__["a" /* default */])({}, remainingProps, routeComponentProps, {
          ref: wrappedComponentRef
        }));
      }
    });
  };

  C.displayName = "withRouter(" + (Component.displayName || Component.name) + ")";
  C.WrappedComponent = Component;

  if (true) {
    C.propTypes = {
      wrappedComponentRef: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func
    };
  }

  return __WEBPACK_IMPORTED_MODULE_11_hoist_non_react_statics___default()(C, Component);
}

if (true) {
  if (typeof window !== "undefined") {
    var global = window;
    var key = "__react_router_build__";
    var buildNames = {
      cjs: "CommonJS",
      esm: "ES modules",
      umd: "UMD"
    };

    if (global[key] && global[key] !== "esm") {
      var initialBuildName = buildNames[global[key]];
      var secondaryBuildName = buildNames["esm"]; // TODO: Add link to article that explains in detail how to avoid
      // loading 2 different builds.

      throw new Error("You are loading the " + secondaryBuildName + " build of React Router " + ("on a page that is already running the " + initialBuildName + " ") + "build, so things won't work right.");
    }

    global[key] = "esm";
  }
}




/***/ }),
/* 186 */
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! VelocityJS.org (1.5.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */

/*************************
 Velocity jQuery Shim
 *************************/

/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */

/* This file contains the jQuery functions that Velocity relies on, thereby removing Velocity's dependency on a full copy of jQuery, and allowing it to work in any environment. */
/* These shimmed functions are only used if jQuery isn't present. If both this shim and jQuery are loaded, Velocity defaults to jQuery proper. */
/* Browser support: Using this shim instead of jQuery proper removes support for IE8. */

(function(window) {
	"use strict";
	/***************
	 Setup
	 ***************/

	/* If jQuery is already loaded, there's no point in loading this shim. */
	if (window.jQuery) {
		return;
	}

	/* jQuery base. */
	var $ = function(selector, context) {
		return new $.fn.init(selector, context);
	};

	/********************
	 Private Methods
	 ********************/

	/* jQuery */
	$.isWindow = function(obj) {
		/* jshint eqeqeq: false */
		return obj && obj === obj.window;
	};

	/* jQuery */
	$.type = function(obj) {
		if (!obj) {
			return obj + "";
		}

		return typeof obj === "object" || typeof obj === "function" ?
				class2type[toString.call(obj)] || "object" :
				typeof obj;
	};

	/* jQuery */
	$.isArray = Array.isArray || function(obj) {
		return $.type(obj) === "array";
	};

	/* jQuery */
	function isArraylike(obj) {
		var length = obj.length,
				type = $.type(obj);

		if (type === "function" || $.isWindow(obj)) {
			return false;
		}

		if (obj.nodeType === 1 && length) {
			return true;
		}

		return type === "array" || length === 0 || typeof length === "number" && length > 0 && (length - 1) in obj;
	}

	/***************
	 $ Methods
	 ***************/

	/* jQuery: Support removed for IE<9. */
	$.isPlainObject = function(obj) {
		var key;

		if (!obj || $.type(obj) !== "object" || obj.nodeType || $.isWindow(obj)) {
			return false;
		}

		try {
			if (obj.constructor &&
					!hasOwn.call(obj, "constructor") &&
					!hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
				return false;
			}
		} catch (e) {
			return false;
		}

		for (key in obj) {
		}

		return key === undefined || hasOwn.call(obj, key);
	};

	/* jQuery */
	$.each = function(obj, callback, args) {
		var value,
				i = 0,
				length = obj.length,
				isArray = isArraylike(obj);

		if (args) {
			if (isArray) {
				for (; i < length; i++) {
					value = callback.apply(obj[i], args);

					if (value === false) {
						break;
					}
				}
			} else {
				for (i in obj) {
					if (!obj.hasOwnProperty(i)) {
						continue;
					}
					value = callback.apply(obj[i], args);

					if (value === false) {
						break;
					}
				}
			}

		} else {
			if (isArray) {
				for (; i < length; i++) {
					value = callback.call(obj[i], i, obj[i]);

					if (value === false) {
						break;
					}
				}
			} else {
				for (i in obj) {
					if (!obj.hasOwnProperty(i)) {
						continue;
					}
					value = callback.call(obj[i], i, obj[i]);

					if (value === false) {
						break;
					}
				}
			}
		}

		return obj;
	};

	/* Custom */
	$.data = function(node, key, value) {
		/* $.getData() */
		if (value === undefined) {
			var getId = node[$.expando],
					store = getId && cache[getId];

			if (key === undefined) {
				return store;
			} else if (store) {
				if (key in store) {
					return store[key];
				}
			}
			/* $.setData() */
		} else if (key !== undefined) {
			var setId = node[$.expando] || (node[$.expando] = ++$.uuid);

			cache[setId] = cache[setId] || {};
			cache[setId][key] = value;

			return value;
		}
	};

	/* Custom */
	$.removeData = function(node, keys) {
		var id = node[$.expando],
				store = id && cache[id];

		if (store) {
			// Cleanup the entire store if no keys are provided.
			if (!keys) {
				delete cache[id];
			} else {
				$.each(keys, function(_, key) {
					delete store[key];
				});
			}
		}
	};

	/* jQuery */
	$.extend = function() {
		var src, copyIsArray, copy, name, options, clone,
				target = arguments[0] || {},
				i = 1,
				length = arguments.length,
				deep = false;

		if (typeof target === "boolean") {
			deep = target;

			target = arguments[i] || {};
			i++;
		}

		if (typeof target !== "object" && $.type(target) !== "function") {
			target = {};
		}

		if (i === length) {
			target = this;
			i--;
		}

		for (; i < length; i++) {
			if ((options = arguments[i])) {
				for (name in options) {
					if (!options.hasOwnProperty(name)) {
						continue;
					}
					src = target[name];
					copy = options[name];

					if (target === copy) {
						continue;
					}

					if (deep && copy && ($.isPlainObject(copy) || (copyIsArray = $.isArray(copy)))) {
						if (copyIsArray) {
							copyIsArray = false;
							clone = src && $.isArray(src) ? src : [];

						} else {
							clone = src && $.isPlainObject(src) ? src : {};
						}

						target[name] = $.extend(deep, clone, copy);

					} else if (copy !== undefined) {
						target[name] = copy;
					}
				}
			}
		}

		return target;
	};

	/* jQuery 1.4.3 */
	$.queue = function(elem, type, data) {
		function $makeArray(arr, results) {
			var ret = results || [];

			if (arr) {
				if (isArraylike(Object(arr))) {
					/* $.merge */
					(function(first, second) {
						var len = +second.length,
								j = 0,
								i = first.length;

						while (j < len) {
							first[i++] = second[j++];
						}

						if (len !== len) {
							while (second[j] !== undefined) {
								first[i++] = second[j++];
							}
						}

						first.length = i;

						return first;
					})(ret, typeof arr === "string" ? [arr] : arr);
				} else {
					[].push.call(ret, arr);
				}
			}

			return ret;
		}

		if (!elem) {
			return;
		}

		type = (type || "fx") + "queue";

		var q = $.data(elem, type);

		if (!data) {
			return q || [];
		}

		if (!q || $.isArray(data)) {
			q = $.data(elem, type, $makeArray(data));
		} else {
			q.push(data);
		}

		return q;
	};

	/* jQuery 1.4.3 */
	$.dequeue = function(elems, type) {
		/* Custom: Embed element iteration. */
		$.each(elems.nodeType ? [elems] : elems, function(i, elem) {
			type = type || "fx";

			var queue = $.queue(elem, type),
					fn = queue.shift();

			if (fn === "inprogress") {
				fn = queue.shift();
			}

			if (fn) {
				if (type === "fx") {
					queue.unshift("inprogress");
				}

				fn.call(elem, function() {
					$.dequeue(elem, type);
				});
			}
		});
	};

	/******************
	 $.fn Methods
	 ******************/

	/* jQuery */
	$.fn = $.prototype = {
		init: function(selector) {
			/* Just return the element wrapped inside an array; don't proceed with the actual jQuery node wrapping process. */
			if (selector.nodeType) {
				this[0] = selector;

				return this;
			} else {
				throw new Error("Not a DOM node.");
			}
		},
		offset: function() {
			/* jQuery altered code: Dropped disconnected DOM node checking. */
			var box = this[0].getBoundingClientRect ? this[0].getBoundingClientRect() : {top: 0, left: 0};

			return {
				top: box.top + (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || 0),
				left: box.left + (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || 0)
			};
		},
		position: function() {
			/* jQuery */
			function offsetParentFn(elem) {
				var offsetParent = elem.offsetParent;

				while (offsetParent && (offsetParent.nodeName.toLowerCase() !== "html" && offsetParent.style && offsetParent.style.position.toLowerCase() === "static")) {
					offsetParent = offsetParent.offsetParent;
				}

				return offsetParent || document;
			}

			/* Zepto */
			var elem = this[0],
					offsetParent = offsetParentFn(elem),
					offset = this.offset(),
					parentOffset = /^(?:body|html)$/i.test(offsetParent.nodeName) ? {top: 0, left: 0} : $(offsetParent).offset();

			offset.top -= parseFloat(elem.style.marginTop) || 0;
			offset.left -= parseFloat(elem.style.marginLeft) || 0;

			if (offsetParent.style) {
				parentOffset.top += parseFloat(offsetParent.style.borderTopWidth) || 0;
				parentOffset.left += parseFloat(offsetParent.style.borderLeftWidth) || 0;
			}

			return {
				top: offset.top - parentOffset.top,
				left: offset.left - parentOffset.left
			};
		}
	};

	/**********************
	 Private Variables
	 **********************/

	/* For $.data() */
	var cache = {};
	$.expando = "velocity" + (new Date().getTime());
	$.uuid = 0;

	/* For $.queue() */
	var class2type = {},
			hasOwn = class2type.hasOwnProperty,
			toString = class2type.toString;

	var types = "Boolean Number String Function Array Date RegExp Object Error".split(" ");
	for (var i = 0; i < types.length; i++) {
		class2type["[object " + types[i] + "]"] = types[i].toLowerCase();
	}

	/* Makes $(node) possible, without having to call init. */
	$.fn.init.prototype = $.fn;

	/* Globalize Velocity onto the window, and assign its Utilities property. */
	window.Velocity = {Utilities: $};
})(window);

/******************
 Velocity.js
 ******************/

(function(factory) {
	"use strict";
	/* CommonJS module. */
	if (typeof module === "object" && typeof module.exports === "object") {
		module.exports = factory();
		/* AMD module. */
	} else if (true) {
		!(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
				__WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
		/* Browser globals. */
	} else {
		factory();
	}
}(function() {
	"use strict";
	return function(global, window, document, undefined) {

		/***************
		 Summary
		 ***************/

		/*
		 - CSS: CSS stack that works independently from the rest of Velocity.
		 - animate(): Core animation method that iterates over the targeted elements and queues the incoming call onto each element individually.
		 - Pre-Queueing: Prepare the element for animation by instantiating its data cache and processing the call's options.
		 - Queueing: The logic that runs once the call has reached its point of execution in the element's $.queue() stack.
		 Most logic is placed here to avoid risking it becoming stale (if the element's properties have changed).
		 - Pushing: Consolidation of the tween data followed by its push onto the global in-progress calls container.
		 - tick(): The single requestAnimationFrame loop responsible for tweening all in-progress calls.
		 - completeCall(): Handles the cleanup process for each Velocity call.
		 */

		/*********************
		 Helper Functions
		 *********************/

		/* IE detection. Gist: https://gist.github.com/julianshapiro/9098609 */
		var IE = (function() {
			if (document.documentMode) {
				return document.documentMode;
			} else {
				for (var i = 7; i > 4; i--) {
					var div = document.createElement("div");

					div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";

					if (div.getElementsByTagName("span").length) {
						div = null;

						return i;
					}
				}
			}

			return undefined;
		})();

		/* rAF shim. Gist: https://gist.github.com/julianshapiro/9497513 */
		var rAFShim = (function() {
			var timeLast = 0;

			return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) {
				var timeCurrent = (new Date()).getTime(),
						timeDelta;

				/* Dynamically set delay on a per-tick basis to match 60fps. */
				/* Technique by Erik Moller. MIT license: https://gist.github.com/paulirish/1579671 */
				timeDelta = Math.max(0, 16 - (timeCurrent - timeLast));
				timeLast = timeCurrent + timeDelta;

				return setTimeout(function() {
					callback(timeCurrent + timeDelta);
				}, timeDelta);
			};
		})();

		var performance = (function() {
			var perf = window.performance || {};

			if (typeof perf.now !== "function") {
				var nowOffset = perf.timing && perf.timing.navigationStart ? perf.timing.navigationStart : (new Date()).getTime();

				perf.now = function() {
					return (new Date()).getTime() - nowOffset;
				};
			}
			return perf;
		})();

		/* Array compacting. Copyright Lo-Dash. MIT License: https://github.com/lodash/lodash/blob/master/LICENSE.txt */
		function compactSparseArray(array) {
			var index = -1,
					length = array ? array.length : 0,
					result = [];

			while (++index < length) {
				var value = array[index];

				if (value) {
					result.push(value);
				}
			}

			return result;
		}

		/**
		 * Shim for "fixing" IE's lack of support (IE < 9) for applying slice
		 * on host objects like NamedNodeMap, NodeList, and HTMLCollection
		 * (technically, since host objects have been implementation-dependent,
		 * at least before ES2015, IE hasn't needed to work this way).
		 * Also works on strings, fixes IE < 9 to allow an explicit undefined
		 * for the 2nd argument (as in Firefox), and prevents errors when
		 * called on other DOM objects.
		 */
		var _slice = (function() {
			var slice = Array.prototype.slice;

			try {
				// Can't be used with DOM elements in IE < 9
				slice.call(document.documentElement);
				return slice;
			} catch (e) { // Fails in IE < 9

				// This will work for genuine arrays, array-like objects, 
				// NamedNodeMap (attributes, entities, notations),
				// NodeList (e.g., getElementsByTagName), HTMLCollection (e.g., childNodes),
				// and will not fail on other DOM objects (as do DOM elements in IE < 9)
				return function(begin, end) {
					var len = this.length;

					if (typeof begin !== "number") {
						begin = 0;
					}
					// IE < 9 gets unhappy with an undefined end argument
					if (typeof end !== "number") {
						end = len;
					}
					// For native Array objects, we use the native slice function
					if (this.slice) {
						return slice.call(this, begin, end);
					}
					// For array like object we handle it ourselves.
					var i,
							cloned = [],
							// Handle negative value for "begin"
							start = (begin >= 0) ? begin : Math.max(0, len + begin),
							// Handle negative value for "end"
							upTo = end < 0 ? len + end : Math.min(end, len),
							// Actual expected size of the slice
							size = upTo - start;

					if (size > 0) {
						cloned = new Array(size);
						if (this.charAt) {
							for (i = 0; i < size; i++) {
								cloned[i] = this.charAt(start + i);
							}
						} else {
							for (i = 0; i < size; i++) {
								cloned[i] = this[start + i];
							}
						}
					}
					return cloned;
				};
			}
		})();

		/* .indexOf doesn't exist in IE<9 */
		var _inArray = (function() {
			if (Array.prototype.includes) {
				return function(arr, val) {
					return arr.includes(val);
				};
			}
			if (Array.prototype.indexOf) {
				return function(arr, val) {
					return arr.indexOf(val) >= 0;
				};
			}
			return function(arr, val) {
				for (var i = 0; i < arr.length; i++) {
					if (arr[i] === val) {
						return true;
					}
				}
				return false;
			};
		});

		function sanitizeElements(elements) {
			/* Unwrap jQuery/Zepto objects. */
			if (Type.isWrapped(elements)) {
				elements = _slice.call(elements);
				/* Wrap a single element in an array so that $.each() can iterate with the element instead of its node's children. */
			} else if (Type.isNode(elements)) {
				elements = [elements];
			}

			return elements;
		}

		var Type = {
			isNumber: function(variable) {
				return (typeof variable === "number");
			},
			isString: function(variable) {
				return (typeof variable === "string");
			},
			isArray: Array.isArray || function(variable) {
				return Object.prototype.toString.call(variable) === "[object Array]";
			},
			isFunction: function(variable) {
				return Object.prototype.toString.call(variable) === "[object Function]";
			},
			isNode: function(variable) {
				return variable && variable.nodeType;
			},
			/* Determine if variable is an array-like wrapped jQuery, Zepto or similar element, or even a NodeList etc. */
			/* NOTE: HTMLFormElements also have a length. */
			isWrapped: function(variable) {
				return variable
						&& variable !== window
						&& Type.isNumber(variable.length)
						&& !Type.isString(variable)
						&& !Type.isFunction(variable)
						&& !Type.isNode(variable)
						&& (variable.length === 0 || Type.isNode(variable[0]));
			},
			isSVG: function(variable) {
				return window.SVGElement && (variable instanceof window.SVGElement);
			},
			isEmptyObject: function(variable) {
				for (var name in variable) {
					if (variable.hasOwnProperty(name)) {
						return false;
					}
				}

				return true;
			}
		};

		/*****************
		 Dependencies
		 *****************/

		var $,
				isJQuery = false;

		if (global.fn && global.fn.jquery) {
			$ = global;
			isJQuery = true;
		} else {
			$ = window.Velocity.Utilities;
		}

		if (IE <= 8 && !isJQuery) {
			throw new Error("Velocity: IE8 and below require jQuery to be loaded before Velocity.");
		} else if (IE <= 7) {
			/* Revert to jQuery's $.animate(), and lose Velocity's extra features. */
			jQuery.fn.velocity = jQuery.fn.animate;

			/* Now that $.fn.velocity is aliased, abort this Velocity declaration. */
			return;
		}

		/*****************
		 Constants
		 *****************/

		var DURATION_DEFAULT = 400,
				EASING_DEFAULT = "swing";

		/*************
		 State
		 *************/

		var Velocity = {
			/* Container for page-wide Velocity state data. */
			State: {
				/* Detect mobile devices to determine if mobileHA should be turned on. */
				isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(window.navigator.userAgent),
				/* The mobileHA option's behavior changes on older Android devices (Gingerbread, versions 2.3.3-2.3.7). */
				isAndroid: /Android/i.test(window.navigator.userAgent),
				isGingerbread: /Android 2\.3\.[3-7]/i.test(window.navigator.userAgent),
				isChrome: window.chrome,
				isFirefox: /Firefox/i.test(window.navigator.userAgent),
				/* Create a cached element for re-use when checking for CSS property prefixes. */
				prefixElement: document.createElement("div"),
				/* Cache every prefix match to avoid repeating lookups. */
				prefixMatches: {},
				/* Cache the anchor used for animating window scrolling. */
				scrollAnchor: null,
				/* Cache the browser-specific property names associated with the scroll anchor. */
				scrollPropertyLeft: null,
				scrollPropertyTop: null,
				/* Keep track of whether our RAF tick is running. */
				isTicking: false,
				/* Container for every in-progress call to Velocity. */
				calls: [],
				delayedElements: {
					count: 0
				}
			},
			/* Velocity's custom CSS stack. Made global for unit testing. */
			CSS: {/* Defined below. */},
			/* A shim of the jQuery utility functions used by Velocity -- provided by Velocity's optional jQuery shim. */
			Utilities: $,
			/* Container for the user's custom animation redirects that are referenced by name in place of the properties map argument. */
			Redirects: {/* Manually registered by the user. */},
			Easings: {/* Defined below. */},
			/* Attempt to use ES6 Promises by default. Users can override this with a third-party promises library. */
			Promise: window.Promise,
			/* Velocity option defaults, which can be overriden by the user. */
			defaults: {
				queue: "",
				duration: DURATION_DEFAULT,
				easing: EASING_DEFAULT,
				begin: undefined,
				complete: undefined,
				progress: undefined,
				display: undefined,
				visibility: undefined,
				loop: false,
				delay: false,
				mobileHA: true,
				/* Advanced: Set to false to prevent property values from being cached between consecutive Velocity-initiated chain calls. */
				_cacheValues: true,
				/* Advanced: Set to false if the promise should always resolve on empty element lists. */
				promiseRejectEmpty: true
			},
			/* A design goal of Velocity is to cache data wherever possible in order to avoid DOM requerying. Accordingly, each element has a data cache. */
			init: function(element) {
				$.data(element, "velocity", {
					/* Store whether this is an SVG element, since its properties are retrieved and updated differently than standard HTML elements. */
					isSVG: Type.isSVG(element),
					/* Keep track of whether the element is currently being animated by Velocity.
					 This is used to ensure that property values are not transferred between non-consecutive (stale) calls. */
					isAnimating: false,
					/* A reference to the element's live computedStyle object. Learn more here: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle */
					computedStyle: null,
					/* Tween data is cached for each animation on the element so that data can be passed across calls --
					 in particular, end values are used as subsequent start values in consecutive Velocity calls. */
					tweensContainer: null,
					/* The full root property values of each CSS hook being animated on this element are cached so that:
					 1) Concurrently-animating hooks sharing the same root can have their root values' merged into one while tweening.
					 2) Post-hook-injection root values can be transferred over to consecutively chained Velocity calls as starting root values. */
					rootPropertyValueCache: {},
					/* A cache for transform updates, which must be manually flushed via CSS.flushTransformCache(). */
					transformCache: {}
				});
			},
			/* A parallel to jQuery's $.css(), used for getting/setting Velocity's hooked CSS properties. */
			hook: null, /* Defined below. */
			/* Velocity-wide animation time remapping for testing purposes. */
			mock: false,
			version: {major: 1, minor: 5, patch: 2},
			/* Set to 1 or 2 (most verbose) to output debug info to console. */
			debug: false,
			/* Use rAF high resolution timestamp when available */
			timestamp: true,
			/* Pause all animations */
			pauseAll: function(queueName) {
				var currentTime = (new Date()).getTime();

				$.each(Velocity.State.calls, function(i, activeCall) {

					if (activeCall) {

						/* If we have a queueName and this call is not on that queue, skip */
						if (queueName !== undefined && ((activeCall[2].queue !== queueName) || (activeCall[2].queue === false))) {
							return true;
						}

						/* Set call to paused */
						activeCall[5] = {
							resume: false
						};
					}
				});

				/* Pause timers on any currently delayed calls */
				$.each(Velocity.State.delayedElements, function(k, element) {
					if (!element) {
						return;
					}
					pauseDelayOnElement(element, currentTime);
				});
			},
			/* Resume all animations */
			resumeAll: function(queueName) {
				var currentTime = (new Date()).getTime();

				$.each(Velocity.State.calls, function(i, activeCall) {

					if (activeCall) {

						/* If we have a queueName and this call is not on that queue, skip */
						if (queueName !== undefined && ((activeCall[2].queue !== queueName) || (activeCall[2].queue === false))) {
							return true;
						}

						/* Set call to resumed if it was paused */
						if (activeCall[5]) {
							activeCall[5].resume = true;
						}
					}
				});
				/* Resume timers on any currently delayed calls */
				$.each(Velocity.State.delayedElements, function(k, element) {
					if (!element) {
						return;
					}
					resumeDelayOnElement(element, currentTime);
				});
			}
		};

		/* Retrieve the appropriate scroll anchor and property name for the browser: https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY */
		if (window.pageYOffset !== undefined) {
			Velocity.State.scrollAnchor = window;
			Velocity.State.scrollPropertyLeft = "pageXOffset";
			Velocity.State.scrollPropertyTop = "pageYOffset";
		} else {
			Velocity.State.scrollAnchor = document.documentElement || document.body.parentNode || document.body;
			Velocity.State.scrollPropertyLeft = "scrollLeft";
			Velocity.State.scrollPropertyTop = "scrollTop";
		}

		/* Shorthand alias for jQuery's $.data() utility. */
		function Data(element) {
			/* Hardcode a reference to the plugin name. */
			var response = $.data(element, "velocity");

			/* jQuery <=1.4.2 returns null instead of undefined when no match is found. We normalize this behavior. */
			return response === null ? undefined : response;
		}

		/**************
		 Delay Timer
		 **************/

		function pauseDelayOnElement(element, currentTime) {
			/* Check for any delay timers, and pause the set timeouts (while preserving time data)
			 to be resumed when the "resume" command is issued */
			var data = Data(element);
			if (data && data.delayTimer && !data.delayPaused) {
				data.delayRemaining = data.delay - currentTime + data.delayBegin;
				data.delayPaused = true;
				clearTimeout(data.delayTimer.setTimeout);
			}
		}

		function resumeDelayOnElement(element, currentTime) {
			/* Check for any paused timers and resume */
			var data = Data(element);
			if (data && data.delayTimer && data.delayPaused) {
				/* If the element was mid-delay, re initiate the timeout with the remaining delay */
				data.delayPaused = false;
				data.delayTimer.setTimeout = setTimeout(data.delayTimer.next, data.delayRemaining);
			}
		}



		/**************
		 Easing
		 **************/

		/* Step easing generator. */
		function generateStep(steps) {
			return function(p) {
				return Math.round(p * steps) * (1 / steps);
			};
		}

		/* Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */
		function generateBezier(mX1, mY1, mX2, mY2) {
			var NEWTON_ITERATIONS = 4,
					NEWTON_MIN_SLOPE = 0.001,
					SUBDIVISION_PRECISION = 0.0000001,
					SUBDIVISION_MAX_ITERATIONS = 10,
					kSplineTableSize = 11,
					kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),
					float32ArraySupported = "Float32Array" in window;

			/* Must contain four arguments. */
			if (arguments.length !== 4) {
				return false;
			}

			/* Arguments must be numbers. */
			for (var i = 0; i < 4; ++i) {
				if (typeof arguments[i] !== "number" || isNaN(arguments[i]) || !isFinite(arguments[i])) {
					return false;
				}
			}

			/* X values must be in the [0, 1] range. */
			mX1 = Math.min(mX1, 1);
			mX2 = Math.min(mX2, 1);
			mX1 = Math.max(mX1, 0);
			mX2 = Math.max(mX2, 0);

			var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);

			function A(aA1, aA2) {
				return 1.0 - 3.0 * aA2 + 3.0 * aA1;
			}
			function B(aA1, aA2) {
				return 3.0 * aA2 - 6.0 * aA1;
			}
			function C(aA1) {
				return 3.0 * aA1;
			}

			function calcBezier(aT, aA1, aA2) {
				return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;
			}

			function getSlope(aT, aA1, aA2) {
				return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);
			}

			function newtonRaphsonIterate(aX, aGuessT) {
				for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
					var currentSlope = getSlope(aGuessT, mX1, mX2);

					if (currentSlope === 0.0) {
						return aGuessT;
					}

					var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
					aGuessT -= currentX / currentSlope;
				}

				return aGuessT;
			}

			function calcSampleValues() {
				for (var i = 0; i < kSplineTableSize; ++i) {
					mSampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
				}
			}

			function binarySubdivide(aX, aA, aB) {
				var currentX, currentT, i = 0;

				do {
					currentT = aA + (aB - aA) / 2.0;
					currentX = calcBezier(currentT, mX1, mX2) - aX;
					if (currentX > 0.0) {
						aB = currentT;
					} else {
						aA = currentT;
					}
				} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);

				return currentT;
			}

			function getTForX(aX) {
				var intervalStart = 0.0,
						currentSample = 1,
						lastSample = kSplineTableSize - 1;

				for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {
					intervalStart += kSampleStepSize;
				}

				--currentSample;

				var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),
						guessForT = intervalStart + dist * kSampleStepSize,
						initialSlope = getSlope(guessForT, mX1, mX2);

				if (initialSlope >= NEWTON_MIN_SLOPE) {
					return newtonRaphsonIterate(aX, guessForT);
				} else if (initialSlope === 0.0) {
					return guessForT;
				} else {
					return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);
				}
			}

			var _precomputed = false;

			function precompute() {
				_precomputed = true;
				if (mX1 !== mY1 || mX2 !== mY2) {
					calcSampleValues();
				}
			}

			var f = function(aX) {
				if (!_precomputed) {
					precompute();
				}
				if (mX1 === mY1 && mX2 === mY2) {
					return aX;
				}
				if (aX === 0) {
					return 0;
				}
				if (aX === 1) {
					return 1;
				}

				return calcBezier(getTForX(aX), mY1, mY2);
			};

			f.getControlPoints = function() {
				return [{x: mX1, y: mY1}, {x: mX2, y: mY2}];
			};

			var str = "generateBezier(" + [mX1, mY1, mX2, mY2] + ")";
			f.toString = function() {
				return str;
			};

			return f;
		}

		/* Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */
		/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass
		 then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */
		var generateSpringRK4 = (function() {
			function springAccelerationForState(state) {
				return (-state.tension * state.x) - (state.friction * state.v);
			}

			function springEvaluateStateWithDerivative(initialState, dt, derivative) {
				var state = {
					x: initialState.x + derivative.dx * dt,
					v: initialState.v + derivative.dv * dt,
					tension: initialState.tension,
					friction: initialState.friction
				};

				return {dx: state.v, dv: springAccelerationForState(state)};
			}

			function springIntegrateState(state, dt) {
				var a = {
					dx: state.v,
					dv: springAccelerationForState(state)
				},
						b = springEvaluateStateWithDerivative(state, dt * 0.5, a),
						c = springEvaluateStateWithDerivative(state, dt * 0.5, b),
						d = springEvaluateStateWithDerivative(state, dt, c),
						dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx),
						dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv);

				state.x = state.x + dxdt * dt;
				state.v = state.v + dvdt * dt;

				return state;
			}

			return function springRK4Factory(tension, friction, duration) {

				var initState = {
					x: -1,
					v: 0,
					tension: null,
					friction: null
				},
						path = [0],
						time_lapsed = 0,
						tolerance = 1 / 10000,
						DT = 16 / 1000,
						have_duration, dt, last_state;

				tension = parseFloat(tension) || 500;
				friction = parseFloat(friction) || 20;
				duration = duration || null;

				initState.tension = tension;
				initState.friction = friction;

				have_duration = duration !== null;

				/* Calculate the actual time it takes for this animation to complete with the provided conditions. */
				if (have_duration) {
					/* Run the simulation without a duration. */
					time_lapsed = springRK4Factory(tension, friction);
					/* Compute the adjusted time delta. */
					dt = time_lapsed / duration * DT;
				} else {
					dt = DT;
				}

				while (true) {
					/* Next/step function .*/
					last_state = springIntegrateState(last_state || initState, dt);
					/* Store the position. */
					path.push(1 + last_state.x);
					time_lapsed += 16;
					/* If the change threshold is reached, break. */
					if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) {
						break;
					}
				}

				/* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the
				 computed path and returns a snapshot of the position according to a given percentComplete. */
				return !have_duration ? time_lapsed : function(percentComplete) {
					return path[ (percentComplete * (path.length - 1)) | 0 ];
				};
			};
		}());

		/* jQuery easings. */
		Velocity.Easings = {
			linear: function(p) {
				return p;
			},
			swing: function(p) {
				return 0.5 - Math.cos(p * Math.PI) / 2;
			},
			/* Bonus "spring" easing, which is a less exaggerated version of easeInOutElastic. */
			spring: function(p) {
				return 1 - (Math.cos(p * 4.5 * Math.PI) * Math.exp(-p * 6));
			}
		};

		/* CSS3 and Robert Penner easings. */
		$.each(
				[
					["ease", [0.25, 0.1, 0.25, 1.0]],
					["ease-in", [0.42, 0.0, 1.00, 1.0]],
					["ease-out", [0.00, 0.0, 0.58, 1.0]],
					["ease-in-out", [0.42, 0.0, 0.58, 1.0]],
					["easeInSine", [0.47, 0, 0.745, 0.715]],
					["easeOutSine", [0.39, 0.575, 0.565, 1]],
					["easeInOutSine", [0.445, 0.05, 0.55, 0.95]],
					["easeInQuad", [0.55, 0.085, 0.68, 0.53]],
					["easeOutQuad", [0.25, 0.46, 0.45, 0.94]],
					["easeInOutQuad", [0.455, 0.03, 0.515, 0.955]],
					["easeInCubic", [0.55, 0.055, 0.675, 0.19]],
					["easeOutCubic", [0.215, 0.61, 0.355, 1]],
					["easeInOutCubic", [0.645, 0.045, 0.355, 1]],
					["easeInQuart", [0.895, 0.03, 0.685, 0.22]],
					["easeOutQuart", [0.165, 0.84, 0.44, 1]],
					["easeInOutQuart", [0.77, 0, 0.175, 1]],
					["easeInQuint", [0.755, 0.05, 0.855, 0.06]],
					["easeOutQuint", [0.23, 1, 0.32, 1]],
					["easeInOutQuint", [0.86, 0, 0.07, 1]],
					["easeInExpo", [0.95, 0.05, 0.795, 0.035]],
					["easeOutExpo", [0.19, 1, 0.22, 1]],
					["easeInOutExpo", [1, 0, 0, 1]],
					["easeInCirc", [0.6, 0.04, 0.98, 0.335]],
					["easeOutCirc", [0.075, 0.82, 0.165, 1]],
					["easeInOutCirc", [0.785, 0.135, 0.15, 0.86]]
				], function(i, easingArray) {
			Velocity.Easings[easingArray[0]] = generateBezier.apply(null, easingArray[1]);
		});

		/* Determine the appropriate easing type given an easing input. */
		function getEasing(value, duration) {
			var easing = value;

			/* The easing option can either be a string that references a pre-registered easing,
			 or it can be a two-/four-item array of integers to be converted into a bezier/spring function. */
			if (Type.isString(value)) {
				/* Ensure that the easing has been assigned to jQuery's Velocity.Easings object. */
				if (!Velocity.Easings[value]) {
					easing = false;
				}
			} else if (Type.isArray(value) && value.length === 1) {
				easing = generateStep.apply(null, value);
			} else if (Type.isArray(value) && value.length === 2) {
				/* springRK4 must be passed the animation's duration. */
				/* Note: If the springRK4 array contains non-numbers, generateSpringRK4() returns an easing
				 function generated with default tension and friction values. */
				easing = generateSpringRK4.apply(null, value.concat([duration]));
			} else if (Type.isArray(value) && value.length === 4) {
				/* Note: If the bezier array contains non-numbers, generateBezier() returns false. */
				easing = generateBezier.apply(null, value);
			} else {
				easing = false;
			}

			/* Revert to the Velocity-wide default easing type, or fall back to "swing" (which is also jQuery's default)
			 if the Velocity-wide default has been incorrectly modified. */
			if (easing === false) {
				if (Velocity.Easings[Velocity.defaults.easing]) {
					easing = Velocity.defaults.easing;
				} else {
					easing = EASING_DEFAULT;
				}
			}

			return easing;
		}

		/*****************
		 CSS Stack
		 *****************/

		/* The CSS object is a highly condensed and performant CSS stack that fully replaces jQuery's.
		 It handles the validation, getting, and setting of both standard CSS properties and CSS property hooks. */
		/* Note: A "CSS" shorthand is aliased so that our code is easier to read. */
		var CSS = Velocity.CSS = {
			/*************
			 RegEx
			 *************/

			RegEx: {
				isHex: /^#([A-f\d]{3}){1,2}$/i,
				/* Unwrap a property value's surrounding text, e.g. "rgba(4, 3, 2, 1)" ==> "4, 3, 2, 1" and "rect(4px 3px 2px 1px)" ==> "4px 3px 2px 1px". */
				valueUnwrap: /^[A-z]+\((.*)\)$/i,
				wrappedValueAlreadyExtracted: /[0-9.]+ [0-9.]+ [0-9.]+( [0-9.]+)?/,
				/* Split a multi-value property into an array of subvalues, e.g. "rgba(4, 3, 2, 1) 4px 3px 2px 1px" ==> [ "rgba(4, 3, 2, 1)", "4px", "3px", "2px", "1px" ]. */
				valueSplit: /([A-z]+\(.+\))|(([A-z0-9#-.]+?)(?=\s|$))/ig
			},
			/************
			 Lists
			 ************/

			Lists: {
				colors: ["fill", "stroke", "stopColor", "color", "backgroundColor", "borderColor", "borderTopColor", "borderRightColor", "borderBottomColor", "borderLeftColor", "outlineColor"],
				transformsBase: ["translateX", "translateY", "scale", "scaleX", "scaleY", "skewX", "skewY", "rotateZ"],
				transforms3D: ["transformPerspective", "translateZ", "scaleZ", "rotateX", "rotateY"],
				units: [
					"%", // relative
					"em", "ex", "ch", "rem", // font relative
					"vw", "vh", "vmin", "vmax", // viewport relative
					"cm", "mm", "Q", "in", "pc", "pt", "px", // absolute lengths
					"deg", "grad", "rad", "turn", // angles
					"s", "ms" // time
				],
				colorNames: {
					"aliceblue": "240,248,255",
					"antiquewhite": "250,235,215",
					"aquamarine": "127,255,212",
					"aqua": "0,255,255",
					"azure": "240,255,255",
					"beige": "245,245,220",
					"bisque": "255,228,196",
					"black": "0,0,0",
					"blanchedalmond": "255,235,205",
					"blueviolet": "138,43,226",
					"blue": "0,0,255",
					"brown": "165,42,42",
					"burlywood": "222,184,135",
					"cadetblue": "95,158,160",
					"chartreuse": "127,255,0",
					"chocolate": "210,105,30",
					"coral": "255,127,80",
					"cornflowerblue": "100,149,237",
					"cornsilk": "255,248,220",
					"crimson": "220,20,60",
					"cyan": "0,255,255",
					"darkblue": "0,0,139",
					"darkcyan": "0,139,139",
					"darkgoldenrod": "184,134,11",
					"darkgray": "169,169,169",
					"darkgrey": "169,169,169",
					"darkgreen": "0,100,0",
					"darkkhaki": "189,183,107",
					"darkmagenta": "139,0,139",
					"darkolivegreen": "85,107,47",
					"darkorange": "255,140,0",
					"darkorchid": "153,50,204",
					"darkred": "139,0,0",
					"darksalmon": "233,150,122",
					"darkseagreen": "143,188,143",
					"darkslateblue": "72,61,139",
					"darkslategray": "47,79,79",
					"darkturquoise": "0,206,209",
					"darkviolet": "148,0,211",
					"deeppink": "255,20,147",
					"deepskyblue": "0,191,255",
					"dimgray": "105,105,105",
					"dimgrey": "105,105,105",
					"dodgerblue": "30,144,255",
					"firebrick": "178,34,34",
					"floralwhite": "255,250,240",
					"forestgreen": "34,139,34",
					"fuchsia": "255,0,255",
					"gainsboro": "220,220,220",
					"ghostwhite": "248,248,255",
					"gold": "255,215,0",
					"goldenrod": "218,165,32",
					"gray": "128,128,128",
					"grey": "128,128,128",
					"greenyellow": "173,255,47",
					"green": "0,128,0",
					"honeydew": "240,255,240",
					"hotpink": "255,105,180",
					"indianred": "205,92,92",
					"indigo": "75,0,130",
					"ivory": "255,255,240",
					"khaki": "240,230,140",
					"lavenderblush": "255,240,245",
					"lavender": "230,230,250",
					"lawngreen": "124,252,0",
					"lemonchiffon": "255,250,205",
					"lightblue": "173,216,230",
					"lightcoral": "240,128,128",
					"lightcyan": "224,255,255",
					"lightgoldenrodyellow": "250,250,210",
					"lightgray": "211,211,211",
					"lightgrey": "211,211,211",
					"lightgreen": "144,238,144",
					"lightpink": "255,182,193",
					"lightsalmon": "255,160,122",
					"lightseagreen": "32,178,170",
					"lightskyblue": "135,206,250",
					"lightslategray": "119,136,153",
					"lightsteelblue": "176,196,222",
					"lightyellow": "255,255,224",
					"limegreen": "50,205,50",
					"lime": "0,255,0",
					"linen": "250,240,230",
					"magenta": "255,0,255",
					"maroon": "128,0,0",
					"mediumaquamarine": "102,205,170",
					"mediumblue": "0,0,205",
					"mediumorchid": "186,85,211",
					"mediumpurple": "147,112,219",
					"mediumseagreen": "60,179,113",
					"mediumslateblue": "123,104,238",
					"mediumspringgreen": "0,250,154",
					"mediumturquoise": "72,209,204",
					"mediumvioletred": "199,21,133",
					"midnightblue": "25,25,112",
					"mintcream": "245,255,250",
					"mistyrose": "255,228,225",
					"moccasin": "255,228,181",
					"navajowhite": "255,222,173",
					"navy": "0,0,128",
					"oldlace": "253,245,230",
					"olivedrab": "107,142,35",
					"olive": "128,128,0",
					"orangered": "255,69,0",
					"orange": "255,165,0",
					"orchid": "218,112,214",
					"palegoldenrod": "238,232,170",
					"palegreen": "152,251,152",
					"paleturquoise": "175,238,238",
					"palevioletred": "219,112,147",
					"papayawhip": "255,239,213",
					"peachpuff": "255,218,185",
					"peru": "205,133,63",
					"pink": "255,192,203",
					"plum": "221,160,221",
					"powderblue": "176,224,230",
					"purple": "128,0,128",
					"red": "255,0,0",
					"rosybrown": "188,143,143",
					"royalblue": "65,105,225",
					"saddlebrown": "139,69,19",
					"salmon": "250,128,114",
					"sandybrown": "244,164,96",
					"seagreen": "46,139,87",
					"seashell": "255,245,238",
					"sienna": "160,82,45",
					"silver": "192,192,192",
					"skyblue": "135,206,235",
					"slateblue": "106,90,205",
					"slategray": "112,128,144",
					"snow": "255,250,250",
					"springgreen": "0,255,127",
					"steelblue": "70,130,180",
					"tan": "210,180,140",
					"teal": "0,128,128",
					"thistle": "216,191,216",
					"tomato": "255,99,71",
					"turquoise": "64,224,208",
					"violet": "238,130,238",
					"wheat": "245,222,179",
					"whitesmoke": "245,245,245",
					"white": "255,255,255",
					"yellowgreen": "154,205,50",
					"yellow": "255,255,0"
				}
			},
			/************
			 Hooks
			 ************/

			/* Hooks allow a subproperty (e.g. "boxShadowBlur") of a compound-value CSS property
			 (e.g. "boxShadow: X Y Blur Spread Color") to be animated as if it were a discrete property. */
			/* Note: Beyond enabling fine-grained property animation, hooking is necessary since Velocity only
			 tweens properties with single numeric values; unlike CSS transitions, Velocity does not interpolate compound-values. */
			Hooks: {
				/********************
				 Registration
				 ********************/

				/* Templates are a concise way of indicating which subproperties must be individually registered for each compound-value CSS property. */
				/* Each template consists of the compound-value's base name, its constituent subproperty names, and those subproperties' default values. */
				templates: {
					"textShadow": ["Color X Y Blur", "black 0px 0px 0px"],
					"boxShadow": ["Color X Y Blur Spread", "black 0px 0px 0px 0px"],
					"clip": ["Top Right Bottom Left", "0px 0px 0px 0px"],
					"backgroundPosition": ["X Y", "0% 0%"],
					"transformOrigin": ["X Y Z", "50% 50% 0px"],
					"perspectiveOrigin": ["X Y", "50% 50%"]
				},
				/* A "registered" hook is one that has been converted from its template form into a live,
				 tweenable property. It contains data to associate it with its root property. */
				registered: {
					/* Note: A registered hook looks like this ==> textShadowBlur: [ "textShadow", 3 ],
					 which consists of the subproperty's name, the associated root property's name,
					 and the subproperty's position in the root's value. */
				},
				/* Convert the templates into individual hooks then append them to the registered object above. */
				register: function() {
					/* Color hooks registration: Colors are defaulted to white -- as opposed to black -- since colors that are
					 currently set to "transparent" default to their respective template below when color-animated,
					 and white is typically a closer match to transparent than black is. An exception is made for text ("color"),
					 which is almost always set closer to black than white. */
					for (var i = 0; i < CSS.Lists.colors.length; i++) {
						var rgbComponents = (CSS.Lists.colors[i] === "color") ? "0 0 0 1" : "255 255 255 1";
						CSS.Hooks.templates[CSS.Lists.colors[i]] = ["Red Green Blue Alpha", rgbComponents];
					}

					var rootProperty,
							hookTemplate,
							hookNames;

					/* In IE, color values inside compound-value properties are positioned at the end the value instead of at the beginning.
					 Thus, we re-arrange the templates accordingly. */
					if (IE) {
						for (rootProperty in CSS.Hooks.templates) {
							if (!CSS.Hooks.templates.hasOwnProperty(rootProperty)) {
								continue;
							}
							hookTemplate = CSS.Hooks.templates[rootProperty];
							hookNames = hookTemplate[0].split(" ");

							var defaultValues = hookTemplate[1].match(CSS.RegEx.valueSplit);

							if (hookNames[0] === "Color") {
								/* Reposition both the hook's name and its default value to the end of their respective strings. */
								hookNames.push(hookNames.shift());
								defaultValues.push(defaultValues.shift());

								/* Replace the existing template for the hook's root property. */
								CSS.Hooks.templates[rootProperty] = [hookNames.join(" "), defaultValues.join(" ")];
							}
						}
					}

					/* Hook registration. */
					for (rootProperty in CSS.Hooks.templates) {
						if (!CSS.Hooks.templates.hasOwnProperty(rootProperty)) {
							continue;
						}
						hookTemplate = CSS.Hooks.templates[rootProperty];
						hookNames = hookTemplate[0].split(" ");

						for (var j in hookNames) {
							if (!hookNames.hasOwnProperty(j)) {
								continue;
							}
							var fullHookName = rootProperty + hookNames[j],
									hookPosition = j;

							/* For each hook, register its full name (e.g. textShadowBlur) with its root property (e.g. textShadow)
							 and the hook's position in its template's default value string. */
							CSS.Hooks.registered[fullHookName] = [rootProperty, hookPosition];
						}
					}
				},
				/*****************************
				 Injection and Extraction
				 *****************************/

				/* Look up the root property associated with the hook (e.g. return "textShadow" for "textShadowBlur"). */
				/* Since a hook cannot be set directly (the browser won't recognize it), style updating for hooks is routed through the hook's root property. */
				getRoot: function(property) {
					var hookData = CSS.Hooks.registered[property];

					if (hookData) {
						return hookData[0];
					} else {
						/* If there was no hook match, return the property name untouched. */
						return property;
					}
				},
				getUnit: function(str, start) {
					var unit = (str.substr(start || 0, 5).match(/^[a-z%]+/) || [])[0] || "";

					if (unit && _inArray(CSS.Lists.units, unit)) {
						return unit;
					}
					return "";
				},
				fixColors: function(str) {
					return str.replace(/(rgba?\(\s*)?(\b[a-z]+\b)/g, function($0, $1, $2) {
						if (CSS.Lists.colorNames.hasOwnProperty($2)) {
							return ($1 ? $1 : "rgba(") + CSS.Lists.colorNames[$2] + ($1 ? "" : ",1)");
						}
						return $1 + $2;
					});
				},
				/* Convert any rootPropertyValue, null or otherwise, into a space-delimited list of hook values so that
				 the targeted hook can be injected or extracted at its standard position. */
				cleanRootPropertyValue: function(rootProperty, rootPropertyValue) {
					/* If the rootPropertyValue is wrapped with "rgb()", "clip()", etc., remove the wrapping to normalize the value before manipulation. */
					if (CSS.RegEx.valueUnwrap.test(rootPropertyValue)) {
						rootPropertyValue = rootPropertyValue.match(CSS.RegEx.valueUnwrap)[1];
					}

					/* If rootPropertyValue is a CSS null-value (from which there's inherently no hook value to extract),
					 default to the root's default value as defined in CSS.Hooks.templates. */
					/* Note: CSS null-values include "none", "auto", and "transparent". They must be converted into their
					 zero-values (e.g. textShadow: "none" ==> textShadow: "0px 0px 0px black") for hook manipulation to proceed. */
					if (CSS.Values.isCSSNullValue(rootPropertyValue)) {
						rootPropertyValue = CSS.Hooks.templates[rootProperty][1];
					}

					return rootPropertyValue;
				},
				/* Extracted the hook's value from its root property's value. This is used to get the starting value of an animating hook. */
				extractValue: function(fullHookName, rootPropertyValue) {
					var hookData = CSS.Hooks.registered[fullHookName];

					if (hookData) {
						var hookRoot = hookData[0],
								hookPosition = hookData[1];

						rootPropertyValue = CSS.Hooks.cleanRootPropertyValue(hookRoot, rootPropertyValue);

						/* Split rootPropertyValue into its constituent hook values then grab the desired hook at its standard position. */
						return rootPropertyValue.toString().match(CSS.RegEx.valueSplit)[hookPosition];
					} else {
						/* If the provided fullHookName isn't a registered hook, return the rootPropertyValue that was passed in. */
						return rootPropertyValue;
					}
				},
				/* Inject the hook's value into its root property's value. This is used to piece back together the root property
				 once Velocity has updated one of its individually hooked values through tweening. */
				injectValue: function(fullHookName, hookValue, rootPropertyValue) {
					var hookData = CSS.Hooks.registered[fullHookName];

					if (hookData) {
						var hookRoot = hookData[0],
								hookPosition = hookData[1],
								rootPropertyValueParts,
								rootPropertyValueUpdated;

						rootPropertyValue = CSS.Hooks.cleanRootPropertyValue(hookRoot, rootPropertyValue);

						/* Split rootPropertyValue into its individual hook values, replace the targeted value with hookValue,
						 then reconstruct the rootPropertyValue string. */
						rootPropertyValueParts = rootPropertyValue.toString().match(CSS.RegEx.valueSplit);
						rootPropertyValueParts[hookPosition] = hookValue;
						rootPropertyValueUpdated = rootPropertyValueParts.join(" ");

						return rootPropertyValueUpdated;
					} else {
						/* If the provided fullHookName isn't a registered hook, return the rootPropertyValue that was passed in. */
						return rootPropertyValue;
					}
				}
			},
			/*******************
			 Normalizations
			 *******************/

			/* Normalizations standardize CSS property manipulation by pollyfilling browser-specific implementations (e.g. opacity)
			 and reformatting special properties (e.g. clip, rgba) to look like standard ones. */
			Normalizations: {
				/* Normalizations are passed a normalization target (either the property's name, its extracted value, or its injected value),
				 the targeted element (which may need to be queried), and the targeted property value. */
				registered: {
					clip: function(type, element, propertyValue) {
						switch (type) {
							case "name":
								return "clip";
								/* Clip needs to be unwrapped and stripped of its commas during extraction. */
							case "extract":
								var extracted;

								/* If Velocity also extracted this value, skip extraction. */
								if (CSS.RegEx.wrappedValueAlreadyExtracted.test(propertyValue)) {
									extracted = propertyValue;
								} else {
									/* Remove the "rect()" wrapper. */
									extracted = propertyValue.toString().match(CSS.RegEx.valueUnwrap);

									/* Strip off commas. */
									extracted = extracted ? extracted[1].replace(/,(\s+)?/g, " ") : propertyValue;
								}

								return extracted;
								/* Clip needs to be re-wrapped during injection. */
							case "inject":
								return "rect(" + propertyValue + ")";
						}
					},
					blur: function(type, element, propertyValue) {
						switch (type) {
							case "name":
								return Velocity.State.isFirefox ? "filter" : "-webkit-filter";
							case "extract":
								var extracted = parseFloat(propertyValue);

								/* If extracted is NaN, meaning the value isn't already extracted. */
								if (!(extracted || extracted === 0)) {
									var blurComponent = propertyValue.toString().match(/blur\(([0-9]+[A-z]+)\)/i);

									/* If the filter string had a blur component, return just the blur value and unit type. */
									if (blurComponent) {
										extracted = blurComponent[1];
										/* If the component doesn't exist, default blur to 0. */
									} else {
										extracted = 0;
									}
								}

								return extracted;
								/* Blur needs to be re-wrapped during injection. */
							case "inject":
								/* For the blur effect to be fully de-applied, it needs to be set to "none" instead of 0. */
								if (!parseFloat(propertyValue)) {
									return "none";
								} else {
									return "blur(" + propertyValue + ")";
								}
						}
					},
					/* <=IE8 do not support the standard opacity property. They use filter:alpha(opacity=INT) instead. */
					opacity: function(type, element, propertyValue) {
						if (IE <= 8) {
							switch (type) {
								case "name":
									return "filter";
								case "extract":
									/* <=IE8 return a "filter" value of "alpha(opacity=\d{1,3})".
									 Extract the value and convert it to a decimal value to match the standard CSS opacity property's formatting. */
									var extracted = propertyValue.toString().match(/alpha\(opacity=(.*)\)/i);

									if (extracted) {
										/* Convert to decimal value. */
										propertyValue = extracted[1] / 100;
									} else {
										/* When extracting opacity, default to 1 since a null value means opacity hasn't been set. */
										propertyValue = 1;
									}

									return propertyValue;
								case "inject":
									/* Opacified elements are required to have their zoom property set to a non-zero value. */
									element.style.zoom = 1;

									/* Setting the filter property on elements with certain font property combinations can result in a
									 highly unappealing ultra-bolding effect. There's no way to remedy this throughout a tween, but dropping the
									 value altogether (when opacity hits 1) at leasts ensures that the glitch is gone post-tweening. */
									if (parseFloat(propertyValue) >= 1) {
										return "";
									} else {
										/* As per the filter property's spec, convert the decimal value to a whole number and wrap the value. */
										return "alpha(opacity=" + parseInt(parseFloat(propertyValue) * 100, 10) + ")";
									}
							}
							/* With all other browsers, normalization is not required; return the same values that were passed in. */
						} else {
							switch (type) {
								case "name":
									return "opacity";
								case "extract":
									return propertyValue;
								case "inject":
									return propertyValue;
							}
						}
					}
				},
				/*****************************
				 Batched Registrations
				 *****************************/

				/* Note: Batched normalizations extend the CSS.Normalizations.registered object. */
				register: function() {

					/*****************
					 Transforms
					 *****************/

					/* Transforms are the subproperties contained by the CSS "transform" property. Transforms must undergo normalization
					 so that they can be referenced in a properties map by their individual names. */
					/* Note: When transforms are "set", they are actually assigned to a per-element transformCache. When all transform
					 setting is complete complete, CSS.flushTransformCache() must be manually called to flush the values to the DOM.
					 Transform setting is batched in this way to improve performance: the transform style only needs to be updated
					 once when multiple transform subproperties are being animated simultaneously. */
					/* Note: IE9 and Android Gingerbread have support for 2D -- but not 3D -- transforms. Since animating unsupported
					 transform properties results in the browser ignoring the *entire* transform string, we prevent these 3D values
					 from being normalized for these browsers so that tweening skips these properties altogether
					 (since it will ignore them as being unsupported by the browser.) */
					if ((!IE || IE > 9) && !Velocity.State.isGingerbread) {
						/* Note: Since the standalone CSS "perspective" property and the CSS transform "perspective" subproperty
						 share the same name, the latter is given a unique token within Velocity: "transformPerspective". */
						CSS.Lists.transformsBase = CSS.Lists.transformsBase.concat(CSS.Lists.transforms3D);
					}

					for (var i = 0; i < CSS.Lists.transformsBase.length; i++) {
						/* Wrap the dynamically generated normalization function in a new scope so that transformName's value is
						 paired with its respective function. (Otherwise, all functions would take the final for loop's transformName.) */
						(function() {
							var transformName = CSS.Lists.transformsBase[i];

							CSS.Normalizations.registered[transformName] = function(type, element, propertyValue) {
								switch (type) {
									/* The normalized property name is the parent "transform" property -- the property that is actually set in CSS. */
									case "name":
										return "transform";
										/* Transform values are cached onto a per-element transformCache object. */
									case "extract":
										/* If this transform has yet to be assigned a value, return its null value. */
										if (Data(element) === undefined || Data(element).transformCache[transformName] === undefined) {
											/* Scale CSS.Lists.transformsBase default to 1 whereas all other transform properties default to 0. */
											return /^scale/i.test(transformName) ? 1 : 0;
											/* When transform values are set, they are wrapped in parentheses as per the CSS spec.
											 Thus, when extracting their values (for tween calculations), we strip off the parentheses. */
										}
										return Data(element).transformCache[transformName].replace(/[()]/g, "");
									case "inject":
										var invalid = false;

										/* If an individual transform property contains an unsupported unit type, the browser ignores the *entire* transform property.
										 Thus, protect users from themselves by skipping setting for transform values supplied with invalid unit types. */
										/* Switch on the base transform type; ignore the axis by removing the last letter from the transform's name. */
										switch (transformName.substr(0, transformName.length - 1)) {
											/* Whitelist unit types for each transform. */
											case "translate":
												invalid = !/(%|px|em|rem|vw|vh|\d)$/i.test(propertyValue);
												break;
												/* Since an axis-free "scale" property is supported as well, a little hack is used here to detect it by chopping off its last letter. */
											case "scal":
											case "scale":
												/* Chrome on Android has a bug in which scaled elements blur if their initial scale
												 value is below 1 (which can happen with forcefeeding). Thus, we detect a yet-unset scale property
												 and ensure that its first value is always 1. More info: http://stackoverflow.com/questions/10417890/css3-animations-with-transform-causes-blurred-elements-on-webkit/10417962#10417962 */
												if (Velocity.State.isAndroid && Data(element).transformCache[transformName] === undefined && propertyValue < 1) {
													propertyValue = 1;
												}

												invalid = !/(\d)$/i.test(propertyValue);
												break;
											case "skew":
												invalid = !/(deg|\d)$/i.test(propertyValue);
												break;
											case "rotate":
												invalid = !/(deg|\d)$/i.test(propertyValue);
												break;
										}

										if (!invalid) {
											/* As per the CSS spec, wrap the value in parentheses. */
											Data(element).transformCache[transformName] = "(" + propertyValue + ")";
										}

										/* Although the value is set on the transformCache object, return the newly-updated value for the calling code to process as normal. */
										return Data(element).transformCache[transformName];
								}
							};
						})();
					}

					/*************
					 Colors
					 *************/

					/* Since Velocity only animates a single numeric value per property, color animation is achieved by hooking the individual RGBA components of CSS color properties.
					 Accordingly, color values must be normalized (e.g. "#ff0000", "red", and "rgb(255, 0, 0)" ==> "255 0 0 1") so that their components can be injected/extracted by CSS.Hooks logic. */
					for (var j = 0; j < CSS.Lists.colors.length; j++) {
						/* Wrap the dynamically generated normalization function in a new scope so that colorName's value is paired with its respective function.
						 (Otherwise, all functions would take the final for loop's colorName.) */
						(function() {
							var colorName = CSS.Lists.colors[j];

							/* Note: In IE<=8, which support rgb but not rgba, color properties are reverted to rgb by stripping off the alpha component. */
							CSS.Normalizations.registered[colorName] = function(type, element, propertyValue) {
								switch (type) {
									case "name":
										return colorName;
										/* Convert all color values into the rgb format. (Old IE can return hex values and color names instead of rgb/rgba.) */
									case "extract":
										var extracted;

										/* If the color is already in its hookable form (e.g. "255 255 255 1") due to having been previously extracted, skip extraction. */
										if (CSS.RegEx.wrappedValueAlreadyExtracted.test(propertyValue)) {
											extracted = propertyValue;
										} else {
											var converted,
													colorNames = {
														black: "rgb(0, 0, 0)",
														blue: "rgb(0, 0, 255)",
														gray: "rgb(128, 128, 128)",
														green: "rgb(0, 128, 0)",
														red: "rgb(255, 0, 0)",
														white: "rgb(255, 255, 255)"
													};

											/* Convert color names to rgb. */
											if (/^[A-z]+$/i.test(propertyValue)) {
												if (colorNames[propertyValue] !== undefined) {
													converted = colorNames[propertyValue];
												} else {
													/* If an unmatched color name is provided, default to black. */
													converted = colorNames.black;
												}
												/* Convert hex values to rgb. */
											} else if (CSS.RegEx.isHex.test(propertyValue)) {
												converted = "rgb(" + CSS.Values.hexToRgb(propertyValue).join(" ") + ")";
												/* If the provided color doesn't match any of the accepted color formats, default to black. */
											} else if (!(/^rgba?\(/i.test(propertyValue))) {
												converted = colorNames.black;
											}

											/* Remove the surrounding "rgb/rgba()" string then replace commas with spaces and strip
											 repeated spaces (in case the value included spaces to begin with). */
											extracted = (converted || propertyValue).toString().match(CSS.RegEx.valueUnwrap)[1].replace(/,(\s+)?/g, " ");
										}

										/* So long as this isn't <=IE8, add a fourth (alpha) component if it's missing and default it to 1 (visible). */
										if ((!IE || IE > 8) && extracted.split(" ").length === 3) {
											extracted += " 1";
										}

										return extracted;
									case "inject":
										/* If we have a pattern then it might already have the right values */
										if (/^rgb/.test(propertyValue)) {
											return propertyValue;
										}

										/* If this is IE<=8 and an alpha component exists, strip it off. */
										if (IE <= 8) {
											if (propertyValue.split(" ").length === 4) {
												propertyValue = propertyValue.split(/\s+/).slice(0, 3).join(" ");
											}
											/* Otherwise, add a fourth (alpha) component if it's missing and default it to 1 (visible). */
										} else if (propertyValue.split(" ").length === 3) {
											propertyValue += " 1";
										}

										/* Re-insert the browser-appropriate wrapper("rgb/rgba()"), insert commas, and strip off decimal units
										 on all values but the fourth (R, G, and B only accept whole numbers). */
										return (IE <= 8 ? "rgb" : "rgba") + "(" + propertyValue.replace(/\s+/g, ",").replace(/\.(\d)+(?=,)/g, "") + ")";
								}
							};
						})();
					}

					/**************
					 Dimensions
					 **************/
					function augmentDimension(name, element, wantInner) {
						var isBorderBox = CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() === "border-box";

						if (isBorderBox === (wantInner || false)) {
							/* in box-sizing mode, the CSS width / height accessors already give the outerWidth / outerHeight. */
							var i,
									value,
									augment = 0,
									sides = name === "width" ? ["Left", "Right"] : ["Top", "Bottom"],
									fields = ["padding" + sides[0], "padding" + sides[1], "border" + sides[0] + "Width", "border" + sides[1] + "Width"];

							for (i = 0; i < fields.length; i++) {
								value = parseFloat(CSS.getPropertyValue(element, fields[i]));
								if (!isNaN(value)) {
									augment += value;
								}
							}
							return wantInner ? -augment : augment;
						}
						return 0;
					}
					function getDimension(name, wantInner) {
						return function(type, element, propertyValue) {
							switch (type) {
								case "name":
									return name;
								case "extract":
									return parseFloat(propertyValue) + augmentDimension(name, element, wantInner);
								case "inject":
									return (parseFloat(propertyValue) - augmentDimension(name, element, wantInner)) + "px";
							}
						};
					}
					CSS.Normalizations.registered.innerWidth = getDimension("width", true);
					CSS.Normalizations.registered.innerHeight = getDimension("height", true);
					CSS.Normalizations.registered.outerWidth = getDimension("width");
					CSS.Normalizations.registered.outerHeight = getDimension("height");
				}
			},
			/************************
			 CSS Property Names
			 ************************/

			Names: {
				/* Camelcase a property name into its JavaScript notation (e.g. "background-color" ==> "backgroundColor").
				 Camelcasing is used to normalize property names between and across calls. */
				camelCase: function(property) {
					return property.replace(/-(\w)/g, function(match, subMatch) {
						return subMatch.toUpperCase();
					});
				},
				/* For SVG elements, some properties (namely, dimensional ones) are GET/SET via the element's HTML attributes (instead of via CSS styles). */
				SVGAttribute: function(property) {
					var SVGAttributes = "width|height|x|y|cx|cy|r|rx|ry|x1|x2|y1|y2";

					/* Certain browsers require an SVG transform to be applied as an attribute. (Otherwise, application via CSS is preferable due to 3D support.) */
					if (IE || (Velocity.State.isAndroid && !Velocity.State.isChrome)) {
						SVGAttributes += "|transform";
					}

					return new RegExp("^(" + SVGAttributes + ")$", "i").test(property);
				},
				/* Determine whether a property should be set with a vendor prefix. */
				/* If a prefixed version of the property exists, return it. Otherwise, return the original property name.
				 If the property is not at all supported by the browser, return a false flag. */
				prefixCheck: function(property) {
					/* If this property has already been checked, return the cached value. */
					if (Velocity.State.prefixMatches[property]) {
						return [Velocity.State.prefixMatches[property], true];
					} else {
						var vendors = ["", "Webkit", "Moz", "ms", "O"];

						for (var i = 0, vendorsLength = vendors.length; i < vendorsLength; i++) {
							var propertyPrefixed;

							if (i === 0) {
								propertyPrefixed = property;
							} else {
								/* Capitalize the first letter of the property to conform to JavaScript vendor prefix notation (e.g. webkitFilter). */
								propertyPrefixed = vendors[i] + property.replace(/^\w/, function(match) {
									return match.toUpperCase();
								});
							}

							/* Check if the browser supports this property as prefixed. */
							if (Type.isString(Velocity.State.prefixElement.style[propertyPrefixed])) {
								/* Cache the match. */
								Velocity.State.prefixMatches[property] = propertyPrefixed;

								return [propertyPrefixed, true];
							}
						}

						/* If the browser doesn't support this property in any form, include a false flag so that the caller can decide how to proceed. */
						return [property, false];
					}
				}
			},
			/************************
			 CSS Property Values
			 ************************/

			Values: {
				/* Hex to RGB conversion. Copyright Tim Down: http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb */
				hexToRgb: function(hex) {
					var shortformRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i,
							longformRegex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,
							rgbParts;

					hex = hex.replace(shortformRegex, function(m, r, g, b) {
						return r + r + g + g + b + b;
					});

					rgbParts = longformRegex.exec(hex);

					return rgbParts ? [parseInt(rgbParts[1], 16), parseInt(rgbParts[2], 16), parseInt(rgbParts[3], 16)] : [0, 0, 0];
				},
				isCSSNullValue: function(value) {
					/* The browser defaults CSS values that have not been set to either 0 or one of several possible null-value strings.
					 Thus, we check for both falsiness and these special strings. */
					/* Null-value checking is performed to default the special strings to 0 (for the sake of tweening) or their hook
					 templates as defined as CSS.Hooks (for the sake of hook injection/extraction). */
					/* Note: Chrome returns "rgba(0, 0, 0, 0)" for an undefined color whereas IE returns "transparent". */
					return (!value || /^(none|auto|transparent|(rgba\(0, ?0, ?0, ?0\)))$/i.test(value));
				},
				/* Retrieve a property's default unit type. Used for assigning a unit type when one is not supplied by the user. */
				getUnitType: function(property) {
					if (/^(rotate|skew)/i.test(property)) {
						return "deg";
					} else if (/(^(scale|scaleX|scaleY|scaleZ|alpha|flexGrow|flexHeight|zIndex|fontWeight)$)|((opacity|red|green|blue|alpha)$)/i.test(property)) {
						/* The above properties are unitless. */
						return "";
					} else {
						/* Default to px for all other properties. */
						return "px";
					}
				},
				/* HTML elements default to an associated display type when they're not set to display:none. */
				/* Note: This function is used for correctly setting the non-"none" display value in certain Velocity redirects, such as fadeIn/Out. */
				getDisplayType: function(element) {
					var tagName = element && element.tagName.toString().toLowerCase();

					if (/^(b|big|i|small|tt|abbr|acronym|cite|code|dfn|em|kbd|strong|samp|var|a|bdo|br|img|map|object|q|script|span|sub|sup|button|input|label|select|textarea)$/i.test(tagName)) {
						return "inline";
					} else if (/^(li)$/i.test(tagName)) {
						return "list-item";
					} else if (/^(tr)$/i.test(tagName)) {
						return "table-row";
					} else if (/^(table)$/i.test(tagName)) {
						return "table";
					} else if (/^(tbody)$/i.test(tagName)) {
						return "table-row-group";
						/* Default to "block" when no match is found. */
					} else {
						return "block";
					}
				},
				/* The class add/remove functions are used to temporarily apply a "velocity-animating" class to elements while they're animating. */
				addClass: function(element, className) {
					if (element) {
						if (element.classList) {
							element.classList.add(className);
						} else if (Type.isString(element.className)) {
							// Element.className is around 15% faster then set/getAttribute
							element.className += (element.className.length ? " " : "") + className;
						} else {
							// Work around for IE strict mode animating SVG - and anything else that doesn't behave correctly - the same way jQuery does it
							var currentClass = element.getAttribute(IE <= 7 ? "className" : "class") || "";

							element.setAttribute("class", currentClass + (currentClass ? " " : "") + className);
						}
					}
				},
				removeClass: function(element, className) {
					if (element) {
						if (element.classList) {
							element.classList.remove(className);
						} else if (Type.isString(element.className)) {
							// Element.className is around 15% faster then set/getAttribute
							// TODO: Need some jsperf tests on performance - can we get rid of the regex and maybe use split / array manipulation?
							element.className = element.className.toString().replace(new RegExp("(^|\\s)" + className.split(" ").join("|") + "(\\s|$)", "gi"), " ");
						} else {
							// Work around for IE strict mode animating SVG - and anything else that doesn't behave correctly - the same way jQuery does it
							var currentClass = element.getAttribute(IE <= 7 ? "className" : "class") || "";

							element.setAttribute("class", currentClass.replace(new RegExp("(^|\s)" + className.split(" ").join("|") + "(\s|$)", "gi"), " "));
						}
					}
				}
			},
			/****************************
			 Style Getting & Setting
			 ****************************/

			/* The singular getPropertyValue, which routes the logic for all normalizations, hooks, and standard CSS properties. */
			getPropertyValue: function(element, property, rootPropertyValue, forceStyleLookup) {
				/* Get an element's computed property value. */
				/* Note: Retrieving the value of a CSS property cannot simply be performed by checking an element's
				 style attribute (which only reflects user-defined values). Instead, the browser must be queried for a property's
				 *computed* value. You can read more about getComputedStyle here: https://developer.mozilla.org/en/docs/Web/API/window.getComputedStyle */
				function computePropertyValue(element, property) {
					/* When box-sizing isn't set to border-box, height and width style values are incorrectly computed when an
					 element's scrollbars are visible (which expands the element's dimensions). Thus, we defer to the more accurate
					 offsetHeight/Width property, which includes the total dimensions for interior, border, padding, and scrollbar.
					 We subtract border and padding to get the sum of interior + scrollbar. */
					var computedValue = 0;

					/* IE<=8 doesn't support window.getComputedStyle, thus we defer to jQuery, which has an extensive array
					 of hacks to accurately retrieve IE8 property values. Re-implementing that logic here is not worth bloating the
					 codebase for a dying browser. The performance repercussions of using jQuery here are minimal since
					 Velocity is optimized to rarely (and sometimes never) query the DOM. Further, the $.css() codepath isn't that slow. */
					if (IE <= 8) {
						computedValue = $.css(element, property); /* GET */
						/* All other browsers support getComputedStyle. The returned live object reference is cached onto its
						 associated element so that it does not need to be refetched upon every GET. */
					} else {
						/* Browsers do not return height and width values for elements that are set to display:"none". Thus, we temporarily
						 toggle display to the element type's default value. */
						var toggleDisplay = false;

						if (/^(width|height)$/.test(property) && CSS.getPropertyValue(element, "display") === 0) {
							toggleDisplay = true;
							CSS.setPropertyValue(element, "display", CSS.Values.getDisplayType(element));
						}

						var revertDisplay = function() {
							if (toggleDisplay) {
								CSS.setPropertyValue(element, "display", "none");
							}
						};

						if (!forceStyleLookup) {
							if (property === "height" && CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() !== "border-box") {
								var contentBoxHeight = element.offsetHeight - (parseFloat(CSS.getPropertyValue(element, "borderTopWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "borderBottomWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingTop")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingBottom")) || 0);
								revertDisplay();

								return contentBoxHeight;
							} else if (property === "width" && CSS.getPropertyValue(element, "boxSizing").toString().toLowerCase() !== "border-box") {
								var contentBoxWidth = element.offsetWidth - (parseFloat(CSS.getPropertyValue(element, "borderLeftWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "borderRightWidth")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingLeft")) || 0) - (parseFloat(CSS.getPropertyValue(element, "paddingRight")) || 0);
								revertDisplay();

								return contentBoxWidth;
							}
						}

						var computedStyle;

						/* For elements that Velocity hasn't been called on directly (e.g. when Velocity queries the DOM on behalf
						 of a parent of an element its animating), perform a direct getComputedStyle lookup since the object isn't cached. */
						if (Data(element) === undefined) {
							computedStyle = window.getComputedStyle(element, null); /* GET */
							/* If the computedStyle object has yet to be cached, do so now. */
						} else if (!Data(element).computedStyle) {
							computedStyle = Data(element).computedStyle = window.getComputedStyle(element, null); /* GET */
							/* If computedStyle is cached, use it. */
						} else {
							computedStyle = Data(element).computedStyle;
						}

						/* IE and Firefox do not return a value for the generic borderColor -- they only return individual values for each border side's color.
						 Also, in all browsers, when border colors aren't all the same, a compound value is returned that Velocity isn't setup to parse.
						 So, as a polyfill for querying individual border side colors, we just return the top border's color and animate all borders from that value. */
						if (property === "borderColor") {
							property = "borderTopColor";
						}

						/* IE9 has a bug in which the "filter" property must be accessed from computedStyle using the getPropertyValue method
						 instead of a direct property lookup. The getPropertyValue method is slower than a direct lookup, which is why we avoid it by default. */
						if (IE === 9 && property === "filter") {
							computedValue = computedStyle.getPropertyValue(property); /* GET */
						} else {
							computedValue = computedStyle[property];
						}

						/* Fall back to the property's style value (if defined) when computedValue returns nothing,
						 which can happen when the element hasn't been painted. */
						if (computedValue === "" || computedValue === null) {
							computedValue = element.style[property];
						}

						revertDisplay();
					}

					/* For top, right, bottom, and left (TRBL) values that are set to "auto" on elements of "fixed" or "absolute" position,
					 defer to jQuery for converting "auto" to a numeric value. (For elements with a "static" or "relative" position, "auto" has the same
					 effect as being set to 0, so no conversion is necessary.) */
					/* An example of why numeric conversion is necessary: When an element with "position:absolute" has an untouched "left"
					 property, which reverts to "auto", left's value is 0 relative to its parent element, but is often non-zero relative
					 to its *containing* (not parent) element, which is the nearest "position:relative" ancestor or the viewport (and always the viewport in the case of "position:fixed"). */
					if (computedValue === "auto" && /^(top|right|bottom|left)$/i.test(property)) {
						var position = computePropertyValue(element, "position"); /* GET */

						/* For absolute positioning, jQuery's $.position() only returns values for top and left;
						 right and bottom will have their "auto" value reverted to 0. */
						/* Note: A jQuery object must be created here since jQuery doesn't have a low-level alias for $.position().
						 Not a big deal since we're currently in a GET batch anyway. */
						if (position === "fixed" || (position === "absolute" && /top|left/i.test(property))) {
							/* Note: jQuery strips the pixel unit from its returned values; we re-add it here to conform with computePropertyValue's behavior. */
							computedValue = $(element).position()[property] + "px"; /* GET */
						}
					}

					return computedValue;
				}

				var propertyValue;

				/* If this is a hooked property (e.g. "clipLeft" instead of the root property of "clip"),
				 extract the hook's value from a normalized rootPropertyValue using CSS.Hooks.extractValue(). */
				if (CSS.Hooks.registered[property]) {
					var hook = property,
							hookRoot = CSS.Hooks.getRoot(hook);

					/* If a cached rootPropertyValue wasn't passed in (which Velocity always attempts to do in order to avoid requerying the DOM),
					 query the DOM for the root property's value. */
					if (rootPropertyValue === undefined) {
						/* Since the browser is now being directly queried, use the official post-prefixing property name for this lookup. */
						rootPropertyValue = CSS.getPropertyValue(element, CSS.Names.prefixCheck(hookRoot)[0]); /* GET */
					}

					/* If this root has a normalization registered, peform the associated normalization extraction. */
					if (CSS.Normalizations.registered[hookRoot]) {
						rootPropertyValue = CSS.Normalizations.registered[hookRoot]("extract", element, rootPropertyValue);
					}

					/* Extract the hook's value. */
					propertyValue = CSS.Hooks.extractValue(hook, rootPropertyValue);

					/* If this is a normalized property (e.g. "opacity" becomes "filter" in <=IE8) or "translateX" becomes "transform"),
					 normalize the property's name and value, and handle the special case of transforms. */
					/* Note: Normalizing a property is mutually exclusive from hooking a property since hook-extracted values are strictly
					 numerical and therefore do not require normalization extraction. */
				} else if (CSS.Normalizations.registered[property]) {
					var normalizedPropertyName,
							normalizedPropertyValue;

					normalizedPropertyName = CSS.Normalizations.registered[property]("name", element);

					/* Transform values are calculated via normalization extraction (see below), which checks against the element's transformCache.
					 At no point do transform GETs ever actually query the DOM; initial stylesheet values are never processed.
					 This is because parsing 3D transform matrices is not always accurate and would bloat our codebase;
					 thus, normalization extraction defaults initial transform values to their zero-values (e.g. 1 for scaleX and 0 for translateX). */
					if (normalizedPropertyName !== "transform") {
						normalizedPropertyValue = computePropertyValue(element, CSS.Names.prefixCheck(normalizedPropertyName)[0]); /* GET */

						/* If the value is a CSS null-value and this property has a hook template, use that zero-value template so that hooks can be extracted from it. */
						if (CSS.Values.isCSSNullValue(normalizedPropertyValue) && CSS.Hooks.templates[property]) {
							normalizedPropertyValue = CSS.Hooks.templates[property][1];
						}
					}

					propertyValue = CSS.Normalizations.registered[property]("extract", element, normalizedPropertyValue);
				}

				/* If a (numeric) value wasn't produced via hook extraction or normalization, query the DOM. */
				if (!/^[\d-]/.test(propertyValue)) {
					/* For SVG elements, dimensional properties (which SVGAttribute() detects) are tweened via
					 their HTML attribute values instead of their CSS style values. */
					var data = Data(element);

					if (data && data.isSVG && CSS.Names.SVGAttribute(property)) {
						/* Since the height/width attribute values must be set manually, they don't reflect computed values.
						 Thus, we use use getBBox() to ensure we always get values for elements with undefined height/width attributes. */
						if (/^(height|width)$/i.test(property)) {
							/* Firefox throws an error if .getBBox() is called on an SVG that isn't attached to the DOM. */
							try {
								propertyValue = element.getBBox()[property];
							} catch (error) {
								propertyValue = 0;
							}
							/* Otherwise, access the attribute value directly. */
						} else {
							propertyValue = element.getAttribute(property);
						}
					} else {
						propertyValue = computePropertyValue(element, CSS.Names.prefixCheck(property)[0]); /* GET */
					}
				}

				/* Since property lookups are for animation purposes (which entails computing the numeric delta between start and end values),
				 convert CSS null-values to an integer of value 0. */
				if (CSS.Values.isCSSNullValue(propertyValue)) {
					propertyValue = 0;
				}

				if (Velocity.debug >= 2) {
					console.log("Get " + property + ": " + propertyValue);
				}

				return propertyValue;
			},
			/* The singular setPropertyValue, which routes the logic for all normalizations, hooks, and standard CSS properties. */
			setPropertyValue: function(element, property, propertyValue, rootPropertyValue, scrollData) {
				var propertyName = property;

				/* In order to be subjected to call options and element queueing, scroll animation is routed through Velocity as if it were a standard CSS property. */
				if (property === "scroll") {
					/* If a container option is present, scroll the container instead of the browser window. */
					if (scrollData.container) {
						scrollData.container["scroll" + scrollData.direction] = propertyValue;
						/* Otherwise, Velocity defaults to scrolling the browser window. */
					} else {
						if (scrollData.direction === "Left") {
							window.scrollTo(propertyValue, scrollData.alternateValue);
						} else {
							window.scrollTo(scrollData.alternateValue, propertyValue);
						}
					}
				} else {
					/* Transforms (translateX, rotateZ, etc.) are applied to a per-element transformCache object, which is manually flushed via flushTransformCache().
					 Thus, for now, we merely cache transforms being SET. */
					if (CSS.Normalizations.registered[property] && CSS.Normalizations.registered[property]("name", element) === "transform") {
						/* Perform a normalization injection. */
						/* Note: The normalization logic handles the transformCache updating. */
						CSS.Normalizations.registered[property]("inject", element, propertyValue);

						propertyName = "transform";
						propertyValue = Data(element).transformCache[property];
					} else {
						/* Inject hooks. */
						if (CSS.Hooks.registered[property]) {
							var hookName = property,
									hookRoot = CSS.Hooks.getRoot(property);

							/* If a cached rootPropertyValue was not provided, query the DOM for the hookRoot's current value. */
							rootPropertyValue = rootPropertyValue || CSS.getPropertyValue(element, hookRoot); /* GET */

							propertyValue = CSS.Hooks.injectValue(hookName, propertyValue, rootPropertyValue);
							property = hookRoot;
						}

						/* Normalize names and values. */
						if (CSS.Normalizations.registered[property]) {
							propertyValue = CSS.Normalizations.registered[property]("inject", element, propertyValue);
							property = CSS.Normalizations.registered[property]("name", element);
						}

						/* Assign the appropriate vendor prefix before performing an official style update. */
						propertyName = CSS.Names.prefixCheck(property)[0];

						/* A try/catch is used for IE<=8, which throws an error when "invalid" CSS values are set, e.g. a negative width.
						 Try/catch is avoided for other browsers since it incurs a performance overhead. */
						if (IE <= 8) {
							try {
								element.style[propertyName] = propertyValue;
							} catch (error) {
								if (Velocity.debug) {
									console.log("Browser does not support [" + propertyValue + "] for [" + propertyName + "]");
								}
							}
							/* SVG elements have their dimensional properties (width, height, x, y, cx, etc.) applied directly as attributes instead of as styles. */
							/* Note: IE8 does not support SVG elements, so it's okay that we skip it for SVG animation. */
						} else {
							var data = Data(element);

							if (data && data.isSVG && CSS.Names.SVGAttribute(property)) {
								/* Note: For SVG attributes, vendor-prefixed property names are never used. */
								/* Note: Not all CSS properties can be animated via attributes, but the browser won't throw an error for unsupported properties. */
								element.setAttribute(property, propertyValue);
							} else {
								element.style[propertyName] = propertyValue;
							}
						}

						if (Velocity.debug >= 2) {
							console.log("Set " + property + " (" + propertyName + "): " + propertyValue);
						}
					}
				}

				/* Return the normalized property name and value in case the caller wants to know how these values were modified before being applied to the DOM. */
				return [propertyName, propertyValue];
			},
			/* To increase performance by batching transform updates into a single SET, transforms are not directly applied to an element until flushTransformCache() is called. */
			/* Note: Velocity applies transform properties in the same order that they are chronogically introduced to the element's CSS styles. */
			flushTransformCache: function(element) {
				var transformString = "",
						data = Data(element);

				/* Certain browsers require that SVG transforms be applied as an attribute. However, the SVG transform attribute takes a modified version of CSS's transform string
				 (units are dropped and, except for skewX/Y, subproperties are merged into their master property -- e.g. scaleX and scaleY are merged into scale(X Y). */
				if ((IE || (Velocity.State.isAndroid && !Velocity.State.isChrome)) && data && data.isSVG) {
					/* Since transform values are stored in their parentheses-wrapped form, we use a helper function to strip out their numeric values.
					 Further, SVG transform properties only take unitless (representing pixels) values, so it's okay that parseFloat() strips the unit suffixed to the float value. */
					var getTransformFloat = function(transformProperty) {
						return parseFloat(CSS.getPropertyValue(element, transformProperty));
					};

					/* Create an object to organize all the transforms that we'll apply to the SVG element. To keep the logic simple,
					 we process *all* transform properties -- even those that may not be explicitly applied (since they default to their zero-values anyway). */
					var SVGTransforms = {
						translate: [getTransformFloat("translateX"), getTransformFloat("translateY")],
						skewX: [getTransformFloat("skewX")], skewY: [getTransformFloat("skewY")],
						/* If the scale property is set (non-1), use that value for the scaleX and scaleY values
						 (this behavior mimics the result of animating all these properties at once on HTML elements). */
						scale: getTransformFloat("scale") !== 1 ? [getTransformFloat("scale"), getTransformFloat("scale")] : [getTransformFloat("scaleX"), getTransformFloat("scaleY")],
						/* Note: SVG's rotate transform takes three values: rotation degrees followed by the X and Y values
						 defining the rotation's origin point. We ignore the origin values (default them to 0). */
						rotate: [getTransformFloat("rotateZ"), 0, 0]
					};

					/* Iterate through the transform properties in the user-defined property map order.
					 (This mimics the behavior of non-SVG transform animation.) */
					$.each(Data(element).transformCache, function(transformName) {
						/* Except for with skewX/Y, revert the axis-specific transform subproperties to their axis-free master
						 properties so that they match up with SVG's accepted transform properties. */
						if (/^translate/i.test(transformName)) {
							transformName = "translate";
						} else if (/^scale/i.test(transformName)) {
							transformName = "scale";
						} else if (/^rotate/i.test(transformName)) {
							transformName = "rotate";
						}

						/* Check that we haven't yet deleted the property from the SVGTransforms container. */
						if (SVGTransforms[transformName]) {
							/* Append the transform property in the SVG-supported transform format. As per the spec, surround the space-delimited values in parentheses. */
							transformString += transformName + "(" + SVGTransforms[transformName].join(" ") + ")" + " ";

							/* After processing an SVG transform property, delete it from the SVGTransforms container so we don't
							 re-insert the same master property if we encounter another one of its axis-specific properties. */
							delete SVGTransforms[transformName];
						}
					});
				} else {
					var transformValue,
							perspective;

					/* Transform properties are stored as members of the transformCache object. Concatenate all the members into a string. */
					$.each(Data(element).transformCache, function(transformName) {
						transformValue = Data(element).transformCache[transformName];

						/* Transform's perspective subproperty must be set first in order to take effect. Store it temporarily. */
						if (transformName === "transformPerspective") {
							perspective = transformValue;
							return true;
						}

						/* IE9 only supports one rotation type, rotateZ, which it refers to as "rotate". */
						if (IE === 9 && transformName === "rotateZ") {
							transformName = "rotate";
						}

						transformString += transformName + transformValue + " ";
					});

					/* If present, set the perspective subproperty first. */
					if (perspective) {
						transformString = "perspective" + perspective + " " + transformString;
					}
				}

				CSS.setPropertyValue(element, "transform", transformString);
			}
		};

		/* Register hooks and normalizations. */
		CSS.Hooks.register();
		CSS.Normalizations.register();

		/* Allow hook setting in the same fashion as jQuery's $.css(). */
		Velocity.hook = function(elements, arg2, arg3) {
			var value;

			elements = sanitizeElements(elements);

			$.each(elements, function(i, element) {
				/* Initialize Velocity's per-element data cache if this element hasn't previously been animated. */
				if (Data(element) === undefined) {
					Velocity.init(element);
				}

				/* Get property value. If an element set was passed in, only return the value for the first element. */
				if (arg3 === undefined) {
					if (value === undefined) {
						value = CSS.getPropertyValue(element, arg2);
					}
					/* Set property value. */
				} else {
					/* sPV returns an array of the normalized propertyName/propertyValue pair used to update the DOM. */
					var adjustedSet = CSS.setPropertyValue(element, arg2, arg3);

					/* Transform properties don't automatically set. They have to be flushed to the DOM. */
					if (adjustedSet[0] === "transform") {
						Velocity.CSS.flushTransformCache(element);
					}

					value = adjustedSet;
				}
			});

			return value;
		};

		/*****************
		 Animation
		 *****************/

		var animate = function() {
			var opts;

			/******************
			 Call Chain
			 ******************/

			/* Logic for determining what to return to the call stack when exiting out of Velocity. */
			function getChain() {
				/* If we are using the utility function, attempt to return this call's promise. If no promise library was detected,
				 default to null instead of returning the targeted elements so that utility function's return value is standardized. */
				if (isUtility) {
					return promiseData.promise || null;
					/* Otherwise, if we're using $.fn, return the jQuery-/Zepto-wrapped element set. */
				} else {
					return elementsWrapped;
				}
			}

			/*************************
			 Arguments Assignment
			 *************************/

			/* To allow for expressive CoffeeScript code, Velocity supports an alternative syntax in which "elements" (or "e"), "properties" (or "p"), and "options" (or "o")
			 objects are defined on a container object that's passed in as Velocity's sole argument. */
			/* Note: Some browsers automatically populate arguments with a "properties" object. We detect it by checking for its default "names" property. */
			var syntacticSugar = (arguments[0] && (arguments[0].p || (($.isPlainObject(arguments[0].properties) && !arguments[0].properties.names) || Type.isString(arguments[0].properties)))),
					/* Whether Velocity was called via the utility function (as opposed to on a jQuery/Zepto object). */
					isUtility,
					/* When Velocity is called via the utility function ($.Velocity()/Velocity()), elements are explicitly
					 passed in as the first parameter. Thus, argument positioning varies. We normalize them here. */
					elementsWrapped,
					argumentIndex;

			var elements,
					propertiesMap,
					options;

			/* Detect jQuery/Zepto elements being animated via the $.fn method. */
			if (Type.isWrapped(this)) {
				isUtility = false;

				argumentIndex = 0;
				elements = this;
				elementsWrapped = this;
				/* Otherwise, raw elements are being animated via the utility function. */
			} else {
				isUtility = true;

				argumentIndex = 1;
				elements = syntacticSugar ? (arguments[0].elements || arguments[0].e) : arguments[0];
			}

			/***************
			 Promises
			 ***************/

			var promiseData = {
				promise: null,
				resolver: null,
				rejecter: null
			};

			/* If this call was made via the utility function (which is the default method of invocation when jQuery/Zepto are not being used), and if
			 promise support was detected, create a promise object for this call and store references to its resolver and rejecter methods. The resolve
			 method is used when a call completes naturally or is prematurely stopped by the user. In both cases, completeCall() handles the associated
			 call cleanup and promise resolving logic. The reject method is used when an invalid set of arguments is passed into a Velocity call. */
			/* Note: Velocity employs a call-based queueing architecture, which means that stopping an animating element actually stops the full call that
			 triggered it -- not that one element exclusively. Similarly, there is one promise per call, and all elements targeted by a Velocity call are
			 grouped together for the purposes of resolving and rejecting a promise. */
			if (isUtility && Velocity.Promise) {
				promiseData.promise = new Velocity.Promise(function(resolve, reject) {
					promiseData.resolver = resolve;
					promiseData.rejecter = reject;
				});
			}

			if (syntacticSugar) {
				propertiesMap = arguments[0].properties || arguments[0].p;
				options = arguments[0].options || arguments[0].o;
			} else {
				propertiesMap = arguments[argumentIndex];
				options = arguments[argumentIndex + 1];
			}

			elements = sanitizeElements(elements);

			if (!elements) {
				if (promiseData.promise) {
					if (!propertiesMap || !options || options.promiseRejectEmpty !== false) {
						promiseData.rejecter();
					} else {
						promiseData.resolver();
					}
				}
				return;
			}

			/* The length of the element set (in the form of a nodeList or an array of elements) is defaulted to 1 in case a
			 single raw DOM element is passed in (which doesn't contain a length property). */
			var elementsLength = elements.length,
					elementsIndex = 0;

			/***************************
			 Argument Overloading
			 ***************************/

			/* Support is included for jQuery's argument overloading: $.animate(propertyMap [, duration] [, easing] [, complete]).
			 Overloading is detected by checking for the absence of an object being passed into options. */
			/* Note: The stop/finish/pause/resume actions do not accept animation options, and are therefore excluded from this check. */
			if (!/^(stop|finish|finishAll|pause|resume)$/i.test(propertiesMap) && !$.isPlainObject(options)) {
				/* The utility function shifts all arguments one position to the right, so we adjust for that offset. */
				var startingArgumentPosition = argumentIndex + 1;

				options = {};

				/* Iterate through all options arguments */
				for (var i = startingArgumentPosition; i < arguments.length; i++) {
					/* Treat a number as a duration. Parse it out. */
					/* Note: The following RegEx will return true if passed an array with a number as its first item.
					 Thus, arrays are skipped from this check. */
					if (!Type.isArray(arguments[i]) && (/^(fast|normal|slow)$/i.test(arguments[i]) || /^\d/.test(arguments[i]))) {
						options.duration = arguments[i];
						/* Treat strings and arrays as easings. */
					} else if (Type.isString(arguments[i]) || Type.isArray(arguments[i])) {
						options.easing = arguments[i];
						/* Treat a function as a complete callback. */
					} else if (Type.isFunction(arguments[i])) {
						options.complete = arguments[i];
					}
				}
			}

			/*********************
			 Action Detection
			 *********************/

			/* Velocity's behavior is categorized into "actions": Elements can either be specially scrolled into view,
			 or they can be started, stopped, paused, resumed, or reversed . If a literal or referenced properties map is passed in as Velocity's
			 first argument, the associated action is "start". Alternatively, "scroll", "reverse", "pause", "resume" or "stop" can be passed in 
			 instead of a properties map. */
			var action;

			switch (propertiesMap) {
				case "scroll":
					action = "scroll";
					break;

				case "reverse":
					action = "reverse";
					break;

				case "pause":

					/*******************
					 Action: Pause
					 *******************/

					var currentTime = (new Date()).getTime();

					/* Handle delay timers */
					$.each(elements, function(i, element) {
						pauseDelayOnElement(element, currentTime);
					});

					/* Pause and Resume are call-wide (not on a per element basis). Thus, calling pause or resume on a 
					 single element will cause any calls that containt tweens for that element to be paused/resumed
					 as well. */

					/* Iterate through all calls and pause any that contain any of our elements */
					$.each(Velocity.State.calls, function(i, activeCall) {

						var found = false;
						/* Inactive calls are set to false by the logic inside completeCall(). Skip them. */
						if (activeCall) {
							/* Iterate through the active call's targeted elements. */
							$.each(activeCall[1], function(k, activeElement) {
								var queueName = (options === undefined) ? "" : options;

								if (queueName !== true && (activeCall[2].queue !== queueName) && !(options === undefined && activeCall[2].queue === false)) {
									return true;
								}

								/* Iterate through the calls targeted by the stop command. */
								$.each(elements, function(l, element) {
									/* Check that this call was applied to the target element. */
									if (element === activeElement) {

										/* Set call to paused */
										activeCall[5] = {
											resume: false
										};

										/* Once we match an element, we can bounce out to the next call entirely */
										found = true;
										return false;
									}
								});

								/* Proceed to check next call if we have already matched */
								if (found) {
									return false;
								}
							});
						}

					});

					/* Since pause creates no new tweens, exit out of Velocity. */
					return getChain();

				case "resume":

					/*******************
					 Action: Resume
					 *******************/

					/* Handle delay timers */
					$.each(elements, function(i, element) {
						resumeDelayOnElement(element, currentTime);
					});

					/* Pause and Resume are call-wide (not on a per elemnt basis). Thus, calling pause or resume on a 
					 single element will cause any calls that containt tweens for that element to be paused/resumed
					 as well. */

					/* Iterate through all calls and pause any that contain any of our elements */
					$.each(Velocity.State.calls, function(i, activeCall) {
						var found = false;
						/* Inactive calls are set to false by the logic inside completeCall(). Skip them. */
						if (activeCall) {
							/* Iterate through the active call's targeted elements. */
							$.each(activeCall[1], function(k, activeElement) {
								var queueName = (options === undefined) ? "" : options;

								if (queueName !== true && (activeCall[2].queue !== queueName) && !(options === undefined && activeCall[2].queue === false)) {
									return true;
								}

								/* Skip any calls that have never been paused */
								if (!activeCall[5]) {
									return true;
								}

								/* Iterate through the calls targeted by the stop command. */
								$.each(elements, function(l, element) {
									/* Check that this call was applied to the target element. */
									if (element === activeElement) {

										/* Flag a pause object to be resumed, which will occur during the next tick. In
										 addition, the pause object will at that time be deleted */
										activeCall[5].resume = true;

										/* Once we match an element, we can bounce out to the next call entirely */
										found = true;
										return false;
									}
								});

								/* Proceed to check next call if we have already matched */
								if (found) {
									return false;
								}
							});
						}

					});

					/* Since resume creates no new tweens, exit out of Velocity. */
					return getChain();

				case "finish":
				case "finishAll":
				case "stop":
					/*******************
					 Action: Stop
					 *******************/

					/* Clear the currently-active delay on each targeted element. */
					$.each(elements, function(i, element) {
						if (Data(element) && Data(element).delayTimer) {
							/* Stop the timer from triggering its cached next() function. */
							clearTimeout(Data(element).delayTimer.setTimeout);

							/* Manually call the next() function so that the subsequent queue items can progress. */
							if (Data(element).delayTimer.next) {
								Data(element).delayTimer.next();
							}

							delete Data(element).delayTimer;
						}

						/* If we want to finish everything in the queue, we have to iterate through it
						 and call each function. This will make them active calls below, which will
						 cause them to be applied via the duration setting. */
						if (propertiesMap === "finishAll" && (options === true || Type.isString(options))) {
							/* Iterate through the items in the element's queue. */
							$.each($.queue(element, Type.isString(options) ? options : ""), function(_, item) {
								/* The queue array can contain an "inprogress" string, which we skip. */
								if (Type.isFunction(item)) {
									item();
								}
							});

							/* Clearing the $.queue() array is achieved by resetting it to []. */
							$.queue(element, Type.isString(options) ? options : "", []);
						}
					});

					var callsToStop = [];

					/* When the stop action is triggered, the elements' currently active call is immediately stopped. The active call might have
					 been applied to multiple elements, in which case all of the call's elements will be stopped. When an element
					 is stopped, the next item in its animation queue is immediately triggered. */
					/* An additional argument may be passed in to clear an element's remaining queued calls. Either true (which defaults to the "fx" queue)
					 or a custom queue string can be passed in. */
					/* Note: The stop command runs prior to Velocity's Queueing phase since its behavior is intended to take effect *immediately*,
					 regardless of the element's current queue state. */

					/* Iterate through every active call. */
					$.each(Velocity.State.calls, function(i, activeCall) {
						/* Inactive calls are set to false by the logic inside completeCall(). Skip them. */
						if (activeCall) {
							/* Iterate through the active call's targeted elements. */
							$.each(activeCall[1], function(k, activeElement) {
								/* If true was passed in as a secondary argument, clear absolutely all calls on this element. Otherwise, only
								 clear calls associated with the relevant queue. */
								/* Call stopping logic works as follows:
								 - options === true --> stop current default queue calls (and queue:false calls), including remaining queued ones.
								 - options === undefined --> stop current queue:"" call and all queue:false calls.
								 - options === false --> stop only queue:false calls.
								 - options === "custom" --> stop current queue:"custom" call, including remaining queued ones (there is no functionality to only clear the currently-running queue:"custom" call). */
								var queueName = (options === undefined) ? "" : options;

								if (queueName !== true && (activeCall[2].queue !== queueName) && !(options === undefined && activeCall[2].queue === false)) {
									return true;
								}

								/* Iterate through the calls targeted by the stop command. */
								$.each(elements, function(l, element) {
									/* Check that this call was applied to the target element. */
									if (element === activeElement) {
										/* Optionally clear the remaining queued calls. If we're doing "finishAll" this won't find anything,
										 due to the queue-clearing above. */
										if (options === true || Type.isString(options)) {
											/* Iterate through the items in the element's queue. */
											$.each($.queue(element, Type.isString(options) ? options : ""), function(_, item) {
												/* The queue array can contain an "inprogress" string, which we skip. */
												if (Type.isFunction(item)) {
													/* Pass the item's callback a flag indicating that we want to abort from the queue call.
													 (Specifically, the queue will resolve the call's associated promise then abort.)  */
													item(null, true);
												}
											});

											/* Clearing the $.queue() array is achieved by resetting it to []. */
											$.queue(element, Type.isString(options) ? options : "", []);
										}

										if (propertiesMap === "stop") {
											/* Since "reverse" uses cached start values (the previous call's endValues), these values must be
											 changed to reflect the final value that the elements were actually tweened to. */
											/* Note: If only queue:false/queue:"custom" animations are currently running on an element, it won't have a tweensContainer
											 object. Also, queue:false/queue:"custom" animations can't be reversed. */
											var data = Data(element);
											if (data && data.tweensContainer && (queueName === true || queueName === "")) {
												$.each(data.tweensContainer, function(m, activeTween) {
													activeTween.endValue = activeTween.currentValue;
												});
											}

											callsToStop.push(i);
										} else if (propertiesMap === "finish" || propertiesMap === "finishAll") {
											/* To get active tweens to finish immediately, we forcefully shorten their durations to 1ms so that
											 they finish upon the next rAf tick then proceed with normal call completion logic. */
											activeCall[2].duration = 1;
										}
									}
								});
							});
						}
					});

					/* Prematurely call completeCall() on each matched active call. Pass an additional flag for "stop" to indicate
					 that the complete callback and display:none setting should be skipped since we're completing prematurely. */
					if (propertiesMap === "stop") {
						$.each(callsToStop, function(i, j) {
							completeCall(j, true);
						});

						if (promiseData.promise) {
							/* Immediately resolve the promise associated with this stop call since stop runs synchronously. */
							promiseData.resolver(elements);
						}
					}

					/* Since we're stopping, and not proceeding with queueing, exit out of Velocity. */
					return getChain();

				default:
					/* Treat a non-empty plain object as a literal properties map. */
					if ($.isPlainObject(propertiesMap) && !Type.isEmptyObject(propertiesMap)) {
						action = "start";

						/****************
						 Redirects
						 ****************/

						/* Check if a string matches a registered redirect (see Redirects above). */
					} else if (Type.isString(propertiesMap) && Velocity.Redirects[propertiesMap]) {
						opts = $.extend({}, options);

						var durationOriginal = opts.duration,
								delayOriginal = opts.delay || 0;

						/* If the backwards option was passed in, reverse the element set so that elements animate from the last to the first. */
						if (opts.backwards === true) {
							elements = $.extend(true, [], elements).reverse();
						}

						/* Individually trigger the redirect for each element in the set to prevent users from having to handle iteration logic in their redirect. */
						$.each(elements, function(elementIndex, element) {
							/* If the stagger option was passed in, successively delay each element by the stagger value (in ms). Retain the original delay value. */
							if (parseFloat(opts.stagger)) {
								opts.delay = delayOriginal + (parseFloat(opts.stagger) * elementIndex);
							} else if (Type.isFunction(opts.stagger)) {
								opts.delay = delayOriginal + opts.stagger.call(element, elementIndex, elementsLength);
							}

							/* If the drag option was passed in, successively increase/decrease (depending on the presense of opts.backwards)
							 the duration of each element's animation, using floors to prevent producing very short durations. */
							if (opts.drag) {
								/* Default the duration of UI pack effects (callouts and transitions) to 1000ms instead of the usual default duration of 400ms. */
								opts.duration = parseFloat(durationOriginal) || (/^(callout|transition)/.test(propertiesMap) ? 1000 : DURATION_DEFAULT);

								/* For each element, take the greater duration of: A) animation completion percentage relative to the original duration,
								 B) 75% of the original duration, or C) a 200ms fallback (in case duration is already set to a low value).
								 The end result is a baseline of 75% of the redirect's duration that increases/decreases as the end of the element set is approached. */
								opts.duration = Math.max(opts.duration * (opts.backwards ? 1 - elementIndex / elementsLength : (elementIndex + 1) / elementsLength), opts.duration * 0.75, 200);
							}

							/* Pass in the call's opts object so that the redirect can optionally extend it. It defaults to an empty object instead of null to
							 reduce the opts checking logic required inside the redirect. */
							Velocity.Redirects[propertiesMap].call(element, element, opts || {}, elementIndex, elementsLength, elements, promiseData.promise ? promiseData : undefined);
						});

						/* Since the animation logic resides within the redirect's own code, abort the remainder of this call.
						 (The performance overhead up to this point is virtually non-existant.) */
						/* Note: The jQuery call chain is kept intact by returning the complete element set. */
						return getChain();
					} else {
						var abortError = "Velocity: First argument (" + propertiesMap + ") was not a property map, a known action, or a registered redirect. Aborting.";

						if (promiseData.promise) {
							promiseData.rejecter(new Error(abortError));
						} else if (window.console) {
							console.log(abortError);
						}

						return getChain();
					}
			}

			/**************************
			 Call-Wide Variables
			 **************************/

			/* A container for CSS unit conversion ratios (e.g. %, rem, and em ==> px) that is used to cache ratios across all elements
			 being animated in a single Velocity call. Calculating unit ratios necessitates DOM querying and updating, and is therefore
			 avoided (via caching) wherever possible. This container is call-wide instead of page-wide to avoid the risk of using stale
			 conversion metrics across Velocity animations that are not immediately consecutively chained. */
			var callUnitConversionData = {
				lastParent: null,
				lastPosition: null,
				lastFontSize: null,
				lastPercentToPxWidth: null,
				lastPercentToPxHeight: null,
				lastEmToPx: null,
				remToPx: null,
				vwToPx: null,
				vhToPx: null
			};

			/* A container for all the ensuing tween data and metadata associated with this call. This container gets pushed to the page-wide
			 Velocity.State.calls array that is processed during animation ticking. */
			var call = [];

			/************************
			 Element Processing
			 ************************/

			/* Element processing consists of three parts -- data processing that cannot go stale and data processing that *can* go stale (i.e. third-party style modifications):
			 1) Pre-Queueing: Element-wide variables, including the element's data storage, are instantiated. Call options are prepared. If triggered, the Stop action is executed.
			 2) Queueing: The logic that runs once this call has reached its point of execution in the element's $.queue() stack. Most logic is placed here to avoid risking it becoming stale.
			 3) Pushing: Consolidation of the tween data followed by its push onto the global in-progress calls container.
			 `elementArrayIndex` allows passing index of the element in the original array to value functions.
			 If `elementsIndex` were used instead the index would be determined by the elements' per-element queue.
			 */
			function processElement(element, elementArrayIndex) {

				/*************************
				 Part I: Pre-Queueing
				 *************************/

				/***************************
				 Element-Wide Variables
				 ***************************/

				var /* The runtime opts object is the extension of the current call's options and Velocity's page-wide option defaults. */
						opts = $.extend({}, Velocity.defaults, options),
						/* A container for the processed data associated with each property in the propertyMap.
						 (Each property in the map produces its own "tween".) */
						tweensContainer = {},
						elementUnitConversionData;

				/******************
				 Element Init
				 ******************/

				if (Data(element) === undefined) {
					Velocity.init(element);
				}

				/******************
				 Option: Delay
				 ******************/

				/* Since queue:false doesn't respect the item's existing queue, we avoid injecting its delay here (it's set later on). */
				/* Note: Velocity rolls its own delay function since jQuery doesn't have a utility alias for $.fn.delay()
				 (and thus requires jQuery element creation, which we avoid since its overhead includes DOM querying). */
				if (parseFloat(opts.delay) && opts.queue !== false) {
					$.queue(element, opts.queue, function(next, clearQueue) {
						if (clearQueue === true) {
							/* Do not continue with animation queueing. */
							return true;
						}

						/* This is a flag used to indicate to the upcoming completeCall() function that this queue entry was initiated by Velocity. See completeCall() for further details. */
						Velocity.velocityQueueEntryFlag = true;

						/* The ensuing queue item (which is assigned to the "next" argument that $.queue() automatically passes in) will be triggered after a setTimeout delay.
						 The setTimeout is stored so that it can be subjected to clearTimeout() if this animation is prematurely stopped via Velocity's "stop" command, and
						 delayBegin/delayTime is used to ensure we can "pause" and "resume" a tween that is still mid-delay. */

						/* Temporarily store delayed elements to facilite access for global pause/resume */
						var callIndex = Velocity.State.delayedElements.count++;
						Velocity.State.delayedElements[callIndex] = element;

						var delayComplete = (function(index) {
							return function() {
								/* Clear the temporary element */
								Velocity.State.delayedElements[index] = false;

								/* Finally, issue the call */
								next();
							};
						})(callIndex);


						Data(element).delayBegin = (new Date()).getTime();
						Data(element).delay = parseFloat(opts.delay);
						Data(element).delayTimer = {
							setTimeout: setTimeout(next, parseFloat(opts.delay)),
							next: delayComplete
						};
					});
				}

				/*********************
				 Option: Duration
				 *********************/

				/* Support for jQuery's named durations. */
				switch (opts.duration.toString().toLowerCase()) {
					case "fast":
						opts.duration = 200;
						break;

					case "normal":
						opts.duration = DURATION_DEFAULT;
						break;

					case "slow":
						opts.duration = 600;
						break;

					default:
						/* Remove the potential "ms" suffix and default to 1 if the user is attempting to set a duration of 0 (in order to produce an immediate style change). */
						opts.duration = parseFloat(opts.duration) || 1;
				}

				/************************
				 Global Option: Mock
				 ************************/

				if (Velocity.mock !== false) {
					/* In mock mode, all animations are forced to 1ms so that they occur immediately upon the next rAF tick.
					 Alternatively, a multiplier can be passed in to time remap all delays and durations. */
					if (Velocity.mock === true) {
						opts.duration = opts.delay = 1;
					} else {
						opts.duration *= parseFloat(Velocity.mock) || 1;
						opts.delay *= parseFloat(Velocity.mock) || 1;
					}
				}

				/*******************
				 Option: Easing
				 *******************/

				opts.easing = getEasing(opts.easing, opts.duration);

				/**********************
				 Option: Callbacks
				 **********************/

				/* Callbacks must functions. Otherwise, default to null. */
				if (opts.begin && !Type.isFunction(opts.begin)) {
					opts.begin = null;
				}

				if (opts.progress && !Type.isFunction(opts.progress)) {
					opts.progress = null;
				}

				if (opts.complete && !Type.isFunction(opts.complete)) {
					opts.complete = null;
				}

				/*********************************
				 Option: Display & Visibility
				 *********************************/

				/* Refer to Velocity's documentation (VelocityJS.org/#displayAndVisibility) for a description of the display and visibility options' behavior. */
				/* Note: We strictly check for undefined instead of falsiness because display accepts an empty string value. */
				if (opts.display !== undefined && opts.display !== null) {
					opts.display = opts.display.toString().toLowerCase();

					/* Users can pass in a special "auto" value to instruct Velocity to set the element to its default display value. */
					if (opts.display === "auto") {
						opts.display = Velocity.CSS.Values.getDisplayType(element);
					}
				}

				if (opts.visibility !== undefined && opts.visibility !== null) {
					opts.visibility = opts.visibility.toString().toLowerCase();
				}

				/**********************
				 Option: mobileHA
				 **********************/

				/* When set to true, and if this is a mobile device, mobileHA automatically enables hardware acceleration (via a null transform hack)
				 on animating elements. HA is removed from the element at the completion of its animation. */
				/* Note: Android Gingerbread doesn't support HA. If a null transform hack (mobileHA) is in fact set, it will prevent other tranform subproperties from taking effect. */
				/* Note: You can read more about the use of mobileHA in Velocity's documentation: VelocityJS.org/#mobileHA. */
				opts.mobileHA = (opts.mobileHA && Velocity.State.isMobile && !Velocity.State.isGingerbread);

				/***********************
				 Part II: Queueing
				 ***********************/

				/* When a set of elements is targeted by a Velocity call, the set is broken up and each element has the current Velocity call individually queued onto it.
				 In this way, each element's existing queue is respected; some elements may already be animating and accordingly should not have this current Velocity call triggered immediately. */
				/* In each queue, tween data is processed for each animating property then pushed onto the call-wide calls array. When the last element in the set has had its tweens processed,
				 the call array is pushed to Velocity.State.calls for live processing by the requestAnimationFrame tick. */
				function buildQueue(next) {
					var data, lastTweensContainer;

					/*******************
					 Option: Begin
					 *******************/

					/* The begin callback is fired once per call -- not once per elemenet -- and is passed the full raw DOM element set as both its context and its first argument. */
					if (opts.begin && elementsIndex === 0) {
						/* We throw callbacks in a setTimeout so that thrown errors don't halt the execution of Velocity itself. */
						try {
							opts.begin.call(elements, elements);
						} catch (error) {
							setTimeout(function() {
								throw error;
							}, 1);
						}
					}

					/*****************************************
					 Tween Data Construction (for Scroll)
					 *****************************************/

					/* Note: In order to be subjected to chaining and animation options, scroll's tweening is routed through Velocity as if it were a standard CSS property animation. */
					if (action === "scroll") {
						/* The scroll action uniquely takes an optional "offset" option -- specified in pixels -- that offsets the targeted scroll position. */
						var scrollDirection = (/^x$/i.test(opts.axis) ? "Left" : "Top"),
								scrollOffset = parseFloat(opts.offset) || 0,
								scrollPositionCurrent,
								scrollPositionCurrentAlternate,
								scrollPositionEnd;

						/* Scroll also uniquely takes an optional "container" option, which indicates the parent element that should be scrolled --
						 as opposed to the browser window itself. This is useful for scrolling toward an element that's inside an overflowing parent element. */
						if (opts.container) {
							/* Ensure that either a jQuery object or a raw DOM element was passed in. */
							if (Type.isWrapped(opts.container) || Type.isNode(opts.container)) {
								/* Extract the raw DOM element from the jQuery wrapper. */
								opts.container = opts.container[0] || opts.container;
								/* Note: Unlike other properties in Velocity, the browser's scroll position is never cached since it so frequently changes
								 (due to the user's natural interaction with the page). */
								scrollPositionCurrent = opts.container["scroll" + scrollDirection]; /* GET */

								/* $.position() values are relative to the container's currently viewable area (without taking into account the container's true dimensions
								 -- say, for example, if the container was not overflowing). Thus, the scroll end value is the sum of the child element's position *and*
								 the scroll container's current scroll position. */
								scrollPositionEnd = (scrollPositionCurrent + $(element).position()[scrollDirection.toLowerCase()]) + scrollOffset; /* GET */
								/* If a value other than a jQuery object or a raw DOM element was passed in, default to null so that this option is ignored. */
							} else {
								opts.container = null;
							}
						} else {
							/* If the window itself is being scrolled -- not a containing element -- perform a live scroll position lookup using
							 the appropriate cached property names (which differ based on browser type). */
							scrollPositionCurrent = Velocity.State.scrollAnchor[Velocity.State["scrollProperty" + scrollDirection]]; /* GET */
							/* When scrolling the browser window, cache the alternate axis's current value since window.scrollTo() doesn't let us change only one value at a time. */
							scrollPositionCurrentAlternate = Velocity.State.scrollAnchor[Velocity.State["scrollProperty" + (scrollDirection === "Left" ? "Top" : "Left")]]; /* GET */

							/* Unlike $.position(), $.offset() values are relative to the browser window's true dimensions -- not merely its currently viewable area --
							 and therefore end values do not need to be compounded onto current values. */
							scrollPositionEnd = $(element).offset()[scrollDirection.toLowerCase()] + scrollOffset; /* GET */
						}

						/* Since there's only one format that scroll's associated tweensContainer can take, we create it manually. */
						tweensContainer = {
							scroll: {
								rootPropertyValue: false,
								startValue: scrollPositionCurrent,
								currentValue: scrollPositionCurrent,
								endValue: scrollPositionEnd,
								unitType: "",
								easing: opts.easing,
								scrollData: {
									container: opts.container,
									direction: scrollDirection,
									alternateValue: scrollPositionCurrentAlternate
								}
							},
							element: element
						};

						if (Velocity.debug) {
							console.log("tweensContainer (scroll): ", tweensContainer.scroll, element);
						}

						/******************************************
						 Tween Data Construction (for Reverse)
						 ******************************************/

						/* Reverse acts like a "start" action in that a property map is animated toward. The only difference is
						 that the property map used for reverse is the inverse of the map used in the previous call. Thus, we manipulate
						 the previous call to construct our new map: use the previous map's end values as our new map's start values. Copy over all other data. */
						/* Note: Reverse can be directly called via the "reverse" parameter, or it can be indirectly triggered via the loop option. (Loops are composed of multiple reverses.) */
						/* Note: Reverse calls do not need to be consecutively chained onto a currently-animating element in order to operate on cached values;
						 there is no harm to reverse being called on a potentially stale data cache since reverse's behavior is simply defined
						 as reverting to the element's values as they were prior to the previous *Velocity* call. */
					} else if (action === "reverse") {
						data = Data(element);

						/* Abort if there is no prior animation data to reverse to. */
						if (!data) {
							return;
						}

						if (!data.tweensContainer) {
							/* Dequeue the element so that this queue entry releases itself immediately, allowing subsequent queue entries to run. */
							$.dequeue(element, opts.queue);

							return;
						} else {
							/*********************
							 Options Parsing
							 *********************/

							/* If the element was hidden via the display option in the previous call,
							 revert display to "auto" prior to reversal so that the element is visible again. */
							if (data.opts.display === "none") {
								data.opts.display = "auto";
							}

							if (data.opts.visibility === "hidden") {
								data.opts.visibility = "visible";
							}

							/* If the loop option was set in the previous call, disable it so that "reverse" calls aren't recursively generated.
							 Further, remove the previous call's callback options; typically, users do not want these to be refired. */
							data.opts.loop = false;
							data.opts.begin = null;
							data.opts.complete = null;

							/* Since we're extending an opts object that has already been extended with the defaults options object,
							 we remove non-explicitly-defined properties that are auto-assigned values. */
							if (!options.easing) {
								delete opts.easing;
							}

							if (!options.duration) {
								delete opts.duration;
							}

							/* The opts object used for reversal is an extension of the options object optionally passed into this
							 reverse call plus the options used in the previous Velocity call. */
							opts = $.extend({}, data.opts, opts);

							/*************************************
							 Tweens Container Reconstruction
							 *************************************/

							/* Create a deepy copy (indicated via the true flag) of the previous call's tweensContainer. */
							lastTweensContainer = $.extend(true, {}, data ? data.tweensContainer : null);

							/* Manipulate the previous tweensContainer by replacing its end values and currentValues with its start values. */
							for (var lastTween in lastTweensContainer) {
								/* In addition to tween data, tweensContainers contain an element property that we ignore here. */
								if (lastTweensContainer.hasOwnProperty(lastTween) && lastTween !== "element") {
									var lastStartValue = lastTweensContainer[lastTween].startValue;

									lastTweensContainer[lastTween].startValue = lastTweensContainer[lastTween].currentValue = lastTweensContainer[lastTween].endValue;
									lastTweensContainer[lastTween].endValue = lastStartValue;

									/* Easing is the only option that embeds into the individual tween data (since it can be defined on a per-property basis).
									 Accordingly, every property's easing value must be updated when an options object is passed in with a reverse call.
									 The side effect of this extensibility is that all per-property easing values are forcefully reset to the new value. */
									if (!Type.isEmptyObject(options)) {
										lastTweensContainer[lastTween].easing = opts.easing;
									}

									if (Velocity.debug) {
										console.log("reverse tweensContainer (" + lastTween + "): " + JSON.stringify(lastTweensContainer[lastTween]), element);
									}
								}
							}

							tweensContainer = lastTweensContainer;
						}

						/*****************************************
						 Tween Data Construction (for Start)
						 *****************************************/

					} else if (action === "start") {

						/*************************
						 Value Transferring
						 *************************/

						/* If this queue entry follows a previous Velocity-initiated queue entry *and* if this entry was created
						 while the element was in the process of being animated by Velocity, then this current call is safe to use
						 the end values from the prior call as its start values. Velocity attempts to perform this value transfer
						 process whenever possible in order to avoid requerying the DOM. */
						/* If values aren't transferred from a prior call and start values were not forcefed by the user (more on this below),
						 then the DOM is queried for the element's current values as a last resort. */
						/* Note: Conversely, animation reversal (and looping) *always* perform inter-call value transfers; they never requery the DOM. */

						data = Data(element);

						/* The per-element isAnimating flag is used to indicate whether it's safe (i.e. the data isn't stale)
						 to transfer over end values to use as start values. If it's set to true and there is a previous
						 Velocity call to pull values from, do so. */
						if (data && data.tweensContainer && data.isAnimating === true) {
							lastTweensContainer = data.tweensContainer;
						}

						/***************************
						 Tween Data Calculation
						 ***************************/

						/* This function parses property data and defaults endValue, easing, and startValue as appropriate. */
						/* Property map values can either take the form of 1) a single value representing the end value,
						 or 2) an array in the form of [ endValue, [, easing] [, startValue] ].
						 The optional third parameter is a forcefed startValue to be used instead of querying the DOM for
						 the element's current value. Read Velocity's docmentation to learn more about forcefeeding: VelocityJS.org/#forcefeeding */
						var parsePropertyValue = function(valueData, skipResolvingEasing) {
							var endValue, easing, startValue;

							/* If we have a function as the main argument then resolve it first, in case it returns an array that needs to be split */
							if (Type.isFunction(valueData)) {
								valueData = valueData.call(element, elementArrayIndex, elementsLength);
							}

							/* Handle the array format, which can be structured as one of three potential overloads:
							 A) [ endValue, easing, startValue ], B) [ endValue, easing ], or C) [ endValue, startValue ] */
							if (Type.isArray(valueData)) {
								/* endValue is always the first item in the array. Don't bother validating endValue's value now
								 since the ensuing property cycling logic does that. */
								endValue = valueData[0];

								/* Two-item array format: If the second item is a number, function, or hex string, treat it as a
								 start value since easings can only be non-hex strings or arrays. */
								if ((!Type.isArray(valueData[1]) && /^[\d-]/.test(valueData[1])) || Type.isFunction(valueData[1]) || CSS.RegEx.isHex.test(valueData[1])) {
									startValue = valueData[1];
									/* Two or three-item array: If the second item is a non-hex string easing name or an array, treat it as an easing. */
								} else if ((Type.isString(valueData[1]) && !CSS.RegEx.isHex.test(valueData[1]) && Velocity.Easings[valueData[1]]) || Type.isArray(valueData[1])) {
									easing = skipResolvingEasing ? valueData[1] : getEasing(valueData[1], opts.duration);

									/* Don't bother validating startValue's value now since the ensuing property cycling logic inherently does that. */
									startValue = valueData[2];
								} else {
									startValue = valueData[1] || valueData[2];
								}
								/* Handle the single-value format. */
							} else {
								endValue = valueData;
							}

							/* Default to the call's easing if a per-property easing type was not defined. */
							if (!skipResolvingEasing) {
								easing = easing || opts.easing;
							}

							/* If functions were passed in as values, pass the function the current element as its context,
							 plus the element's index and the element set's size as arguments. Then, assign the returned value. */
							if (Type.isFunction(endValue)) {
								endValue = endValue.call(element, elementArrayIndex, elementsLength);
							}

							if (Type.isFunction(startValue)) {
								startValue = startValue.call(element, elementArrayIndex, elementsLength);
							}

							/* Allow startValue to be left as undefined to indicate to the ensuing code that its value was not forcefed. */
							return [endValue || 0, easing, startValue];
						};

						var fixPropertyValue = function(property, valueData) {
							/* In case this property is a hook, there are circumstances where we will intend to work on the hook's root property and not the hooked subproperty. */
							var rootProperty = CSS.Hooks.getRoot(property),
									rootPropertyValue = false,
									/* Parse out endValue, easing, and startValue from the property's data. */
									endValue = valueData[0],
									easing = valueData[1],
									startValue = valueData[2],
									pattern;

							/**************************
							 Start Value Sourcing
							 **************************/

							/* Other than for the dummy tween property, properties that are not supported by the browser (and do not have an associated normalization) will
							 inherently produce no style changes when set, so they are skipped in order to decrease animation tick overhead.
							 Property support is determined via prefixCheck(), which returns a false flag when no supported is detected. */
							/* Note: Since SVG elements have some of their properties directly applied as HTML attributes,
							 there is no way to check for their explicit browser support, and so we skip skip this check for them. */
							if ((!data || !data.isSVG) && rootProperty !== "tween" && CSS.Names.prefixCheck(rootProperty)[1] === false && CSS.Normalizations.registered[rootProperty] === undefined) {
								if (Velocity.debug) {
									console.log("Skipping [" + rootProperty + "] due to a lack of browser support.");
								}
								return;
							}

							/* If the display option is being set to a non-"none" (e.g. "block") and opacity (filter on IE<=8) is being
							 animated to an endValue of non-zero, the user's intention is to fade in from invisible, thus we forcefeed opacity
							 a startValue of 0 if its startValue hasn't already been sourced by value transferring or prior forcefeeding. */
							if (((opts.display !== undefined && opts.display !== null && opts.display !== "none") || (opts.visibility !== undefined && opts.visibility !== "hidden")) && /opacity|filter/.test(property) && !startValue && endValue !== 0) {
								startValue = 0;
							}

							/* If values have been transferred from the previous Velocity call, extract the endValue and rootPropertyValue
							 for all of the current call's properties that were *also* animated in the previous call. */
							/* Note: Value transferring can optionally be disabled by the user via the _cacheValues option. */
							if (opts._cacheValues && lastTweensContainer && lastTweensContainer[property]) {
								if (startValue === undefined) {
									startValue = lastTweensContainer[property].endValue + lastTweensContainer[property].unitType;
								}

								/* The previous call's rootPropertyValue is extracted from the element's data cache since that's the
								 instance of rootPropertyValue that gets freshly updated by the tweening process, whereas the rootPropertyValue
								 attached to the incoming lastTweensContainer is equal to the root property's value prior to any tweening. */
								rootPropertyValue = data.rootPropertyValueCache[rootProperty];
								/* If values were not transferred from a previous Velocity call, query the DOM as needed. */
							} else {
								/* Handle hooked properties. */
								if (CSS.Hooks.registered[property]) {
									if (startValue === undefined) {
										rootPropertyValue = CSS.getPropertyValue(element, rootProperty); /* GET */
										/* Note: The following getPropertyValue() call does not actually trigger a DOM query;
										 getPropertyValue() will extract the hook from rootPropertyValue. */
										startValue = CSS.getPropertyValue(element, property, rootPropertyValue);
										/* If startValue is already defined via forcefeeding, do not query the DOM for the root property's value;
										 just grab rootProperty's zero-value template from CSS.Hooks. This overwrites the element's actual
										 root property value (if one is set), but this is acceptable since the primary reason users forcefeed is
										 to avoid DOM queries, and thus we likewise avoid querying the DOM for the root property's value. */
									} else {
										/* Grab this hook's zero-value template, e.g. "0px 0px 0px black". */
										rootPropertyValue = CSS.Hooks.templates[rootProperty][1];
									}
									/* Handle non-hooked properties that haven't already been defined via forcefeeding. */
								} else if (startValue === undefined) {
									startValue = CSS.getPropertyValue(element, property); /* GET */
								}
							}

							/**************************
							 Value Data Extraction
							 **************************/

							var separatedValue,
									endValueUnitType,
									startValueUnitType,
									operator = false;

							/* Separates a property value into its numeric value and its unit type. */
							var separateValue = function(property, value) {
								var unitType,
										numericValue;

								numericValue = (value || "0")
										.toString()
										.toLowerCase()
										/* Match the unit type at the end of the value. */
										.replace(/[%A-z]+$/, function(match) {
											/* Grab the unit type. */
											unitType = match;

											/* Strip the unit type off of value. */
											return "";
										});

								/* If no unit type was supplied, assign one that is appropriate for this property (e.g. "deg" for rotateZ or "px" for width). */
								if (!unitType) {
									unitType = CSS.Values.getUnitType(property);
								}

								return [numericValue, unitType];
							};

							if (startValue !== endValue && Type.isString(startValue) && Type.isString(endValue)) {
								pattern = "";
								var iStart = 0, // index in startValue
										iEnd = 0, // index in endValue
										aStart = [], // array of startValue numbers
										aEnd = [], // array of endValue numbers
										inCalc = 0, // Keep track of being inside a "calc()" so we don't duplicate it
										inRGB = 0, // Keep track of being inside an RGB as we can't use fractional values
										inRGBA = 0; // Keep track of being inside an RGBA as we must pass fractional for the alpha channel

								startValue = CSS.Hooks.fixColors(startValue);
								endValue = CSS.Hooks.fixColors(endValue);
								while (iStart < startValue.length && iEnd < endValue.length) {
									var cStart = startValue[iStart],
											cEnd = endValue[iEnd];

									if (/[\d\.-]/.test(cStart) && /[\d\.-]/.test(cEnd)) {
										var tStart = cStart, // temporary character buffer
												tEnd = cEnd, // temporary character buffer
												dotStart = ".", // Make sure we can only ever match a single dot in a decimal
												dotEnd = "."; // Make sure we can only ever match a single dot in a decimal

										while (++iStart < startValue.length) {
											cStart = startValue[iStart];
											if (cStart === dotStart) {
												dotStart = ".."; // Can never match two characters
											} else if (!/\d/.test(cStart)) {
												break;
											}
											tStart += cStart;
										}
										while (++iEnd < endValue.length) {
											cEnd = endValue[iEnd];
											if (cEnd === dotEnd) {
												dotEnd = ".."; // Can never match two characters
											} else if (!/\d/.test(cEnd)) {
												break;
											}
											tEnd += cEnd;
										}
										var uStart = CSS.Hooks.getUnit(startValue, iStart), // temporary unit type
												uEnd = CSS.Hooks.getUnit(endValue, iEnd); // temporary unit type

										iStart += uStart.length;
										iEnd += uEnd.length;
										if (uStart === uEnd) {
											// Same units
											if (tStart === tEnd) {
												// Same numbers, so just copy over
												pattern += tStart + uStart;
											} else {
												// Different numbers, so store them
												pattern += "{" + aStart.length + (inRGB ? "!" : "") + "}" + uStart;
												aStart.push(parseFloat(tStart));
												aEnd.push(parseFloat(tEnd));
											}
										} else {
											// Different units, so put into a "calc(from + to)" and animate each side to/from zero
											var nStart = parseFloat(tStart),
													nEnd = parseFloat(tEnd);

											pattern += (inCalc < 5 ? "calc" : "") + "("
													+ (nStart ? "{" + aStart.length + (inRGB ? "!" : "") + "}" : "0") + uStart
													+ " + "
													+ (nEnd ? "{" + (aStart.length + (nStart ? 1 : 0)) + (inRGB ? "!" : "") + "}" : "0") + uEnd
													+ ")";
											if (nStart) {
												aStart.push(nStart);
												aEnd.push(0);
											}
											if (nEnd) {
												aStart.push(0);
												aEnd.push(nEnd);
											}
										}
									} else if (cStart === cEnd) {
										pattern += cStart;
										iStart++;
										iEnd++;
										// Keep track of being inside a calc()
										if (inCalc === 0 && cStart === "c"
												|| inCalc === 1 && cStart === "a"
												|| inCalc === 2 && cStart === "l"
												|| inCalc === 3 && cStart === "c"
												|| inCalc >= 4 && cStart === "("
												) {
											inCalc++;
										} else if ((inCalc && inCalc < 5)
												|| inCalc >= 4 && cStart === ")" && --inCalc < 5) {
											inCalc = 0;
										}
										// Keep track of being inside an rgb() / rgba()
										if (inRGB === 0 && cStart === "r"
												|| inRGB === 1 && cStart === "g"
												|| inRGB === 2 && cStart === "b"
												|| inRGB === 3 && cStart === "a"
												|| inRGB >= 3 && cStart === "("
												) {
											if (inRGB === 3 && cStart === "a") {
												inRGBA = 1;
											}
											inRGB++;
										} else if (inRGBA && cStart === ",") {
											if (++inRGBA > 3) {
												inRGB = inRGBA = 0;
											}
										} else if ((inRGBA && inRGB < (inRGBA ? 5 : 4))
												|| inRGB >= (inRGBA ? 4 : 3) && cStart === ")" && --inRGB < (inRGBA ? 5 : 4)) {
											inRGB = inRGBA = 0;
										}
									} else {
										inCalc = 0;
										// TODO: changing units, fixing colours
										break;
									}
								}
								if (iStart !== startValue.length || iEnd !== endValue.length) {
									if (Velocity.debug) {
										console.error("Trying to pattern match mis-matched strings [\"" + endValue + "\", \"" + startValue + "\"]");
									}
									pattern = undefined;
								}
								if (pattern) {
									if (aStart.length) {
										if (Velocity.debug) {
											console.log("Pattern found \"" + pattern + "\" -> ", aStart, aEnd, "[" + startValue + "," + endValue + "]");
										}
										startValue = aStart;
										endValue = aEnd;
										endValueUnitType = startValueUnitType = "";
									} else {
										pattern = undefined;
									}
								}
							}

							if (!pattern) {
								/* Separate startValue. */
								separatedValue = separateValue(property, startValue);
								startValue = separatedValue[0];
								startValueUnitType = separatedValue[1];

								/* Separate endValue, and extract a value operator (e.g. "+=", "-=") if one exists. */
								separatedValue = separateValue(property, endValue);
								endValue = separatedValue[0].replace(/^([+-\/*])=/, function(match, subMatch) {
									operator = subMatch;

									/* Strip the operator off of the value. */
									return "";
								});
								endValueUnitType = separatedValue[1];

								/* Parse float values from endValue and startValue. Default to 0 if NaN is returned. */
								startValue = parseFloat(startValue) || 0;
								endValue = parseFloat(endValue) || 0;

								/***************************************
								 Property-Specific Value Conversion
								 ***************************************/

								/* Custom support for properties that don't actually accept the % unit type, but where pollyfilling is trivial and relatively foolproof. */
								if (endValueUnitType === "%") {
									/* A %-value fontSize/lineHeight is relative to the parent's fontSize (as opposed to the parent's dimensions),
									 which is identical to the em unit's behavior, so we piggyback off of that. */
									if (/^(fontSize|lineHeight)$/.test(property)) {
										/* Convert % into an em decimal value. */
										endValue = endValue / 100;
										endValueUnitType = "em";
										/* For scaleX and scaleY, convert the value into its decimal format and strip off the unit type. */
									} else if (/^scale/.test(property)) {
										endValue = endValue / 100;
										endValueUnitType = "";
										/* For RGB components, take the defined percentage of 255 and strip off the unit type. */
									} else if (/(Red|Green|Blue)$/i.test(property)) {
										endValue = (endValue / 100) * 255;
										endValueUnitType = "";
									}
								}
							}

							/***************************
							 Unit Ratio Calculation
							 ***************************/

							/* When queried, the browser returns (most) CSS property values in pixels. Therefore, if an endValue with a unit type of
							 %, em, or rem is animated toward, startValue must be converted from pixels into the same unit type as endValue in order
							 for value manipulation logic (increment/decrement) to proceed. Further, if the startValue was forcefed or transferred
							 from a previous call, startValue may also not be in pixels. Unit conversion logic therefore consists of two steps:
							 1) Calculating the ratio of %/em/rem/vh/vw relative to pixels
							 2) Converting startValue into the same unit of measurement as endValue based on these ratios. */
							/* Unit conversion ratios are calculated by inserting a sibling node next to the target node, copying over its position property,
							 setting values with the target unit type then comparing the returned pixel value. */
							/* Note: Even if only one of these unit types is being animated, all unit ratios are calculated at once since the overhead
							 of batching the SETs and GETs together upfront outweights the potential overhead
							 of layout thrashing caused by re-querying for uncalculated ratios for subsequently-processed properties. */
							/* Todo: Shift this logic into the calls' first tick instance so that it's synced with RAF. */
							var calculateUnitRatios = function() {

								/************************
								 Same Ratio Checks
								 ************************/

								/* The properties below are used to determine whether the element differs sufficiently from this call's
								 previously iterated element to also differ in its unit conversion ratios. If the properties match up with those
								 of the prior element, the prior element's conversion ratios are used. Like most optimizations in Velocity,
								 this is done to minimize DOM querying. */
								var sameRatioIndicators = {
									myParent: element.parentNode || document.body, /* GET */
									position: CSS.getPropertyValue(element, "position"), /* GET */
									fontSize: CSS.getPropertyValue(element, "fontSize") /* GET */
								},
										/* Determine if the same % ratio can be used. % is based on the element's position value and its parent's width and height dimensions. */
										samePercentRatio = ((sameRatioIndicators.position === callUnitConversionData.lastPosition) && (sameRatioIndicators.myParent === callUnitConversionData.lastParent)),
										/* Determine if the same em ratio can be used. em is relative to the element's fontSize. */
										sameEmRatio = (sameRatioIndicators.fontSize === callUnitConversionData.lastFontSize);

								/* Store these ratio indicators call-wide for the next element to compare against. */
								callUnitConversionData.lastParent = sameRatioIndicators.myParent;
								callUnitConversionData.lastPosition = sameRatioIndicators.position;
								callUnitConversionData.lastFontSize = sameRatioIndicators.fontSize;

								/***************************
								 Element-Specific Units
								 ***************************/

								/* Note: IE8 rounds to the nearest pixel when returning CSS values, thus we perform conversions using a measurement
								 of 100 (instead of 1) to give our ratios a precision of at least 2 decimal values. */
								var measurement = 100,
										unitRatios = {};

								if (!sameEmRatio || !samePercentRatio) {
									var dummy = data && data.isSVG ? document.createElementNS("http://www.w3.org/2000/svg", "rect") : document.createElement("div");

									Velocity.init(dummy);
									sameRatioIndicators.myParent.appendChild(dummy);

									/* To accurately and consistently calculate conversion ratios, the element's cascaded overflow and box-sizing are stripped.
									 Similarly, since width/height can be artificially constrained by their min-/max- equivalents, these are controlled for as well. */
									/* Note: Overflow must be also be controlled for per-axis since the overflow property overwrites its per-axis values. */
									$.each(["overflow", "overflowX", "overflowY"], function(i, property) {
										Velocity.CSS.setPropertyValue(dummy, property, "hidden");
									});
									Velocity.CSS.setPropertyValue(dummy, "position", sameRatioIndicators.position);
									Velocity.CSS.setPropertyValue(dummy, "fontSize", sameRatioIndicators.fontSize);
									Velocity.CSS.setPropertyValue(dummy, "boxSizing", "content-box");

									/* width and height act as our proxy properties for measuring the horizontal and vertical % ratios. */
									$.each(["minWidth", "maxWidth", "width", "minHeight", "maxHeight", "height"], function(i, property) {
										Velocity.CSS.setPropertyValue(dummy, property, measurement + "%");
									});
									/* paddingLeft arbitrarily acts as our proxy property for the em ratio. */
									Velocity.CSS.setPropertyValue(dummy, "paddingLeft", measurement + "em");

									/* Divide the returned value by the measurement to get the ratio between 1% and 1px. Default to 1 since working with 0 can produce Infinite. */
									unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth = (parseFloat(CSS.getPropertyValue(dummy, "width", null, true)) || 1) / measurement; /* GET */
									unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight = (parseFloat(CSS.getPropertyValue(dummy, "height", null, true)) || 1) / measurement; /* GET */
									unitRatios.emToPx = callUnitConversionData.lastEmToPx = (parseFloat(CSS.getPropertyValue(dummy, "paddingLeft")) || 1) / measurement; /* GET */

									sameRatioIndicators.myParent.removeChild(dummy);
								} else {
									unitRatios.emToPx = callUnitConversionData.lastEmToPx;
									unitRatios.percentToPxWidth = callUnitConversionData.lastPercentToPxWidth;
									unitRatios.percentToPxHeight = callUnitConversionData.lastPercentToPxHeight;
								}

								/***************************
								 Element-Agnostic Units
								 ***************************/

								/* Whereas % and em ratios are determined on a per-element basis, the rem unit only needs to be checked
								 once per call since it's exclusively dependant upon document.body's fontSize. If this is the first time
								 that calculateUnitRatios() is being run during this call, remToPx will still be set to its default value of null,
								 so we calculate it now. */
								if (callUnitConversionData.remToPx === null) {
									/* Default to browsers' default fontSize of 16px in the case of 0. */
									callUnitConversionData.remToPx = parseFloat(CSS.getPropertyValue(document.body, "fontSize")) || 16; /* GET */
								}

								/* Similarly, viewport units are %-relative to the window's inner dimensions. */
								if (callUnitConversionData.vwToPx === null) {
									callUnitConversionData.vwToPx = parseFloat(window.innerWidth) / 100; /* GET */
									callUnitConversionData.vhToPx = parseFloat(window.innerHeight) / 100; /* GET */
								}

								unitRatios.remToPx = callUnitConversionData.remToPx;
								unitRatios.vwToPx = callUnitConversionData.vwToPx;
								unitRatios.vhToPx = callUnitConversionData.vhToPx;

								if (Velocity.debug >= 1) {
									console.log("Unit ratios: " + JSON.stringify(unitRatios), element);
								}
								return unitRatios;
							};

							/********************
							 Unit Conversion
							 ********************/

							/* The * and / operators, which are not passed in with an associated unit, inherently use startValue's unit. Skip value and unit conversion. */
							if (/[\/*]/.test(operator)) {
								endValueUnitType = startValueUnitType;
								/* If startValue and endValue differ in unit type, convert startValue into the same unit type as endValue so that if endValueUnitType
								 is a relative unit (%, em, rem), the values set during tweening will continue to be accurately relative even if the metrics they depend
								 on are dynamically changing during the course of the animation. Conversely, if we always normalized into px and used px for setting values, the px ratio
								 would become stale if the original unit being animated toward was relative and the underlying metrics change during the animation. */
								/* Since 0 is 0 in any unit type, no conversion is necessary when startValue is 0 -- we just start at 0 with endValueUnitType. */
							} else if ((startValueUnitType !== endValueUnitType) && startValue !== 0) {
								/* Unit conversion is also skipped when endValue is 0, but *startValueUnitType* must be used for tween values to remain accurate. */
								/* Note: Skipping unit conversion here means that if endValueUnitType was originally a relative unit, the animation won't relatively
								 match the underlying metrics if they change, but this is acceptable since we're animating toward invisibility instead of toward visibility,
								 which remains past the point of the animation's completion. */
								if (endValue === 0) {
									endValueUnitType = startValueUnitType;
								} else {
									/* By this point, we cannot avoid unit conversion (it's undesirable since it causes layout thrashing).
									 If we haven't already, we trigger calculateUnitRatios(), which runs once per element per call. */
									elementUnitConversionData = elementUnitConversionData || calculateUnitRatios();

									/* The following RegEx matches CSS properties that have their % values measured relative to the x-axis. */
									/* Note: W3C spec mandates that all of margin and padding's properties (even top and bottom) are %-relative to the *width* of the parent element. */
									var axis = (/margin|padding|left|right|width|text|word|letter/i.test(property) || /X$/.test(property) || property === "x") ? "x" : "y";

									/* In order to avoid generating n^2 bespoke conversion functions, unit conversion is a two-step process:
									 1) Convert startValue into pixels. 2) Convert this new pixel value into endValue's unit type. */
									switch (startValueUnitType) {
										case "%":
											/* Note: translateX and translateY are the only properties that are %-relative to an element's own dimensions -- not its parent's dimensions.
											 Velocity does not include a special conversion process to account for this behavior. Therefore, animating translateX/Y from a % value
											 to a non-% value will produce an incorrect start value. Fortunately, this sort of cross-unit conversion is rarely done by users in practice. */
											startValue *= (axis === "x" ? elementUnitConversionData.percentToPxWidth : elementUnitConversionData.percentToPxHeight);
											break;

										case "px":
											/* px acts as our midpoint in the unit conversion process; do nothing. */
											break;

										default:
											startValue *= elementUnitConversionData[startValueUnitType + "ToPx"];
									}

									/* Invert the px ratios to convert into to the target unit. */
									switch (endValueUnitType) {
										case "%":
											startValue *= 1 / (axis === "x" ? elementUnitConversionData.percentToPxWidth : elementUnitConversionData.percentToPxHeight);
											break;

										case "px":
											/* startValue is already in px, do nothing; we're done. */
											break;

										default:
											startValue *= 1 / elementUnitConversionData[endValueUnitType + "ToPx"];
									}
								}
							}

							/*********************
							 Relative Values
							 *********************/

							/* Operator logic must be performed last since it requires unit-normalized start and end values. */
							/* Note: Relative *percent values* do not behave how most people think; while one would expect "+=50%"
							 to increase the property 1.5x its current value, it in fact increases the percent units in absolute terms:
							 50 points is added on top of the current % value. */
							switch (operator) {
								case "+":
									endValue = startValue + endValue;
									break;

								case "-":
									endValue = startValue - endValue;
									break;

								case "*":
									endValue = startValue * endValue;
									break;

								case "/":
									endValue = startValue / endValue;
									break;
							}

							/**************************
							 tweensContainer Push
							 **************************/

							/* Construct the per-property tween object, and push it to the element's tweensContainer. */
							tweensContainer[property] = {
								rootPropertyValue: rootPropertyValue,
								startValue: startValue,
								currentValue: startValue,
								endValue: endValue,
								unitType: endValueUnitType,
								easing: easing
							};
							if (pattern) {
								tweensContainer[property].pattern = pattern;
							}

							if (Velocity.debug) {
								console.log("tweensContainer (" + property + "): " + JSON.stringify(tweensContainer[property]), element);
							}
						};

						/* Create a tween out of each property, and append its associated data to tweensContainer. */
						for (var property in propertiesMap) {

							if (!propertiesMap.hasOwnProperty(property)) {
								continue;
							}
							/* The original property name's format must be used for the parsePropertyValue() lookup,
							 but we then use its camelCase styling to normalize it for manipulation. */
							var propertyName = CSS.Names.camelCase(property),
									valueData = parsePropertyValue(propertiesMap[property]);

							/* Find shorthand color properties that have been passed a hex string. */
							/* Would be quicker to use CSS.Lists.colors.includes() if possible */
							if (_inArray(CSS.Lists.colors, propertyName)) {
								/* Parse the value data for each shorthand. */
								var endValue = valueData[0],
										easing = valueData[1],
										startValue = valueData[2];

								if (CSS.RegEx.isHex.test(endValue)) {
									/* Convert the hex strings into their RGB component arrays. */
									var colorComponents = ["Red", "Green", "Blue"],
											endValueRGB = CSS.Values.hexToRgb(endValue),
											startValueRGB = startValue ? CSS.Values.hexToRgb(startValue) : undefined;

									/* Inject the RGB component tweens into propertiesMap. */
									for (var i = 0; i < colorComponents.length; i++) {
										var dataArray = [endValueRGB[i]];

										if (easing) {
											dataArray.push(easing);
										}

										if (startValueRGB !== undefined) {
											dataArray.push(startValueRGB[i]);
										}

										fixPropertyValue(propertyName + colorComponents[i], dataArray);
									}
									/* If we have replaced a shortcut color value then don't update the standard property name */
									continue;
								}
							}
							fixPropertyValue(propertyName, valueData);
						}

						/* Along with its property data, store a reference to the element itself onto tweensContainer. */
						tweensContainer.element = element;
					}

					/*****************
					 Call Push
					 *****************/

					/* Note: tweensContainer can be empty if all of the properties in this call's property map were skipped due to not
					 being supported by the browser. The element property is used for checking that the tweensContainer has been appended to. */
					if (tweensContainer.element) {
						/* Apply the "velocity-animating" indicator class. */
						CSS.Values.addClass(element, "velocity-animating");

						/* The call array houses the tweensContainers for each element being animated in the current call. */
						call.push(tweensContainer);

						data = Data(element);

						if (data) {
							/* Store the tweensContainer and options if we're working on the default effects queue, so that they can be used by the reverse command. */
							if (opts.queue === "") {

								data.tweensContainer = tweensContainer;
								data.opts = opts;
							}

							/* Switch on the element's animating flag. */
							data.isAnimating = true;
						}

						/* Once the final element in this call's element set has been processed, push the call array onto
						 Velocity.State.calls for the animation tick to immediately begin processing. */
						if (elementsIndex === elementsLength - 1) {
							/* Add the current call plus its associated metadata (the element set and the call's options) onto the global call container.
							 Anything on this call container is subjected to tick() processing. */
							Velocity.State.calls.push([call, elements, opts, null, promiseData.resolver, null, 0]);

							/* If the animation tick isn't running, start it. (Velocity shuts it off when there are no active calls to process.) */
							if (Velocity.State.isTicking === false) {
								Velocity.State.isTicking = true;

								/* Start the tick loop. */
								tick();
							}
						} else {
							elementsIndex++;
						}
					}
				}

				/* When the queue option is set to false, the call skips the element's queue and fires immediately. */
				if (opts.queue === false) {
					/* Since this buildQueue call doesn't respect the element's existing queue (which is where a delay option would have been appended),
					 we manually inject the delay property here with an explicit setTimeout. */
					if (opts.delay) {

						/* Temporarily store delayed elements to facilitate access for global pause/resume */
						var callIndex = Velocity.State.delayedElements.count++;
						Velocity.State.delayedElements[callIndex] = element;

						var delayComplete = (function(index) {
							return function() {
								/* Clear the temporary element */
								Velocity.State.delayedElements[index] = false;

								/* Finally, issue the call */
								buildQueue();
							};
						})(callIndex);

						Data(element).delayBegin = (new Date()).getTime();
						Data(element).delay = parseFloat(opts.delay);
						Data(element).delayTimer = {
							setTimeout: setTimeout(buildQueue, parseFloat(opts.delay)),
							next: delayComplete
						};
					} else {
						buildQueue();
					}
					/* Otherwise, the call undergoes element queueing as normal. */
					/* Note: To interoperate with jQuery, Velocity uses jQuery's own $.queue() stack for queuing logic. */
				} else {
					$.queue(element, opts.queue, function(next, clearQueue) {
						/* If the clearQueue flag was passed in by the stop command, resolve this call's promise. (Promises can only be resolved once,
						 so it's fine if this is repeatedly triggered for each element in the associated call.) */
						if (clearQueue === true) {
							if (promiseData.promise) {
								promiseData.resolver(elements);
							}

							/* Do not continue with animation queueing. */
							return true;
						}

						/* This flag indicates to the upcoming completeCall() function that this queue entry was initiated by Velocity.
						 See completeCall() for further details. */
						Velocity.velocityQueueEntryFlag = true;

						buildQueue(next);
					});
				}

				/*********************
				 Auto-Dequeuing
				 *********************/

				/* As per jQuery's $.queue() behavior, to fire the first non-custom-queue entry on an element, the element
				 must be dequeued if its queue stack consists *solely* of the current call. (This can be determined by checking
				 for the "inprogress" item that jQuery prepends to active queue stack arrays.) Regardless, whenever the element's
				 queue is further appended with additional items -- including $.delay()'s or even $.animate() calls, the queue's
				 first entry is automatically fired. This behavior contrasts that of custom queues, which never auto-fire. */
				/* Note: When an element set is being subjected to a non-parallel Velocity call, the animation will not begin until
				 each one of the elements in the set has reached the end of its individually pre-existing queue chain. */
				/* Note: Unfortunately, most people don't fully grasp jQuery's powerful, yet quirky, $.queue() function.
				 Lean more here: http://stackoverflow.com/questions/1058158/can-somebody-explain-jquery-queue-to-me */
				if ((opts.queue === "" || opts.queue === "fx") && $.queue(element)[0] !== "inprogress") {
					$.dequeue(element);
				}
			}

			/**************************
			 Element Set Iteration
			 **************************/

			/* If the "nodeType" property exists on the elements variable, we're animating a single element.
			 Place it in an array so that $.each() can iterate over it. */
			$.each(elements, function(i, element) {
				/* Ensure each element in a set has a nodeType (is a real element) to avoid throwing errors. */
				if (Type.isNode(element)) {
					processElement(element, i);
				}
			});

			/******************
			 Option: Loop
			 ******************/

			/* The loop option accepts an integer indicating how many times the element should loop between the values in the
			 current call's properties map and the element's property values prior to this call. */
			/* Note: The loop option's logic is performed here -- after element processing -- because the current call needs
			 to undergo its queue insertion prior to the loop option generating its series of constituent "reverse" calls,
			 which chain after the current call. Two reverse calls (two "alternations") constitute one loop. */
			opts = $.extend({}, Velocity.defaults, options);
			opts.loop = parseInt(opts.loop, 10);
			var reverseCallsCount = (opts.loop * 2) - 1;

			if (opts.loop) {
				/* Double the loop count to convert it into its appropriate number of "reverse" calls.
				 Subtract 1 from the resulting value since the current call is included in the total alternation count. */
				for (var x = 0; x < reverseCallsCount; x++) {
					/* Since the logic for the reverse action occurs inside Queueing and therefore this call's options object
					 isn't parsed until then as well, the current call's delay option must be explicitly passed into the reverse
					 call so that the delay logic that occurs inside *Pre-Queueing* can process it. */
					var reverseOptions = {
						delay: opts.delay,
						progress: opts.progress
					};

					/* If a complete callback was passed into this call, transfer it to the loop redirect's final "reverse" call
					 so that it's triggered when the entire redirect is complete (and not when the very first animation is complete). */
					if (x === reverseCallsCount - 1) {
						reverseOptions.display = opts.display;
						reverseOptions.visibility = opts.visibility;
						reverseOptions.complete = opts.complete;
					}

					animate(elements, "reverse", reverseOptions);
				}
			}

			/***************
			 Chaining
			 ***************/

			/* Return the elements back to the call chain, with wrapped elements taking precedence in case Velocity was called via the $.fn. extension. */
			return getChain();
		};

		/* Turn Velocity into the animation function, extended with the pre-existing Velocity object. */
		Velocity = $.extend(animate, Velocity);
		/* For legacy support, also expose the literal animate method. */
		Velocity.animate = animate;

		/**************
		 Timing
		 **************/

		/* Ticker function. */
		var ticker = window.requestAnimationFrame || rAFShim;

		/* Inactive browser tabs pause rAF, which results in all active animations immediately sprinting to their completion states when the tab refocuses.
		 To get around this, we dynamically switch rAF to setTimeout (which the browser *doesn't* pause) when the tab loses focus. We skip this for mobile
		 devices to avoid wasting battery power on inactive tabs. */
		/* Note: Tab focus detection doesn't work on older versions of IE, but that's okay since they don't support rAF to begin with. */
		if (!Velocity.State.isMobile && document.hidden !== undefined) {
			var updateTicker = function() {
				/* Reassign the rAF function (which the global tick() function uses) based on the tab's focus state. */
				if (document.hidden) {
					ticker = function(callback) {
						/* The tick function needs a truthy first argument in order to pass its internal timestamp check. */
						return setTimeout(function() {
							callback(true);
						}, 16);
					};

					/* The rAF loop has been paused by the browser, so we manually restart the tick. */
					tick();
				} else {
					ticker = window.requestAnimationFrame || rAFShim;
				}
			};

			/* Page could be sitting in the background at this time (i.e. opened as new tab) so making sure we use correct ticker from the start */
			updateTicker();

			/* And then run check again every time visibility changes */
			document.addEventListener("visibilitychange", updateTicker);
		}

		/************
		 Tick
		 ************/

		/* Note: All calls to Velocity are pushed to the Velocity.State.calls array, which is fully iterated through upon each tick. */
		function tick(timestamp) {
			/* An empty timestamp argument indicates that this is the first tick occurence since ticking was turned on.
			 We leverage this metadata to fully ignore the first tick pass since RAF's initial pass is fired whenever
			 the browser's next tick sync time occurs, which results in the first elements subjected to Velocity
			 calls being animated out of sync with any elements animated immediately thereafter. In short, we ignore
			 the first RAF tick pass so that elements being immediately consecutively animated -- instead of simultaneously animated
			 by the same Velocity call -- are properly batched into the same initial RAF tick and consequently remain in sync thereafter. */
			if (timestamp) {
				/* We normally use RAF's high resolution timestamp but as it can be significantly offset when the browser is
				 under high stress we give the option for choppiness over allowing the browser to drop huge chunks of frames.
				 We use performance.now() and shim it if it doesn't exist for when the tab is hidden. */
				var timeCurrent = Velocity.timestamp && timestamp !== true ? timestamp : performance.now();

				/********************
				 Call Iteration
				 ********************/

				var callsLength = Velocity.State.calls.length;

				/* To speed up iterating over this array, it is compacted (falsey items -- calls that have completed -- are removed)
				 when its length has ballooned to a point that can impact tick performance. This only becomes necessary when animation
				 has been continuous with many elements over a long period of time; whenever all active calls are completed, completeCall() clears Velocity.State.calls. */
				if (callsLength > 10000) {
					Velocity.State.calls = compactSparseArray(Velocity.State.calls);
					callsLength = Velocity.State.calls.length;
				}

				/* Iterate through each active call. */
				for (var i = 0; i < callsLength; i++) {
					/* When a Velocity call is completed, its Velocity.State.calls entry is set to false. Continue on to the next call. */
					if (!Velocity.State.calls[i]) {
						continue;
					}

					/************************
					 Call-Wide Variables
					 ************************/

					var callContainer = Velocity.State.calls[i],
							call = callContainer[0],
							opts = callContainer[2],
							timeStart = callContainer[3],
							firstTick = !timeStart,
							tweenDummyValue = null,
							pauseObject = callContainer[5],
							millisecondsEllapsed = callContainer[6];



					/* If timeStart is undefined, then this is the first time that this call has been processed by tick().
					 We assign timeStart now so that its value is as close to the real animation start time as possible.
					 (Conversely, had timeStart been defined when this call was added to Velocity.State.calls, the delay
					 between that time and now would cause the first few frames of the tween to be skipped since
					 percentComplete is calculated relative to timeStart.) */
					/* Further, subtract 16ms (the approximate resolution of RAF) from the current time value so that the
					 first tick iteration isn't wasted by animating at 0% tween completion, which would produce the
					 same style value as the element's current value. */
					if (!timeStart) {
						timeStart = Velocity.State.calls[i][3] = timeCurrent - 16;
					}

					/* If a pause object is present, skip processing unless it has been set to resume */
					if (pauseObject) {
						if (pauseObject.resume === true) {
							/* Update the time start to accomodate the paused completion amount */
							timeStart = callContainer[3] = Math.round(timeCurrent - millisecondsEllapsed - 16);

							/* Remove pause object after processing */
							callContainer[5] = null;
						} else {
							continue;
						}
					}

					millisecondsEllapsed = callContainer[6] = timeCurrent - timeStart;

					/* The tween's completion percentage is relative to the tween's start time, not the tween's start value
					 (which would result in unpredictable tween durations since JavaScript's timers are not particularly accurate).
					 Accordingly, we ensure that percentComplete does not exceed 1. */
					var percentComplete = Math.min((millisecondsEllapsed) / opts.duration, 1);

					/**********************
					 Element Iteration
					 **********************/

					/* For every call, iterate through each of the elements in its set. */
					for (var j = 0, callLength = call.length; j < callLength; j++) {
						var tweensContainer = call[j],
								element = tweensContainer.element;

						/* Check to see if this element has been deleted midway through the animation by checking for the
						 continued existence of its data cache. If it's gone, or the element is currently paused, skip animating this element. */
						if (!Data(element)) {
							continue;
						}

						var transformPropertyExists = false;

						/**********************************
						 Display & Visibility Toggling
						 **********************************/

						/* If the display option is set to non-"none", set it upfront so that the element can become visible before tweening begins.
						 (Otherwise, display's "none" value is set in completeCall() once the animation has completed.) */
						if (opts.display !== undefined && opts.display !== null && opts.display !== "none") {
							if (opts.display === "flex") {
								var flexValues = ["-webkit-box", "-moz-box", "-ms-flexbox", "-webkit-flex"];

								$.each(flexValues, function(i, flexValue) {
									CSS.setPropertyValue(element, "display", flexValue);
								});
							}

							CSS.setPropertyValue(element, "display", opts.display);
						}

						/* Same goes with the visibility option, but its "none" equivalent is "hidden". */
						if (opts.visibility !== undefined && opts.visibility !== "hidden") {
							CSS.setPropertyValue(element, "visibility", opts.visibility);
						}

						/************************
						 Property Iteration
						 ************************/

						/* For every element, iterate through each property. */
						for (var property in tweensContainer) {
							/* Note: In addition to property tween data, tweensContainer contains a reference to its associated element. */
							if (tweensContainer.hasOwnProperty(property) && property !== "element") {
								var tween = tweensContainer[property],
										currentValue,
										/* Easing can either be a pre-genereated function or a string that references a pre-registered easing
										 on the Velocity.Easings object. In either case, return the appropriate easing *function*. */
										easing = Type.isString(tween.easing) ? Velocity.Easings[tween.easing] : tween.easing;

								/******************************
								 Current Value Calculation
								 ******************************/

								if (Type.isString(tween.pattern)) {
									var patternReplace = percentComplete === 1 ?
											function($0, index, round) {
												var result = tween.endValue[index];

												return round ? Math.round(result) : result;
											} :
											function($0, index, round) {
												var startValue = tween.startValue[index],
														tweenDelta = tween.endValue[index] - startValue,
														result = startValue + (tweenDelta * easing(percentComplete, opts, tweenDelta));

												return round ? Math.round(result) : result;
											};

									currentValue = tween.pattern.replace(/{(\d+)(!)?}/g, patternReplace);
								} else if (percentComplete === 1) {
									/* If this is the last tick pass (if we've reached 100% completion for this tween),
									 ensure that currentValue is explicitly set to its target endValue so that it's not subjected to any rounding. */
									currentValue = tween.endValue;
								} else {
									/* Otherwise, calculate currentValue based on the current delta from startValue. */
									var tweenDelta = tween.endValue - tween.startValue;

									currentValue = tween.startValue + (tweenDelta * easing(percentComplete, opts, tweenDelta));
									/* If no value change is occurring, don't proceed with DOM updating. */
								}
								if (!firstTick && (currentValue === tween.currentValue)) {
									continue;
								}

								tween.currentValue = currentValue;

								/* If we're tweening a fake 'tween' property in order to log transition values, update the one-per-call variable so that
								 it can be passed into the progress callback. */
								if (property === "tween") {
									tweenDummyValue = currentValue;
								} else {
									/******************
									 Hooks: Part I
									 ******************/
									var hookRoot;

									/* For hooked properties, the newly-updated rootPropertyValueCache is cached onto the element so that it can be used
									 for subsequent hooks in this call that are associated with the same root property. If we didn't cache the updated
									 rootPropertyValue, each subsequent update to the root property in this tick pass would reset the previous hook's
									 updates to rootPropertyValue prior to injection. A nice performance byproduct of rootPropertyValue caching is that
									 subsequently chained animations using the same hookRoot but a different hook can use this cached rootPropertyValue. */
									if (CSS.Hooks.registered[property]) {
										hookRoot = CSS.Hooks.getRoot(property);

										var rootPropertyValueCache = Data(element).rootPropertyValueCache[hookRoot];

										if (rootPropertyValueCache) {
											tween.rootPropertyValue = rootPropertyValueCache;
										}
									}

									/*****************
									 DOM Update
									 *****************/

									/* setPropertyValue() returns an array of the property name and property value post any normalization that may have been performed. */
									/* Note: To solve an IE<=8 positioning bug, the unit type is dropped when setting a property value of 0. */
									var adjustedSetData = CSS.setPropertyValue(element, /* SET */
											property,
											tween.currentValue + (IE < 9 && parseFloat(currentValue) === 0 ? "" : tween.unitType),
											tween.rootPropertyValue,
											tween.scrollData);

									/*******************
									 Hooks: Part II
									 *******************/

									/* Now that we have the hook's updated rootPropertyValue (the post-processed value provided by adjustedSetData), cache it onto the element. */
									if (CSS.Hooks.registered[property]) {
										/* Since adjustedSetData contains normalized data ready for DOM updating, the rootPropertyValue needs to be re-extracted from its normalized form. ?? */
										if (CSS.Normalizations.registered[hookRoot]) {
											Data(element).rootPropertyValueCache[hookRoot] = CSS.Normalizations.registered[hookRoot]("extract", null, adjustedSetData[1]);
										} else {
											Data(element).rootPropertyValueCache[hookRoot] = adjustedSetData[1];
										}
									}

									/***************
									 Transforms
									 ***************/

									/* Flag whether a transform property is being animated so that flushTransformCache() can be triggered once this tick pass is complete. */
									if (adjustedSetData[0] === "transform") {
										transformPropertyExists = true;
									}

								}
							}
						}

						/****************
						 mobileHA
						 ****************/

						/* If mobileHA is enabled, set the translate3d transform to null to force hardware acceleration.
						 It's safe to override this property since Velocity doesn't actually support its animation (hooks are used in its place). */
						if (opts.mobileHA) {
							/* Don't set the null transform hack if we've already done so. */
							if (Data(element).transformCache.translate3d === undefined) {
								/* All entries on the transformCache object are later concatenated into a single transform string via flushTransformCache(). */
								Data(element).transformCache.translate3d = "(0px, 0px, 0px)";

								transformPropertyExists = true;
							}
						}

						if (transformPropertyExists) {
							CSS.flushTransformCache(element);
						}
					}

					/* The non-"none" display value is only applied to an element once -- when its associated call is first ticked through.
					 Accordingly, it's set to false so that it isn't re-processed by this call in the next tick. */
					if (opts.display !== undefined && opts.display !== "none") {
						Velocity.State.calls[i][2].display = false;
					}
					if (opts.visibility !== undefined && opts.visibility !== "hidden") {
						Velocity.State.calls[i][2].visibility = false;
					}

					/* Pass the elements and the timing data (percentComplete, msRemaining, timeStart, tweenDummyValue) into the progress callback. */
					if (opts.progress) {
						opts.progress.call(callContainer[1],
								callContainer[1],
								percentComplete,
								Math.max(0, (timeStart + opts.duration) - timeCurrent),
								timeStart,
								tweenDummyValue);
					}

					/* If this call has finished tweening, pass its index to completeCall() to handle call cleanup. */
					if (percentComplete === 1) {
						completeCall(i);
					}
				}
			}

			/* Note: completeCall() sets the isTicking flag to false when the last call on Velocity.State.calls has completed. */
			if (Velocity.State.isTicking) {
				ticker(tick);
			}
		}

		/**********************
		 Call Completion
		 **********************/

		/* Note: Unlike tick(), which processes all active calls at once, call completion is handled on a per-call basis. */
		function completeCall(callIndex, isStopped) {
			/* Ensure the call exists. */
			if (!Velocity.State.calls[callIndex]) {
				return false;
			}

			/* Pull the metadata from the call. */
			var call = Velocity.State.calls[callIndex][0],
					elements = Velocity.State.calls[callIndex][1],
					opts = Velocity.State.calls[callIndex][2],
					resolver = Velocity.State.calls[callIndex][4];

			var remainingCallsExist = false;

			/*************************
			 Element Finalization
			 *************************/

			for (var i = 0, callLength = call.length; i < callLength; i++) {
				var element = call[i].element;

				/* If the user set display to "none" (intending to hide the element), set it now that the animation has completed. */
				/* Note: display:none isn't set when calls are manually stopped (via Velocity("stop"). */
				/* Note: Display gets ignored with "reverse" calls and infinite loops, since this behavior would be undesirable. */
				if (!isStopped && !opts.loop) {
					if (opts.display === "none") {
						CSS.setPropertyValue(element, "display", opts.display);
					}

					if (opts.visibility === "hidden") {
						CSS.setPropertyValue(element, "visibility", opts.visibility);
					}
				}

				/* If the element's queue is empty (if only the "inprogress" item is left at position 0) or if its queue is about to run
				 a non-Velocity-initiated entry, turn off the isAnimating flag. A non-Velocity-initiatied queue entry's logic might alter
				 an element's CSS values and thereby cause Velocity's cached value data to go stale. To detect if a queue entry was initiated by Velocity,
				 we check for the existence of our special Velocity.queueEntryFlag declaration, which minifiers won't rename since the flag
				 is assigned to jQuery's global $ object and thus exists out of Velocity's own scope. */
				var data = Data(element);

				if (opts.loop !== true && ($.queue(element)[1] === undefined || !/\.velocityQueueEntryFlag/i.test($.queue(element)[1]))) {
					/* The element may have been deleted. Ensure that its data cache still exists before acting on it. */
					if (data) {
						data.isAnimating = false;
						/* Clear the element's rootPropertyValueCache, which will become stale. */
						data.rootPropertyValueCache = {};

						var transformHAPropertyExists = false;
						/* If any 3D transform subproperty is at its default value (regardless of unit type), remove it. */
						$.each(CSS.Lists.transforms3D, function(i, transformName) {
							var defaultValue = /^scale/.test(transformName) ? 1 : 0,
									currentValue = data.transformCache[transformName];

							if (data.transformCache[transformName] !== undefined && new RegExp("^\\(" + defaultValue + "[^.]").test(currentValue)) {
								transformHAPropertyExists = true;

								delete data.transformCache[transformName];
							}
						});

						/* Mobile devices have hardware acceleration removed at the end of the animation in order to avoid hogging the GPU's memory. */
						if (opts.mobileHA) {
							transformHAPropertyExists = true;
							delete data.transformCache.translate3d;
						}

						/* Flush the subproperty removals to the DOM. */
						if (transformHAPropertyExists) {
							CSS.flushTransformCache(element);
						}

						/* Remove the "velocity-animating" indicator class. */
						CSS.Values.removeClass(element, "velocity-animating");
					}
				}

				/*********************
				 Option: Complete
				 *********************/

				/* Complete is fired once per call (not once per element) and is passed the full raw DOM element set as both its context and its first argument. */
				/* Note: Callbacks aren't fired when calls are manually stopped (via Velocity("stop"). */
				if (!isStopped && opts.complete && !opts.loop && (i === callLength - 1)) {
					/* We throw callbacks in a setTimeout so that thrown errors don't halt the execution of Velocity itself. */
					try {
						opts.complete.call(elements, elements);
					} catch (error) {
						setTimeout(function() {
							throw error;
						}, 1);
					}
				}

				/**********************
				 Promise Resolving
				 **********************/

				/* Note: Infinite loops don't return promises. */
				if (resolver && opts.loop !== true) {
					resolver(elements);
				}

				/****************************
				 Option: Loop (Infinite)
				 ****************************/

				if (data && opts.loop === true && !isStopped) {
					/* If a rotateX/Y/Z property is being animated by 360 deg with loop:true, swap tween start/end values to enable
					 continuous iterative rotation looping. (Otherise, the element would just rotate back and forth.) */
					$.each(data.tweensContainer, function(propertyName, tweenContainer) {
						if (/^rotate/.test(propertyName) && ((parseFloat(tweenContainer.startValue) - parseFloat(tweenContainer.endValue)) % 360 === 0)) {
							var oldStartValue = tweenContainer.startValue;

							tweenContainer.startValue = tweenContainer.endValue;
							tweenContainer.endValue = oldStartValue;
						}

						if (/^backgroundPosition/.test(propertyName) && parseFloat(tweenContainer.endValue) === 100 && tweenContainer.unitType === "%") {
							tweenContainer.endValue = 0;
							tweenContainer.startValue = 100;
						}
					});

					Velocity(element, "reverse", {loop: true, delay: opts.delay});
				}

				/***************
				 Dequeueing
				 ***************/

				/* Fire the next call in the queue so long as this call's queue wasn't set to false (to trigger a parallel animation),
				 which would have already caused the next call to fire. Note: Even if the end of the animation queue has been reached,
				 $.dequeue() must still be called in order to completely clear jQuery's animation queue. */
				if (opts.queue !== false) {
					$.dequeue(element, opts.queue);
				}
			}

			/************************
			 Calls Array Cleanup
			 ************************/

			/* Since this call is complete, set it to false so that the rAF tick skips it. This array is later compacted via compactSparseArray().
			 (For performance reasons, the call is set to false instead of being deleted from the array: http://www.html5rocks.com/en/tutorials/speed/v8/) */
			Velocity.State.calls[callIndex] = false;

			/* Iterate through the calls array to determine if this was the final in-progress animation.
			 If so, set a flag to end ticking and clear the calls array. */
			for (var j = 0, callsLength = Velocity.State.calls.length; j < callsLength; j++) {
				if (Velocity.State.calls[j] !== false) {
					remainingCallsExist = true;

					break;
				}
			}

			if (remainingCallsExist === false) {
				/* tick() will detect this flag upon its next iteration and subsequently turn itself off. */
				Velocity.State.isTicking = false;

				/* Clear the calls array so that its length is reset. */
				delete Velocity.State.calls;
				Velocity.State.calls = [];
			}
		}

		/******************
		 Frameworks
		 ******************/

		/* Both jQuery and Zepto allow their $.fn object to be extended to allow wrapped elements to be subjected to plugin calls.
		 If either framework is loaded, register a "velocity" extension pointing to Velocity's core animate() method.  Velocity
		 also registers itself onto a global container (window.jQuery || window.Zepto || window) so that certain features are
		 accessible beyond just a per-element scope. This master object contains an .animate() method, which is later assigned to $.fn
		 (if jQuery or Zepto are present). Accordingly, Velocity can both act on wrapped DOM elements and stand alone for targeting raw DOM elements. */
		global.Velocity = Velocity;

		if (global !== window) {
			/* Assign the element function to Velocity's core animate() method. */
			global.fn.velocity = animate;
			/* Assign the object function's defaults to Velocity's global defaults object. */
			global.fn.velocity.defaults = Velocity.defaults;
		}

		/***********************
		 Packaged Redirects
		 ***********************/

		/* slideUp, slideDown */
		$.each(["Down", "Up"], function(i, direction) {
			Velocity.Redirects["slide" + direction] = function(element, options, elementsIndex, elementsSize, elements, promiseData) {
				var opts = $.extend({}, options),
						begin = opts.begin,
						complete = opts.complete,
						inlineValues = {},
						computedValues = {height: "", marginTop: "", marginBottom: "", paddingTop: "", paddingBottom: ""};

				if (opts.display === undefined) {
					/* Show the element before slideDown begins and hide the element after slideUp completes. */
					/* Note: Inline elements cannot have dimensions animated, so they're reverted to inline-block. */
					opts.display = (direction === "Down" ? (Velocity.CSS.Values.getDisplayType(element) === "inline" ? "inline-block" : "block") : "none");
				}

				opts.begin = function() {
					/* If the user passed in a begin callback, fire it now. */
					if (elementsIndex === 0 && begin) {
						begin.call(elements, elements);
					}

					/* Cache the elements' original vertical dimensional property values so that we can animate back to them. */
					for (var property in computedValues) {
						if (!computedValues.hasOwnProperty(property)) {
							continue;
						}
						inlineValues[property] = element.style[property];

						/* For slideDown, use forcefeeding to animate all vertical properties from 0. For slideUp,
						 use forcefeeding to start from computed values and animate down to 0. */
						var propertyValue = CSS.getPropertyValue(element, property);
						computedValues[property] = (direction === "Down") ? [propertyValue, 0] : [0, propertyValue];
					}

					/* Force vertical overflow content to clip so that sliding works as expected. */
					inlineValues.overflow = element.style.overflow;
					element.style.overflow = "hidden";
				};

				opts.complete = function() {
					/* Reset element to its pre-slide inline values once its slide animation is complete. */
					for (var property in inlineValues) {
						if (inlineValues.hasOwnProperty(property)) {
							element.style[property] = inlineValues[property];
						}
					}

					/* If the user passed in a complete callback, fire it now. */
					if (elementsIndex === elementsSize - 1) {
						if (complete) {
							complete.call(elements, elements);
						}
						if (promiseData) {
							promiseData.resolver(elements);
						}
					}
				};

				Velocity(element, computedValues, opts);
			};
		});

		/* fadeIn, fadeOut */
		$.each(["In", "Out"], function(i, direction) {
			Velocity.Redirects["fade" + direction] = function(element, options, elementsIndex, elementsSize, elements, promiseData) {
				var opts = $.extend({}, options),
						complete = opts.complete,
						propertiesMap = {opacity: (direction === "In") ? 1 : 0};

				/* Since redirects are triggered individually for each element in the animated set, avoid repeatedly triggering
				 callbacks by firing them only when the final element has been reached. */
				if (elementsIndex !== 0) {
					opts.begin = null;
				}
				if (elementsIndex !== elementsSize - 1) {
					opts.complete = null;
				} else {
					opts.complete = function() {
						if (complete) {
							complete.call(elements, elements);
						}
						if (promiseData) {
							promiseData.resolver(elements);
						}
					};
				}

				/* If a display was passed in, use it. Otherwise, default to "none" for fadeOut or the element-specific default for fadeIn. */
				/* Note: We allow users to pass in "null" to skip display setting altogether. */
				if (opts.display === undefined) {
					opts.display = (direction === "In" ? "auto" : "none");
				}

				Velocity(this, propertiesMap, opts);
			};
		});

		return Velocity;
	}((window.jQuery || window.Zepto || window), window, (window ? window.document : undefined));
}));

/******************
 Known Issues
 ******************/

/* The CSS spec mandates that the translateX/Y/Z transforms are %-relative to the element itself -- not its parent.
 Velocity, however, doesn't make this distinction. Thus, converting to or from the % unit with these subproperties
 will produce an inaccurate conversion value. The same issue exists with the cx/cy attributes of SVG circles and ellipses. */


/***/ }),
/* 187 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = _extends;
function _extends() {
  _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];

      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }

    return target;
  };

  return _extends.apply(this, arguments);
}

/***/ }),
/* 188 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (datasetId, callback) {
  (0, _xhr2.default)({
    url: "/" + 'api/session/PostArchiveDataSet',
    method: 'POST',
    json: {
      FarmDataSetId: datasetId
    },
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {
    if (resp.statusCode === 200) {
      _Actions2.default.UPDATE_DATASET_LIST(resp.body.DataSetList);

      if (datasetId === _activeDataset2.default.id) {
        (0, _POST__loadDataset2.default)(resp.body.DataSetList[0].Id);
      }
    }

    if (typeof callback !== 'undefined') {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 189 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createData = module.exports = function (data, callback) {

  _Actions2.default.SET_APP_STATUS("updating");

  (0, _xhr2.default)({
    url: "/" + "api/editor/PostCreateData",
    method: "POST",
    json: data,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.RECEIVE_DATA_UPDATE(resp.body);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createData, 'POST__createData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__createData/index.js');
}();

;

/***/ }),
/* 190 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__editData = module.exports = function (data, callback) {

  _Actions2.default.SET_APP_STATUS("updating");

  (0, _xhr2.default)({
    url: "/" + "api/editor/PostDeleteData",
    method: "POST",
    json: data,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.RECEIVE_DATA_UPDATE(resp.body);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__editData, 'POST__editData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__deleteData/index.js');
}();

;

/***/ }),
/* 191 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__editData = module.exports = function (data, callback) {

  _Actions2.default.SET_APP_STATUS("updating");

  (0, _xhr2.default)({
    url: "/" + "api/editor/PostEditDataSetDetail",
    method: "POST",
    json: data,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {
    var data = resp.body;
    if (resp.statusCode === (200 || 201)) {
      if (data.Data !== null) {
        _Actions2.default.RECEIVE_DATA_UPDATE(data);
      }
      _Actions2.default.UPDATE_DATASET_LIST(data.DataSetList);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__editData, 'POST__editData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__editDataSetDetail/index.js');
}();

;

/***/ }),
/* 192 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = [{
  id: 'UserReportSingles',
  url: 'single',
  name: 'Single Dataset Report',
  maxDatasets: 1
}, {
  id: 'UserReportComparisons',
  url: 'comparison',
  name: 'Comparison Report',
  maxDatasets: 6
}, {
  id: 'BulkComparisons',
  url: 'bulk-comparison',
  name: 'Bulk Comparison Report',
  maxDatasets: 999
}, {
  id: 'UserReportFarmSizes',
  url: 'farm-size',
  name: 'Farm Size Analysis',
  maxDatasets: 6
}, {
  id: 'UserReportFarmHistories',
  url: 'farm-history',
  name: 'Farm History Analysis',
  maxDatasets: 6
}, {
  id: 'CarbonCalculator',
  url: 'dbcc',
  name: 'Carbon Calculator',
  maxDatasets: 1
}, {
  id: 'DFMPFarmClientReport',
  url: 'dfmp-farm-client-report',
  name: 'DFMP Farm Client Report',
  maxDatasets: 1
}];
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 193 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var _default = {
  navigateright: __webpack_require__(1322),
  alert: __webpack_require__(1276),
  action: __webpack_require__(1275),
  back: __webpack_require__(1277),
  forward: __webpack_require__(1314),
  barchart: __webpack_require__(1278),
  downarrow: __webpack_require__(1309),
  uparrow: __webpack_require__(1329),
  leftarrow: __webpack_require__(1318),
  rightarrow: __webpack_require__(1326),
  cloudupload: __webpack_require__(1283),
  dairyaustralialogo: __webpack_require__(1307),
  close: __webpack_require__(1282),
  copy: __webpack_require__(1285),
  globe: __webpack_require__(1315),
  folder: __webpack_require__(1313),
  print: __webpack_require__(1325),
  mail: __webpack_require__(1321),
  help: __webpack_require__(1316),
  tick: __webpack_require__(1328),
  error: __webpack_require__(1312),
  edit: __webpack_require__(1311),
  inbox: __webpack_require__(1317),
  pin: __webpack_require__(1323),
  dollarsign: __webpack_require__(1308),
  cog: __webpack_require__(1284),
  plus: __webpack_require__(1324),
  tag: __webpack_require__(1327),
  user: __webpack_require__(1330),
  curvedtriangle: __webpack_require__(1286),
  curvedtriangledown: __webpack_require__(1287),
  lock: __webpack_require__(1320),
  loading: __webpack_require__(1319),
  download: __webpack_require__(1310),
  circle_number_1: __webpack_require__(1279),
  circle_number_2: __webpack_require__(1280),
  circle_number_3: __webpack_require__(1281),
  da_alert: __webpack_require__(1288),
  da_arrow_down: __webpack_require__(1289),
  da_arrow_left: __webpack_require__(1290),
  da_arrow_right: __webpack_require__(1291),
  da_arrow_up: __webpack_require__(1292),
  da_calculator: __webpack_require__(1293),
  da_close: __webpack_require__(1294),
  da_copy: __webpack_require__(1296),
  da_create: __webpack_require__(1297),
  da_create_stroke: __webpack_require__(1298),
  da_edit: __webpack_require__(1299),
  da_edit_stroke: __webpack_require__(1300),
  da_external_link: __webpack_require__(1302),
  da_info: __webpack_require__(1303),
  da_launch: __webpack_require__(1304),
  da_notes: __webpack_require__(1305),
  da_notes_stroke: __webpack_require__(1306),
  da_expand: __webpack_require__(1301),
  da_collapse: __webpack_require__(1295)
};
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/data/iconList/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 194 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _requestLog = __webpack_require__(123);

var _requestLog2 = _interopRequireDefault(_requestLog);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var fieldErrorMixin = module.exports = {
  componentWillMount: function componentWillMount() {
    this._handleRequestLogUpdate();
  },
  componentDidMount: function componentDidMount() {
    this.unsubscribeTofieldErrorMixin = _requestLog2.default.listen(this._handleRequestLogUpdate);
  },
  componentWillUnmount: function componentWillUnmount() {
    this.unsubscribeTofieldErrorMixin();
  },
  _handleRequestLogUpdate: function _handleRequestLogUpdate() {
    var _this = this;

    var latestRequest = _.findLast(_requestLog2.default.store, function (item) {
      return _this.props.data.FieldId === item.FieldId;
    });

    if (typeof latestRequest === "undefined") return;

    if (latestRequest.error) {
      _Actions2.default.SET_DATA_ERROR(this.props.data.FieldId, true);
    } else {
      _Actions2.default.SET_DATA_ERROR(this.props.data.FieldId, false);
    }
  }
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(fieldErrorMixin, 'fieldErrorMixin', 'C:/_repos_windows/dairybase/Frontend/app/mixins/_fieldErrorMixin/index.js');
}();

;

/***/ }),
/* 195 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _commas = __webpack_require__(33);

var _NaNtoDash = __webpack_require__(147);

var _NaNtoDash2 = _interopRequireDefault(_NaNtoDash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (id) {
  var calculations = [{
    Id: 'NotDefined',
    Name: 'null',
    fn: function fn(value) {
      return null;
    }
  }, {
    Id: 'RawValue',
    Name: 'Raw Value',
    fn: function fn(value) {
      return fixIt(value, 0);
    }
  }, {
    Id: 'PerCow',
    Name: 'Per Cow',
    fn: function fn(value) {
      return fixIt(value, 0);
    }
  }, {
    Id: 'PerKgMS',
    Name: 'Per Kg MS',
    fn: function fn(value) {
      return fixIt(value, 2);
    }
  }, {
    Id: 'PerMilkingHa',
    Name: 'Per Milking ha',
    fn: function fn(value) {
      return fixIt(value, 0);
    }
  }, {
    Id: 'PerUsableHa',
    Name: 'Per Usable ha',
    fn: function fn(value) {
      return fixIt(value, 0);
    }
  }, {
    Id: 'DollarsPerLitre',
    Name: 'Dollars Per Litre',
    fn: function fn(value) {
      return fixIt(value, 2);
    }
  }, {
    Id: 'CentsPerLitre',
    cents: true,
    Name: 'Cents Per Litre',
    fn: function fn(value) {
      return fixIt(value, 1);
    }
  }, {
    Id: 'PercentOfIncome',
    Name: '% of Income',
    fn: function fn(value) {
      return fixIt(value, 1);
    }
  }];
  return _.find(calculations, { Id: id });
};

function fixIt(val, dec) {
  if (val === null) return '-';
  if (typeof val !== 'number') return '-';
  var fixed = val.toFixed(dec);
  return (0, _commas.addCommas)(fixed);
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(fixIt, 'fixIt', 'C:/_repos_windows/dairybase/Frontend/app/utils/_financeCalculations/_decimals.js');
}();

;

/***/ }),
/* 196 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _addOptions = __webpack_require__(453);

var _addOptions2 = _interopRequireDefault(_addOptions);

var _mutateValue = __webpack_require__(454);

var _mutateValue2 = _interopRequireDefault(_mutateValue);

var _parseMultiSelect = __webpack_require__(455);

var _parseMultiSelect2 = _interopRequireDefault(_parseMultiSelect);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (newData, groupId, store) {

        var newObj = _.cloneDeep(store);

        _dataDefinition2.default.properties[groupId].Fields.forEach(function (item, index) {

                // TODO: Move this outside the function so we can send individual tables...
                if (typeof newData[item.Table] === "undefined" || typeof newData[item.Table] === "null") return;

                var _id = item.FieldId;
                var _table = item.Table;

                if (_.find(_dataDefinition2.default.properties[groupId].Tables, { TableName: _table }).MultiRow) {

                        // Apply the properties to correspoding item in each row
                        newData[_table].forEach(function (row, index) {
                                var _item = _.cloneDeep(item);
                                _item.Value = row[_id];
                                _item = (0, _addOptions2.default)(_item);
                                _item = (0, _mutateValue2.default)(_item);
                                _item = (0, _parseMultiSelect2.default)(_item);
                                row[_id] = _item;
                        });

                        // then just apply the whole table to the store.
                        newObj[_table] = newData[_table];
                } else {
                        // apply individual fields directly to the store.

                        // because we moved an output to an input...
                        if (_id === 'CowMilkerNumber' && _table === 'FarmCalculation') {

                                item.Value = newData[_table][_id];
                                item.RowId = newData[_table].Id;
                                item = (0, _addOptions2.default)(item);
                                item = (0, _mutateValue2.default)(item);
                                item = (0, _parseMultiSelect2.default)(item);

                                if (typeof newObj._calcs === 'undefined') newObj._calcs = {};
                                newObj._calcs[_id] = item;
                        } else {

                                item.Value = newData[_table][_id];
                                item.RowId = newData[_table].Id;
                                item = (0, _addOptions2.default)(item);
                                item = (0, _mutateValue2.default)(item);
                                item = (0, _parseMultiSelect2.default)(item);
                                newObj[_id] = item;
                        }
                }
        });

        return newObj;
};
;

var _temp = function () {
        if (typeof __REACT_HOT_LOADER__ === 'undefined') {
                return;
        }
}();

;

/***/ }),
/* 197 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(961);

var _style2 = _interopRequireDefault(_style);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Boolean = __webpack_require__(274);

var _Boolean2 = _interopRequireDefault(_Boolean);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _DatasetSearch = __webpack_require__(390);

var _DatasetSearch2 = _interopRequireDefault(_DatasetSearch);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListGroups2.default, 'handleGroupUpdate')],

  componentWillMount: function componentWillMount() {
    this.handleGroupUpdate();
  },
  handleGroupUpdate: function handleGroupUpdate() {
    this.setState({
      user: _datasetListGroups2.default.store.user,
      budgets: _datasetListGroups2.default.store.budgets,
      other: _datasetListGroups2.default.store.other,
      industry: _datasetListGroups2.default.store.industry
    });
  },
  updateField: function updateField(value, id) {
    _Actions2.default.UPDATE_DATASETLIST_GROUP(id, value);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.col1 },
        _react2.default.createElement(
          'h2',
          { className: _style2.default.title },
          'Search Datasets:'
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.search },
          _react2.default.createElement(_DatasetSearch2.default, {
            onSelectDataset: this.props.onSelectDataset,
            isZZtop: this.props.isZZtop
          })
        )
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.col2 },
        _react2.default.createElement(
          'h2',
          { className: _style2.default.title },
          'Include in list:'
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.includes },
          _react2.default.createElement(
            'div',
            null,
            _react2.default.createElement(
              'div',
              { className: _style2.default.field },
              _react2.default.createElement(_Boolean2.default, {
                id: 'user',
                label: 'My datasets',
                value: this.state.user,
                onSubmit: this.updateField
              })
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default.field },
              _react2.default.createElement(_Boolean2.default, {
                id: 'budgets',
                label: 'Budgets',
                value: this.state.budgets,
                onSubmit: this.updateField
              })
            )
          ),
          _react2.default.createElement(
            'div',
            null,
            _react2.default.createElement(
              'div',
              { className: _style2.default.field },
              _react2.default.createElement(_Boolean2.default, {
                id: 'other',
                label: 'Shared user datasets',
                value: this.state.other,
                onSubmit: this.updateField
              })
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default.field },
              _react2.default.createElement(_Boolean2.default, {
                id: 'industry',
                label: 'Industry datasets',
                value: this.state.industry,
                onSubmit: this.updateField
              })
            )
          )
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/GroupFilters/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 198 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _index = __webpack_require__(1019);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleNewFilter'), _reflux2.default.listenTo(_datasetGroups2.default, '_handleNewFilter')],

  getInitialState: function getInitialState() {
    return {
      filter: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      filter: _datasetListFilter2.default.store,
      filtering: _datasetListFilter2.default.filtering
    });
  },
  _getFilteredList: function _getFilteredList() {
    var _this = this;

    // nothing filtered so return whole list
    if (!this.state.filtering) return this.props.list;
    return this.props.list.filter(function (item, index) {
      // item is not included in the filter
      return !_.includes((0, _checkItemInFilter2.default)(item, _this.state.filter), true);
    });
  },
  render: function render() {
    var DatasetListComponent = this.props.listComponent;
    return _react2.default.createElement(
      'div',
      { className: 'Filter__UnFilteredList' },
      _react2.default.createElement(
        'div',
        { className: '_list' },
        this.renderSubGroup('My datasets', this.getUserList),
        this.renderSubGroup('Shared user datasets', this.getOtherUserList),
        this.renderSubGroup('Industry datasets', this.getIndustryList)
      )
    );
  },
  renderSubGroup: function renderSubGroup(title, listfn) {
    var DatasetListComponent = this.props.listComponent;
    var list = listfn();

    return list.length === 0 ? null : _react2.default.createElement(
      'div',
      { className: '_subGroup' },
      _react2.default.createElement(
        'div',
        { className: '_header' },
        _react2.default.createElement(
          'h3',
          { className: '_text' },
          title
        )
      ),
      _react2.default.createElement(DatasetListComponent, {
        list: list,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        hasCheckbox: this.props.hasCheckbox
      })
    );
  },
  getUserList: function getUserList() {
    return this._getFilteredList().filter(function (item) {
      return item.IsThisOwner;
    });
  },
  getOtherUserList: function getOtherUserList() {
    return this._getFilteredList().filter(function (item) {
      return !item.IsThisOwner && !item.SystemDataSet;
    });
  },
  getIndustryList: function getIndustryList() {
    return this._getFilteredList().filter(function (item) {
      return item.SystemDataSet;
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/UnfilteredList/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 199 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = convertMdToHTML;

var _marked = __webpack_require__(181);

var _marked2 = _interopRequireDefault(_marked);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function convertMdToHTML(md) {
  return {
    __html: (0, _marked2.default)(typeof md !== 'string' ? '' : md, {
      sanitize: true,
      breaks: true
    })
  };
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(convertMdToHTML, 'convertMdToHTML', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/utils/convertMdToHTML/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 200 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _style = __webpack_require__(967);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(_Icon2.default, { id: 'loading', className: _style2.default['icon'] })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/xch-Spinner/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 201 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _LoadDetailModal = __webpack_require__(206);

var _LoadDetailModal2 = _interopRequireDefault(_LoadDetailModal);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LoadDatasetList = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  getInitialState: function getInitialState() {
    return {
      loadDatasetPortalOpen: false,
      selectedDataset: undefined
    };
  },
  _handleDatasetSelection: function _handleDatasetSelection(dataset) {
    if (this.props.emitItemClick) {
      return this.props.emitItemClick(dataset);
    }
    this.setState({
      selectedDataset: dataset.Id,
      loadDatasetPortalOpen: true
    });
  },
  _toggleLoadDataset: function _toggleLoadDataset() {
    this.setState({
      loadDatasetPortalOpen: !this.state.loadDatasetPortalOpen
    });
  },


  _getSelectedDataset: function _getSelectedDataset() {
    if (typeof this.state.selectedDataset === 'undefined') return;
    return _.find(this.props.list, { Id: this.state.selectedDataset });
  },

  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'LoadDatasetList' },
      _react2.default.createElement(_DatasetList2.default, {
        forceBudgetList: this.props.forceBudgetList,
        list: this.props.list,
        emitItemClick: this._handleDatasetSelection
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          forceZ: true,
          context: document.body,
          isOpen: this.state.loadDatasetPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(_LoadDetailModal2.default, _extends({}, this.props, {
          toggleMethod: this._toggleLoadDataset,
          dataset: this._getSelectedDataset()
        }))
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LoadDatasetList, 'LoadDatasetList', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_LoadDatasetList/index.jsx');
}();

;

/***/ }),
/* 202 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1023);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _fieldErrorMixin = __webpack_require__(194);

var _fieldErrorMixin2 = _interopRequireDefault(_fieldErrorMixin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var OptimisticInputSelect = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, _fieldErrorMixin2.default],

  _handleSubmitData: function _handleSubmitData(newValue) {
    // passed validation? Set the new data in store:
    _Actions2.default.UPDATE_DATA_ELEMENT({
      "Table": this.props.data.Table,
      "Element": this.props.data.FieldId,
      "Value": newValue
    });
  },
  render: function render() {
    return _react2.default.createElement(_InputSelect2.default, {
      id: this.props.data.FieldId,
      value: this.props.data.Value,
      options: this.props.data.Options,
      onSubmit: this._handleSubmitData,
      disabled: !this.state.editAuthority,
      error: this.props.data.error });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(OptimisticInputSelect, 'OptimisticInputSelect', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_OptimisticInputSelect/index.jsx');
}();

;

/***/ }),
/* 203 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1031);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GenericTotal = module.exports = __webpack_require__(1)({
  _renderPreUnit: function _renderPreUnit() {
    return typeof this.props.preUnit === 'undefined' ? null : _react2.default.createElement(
      'span',
      null,
      this.props.preUnit
    );
  },
  _renderPostUnit: function _renderPostUnit() {
    return typeof this.props.postUnit === 'undefined' ? null : _react2.default.createElement(
      'span',
      null,
      this.props.postUnit
    );
  },
  render: function render() {
    var _value = typeof this.props.value === 'number' || typeof this.props.value === 'string' ? this.props.value : '-';
    return _react2.default.createElement(
      'div',
      { className: 'GenericTotal' },
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this._renderPreUnit(),
        _value,
        this._renderPostUnit()
      ),
      _react2.default.createElement('span', { className: '_label', dangerouslySetInnerHTML: { __html: this.props.label } })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GenericTotal, 'GenericTotal', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_GenericTotal/index.jsx');
}();

;

/***/ }),
/* 204 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _style = __webpack_require__(970);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchCheckBox = __webpack_require__(125);

var _xchCheckBox2 = _interopRequireDefault(_xchCheckBox);

var _classnames4 = __webpack_require__(7);

var _classnames5 = _interopRequireDefault(_classnames4);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    var options = this.sortOptions(this.props.options);
    return {
      value: this.props.value,
      options: options
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.setState({
      // value: newProps.value,
      options: this.sortOptions(newProps.options)
    });
  },
  sortOptions: function sortOptions(options) {

    if (!Array.isArray(options)) return [];

    if (options.length === 0) return options;
    if (typeof options[0].Order !== 'undefined' && options[0].Order !== null) {
      return _.sortBy(options, 'Order');
    }
    return _.sortBy(options, 'Id');
  },
  _handleSelect: function _handleSelect(evt) {
    if (!this.props.disabled) {
      this._handleSubmitData(evt.target.value);
    }
  },
  handleSubmit: function handleSubmit(newValue, updatedIndex) {
    var _this = this;

    if (this.props.disabled) return;

    var newArr = this.state.value.map(function (value, index) {
      if (index === updatedIndex) return newValue;
      return value;
    });
    this.setState({
      value: newArr
    }, function () {
      return _this.props.onSubmit(newArr.join(''), _this.props.id);
    });
  },
  render: function render() {
    var _classnames;

    var SelectInput__dropdown = (0, _classnames5.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['SelectInput__dropdown'], true), _defineProperty(_classnames, _style2.default['is-error'], this.props.error), _classnames));
    return _react2.default.createElement(
      'div',
      { className: _style2.default["SelectInput"] },
      _react2.default.createElement(
        'div',
        { className: SelectInput__dropdown },
        this._renderSelectElement()
      )
    );
  },
  _renderSelectElement: function _renderSelectElement() {
    var _classnames2,
        _this2 = this;

    var classList = (0, _classnames5.default)((_classnames2 = {}, _defineProperty(_classnames2, _style2.default["SelectInput__field"], true), _defineProperty(_classnames2, _style2.default["is-error"], this.props.error), _defineProperty(_classnames2, _style2.default["is-disabled"], this.props.disabled), _classnames2));

    if (this.state.options.length === 0) return _react2.default.createElement(
      'div',
      { className: classList },
      'no options found.'
    );

    if (typeof this.state.value !== "undefined") {

      return this.state.options.map(function (option, index) {
        var _classnames3;

        return _react2.default.createElement(
          'div',
          { className: _style2.default.option, key: option.Id },
          _react2.default.createElement(
            'div',
            { className: (0, _classnames5.default)((_classnames3 = {}, _defineProperty(_classnames3, _style2.default["checkbox"], true), _defineProperty(_classnames3, _style2.default["is-disabled"], _this2.props.disabled), _classnames3)) },
            _react2.default.createElement(_xchCheckBox2.default, {
              id: index,
              value: _this2.state.value[index],
              onSubmit: _this2.handleSubmit })
          ),
          option.Title
        );
      });
    }

    return _react2.default.createElement(
      'div',
      { className: classList },
      'waiting for data...'
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 205 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _uniqueIdGenerator = __webpack_require__(457);

var _uniqueIdGenerator2 = _interopRequireDefault(_uniqueIdGenerator);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _replaceChartBalloons2 = __webpack_require__(456);

var _replaceChartBalloons3 = _interopRequireDefault(_replaceChartBalloons2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Chart = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      uniqueId: this.props.id + (0, _uniqueIdGenerator2.default)() + ''
    };
  },
  componentDidMount: function componentDidMount() {
    this._setChartData(this.props);
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (typeof this.chart === 'undefined') return;
    if (this.props.preventUpdate) return;
    // Warning: performance implications if we allow updates (sometimes necessary)
    this._setChartData(newProps);
  },
  _setChartData: function _setChartData(props) {
    var settingsObj = _.find(_dataDefinition2.default.chartSettings, { ChartSettingId: props.data.ChartSettingId }).JsonSetting;
    var chartObj = _.cloneDeep(settingsObj);

    if (typeof this.props.datasetList !== 'undefined') {
      chartObj = (0, _replaceChartBalloons3.default)(chartObj, this.props.datasetList);
    }

    chartObj.dataProvider = props.data.ChartData;

    this.setState({
      chartObj: chartObj
    }, this._renderChart);
  },
  _renderChart: function _renderChart() {
    this.chart = window.AmCharts.makeChart(this.state.uniqueId, this.state.chartObj, 0);
    if (this.props.preventUpdate) {
      this.chart.addListener("rendered", this.props.emitLoaded);
    }
  },
  render: function render() {
    return _react2.default.createElement('div', { id: this.state.uniqueId, style: { height: this.props.height, width: this.props.width } });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Chart, 'Chart', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Chart/index.jsx');
}();

;

/***/ }),
/* 206 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _CreateBudgetButton = __webpack_require__(150);

var _CreateBudgetButton2 = _interopRequireDefault(_CreateBudgetButton);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _ConfirmationModal = __webpack_require__(109);

var _ConfirmationModal2 = _interopRequireDefault(_ConfirmationModal);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _SubActionBtn = __webpack_require__(487);

var _SubActionBtn2 = _interopRequireDefault(_SubActionBtn);

var _DatasetDetail = __webpack_require__(278);

var _DatasetDetail2 = _interopRequireDefault(_DatasetDetail);

var _POST__archiveDataset = __webpack_require__(188);

var _POST__archiveDataset2 = _interopRequireDefault(_POST__archiveDataset);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _POST__createExcelFile = __webpack_require__(415);

var _POST__createExcelFile2 = _interopRequireDefault(_POST__createExcelFile);

var _POST__createBudget = __webpack_require__(144);

var _POST__createBudget2 = _interopRequireDefault(_POST__createBudget);

var _checkFarmAuth = __webpack_require__(148);

var _checkFarmAuth2 = _interopRequireDefault(_checkFarmAuth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Detail = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      createBudgetPending: false,
      loadingDataset: false,
      loadingSpreadsheet: false,
      archivingDataset: false,
      createPortalOpen: false,
      downloadSpreadsheetPortalOpen: false,
      loadRequestPortalOpen: false,
      archiveRequestPortalOpen: false,
      archiveConfirmPortalOpen: false
    };
  },
  _loadDataset: function _loadDataset(evt) {
    var dataset = this.props.dataset;


    var newDataset = dataset.Id;
    var activeDataset = _activeDataset2.default.id;

    if (dataset.IsCcModel) {
      return this.props.history.push('/budget/' + dataset.Id);
    }

    if (+newDataset === +activeDataset) {
      this._loadSameDataset(newDataset);
    } else {
      this._toggleLoadRequestPortal();
    }
  },
  _loadSameDataset: function _loadSameDataset(newDataset) {
    this.props.history.push('/editor');
  },
  _handleLoadResponse: function _handleLoadResponse(resp) {
    setTimeout(this._toggleLoadRequestPortal, 500);
    this.props.history.push('/editor');
  },
  _toggleLoadRequestPortal: function _toggleLoadRequestPortal() {
    this.setState({
      loadRequestPortalOpen: !this.state.loadRequestPortalOpen
    });
  },
  _toggleCreatePortal: function _toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  _handleCreateTransition: function _handleCreateTransition() {
    this._toggleCreatePortal();
    this.props.history.push('/editor');
  },
  _toggleSpreadsheetPortal: function _toggleSpreadsheetPortal() {
    this.setState({
      downloadSpreadsheetPortalOpen: !this.state.downloadSpreadsheetPortalOpen
    });
  },
  _handleArchiveDatasetSuccess: function _handleArchiveDatasetSuccess() {
    this._toggleArchiveRequestPortal();
    this.props.toggleMethod();
  },
  _toggleArchiveConfirmPortal: function _toggleArchiveConfirmPortal() {
    this.setState({
      archiveConfirmPortalOpen: !this.state.archiveConfirmPortalOpen
    });
  },
  _handleArchiveConfirm: function _handleArchiveConfirm() {
    this._toggleArchiveConfirmPortal();
    this._toggleArchiveRequestPortal();
  },
  _toggleArchiveRequestPortal: function _toggleArchiveRequestPortal() {
    this.setState({
      archiveRequestPortalOpen: !this.state.archiveRequestPortalOpen
    });
  },
  _togglePortal: function _togglePortal() {
    this.props.toggleMethod();
  },
  render: function render() {
    var _this = this;

    var dataset = this.props.dataset;


    var loadText = this.state.loadingDataset ? 'Loading Dataset...' : 'Load Dataset';

    if (dataset.IsCcModel) {
      loadText = 'Load Budget';
    }

    return _react2.default.createElement(
      'div',
      { className: 'ActionBox' },
      _react2.default.createElement(
        'div',
        { className: 'ActionBox__contentBox' },
        _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._togglePortal }),
        _react2.default.createElement(_DatasetDetail2.default, { dataset: this.props.dataset }),
        _react2.default.createElement(
          'div',
          { className: '_mainAction' },
          _react2.default.createElement(
            'button',
            { className: '_btn', onClick: this._loadDataset },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(
                'span',
                { className: '_label' },
                loadText
              ),
              _react2.default.createElement(_Icon2.default, { id: 'forward', className: '_icon' })
            )
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'ActionBox__subActions' },
        _react2.default.createElement(_SubActionBtn2.default, {
          render: !this.props.dataset.ReadOnlyAuthority,
          onClick: this._toggleSpreadsheetPortal,
          id: 'spreadsheet',
          label: this.state.loadingSpreadsheet ? 'Downloading...' : 'Download',
          icon: 'download'
        }),
        _react2.default.createElement(_SubActionBtn2.default, {
          render: this.props.dataset.CopyAuthority,
          onClick: this._toggleCreatePortal,
          id: 'copy',
          label: 'Copy',
          icon: 'copy'
        }),
        _react2.default.createElement(_SubActionBtn2.default, {
          render: this.props.dataset.DeleteAuthority,
          onClick: this._toggleArchiveConfirmPortal,
          id: 'archive',
          label: this.state.archivingDataset ? 'Archiving...' : 'Archive',
          icon: 'close'
        }),
        _react2.default.createElement(_CreateBudgetButton2.default, {
          tidyUp: true,
          history: this.props.history,
          datasetId: this.props.dataset.Id,
          Button: function Button(_ref) {
            var onOpen = _ref.onOpen;
            return _react2.default.createElement(_SubActionBtn2.default, {
              render: _this.props.dataset.IsActual,
              onClick: function onClick() {
                console.log('clicekd');
                // this.setState({ createBudgetPending: true })
                onOpen();
              },
              id: 'budget',
              label: 'Create Budget',
              icon: 'da_calculator'
            });
          }
        }),
        _react2.default.createElement(_SubActionBtn2.default, {
          render: true,
          link: true,
          url: '/dbcc/#/editor/' + this.props.dataset.Id + '/inputs/livestock',
          id: 'carbon',
          label: 'Carbon Calculator',
          icon: 'navigateright'
        })
      ),
      _react2.default.createElement(_DARequestPortal2.default, {
        isOpen: this.state.createBudgetPending,
        onSuccess: function onSuccess(data) {
          var budgetId = data.body.CompCalculatorOutput.ScenarioDataset.Id;

          _this.props.history.push('/budget/' + budgetId + '/editor');
          _this.setState({ createBudgetPending: false });
        },
        onClose: function onClose() {
          return _this.setState({ createBudgetPending: false });
        },
        request: function request(callback) {
          return (0, _POST__createBudget2.default)({
            FarmDataSetId: _this.props.dataset.Id,
            FinancialYearId: 52,
            Name: 'New Budget'
          }, callback);
        },
        text: {
          pendingTitle: 'Please wait a moment...',
          pendingDescription: 'Generating new budget dataset.',
          successTitle: 'Success!',
          successDescription: 'Your budget dataset has been created.',
          successButton: 'Launch budget editor',
          errorTitle: 'Oops, something went wrong',
          errorDescription: 'Connection timed out.'
        }
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.createPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleCreatePortal }),
          _react2.default.createElement(_CreateDatasetModal2.default, {
            callback: this._handleCreateTransition,
            bulkCallback: this._toggleCreatePortal,
            prefillFarm: (0, _checkFarmAuth2.default)(this.props.dataset.DairyBaseId) ? this.props.dataset.DairyBaseId : undefined,
            prefillYear: this.props.dataset.FinancialYear,
            prefillDataset: this.props.dataset.Id
          })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.downloadSpreadsheetPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleSpreadsheetPortal,
          failHandler: this._toggleSpreadsheetPortal,
          request: _POST__createExcelFile2.default,
          wait: true,
          data: this.props.dataset.Id,
          pendingText: {
            title: 'Please wait',
            text: 'Generating spreadsheet.'
          },
          successText: {
            title: 'Spreadsheet created!',
            text: 'The Excel file should be in your download folder. To use this in Excel you will need to Enable Editing at the top of the spreadsheet.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The spreadsheet was not generated.'
          }
        })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.loadRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleLoadResponse,
          failHandler: this._toggleLoadRequestPortal,
          request: _POST__loadDataset2.default,
          data: this.props.dataset.Id,
          pendingText: {
            title: 'Please wait',
            text: 'Loading Dataset...'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset Loaded'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be loaded.'
          }
        })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.archiveRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleArchiveDatasetSuccess,
          failHandler: this._toggleArchiveRequestPortal,
          request: _POST__archiveDataset2.default,
          data: this.props.dataset.Id,
          pendingText: {
            title: 'Please wait',
            text: 'Archiving Dataset...'
          },
          successText: {
            title: 'Success!',
            text: 'The dataset has been archived'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be archived.'
          }
        })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.archiveConfirmPortalOpen },
        _react2.default.createElement(_ConfirmationModal2.default, {
          confirmHandler: this._handleArchiveConfirm,
          cancelHandler: this._toggleArchiveConfirmPortal,
          content: {
            title: 'Are you sure?',
            text: 'This dataset will be archived, but can be restored later.',
            btns: {
              confirm: 'Archive Dataset',
              cancel: 'Cancel'
            }
          }
        })
      )
    );
  }
});

module.exports = Detail;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Detail, 'Detail', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_LoadDetailModal/index.jsx');
}();

;

/***/ }),
/* 207 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _RatioSelector = __webpack_require__(208);

var _RatioSelector2 = _interopRequireDefault(_RatioSelector);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _SelectInput = __webpack_require__(556);

var _SelectInput2 = _interopRequireDefault(_SelectInput);

var _style = __webpack_require__(558);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  // withRouter: true,
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _RatioSelector2.default,
      null,
      function (_ref) {
        var selectedRatio = _ref.selectedRatio,
            onSubmit = _ref.onSubmit,
            options = _ref.options,
            Label = _ref.Label;
        return _react2.default.createElement(_SelectInput2.default, {
          options: options,
          value: selectedRatio,
          onSubmit: onSubmit
        });
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 208 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_budgets2.default, 'handleBudgetUpdate')],

  getInitialState: function getInitialState() {
    return {
      selectedRatio: 0
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleBudgetUpdate();
  },
  handleBudgetUpdate: function handleBudgetUpdate() {
    this.setState({
      selectedRatio: _budgets2.default.store.selectedRatio
    });
  },
  handleSubmit: function handleSubmit(newValue) {
    _Actions2.default.UPDATE_CC_RATIO_SWITCH(newValue);
  },
  render: function render() {
    var selectedRatio = this.state.selectedRatio;


    return this.props.children({
      selectedRatio: selectedRatio,
      ratioKey: selectedRatio === 0 ? 'kgMS' : 'cpl',
      options: [{
        Id: 0,
        Title: '$ / kg MS'
      }, {
        Id: 1,
        Title: 'cpl'
      }],
      Label: selectedRatio === 0 ? '$ / kg MS' : 'cpl',
      onSubmit: this.handleSubmit
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioSelector/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioSelector/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 209 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1140);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _ChartItem = __webpack_require__(636);

var _ChartItem2 = _interopRequireDefault(_ChartItem);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chartGrid = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      },
      chartIndex: 0
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        key: this.props.activeTab.id,
        className: 'ComparisonReport__tableWrapper',
        style: { marginTop: this.props.headingHeight } },
      _react2.default.createElement(
        'div',
        { className: 'ChartGrid' + ' ' + this.props.activeTab.id },
        this._renderCharts()
      )
    );
  },
  _renderCharts: function _renderCharts() {
    var _this = this;

    var _activeTab = this.props.activeTab;
    var ComparisonChartAxis = _reportFilters2.default.store.UserReportComparisons[0].FinChartAxis;
    var _chartAxisIndex = ComparisonChartAxis.Value - 1;
    var _chartAxis = ComparisonChartAxis.Options[_chartAxisIndex];

    return _activeTab.chartList.map(function (chartKey, index) {
      var _chart = _this.state.report.charts[chartKey];
      var chartHeight = _this.props.isPrinting ? '200px' : '300px';
      return _this.state.chartIndex < index ? null : _react2.default.createElement(
        'div',
        { className: '_item', key: index },
        _react2.default.createElement(_ChartItem2.default, _extends({}, _this.props, {
          chart: _chart,
          chartKey: chartKey,
          chartHeight: chartHeight,
          selectedDatasets: _this.props.selectedDatasets,
          emitLoadNextChart: _this.loadNextChart.bind(_this, index + 1) })),
        _this._renderAxisTitle(_chartAxis)
      );
    });
  },
  loadNextChart: function loadNextChart(nextChartIndex) {
    var _this2 = this;

    this.setState({
      chartIndex: nextChartIndex
    }, function () {
      if (_this2.props.activeTab.chartList.length === nextChartIndex) {
        _this2.props.emitChartsLoaded();
      }
    });
  },
  _renderAxisTitle: function _renderAxisTitle(_chartAxis) {
    return this.props.activeTab.id === 'SummaryCharts' ? null : _react2.default.createElement(
      'div',
      { className: '_xAxis' },
      _chartAxis.Title
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_chartGrid, '_chartGrid', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_ChartGrid/index.jsx');
}();

;

/***/ }),
/* 210 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var __headerLabels = exports.__headerLabels = [{
  Title: 'Milking Cows'
}, {
  Title: 'Rising 2 Year Heifers'
}, {
  Title: 'Rising 1 Year Heifers'
}, {
  Title: 'Mature',
  SecondLine: 'Bulls'
}, {
  Title: 'Nitrogen Fertiliser'
}, {
  Title: 'Total GHG',
  Unit: 't CO2e / Year'
}, {
  Title: '% of Total GHG'
}];

var __data = exports.__data = [{
  total: false,
  category: 'Methane:',
  title: 'Enteric fermentation',
  col1: 'CooCowsEntFermTonnes',
  col2: 'CooR2HeifersEntFermTonnes',
  col3: 'CooR1HeifersEntFermTonnes',
  col4: 'CooBullsEntFermTonnes',
  // col5: 'CooOtherLivestockEntFermTonnes',
  // col6: ,
  col7: 'CooTotalEntFermTonnes',
  col8: 'CooTotalEntFermPercent',
  col9: 'CooTypicalEntFermKgPerKgMs',
  col10: 'CooTypicalEntFermPercent',
  inputPath: 'livestock'
}, {
  total: false,
  title: 'Waste management',
  col1: 'CooCowsWasteManagTonnes',
  col2: 'CooR2HeifersWasteManagTonnes',
  col3: 'CooR1HeifersWasteManagTonnes',
  col4: 'CooBullsWasteManagTonnes',
  // col5: 'CooOtherLivestockWasteManagTonnes',
  // col6: ,
  col7: 'CooTotalWasteManagTonnes',
  col8: 'CooTotalWasteManagPercent',
  col9: 'CooTypicalWasteManagKgPerKgMs',
  col10: 'CooTypicalWasteManagPercent',
  inputPath: 'manure'
}, {
  total: false,
  category: 'Nitrous oxide:',
  title: 'Direct on pastures',
  col1: 'CooCowsDirectPastureTonnes',
  col2: 'CooR2HeifersDirectPastureTonnes',
  col3: 'CooR1HeifersDirectPastureTonnes',
  col4: 'CooBullsDirectPastureTonnes',
  // col5: 'CooOtherLivestockDirectPastureTonnes',
  // col6: ,
  col7: 'CooTotalDirectPastureTonnes',
  col8: 'CooTotalDirectPasturePercent',
  col9: 'CooTypicalDirectPastureKgPerKgMs',
  col10: 'CooTypicalDirectPasturePercent',
  inputPath: 'manure'
}, {
  total: false,
  title: 'Manure storage & spread',
  col1: 'CooCowsManureSpreadTonnes',
  col2: 'CooR2HeifersManureSpreadTonnes',
  col3: 'CooR1HeifersManureSpreadTonnes',
  col4: 'CooBullsManureSpreadTonnes',
  // col5: 'CooOtherLivestockManureSpreadTonnes',
  // col6: ,
  col7: 'CooTotalManureSpreadTonnes',
  col8: 'CooTotalManureSpreadPercent',
  col9: 'CooTypicalManureSpreadKgPerKgMs',
  col10: 'CooTypicalManureSpreadPercent',
  inputPath: 'manure'
}, {
  total: false,
  title: 'Indirect N waste',
  col1: 'CooCowsIndirectNWasteTonnes',
  col2: 'CooR2HeifersIndirectNWasteTonnes',
  col3: 'CooR1HeifersIndirectNWasteTonnes',
  col4: 'CooBullsIndirectNWasteTonnes',
  // col5: 'CooOtherLivestockIndirectNWasteTonnes',
  // col6: ,
  col7: 'CooTotalIndirectNWasteTonnes',
  col8: 'CooTotalIndirectNWastePercent',
  col9: 'CooTypicalIndirectNWasteKgPerKgMs',
  col10: 'CooTypicalIndirectNWastePercent',
  inputPath: 'manure'
}, {
  total: false,
  title: 'Direct N fertiliser',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  col6: 'CooNitrogenDirectNFertTonnes',
  col7: 'CooTotalDirectNFertTonnes',
  col8: 'CooTotalDirectNFertPercent',
  col9: 'CooTypicalDirectNFertKgPerKgMs',
  col10: 'CooTypicalDirectNFertPercent',
  inputPath: 'fertiliser'
}, {
  total: false,
  title: 'Indirect N fertiliser',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  col6: 'CooNitrogenIndirectNFertTonnes',
  col7: 'CooTotalIndirectNFertTonnes',
  col8: 'CooTotalIndirectNFertPercent',
  col9: 'CooTypicalIndirectNFertKgPerKgMs',
  col10: 'CooTypicalIndirectNFertPercent',
  inputPath: 'fertiliser'
}, {
  total: false,
  category: 'Carbon dioxide:',
  title: 'Electricity',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  // col6: ,
  col7: 'CooTotalElectrictyTonnes',
  col8: 'CooTotalElectrictyPercent',
  col9: 'CooTypicalElectrictyKgPerKgMs',
  col10: 'CooTypicalElectrictyPercent',
  inputPath: 'energy'
}, {
  total: false,
  title: 'Fuel',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  // col6: ,
  col7: 'CooTotalFuelTonnes',
  col8: 'CooTotalFuelPercent',
  col9: 'CooTypicalFuelKgPerKgMs',
  col10: 'CooTypicalFuelPercent',
  inputPath: 'energy'
}, {
  total: false,
  category: 'Pre-farm gate embedded',
  title: 'Concentrates',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  // col6: ,
  col7: 'CooTotalPreFarmConcTonnes',
  col8: 'CooTotalPreFarmConcPercent',
  col9: 'CooTypicalPreFarmConcKgPerKgMs',
  col10: 'CooTypicalPreFarmConcPercent',
  inputPath: 'feed'
}, {
  total: false,
  title: 'Fodder',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  // col6: ,
  col7: 'CooTotalPreFarmFodderTonnes',
  col8: 'CooTotalPreFarmFodderPercent',
  col9: 'CooTypicalPreFarmFodderKgPerKgMs',
  col10: 'CooTypicalPreFarmFodderPercent',
  inputPath: 'feed'
}, {
  total: false,
  title: 'Fertiliser',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  // col6: ,
  col7: 'CooTotalPreFarmFertTonnes',
  col8: 'CooTotalPreFarmFertPercent',
  col9: 'CooTypicalPreFarmFertKgPerKgMs',
  col10: 'CooTypicalPreFarmFertPercent',
  inputPath: 'fertiliser'
}, {
  total: false,
  category: 'Sequestration',
  title: 'Tree plantings',
  // col1: ,
  // col2: ,
  // col3: ,
  // col4: ,
  // col5: ,
  // col6: ,
  col7: 'CooTotalTreeSequesterTonnes',
  col8: 'CooTotalTreeSequesterPercent',
  col9: 'CooTypicalTreeSequesterKgPerKgMs',
  col10: 'CooTypicalTreeSequesterPercent',
  inputPath: 'carbon'
}, {
  total: true,
  title: 'Total GHG emissions (t CO2e/annum)',
  col1: 'CooCowsTotalTonnes',
  col2: 'CooR2HeifersTotalTonnes',
  col3: 'CooR1HeifersTotalTonnes',
  col4: 'CooBullsTotalTonnes',
  // col5: 'CooOtherLivestockTotalTonnes',
  col6: 'CooNitrogenTotalTonnes',
  col7: 'CooFarmTotalTonnes'
  // col8: ,
}, {
  total: true,
  title: '% of total GHG emissions',
  col1: 'CooCowsTotalPercent',
  col2: 'CooR2HeifersTotalPercent',
  col3: 'CooR1HeifersTotalPercent',
  col4: 'CooBullsTotalPercent',
  // col5: 'CooOtherLivestockTotalPercent',
  col6: 'CooNitrogenTotalPercent'
  // col7: ,
  // col8: ,
}];

var palette = ['#5b9bd5', '#ed7d31', '#a5a5a5', '#ffc000', '#4472c4', '#70ad47', '#255e91', '#9e480e', '#636363', '#997300', '#264478', '#43682b', '#a4c7e7'];

var palette1 = ['#391E11', '#4C2C18', '#5F3B1E', '#724B25', '#855C2B', '#976D31', '#A88038', '#B7943F', '#C6A947', '#D4BE50', '#E0D45B', '#EAEB67', '#AFE589'];

var palette2 = ['#3D1D18', '#53292E', '#65394A', '#6D4D68', '#6B6586', '#5D7E9E', '#4898AD', '#38B2B0', '#49C9A7', '#75DE97', '#ADEF83', '#EBFC73', '#20E67D', '#AFE589'];

var palette3 = ['#312F2B', '#3F3E39', '#4D4D46', '#5B5D53', '#6B6E60', '#7B7F6D', '#8D9079', '#A0A186', '#B4B392', '#C9C49E', '#E0D6AB', '#F8E7B8', '#AFE589'];

var __chartData = exports.__chartData = __data.filter(function (r) {
  return typeof r.col8 !== 'undefined';
}).map(function (r, i) {
  return _extends({}, r, {
    color: palette[i]
  });
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__headerLabels, '__headerLabels', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');

  __REACT_HOT_LOADER__.register(__data, '__data', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');

  __REACT_HOT_LOADER__.register(palette, 'palette', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');

  __REACT_HOT_LOADER__.register(palette1, 'palette1', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');

  __REACT_HOT_LOADER__.register(palette2, 'palette2', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');

  __REACT_HOT_LOADER__.register(palette3, 'palette3', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');

  __REACT_HOT_LOADER__.register(__chartData, '__chartData', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/reportData/index.js');
}();

;

/***/ }),
/* 211 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _decimals = __webpack_require__(195);

var _decimals2 = _interopRequireDefault(_decimals);

var _TableHeader2 = __webpack_require__(300);

var _TableHeader3 = _interopRequireDefault(_TableHeader2);

var _ReportHeaderTemplate = __webpack_require__(159);

var _ReportHeaderTemplate2 = _interopRequireDefault(_ReportHeaderTemplate);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReportTable = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      },
      ratio: {},
      year: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportFarmClients[0];
    var ratio = filters.FinanceRatioId;
    var year = filters.FinancialYearId;

    this.setState({
      ratio: ratio,
      year: year
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;
    this.setState({
      report: report
    });
  },
  render: function render() {
    var _this = this;

    var ComparisonReport__tableWrapper = (0, _classnames2.default)({
      ComparisonReport__tableWrapper: true,
      'menu-open': this.props.menuOpen
    });

    if (!this.state.report.hasData) return null;

    var MAX_COLS = this.props.IsLandscape ? 15 : 8;

    var DairyBaseRow = _.find(this.state.report.tables.TextTable, function (row) {
      return row.Props.Label === 'DairyBase Id';
    });

    var colLength = DairyBaseRow.cols.length;

    var renderNumber = Math.ceil(colLength / MAX_COLS);

    var tableArray = [];

    for (var i = 0; i < renderNumber; i++) {
      tableArray.push(i + 1);
    }

    return _react2.default.createElement(
      'div',
      {
        style: {
          marginTop: 0
        },
        className: '\n          ' + ComparisonReport__tableWrapper + '\n          ' + (this.props.activeTab.id === 'cash' ? ' __condenseRows__ ' : ' ') + '\n        ' },
      this.props.isPrinting ? tableArray.map(function (id, i) {
        return _react2.default.createElement(
          _react2.default.Fragment,
          { key: id },
          _react2.default.createElement(
            _ReportHeaderTemplate2.default,
            _extends({}, _this.props, {
              isSplit: i > 0,
              isPrinting: true,
              tableSplitIndex: i }),
            _react2.default.createElement(_TableHeader3.default, { isPrinting: true, tableSplitIndex: i })
          ),
          _react2.default.createElement(
            'div',
            { className: 'ComparisonReportTable' },
            _this._renderRows(i)
          )
        );
      }) : _react2.default.createElement(
        _react2.default.Fragment,
        null,
        _react2.default.createElement(
          _ReportHeaderTemplate2.default,
          this.props,
          _react2.default.createElement(_TableHeader3.default, null)
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable' },
          this._renderRows(0)
        )
      )
    );
  },
  _renderRows: function _renderRows(i) {
    var _this2 = this;

    var MAX_COLS = this.props.IsLandscape ? 15 : 8;
    return this.state.report.tables[this.props.activeTab.table].map(function (row, index) {
      // 0    1     2
      // 0-7, 8-15, 16-...
      var startIndex = i * MAX_COLS;
      var endIndex = startIndex + MAX_COLS;

      var printCols = row.cols.slice(startIndex, endIndex);

      var _cols = _this2.props.isPrinting ? printCols : row.cols;

      var isHeading = row.Props.Hierachy === 1 && _cols.length === 0;

      var _colArr = [];

      if (isHeading) {
        var colLength = row.colLength;

        var _maxColLength = _this2.props.isPrinting ? MAX_COLS : colLength;
        for (var step = 0; step < _maxColLength; step++) {
          // Runs 5 times, with values of step 0 through 4.
          _colArr.push(step);
        }
      }

      var FarmClientReportTable__row = (0, _classnames2.default)({
        FarmClientReportTable__row: true,
        'is-total': row.Props.Hierachy === 5,
        'is-row-heading': isHeading
      });

      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: FarmClientReportTable__row + ' is-h' + row.Props.Hierachy },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: row.Props.Label,
              description: row.Props.Description
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__data' },
          isHeading && _cols.length === 0 && _colArr.map(function (c) {
            return _react2.default.createElement('div', { key: c, style: { width: '80px' } });
          }),
          _cols.map(function (col, index) {
            return _this2._renderValueRatios(col, index);
          })
        )
      );
    });
  },
  _renderValueRatios: function _renderValueRatios(baseValue, index) {
    if (baseValue.props.Dynamic) {
      var fnMap = ['NotDefined', 'PercentOfIncome', 'PerCow', 'PerKgMS', 'PerMilkingHa', 'PerUsableHa', 'DollarsPerLitre', 'CentsPerLitre', 'RawValue'];

      var selectedRatioId = this.state.ratio.Value;

      var fnId = fnMap[selectedRatioId];
      var caculation = (0, _decimals2.default)(fnId);
      var value = caculation.fn(baseValue.value);

      return _react2.default.createElement(
        'div',
        { key: index, className: '_col' },
        value
      );
    }

    return _react2.default.createElement(
      'div',
      { key: index, className: '_col' },
      (0, _commas.addCommas)(baseValue.value),
      baseValue.props.Percent ? '%' : null
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReportTable, 'ComparisonReportTable', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_Table/index.jsx');
}();

;

/***/ }),
/* 212 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1181);

var _index2 = _interopRequireDefault(_index);

var _newStyle = __webpack_require__(1011);

var _newStyle2 = _interopRequireDefault(_newStyle);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetList2 = __webpack_require__(10);

var _datasetList3 = _interopRequireDefault(_datasetList2);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilteringDatasetList = __webpack_require__(155);

var _FilteringDatasetList2 = _interopRequireDefault(_FilteringDatasetList);

var _SmallFilterBar = __webpack_require__(290);

var _SmallFilterBar2 = _interopRequireDefault(_SmallFilterBar);

var _SelectedList = __webpack_require__(698);

var _SelectedList2 = _interopRequireDefault(_SelectedList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList3.default, "_handleNewData"), (0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      datasetList: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewData();
  },
  _handleNewData: function _handleNewData() {
    var _datasetList = (0, _filterVisibleDatasets2.default)();

    var selectedDatasets = this.props.selectedDatasets;


    var existingDatasets = _.map(_datasetList, 'Id');
    var validSelectedIds = _.intersection(selectedDatasets, existingDatasets);

    this.props.emitChangeDatasets(validSelectedIds);

    this.setState({
      datasetList: _datasetList
    });
  },
  _reorderSelected: function _reorderSelected(newArr) {
    this.props.emitChangeDatasets(newArr);
  },
  _addToSelected: function _addToSelected(id) {
    var selectedList = this.props.selectedDatasets;
    if (_.includes(selectedList, id)) return this._removeFromSelected(id);
    if (selectedList.length === 6) return;

    var newArr = selectedList;
    newArr.push(id);

    this.props.emitChangeDatasets(newArr);
  },
  _removeFromSelected: function _removeFromSelected(id) {
    var newArr = this.props.selectedDatasets.filter(function (item) {
      return item !== id;
    });

    this.props.emitChangeDatasets(newArr);
  },
  _handleDatasetItemClick: function _handleDatasetItemClick(item) {
    this._addToSelected(item.Id);
  },
  _handleTransitionToFilters: function _handleTransitionToFilters() {
    this.props.emitChangeStep('filter');
  },
  _clearAllDatasets: function _clearAllDatasets() {
    var selectedDatasets = this.props.selectedDatasets;


    if (selectedDatasets.length === 0) return;

    return this.props.emitChangeDatasets([]);
  },
  render: function render() {

    var noSelected = this.props.selectedDatasets.length === 0;

    return _react2.default.createElement(
      'div',
      { className: 'ComparisonReport__Datasets' },
      _react2.default.createElement(
        _Portal2.default,
        {
          context: this.props.bannerDOMRef,
          isOpen: this.state.permaPortalOpen },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReport__BannerPortal', style: { right: (0, _getScrollbarWidth2.default)() } },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_SmallFilterBar2.default, null),
            _react2.default.createElement(_SelectedList2.default, {
              maxDatasets: 6,
              datasetList: this.state.datasetList,
              selected: this.props.selectedDatasets,
              emitRemoveFromSelected: this._removeFromSelected,
              reorder: this._reorderSelected,
              _emitTransitionToFilters: this._handleTransitionToFilters })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(
          'button',
          {
            className: _newStyle2.default.allButton + ' ' + (noSelected ? _newStyle2.default.disabled : ''),
            onClick: this._clearAllDatasets },
          'Clear All'
        ),
        _react2.default.createElement(_FilteringDatasetList2.default, {
          list: this.state.datasetList,
          selectedList: this.props.selectedDatasets,
          emitItemClick: this._handleDatasetItemClick })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/index.jsx');
}();

;

/***/ }),
/* 213 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1182);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportStepTemplate = __webpack_require__(164);

var _ReportStepTemplate2 = _interopRequireDefault(_ReportStepTemplate);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__generateReport = __webpack_require__(146);

var _POST__generateReport2 = _interopRequireDefault(_POST__generateReport);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_user2.default, "handleUserUpdate")],

  getInitialState: function getInitialState() {
    return {
      prefillIds: this.props.prefillDatasetIds,
      selectedDatasets: [],
      reportRequestPortalOpen: false,
      reportLoaded: false,
      approvedStep: 0
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleUserUpdate();
  },
  componentWillUnmount: function componentWillUnmount() {
    this._handlePostDatasetChange();
  },
  getReportKey: function getReportKey() {
    switch (this.props.reportId) {
      case 2:
        return 'StdComparisonDatasetIdArray';
      case 3:
        return 'FarmSizeDatasetIdArray';
      case 4:
        return 'FarmHistoryDatasetIdArray';

      // this uses a different template i think, but will leave it here anyway
      case 5:
        return 'BulkComparisonDatasetIdArray';

      default:
        return 'StdComparisonDatasetIdArray';
    }
  },
  handleUserUpdate: function handleUserUpdate() {
    var prefillIds = this.state.prefillIds;

    var _datasetObj = _user2.default.store[this.getReportKey()] || {};
    var arr = _datasetObj.Value || [];
    this.setState({
      selectedDatasets: prefillIds || arr
    });
  },
  _handlePostDatasetChange: function _handlePostDatasetChange() {
    return _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      "Element": this.getReportKey(),
      "Value": this.state.selectedDatasets
    });
  },
  _handleDatasetSelection: function _handleDatasetSelection(newList) {
    this.setState({
      selectedDatasets: newList,
      approvedStep: newList.length >= 1 ? 1 : 0
    });
  },
  _handleFilterChange: function _handleFilterChange() {
    this.setState({
      approvedStep: 1
    });
  },
  _toggleReportRequestPortal: function _toggleReportRequestPortal() {
    this.setState({
      reportRequestPortalOpen: !this.state.reportRequestPortalOpen
    });
  },
  _handleLoadReportSuccess: function _handleLoadReportSuccess() {
    var _this = this;

    this.setState({
      reportLoaded: true,
      approvedStep: 2
    }, function () {
      _this._toggleReportRequestPortal();
      _this.setState({
        reportLoaded: false
      });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ComparisonReport' },
      _react2.default.createElement(_ReportStepTemplate2.default, {
        emitResetScroll: this.props.emitResetScroll,
        approvedStep: this.state.approvedStep,
        emitFilterChange: this._handleFilterChange,
        reportLoaded: this.state.reportLoaded,
        emitGenerateReport: this._toggleReportRequestPortal,
        selectedDatasets: this.state.selectedDatasets,
        bannerDOMRef: this.props.bannerDOMRef,
        emitChangeDatasets: this._handleDatasetSelection,
        steps: this.props.steps
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.reportRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleLoadReportSuccess,
          failHandler: this._toggleReportRequestPortal,
          request: _POST__generateReport2.default,
          data: {
            ReportId: this.props.reportId,
            FarmDataSetList: this.state.selectedDatasets
          },
          pendingText: {
            title: 'Please wait',
            text: 'Generating Report'
          },
          successText: {
            title: 'Success!',
            text: 'Report generated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Your report could not be generated.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport, 'ComparisonReport', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/index.jsx');
}();

;

/***/ }),
/* 214 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var at = __webpack_require__(176)(true);

 // `AdvanceStringIndex` abstract operation
// https://tc39.github.io/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
  return index + (unicode ? at(S, index).length : 1);
};


/***/ }),
/* 215 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)

var toObject = __webpack_require__(35);
var toAbsoluteIndex = __webpack_require__(102);
var toLength = __webpack_require__(27);
module.exports = function fill(value /* , start = 0, end = @length */) {
  var O = toObject(this);
  var length = toLength(O.length);
  var aLen = arguments.length;
  var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
  var end = aLen > 2 ? arguments[2] : undefined;
  var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
  while (endPos > index) O[index++] = value;
  return O;
};


/***/ }),
/* 216 */
/***/ (function(module, exports, __webpack_require__) {

// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var speciesConstructor = __webpack_require__(718);

module.exports = function (original, length) {
  return new (speciesConstructor(original))(length);
};


/***/ }),
/* 217 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $defineProperty = __webpack_require__(31);
var createDesc = __webpack_require__(99);

module.exports = function (object, index, value) {
  if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  else object[index] = value;
};


/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(22);
var document = __webpack_require__(16).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
  return is ? document.createElement(it) : {};
};


/***/ }),
/* 219 */
/***/ (function(module, exports) {

// IE 8- don't enum bug keys
module.exports = (
  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');


/***/ }),
/* 220 */
/***/ (function(module, exports, __webpack_require__) {

var MATCH = __webpack_require__(26)('match');
module.exports = function (KEY) {
  var re = /./;
  try {
    '/./'[KEY](re);
  } catch (e) {
    try {
      re[MATCH] = false;
      return !'/./'[KEY](re);
    } catch (f) { /* empty */ }
  } return true;
};


/***/ }),
/* 221 */
/***/ (function(module, exports, __webpack_require__) {

var document = __webpack_require__(16).document;
module.exports = document && document.documentElement;


/***/ }),
/* 222 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(22);
var setPrototypeOf = __webpack_require__(231).set;
module.exports = function (that, target, C) {
  var S = target.constructor;
  var P;
  if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
    setPrototypeOf(that, P);
  } return that;
};


/***/ }),
/* 223 */
/***/ (function(module, exports, __webpack_require__) {

// check on default Array iterator
var Iterators = __webpack_require__(114);
var ITERATOR = __webpack_require__(26)('iterator');
var ArrayProto = Array.prototype;

module.exports = function (it) {
  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};


/***/ }),
/* 224 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var create = __webpack_require__(96);
var descriptor = __webpack_require__(99);
var setToStringTag = __webpack_require__(115);
var IteratorPrototype = {};

// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(48)(IteratorPrototype, __webpack_require__(26)('iterator'), function () { return this; });

module.exports = function (Constructor, NAME, next) {
  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  setToStringTag(Constructor, NAME + ' Iterator');
};


/***/ }),
/* 225 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var LIBRARY = __webpack_require__(81);
var $export = __webpack_require__(2);
var redefine = __webpack_require__(49);
var hide = __webpack_require__(48);
var Iterators = __webpack_require__(114);
var $iterCreate = __webpack_require__(224);
var setToStringTag = __webpack_require__(115);
var getPrototypeOf = __webpack_require__(54);
var ITERATOR = __webpack_require__(26)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';

var returnThis = function () { return this; };

module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  $iterCreate(Constructor, NAME, next);
  var getMethod = function (kind) {
    if (!BUGGY && kind in proto) return proto[kind];
    switch (kind) {
      case KEYS: return function keys() { return new Constructor(this, kind); };
      case VALUES: return function values() { return new Constructor(this, kind); };
    } return function entries() { return new Constructor(this, kind); };
  };
  var TAG = NAME + ' Iterator';
  var DEF_VALUES = DEFAULT == VALUES;
  var VALUES_BUG = false;
  var proto = Base.prototype;
  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  var $default = $native || getMethod(DEFAULT);
  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  var methods, key, IteratorPrototype;
  // Fix native
  if ($anyNative) {
    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
      // Set @@toStringTag to native iterators
      setToStringTag(IteratorPrototype, TAG, true);
      // fix for some old engines
      if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
    }
  }
  // fix Array#{values, @@iterator}.name in V8 / FF
  if (DEF_VALUES && $native && $native.name !== VALUES) {
    VALUES_BUG = true;
    $default = function values() { return $native.call(this); };
  }
  // Define iterator
  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
    hide(proto, ITERATOR, $default);
  }
  // Plug for library
  Iterators[NAME] = $default;
  Iterators[TAG] = returnThis;
  if (DEFAULT) {
    methods = {
      values: DEF_VALUES ? $default : getMethod(VALUES),
      keys: IS_SET ? $default : getMethod(KEYS),
      entries: $entries
    };
    if (FORCED) for (key in methods) {
      if (!(key in proto)) redefine(proto, key, methods[key]);
    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  }
  return methods;
};


/***/ }),
/* 226 */
/***/ (function(module, exports) {

// 20.2.2.14 Math.expm1(x)
var $expm1 = Math.expm1;
module.exports = (!$expm1
  // Old FF bug
  || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
  // Tor Browser bug
  || $expm1(-2e-17) != -2e-17
) ? function expm1(x) {
  return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
} : $expm1;


/***/ }),
/* 227 */
/***/ (function(module, exports) {

// 20.2.2.28 Math.sign(x)
module.exports = Math.sign || function sign(x) {
  // eslint-disable-next-line no-self-compare
  return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};


/***/ }),
/* 228 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var macrotask = __webpack_require__(236).set;
var Observer = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
var Promise = global.Promise;
var isNode = __webpack_require__(56)(process) == 'process';

module.exports = function () {
  var head, last, notify;

  var flush = function () {
    var parent, fn;
    if (isNode && (parent = process.domain)) parent.exit();
    while (head) {
      fn = head.fn;
      head = head.next;
      try {
        fn();
      } catch (e) {
        if (head) notify();
        else last = undefined;
        throw e;
      }
    } last = undefined;
    if (parent) parent.enter();
  };

  // Node.js
  if (isNode) {
    notify = function () {
      process.nextTick(flush);
    };
  // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  } else if (Observer && !(global.navigator && global.navigator.standalone)) {
    var toggle = true;
    var node = document.createTextNode('');
    new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
    notify = function () {
      node.data = toggle = !toggle;
    };
  // environments with maybe non-completely correct, but existent Promise
  } else if (Promise && Promise.resolve) {
    // Promise.resolve without an argument throws an error in LG WebOS 2
    var promise = Promise.resolve(undefined);
    notify = function () {
      promise.then(flush);
    };
  // for other environments - macrotask based on:
  // - setImmediate
  // - MessageChannel
  // - window.postMessag
  // - onreadystatechange
  // - setTimeout
  } else {
    notify = function () {
      // strange IE + webpack dev server bug - use .call(global)
      macrotask.call(global, flush);
    };
  }

  return function (fn) {
    var task = { fn: fn, next: undefined };
    if (last) last.next = task;
    if (!head) {
      head = task;
      notify();
    } last = task;
  };
};


/***/ }),
/* 229 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 25.4.1.5 NewPromiseCapability(C)
var aFunction = __webpack_require__(42);

function PromiseCapability(C) {
  var resolve, reject;
  this.promise = new C(function ($$resolve, $$reject) {
    if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
    resolve = $$resolve;
    reject = $$reject;
  });
  this.resolve = aFunction(resolve);
  this.reject = aFunction(reject);
}

module.exports.f = function (C) {
  return new PromiseCapability(C);
};


/***/ }),
/* 230 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var regexpFlags = __webpack_require__(135);

var nativeExec = RegExp.prototype.exec;
// This always refers to the native implementation, because the
// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
// which loads this file before patching the method.
var nativeReplace = String.prototype.replace;

var patchedExec = nativeExec;

var LAST_INDEX = 'lastIndex';

var UPDATES_LAST_INDEX_WRONG = (function () {
  var re1 = /a/,
      re2 = /b*/g;
  nativeExec.call(re1, 'a');
  nativeExec.call(re2, 'a');
  return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
})();

// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;

var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;

if (PATCH) {
  patchedExec = function exec(str) {
    var re = this;
    var lastIndex, reCopy, match, i;

    if (NPCG_INCLUDED) {
      reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
    }
    if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];

    match = nativeExec.call(re, str);

    if (UPDATES_LAST_INDEX_WRONG && match) {
      re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
    }
    if (NPCG_INCLUDED && match && match.length > 1) {
      // Fix browsers whose `exec` methods don't consistently return `undefined`
      // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
      // eslint-disable-next-line no-loop-func
      nativeReplace.call(match[0], reCopy, function () {
        for (i = 1; i < arguments.length - 2; i++) {
          if (arguments[i] === undefined) match[i] = undefined;
        }
      });
    }

    return match;
  };
}

module.exports = patchedExec;


/***/ }),
/* 231 */
/***/ (function(module, exports, __webpack_require__) {

// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
var isObject = __webpack_require__(22);
var anObject = __webpack_require__(11);
var check = function (O, proto) {
  anObject(O);
  if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
};
module.exports = {
  set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
    function (test, buggy, set) {
      try {
        set = __webpack_require__(58)(Function.call, __webpack_require__(53).f(Object.prototype, '__proto__').set, 2);
        set(test, []);
        buggy = !(test instanceof Array);
      } catch (e) { buggy = true; }
      return function setPrototypeOf(O, proto) {
        check(O, proto);
        if (buggy) O.__proto__ = proto;
        else set(O, proto);
        return O;
      };
    }({}, false) : undefined),
  check: check
};


/***/ }),
/* 232 */
/***/ (function(module, exports, __webpack_require__) {

var shared = __webpack_require__(138)('keys');
var uid = __webpack_require__(103);
module.exports = function (key) {
  return shared[key] || (shared[key] = uid(key));
};


/***/ }),
/* 233 */
/***/ (function(module, exports, __webpack_require__) {

// helper for String#{startsWith, endsWith, includes}
var isRegExp = __webpack_require__(169);
var defined = __webpack_require__(66);

module.exports = function (that, searchString, NAME) {
  if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
  return String(defined(that));
};


/***/ }),
/* 234 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var toInteger = __webpack_require__(60);
var defined = __webpack_require__(66);

module.exports = function repeat(count) {
  var str = String(defined(this));
  var res = '';
  var n = toInteger(count);
  if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
  for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
  return res;
};


/***/ }),
/* 235 */
/***/ (function(module, exports) {

module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
  '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';


/***/ }),
/* 236 */
/***/ (function(module, exports, __webpack_require__) {

var ctx = __webpack_require__(58);
var invoke = __webpack_require__(322);
var html = __webpack_require__(221);
var cel = __webpack_require__(218);
var global = __webpack_require__(16);
var process = global.process;
var setTask = global.setImmediate;
var clearTask = global.clearImmediate;
var MessageChannel = global.MessageChannel;
var Dispatch = global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer, channel, port;
var run = function () {
  var id = +this;
  // eslint-disable-next-line no-prototype-builtins
  if (queue.hasOwnProperty(id)) {
    var fn = queue[id];
    delete queue[id];
    fn();
  }
};
var listener = function (event) {
  run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!setTask || !clearTask) {
  setTask = function setImmediate(fn) {
    var args = [];
    var i = 1;
    while (arguments.length > i) args.push(arguments[i++]);
    queue[++counter] = function () {
      // eslint-disable-next-line no-new-func
      invoke(typeof fn == 'function' ? fn : Function(fn), args);
    };
    defer(counter);
    return counter;
  };
  clearTask = function clearImmediate(id) {
    delete queue[id];
  };
  // Node.js 0.8-
  if (__webpack_require__(56)(process) == 'process') {
    defer = function (id) {
      process.nextTick(ctx(run, id, 1));
    };
  // Sphere (JS game engine) Dispatch API
  } else if (Dispatch && Dispatch.now) {
    defer = function (id) {
      Dispatch.now(ctx(run, id, 1));
    };
  // Browsers with MessageChannel, includes WebWorkers
  } else if (MessageChannel) {
    channel = new MessageChannel();
    port = channel.port2;
    channel.port1.onmessage = listener;
    defer = ctx(port.postMessage, port, 1);
  // Browsers with postMessage, skip WebWorkers
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
    defer = function (id) {
      global.postMessage(id + '', '*');
    };
    global.addEventListener('message', listener, false);
  // IE8-
  } else if (ONREADYSTATECHANGE in cel('script')) {
    defer = function (id) {
      html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
        html.removeChild(this);
        run.call(id);
      };
    };
  // Rest old browsers
  } else {
    defer = function (id) {
      setTimeout(ctx(run, id, 1), 0);
    };
  }
}
module.exports = {
  set: setTask,
  clear: clearTask
};


/***/ }),
/* 237 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var global = __webpack_require__(16);
var DESCRIPTORS = __webpack_require__(30);
var LIBRARY = __webpack_require__(81);
var $typed = __webpack_require__(177);
var hide = __webpack_require__(48);
var redefineAll = __webpack_require__(100);
var fails = __webpack_require__(20);
var anInstance = __webpack_require__(94);
var toInteger = __webpack_require__(60);
var toLength = __webpack_require__(27);
var toIndex = __webpack_require__(341);
var gOPN = __webpack_require__(97).f;
var dP = __webpack_require__(31).f;
var arrayFill = __webpack_require__(215);
var setToStringTag = __webpack_require__(115);
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length!';
var WRONG_INDEX = 'Wrong index!';
var $ArrayBuffer = global[ARRAY_BUFFER];
var $DataView = global[DATA_VIEW];
var Math = global.Math;
var RangeError = global.RangeError;
// eslint-disable-next-line no-shadow-restricted-names
var Infinity = global.Infinity;
var BaseBuffer = $ArrayBuffer;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var BUFFER = 'buffer';
var BYTE_LENGTH = 'byteLength';
var BYTE_OFFSET = 'byteOffset';
var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;

// IEEE754 conversions based on https://github.com/feross/ieee754
function packIEEE754(value, mLen, nBytes) {
  var buffer = new Array(nBytes);
  var eLen = nBytes * 8 - mLen - 1;
  var eMax = (1 << eLen) - 1;
  var eBias = eMax >> 1;
  var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
  var i = 0;
  var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  var e, m, c;
  value = abs(value);
  // eslint-disable-next-line no-self-compare
  if (value != value || value === Infinity) {
    // eslint-disable-next-line no-self-compare
    m = value != value ? 1 : 0;
    e = eMax;
  } else {
    e = floor(log(value) / LN2);
    if (value * (c = pow(2, -e)) < 1) {
      e--;
      c *= 2;
    }
    if (e + eBias >= 1) {
      value += rt / c;
    } else {
      value += rt * pow(2, 1 - eBias);
    }
    if (value * c >= 2) {
      e++;
      c /= 2;
    }
    if (e + eBias >= eMax) {
      m = 0;
      e = eMax;
    } else if (e + eBias >= 1) {
      m = (value * c - 1) * pow(2, mLen);
      e = e + eBias;
    } else {
      m = value * pow(2, eBias - 1) * pow(2, mLen);
      e = 0;
    }
  }
  for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
  e = e << mLen | m;
  eLen += mLen;
  for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
  buffer[--i] |= s * 128;
  return buffer;
}
function unpackIEEE754(buffer, mLen, nBytes) {
  var eLen = nBytes * 8 - mLen - 1;
  var eMax = (1 << eLen) - 1;
  var eBias = eMax >> 1;
  var nBits = eLen - 7;
  var i = nBytes - 1;
  var s = buffer[i--];
  var e = s & 127;
  var m;
  s >>= 7;
  for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
  m = e & (1 << -nBits) - 1;
  e >>= -nBits;
  nBits += mLen;
  for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
  if (e === 0) {
    e = 1 - eBias;
  } else if (e === eMax) {
    return m ? NaN : s ? -Infinity : Infinity;
  } else {
    m = m + pow(2, mLen);
    e = e - eBias;
  } return (s ? -1 : 1) * m * pow(2, e - mLen);
}

function unpackI32(bytes) {
  return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
}
function packI8(it) {
  return [it & 0xff];
}
function packI16(it) {
  return [it & 0xff, it >> 8 & 0xff];
}
function packI32(it) {
  return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
}
function packF64(it) {
  return packIEEE754(it, 52, 8);
}
function packF32(it) {
  return packIEEE754(it, 23, 4);
}

function addGetter(C, key, internal) {
  dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
}

function get(view, bytes, index, isLittleEndian) {
  var numIndex = +index;
  var intIndex = toIndex(numIndex);
  if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  var store = view[$BUFFER]._b;
  var start = intIndex + view[$OFFSET];
  var pack = store.slice(start, start + bytes);
  return isLittleEndian ? pack : pack.reverse();
}
function set(view, bytes, index, conversion, value, isLittleEndian) {
  var numIndex = +index;
  var intIndex = toIndex(numIndex);
  if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
  var store = view[$BUFFER]._b;
  var start = intIndex + view[$OFFSET];
  var pack = conversion(+value);
  for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
}

if (!$typed.ABV) {
  $ArrayBuffer = function ArrayBuffer(length) {
    anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
    var byteLength = toIndex(length);
    this._b = arrayFill.call(new Array(byteLength), 0);
    this[$LENGTH] = byteLength;
  };

  $DataView = function DataView(buffer, byteOffset, byteLength) {
    anInstance(this, $DataView, DATA_VIEW);
    anInstance(buffer, $ArrayBuffer, DATA_VIEW);
    var bufferLength = buffer[$LENGTH];
    var offset = toInteger(byteOffset);
    if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
    byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
    if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
    this[$BUFFER] = buffer;
    this[$OFFSET] = offset;
    this[$LENGTH] = byteLength;
  };

  if (DESCRIPTORS) {
    addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
    addGetter($DataView, BUFFER, '_b');
    addGetter($DataView, BYTE_LENGTH, '_l');
    addGetter($DataView, BYTE_OFFSET, '_o');
  }

  redefineAll($DataView[PROTOTYPE], {
    getInt8: function getInt8(byteOffset) {
      return get(this, 1, byteOffset)[0] << 24 >> 24;
    },
    getUint8: function getUint8(byteOffset) {
      return get(this, 1, byteOffset)[0];
    },
    getInt16: function getInt16(byteOffset /* , littleEndian */) {
      var bytes = get(this, 2, byteOffset, arguments[1]);
      return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
    },
    getUint16: function getUint16(byteOffset /* , littleEndian */) {
      var bytes = get(this, 2, byteOffset, arguments[1]);
      return bytes[1] << 8 | bytes[0];
    },
    getInt32: function getInt32(byteOffset /* , littleEndian */) {
      return unpackI32(get(this, 4, byteOffset, arguments[1]));
    },
    getUint32: function getUint32(byteOffset /* , littleEndian */) {
      return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
    },
    getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
      return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
    },
    getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
      return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
    },
    setInt8: function setInt8(byteOffset, value) {
      set(this, 1, byteOffset, packI8, value);
    },
    setUint8: function setUint8(byteOffset, value) {
      set(this, 1, byteOffset, packI8, value);
    },
    setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
      set(this, 2, byteOffset, packI16, value, arguments[2]);
    },
    setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
      set(this, 2, byteOffset, packI16, value, arguments[2]);
    },
    setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
      set(this, 4, byteOffset, packI32, value, arguments[2]);
    },
    setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
      set(this, 4, byteOffset, packI32, value, arguments[2]);
    },
    setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
      set(this, 4, byteOffset, packF32, value, arguments[2]);
    },
    setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
      set(this, 8, byteOffset, packF64, value, arguments[2]);
    }
  });
} else {
  if (!fails(function () {
    $ArrayBuffer(1);
  }) || !fails(function () {
    new $ArrayBuffer(-1); // eslint-disable-line no-new
  }) || fails(function () {
    new $ArrayBuffer(); // eslint-disable-line no-new
    new $ArrayBuffer(1.5); // eslint-disable-line no-new
    new $ArrayBuffer(NaN); // eslint-disable-line no-new
    return $ArrayBuffer.name != ARRAY_BUFFER;
  })) {
    $ArrayBuffer = function ArrayBuffer(length) {
      anInstance(this, $ArrayBuffer);
      return new BaseBuffer(toIndex(length));
    };
    var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
    for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
      if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
    }
    if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
  }
  // iOS Safari 7.x bug
  var view = new $DataView(new $ArrayBuffer(2));
  var $setInt8 = $DataView[PROTOTYPE].setInt8;
  view.setInt8(0, 2147483648);
  view.setInt8(1, 2147483649);
  if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
    setInt8: function setInt8(byteOffset, value) {
      $setInt8.call(this, byteOffset, value << 24 >> 24);
    },
    setUint8: function setUint8(byteOffset, value) {
      $setInt8.call(this, byteOffset, value << 24 >> 24);
    }
  }, true);
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
hide($DataView[PROTOTYPE], $typed.VIEW, true);
exports[ARRAY_BUFFER] = $ArrayBuffer;
exports[DATA_VIEW] = $DataView;


/***/ }),
/* 238 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var core = __webpack_require__(57);
var LIBRARY = __webpack_require__(81);
var wksExt = __webpack_require__(342);
var defineProperty = __webpack_require__(31).f;
module.exports = function (name) {
  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
};


/***/ }),
/* 239 */
/***/ (function(module, exports, __webpack_require__) {

var classof = __webpack_require__(113);
var ITERATOR = __webpack_require__(26)('iterator');
var Iterators = __webpack_require__(114);
module.exports = __webpack_require__(57).getIteratorMethod = function (it) {
  if (it != undefined) return it[ITERATOR]
    || it['@@iterator']
    || Iterators[classof(it)];
};


/***/ }),
/* 240 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var addToUnscopables = __webpack_require__(80);
var step = __webpack_require__(325);
var Iterators = __webpack_require__(114);
var toIObject = __webpack_require__(55);

// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(225)(Array, 'Array', function (iterated, kind) {
  this._t = toIObject(iterated); // target
  this._i = 0;                   // next index
  this._k = kind;                // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var kind = this._k;
  var index = this._i++;
  if (!O || index >= O.length) {
    this._t = undefined;
    return step(1);
  }
  if (kind == 'keys') return step(0, index);
  if (kind == 'values') return step(0, O[index]);
  return step(0, [index, O[index]]);
}, 'values');

// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;

addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');


/***/ }),
/* 241 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(1215);

module.exports = Function.prototype.bind || implementation;


/***/ }),
/* 242 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/**
 * Copyright 2015, Yahoo! Inc.
 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */
var ReactIs = __webpack_require__(142);
var REACT_STATICS = {
    childContextTypes: true,
    contextType: true,
    contextTypes: true,
    defaultProps: true,
    displayName: true,
    getDefaultProps: true,
    getDerivedStateFromError: true,
    getDerivedStateFromProps: true,
    mixins: true,
    propTypes: true,
    type: true
};

var KNOWN_STATICS = {
    name: true,
    length: true,
    prototype: true,
    caller: true,
    callee: true,
    arguments: true,
    arity: true
};

var FORWARD_REF_STATICS = {
    '$$typeof': true,
    render: true,
    defaultProps: true,
    displayName: true,
    propTypes: true
};

var MEMO_STATICS = {
    '$$typeof': true,
    compare: true,
    defaultProps: true,
    displayName: true,
    propTypes: true,
    type: true
};

var TYPE_STATICS = {};
TYPE_STATICS[ReactIs.ForwardRef] = FORWARD_REF_STATICS;

function getStatics(component) {
    if (ReactIs.isMemo(component)) {
        return MEMO_STATICS;
    }
    return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}

var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;

function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
    if (typeof sourceComponent !== 'string') {
        // don't hoist over string (html) components

        if (objectPrototype) {
            var inheritedComponent = getPrototypeOf(sourceComponent);
            if (inheritedComponent && inheritedComponent !== objectPrototype) {
                hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
            }
        }

        var keys = getOwnPropertyNames(sourceComponent);

        if (getOwnPropertySymbols) {
            keys = keys.concat(getOwnPropertySymbols(sourceComponent));
        }

        var targetStatics = getStatics(targetComponent);
        var sourceStatics = getStatics(sourceComponent);

        for (var i = 0; i < keys.length; ++i) {
            var key = keys[i];
            if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
                var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
                try {
                    // Avoid failures from read-only properties
                    defineProperty(targetComponent, key, descriptor);
                } catch (e) {}
            }
        }

        return targetComponent;
    }

    return targetComponent;
}

module.exports = hoistNonReactStatics;


/***/ }),
/* 243 */
/***/ (function(module, exports, __webpack_require__) {

var invariant = __webpack_require__(32);

var hasOwnProperty = Object.prototype.hasOwnProperty;
var splice = Array.prototype.splice;

var toString = Object.prototype.toString
var type = function(obj) {
  return toString.call(obj).slice(8, -1);
}

var assign = Object.assign || /* istanbul ignore next */ function assign(target, source) {
  getAllKeys(source).forEach(function(key) {
    if (hasOwnProperty.call(source, key)) {
      target[key] = source[key];
    }
  });
  return target;
};

var getAllKeys = typeof Object.getOwnPropertySymbols === 'function' ?
  function(obj) { return Object.keys(obj).concat(Object.getOwnPropertySymbols(obj)) } :
  /* istanbul ignore next */ function(obj) { return Object.keys(obj) };

/* istanbul ignore next */
function copy(object) {
  if (Array.isArray(object)) {
    return assign(object.constructor(object.length), object)
  } else if (type(object) === 'Map') {
    return new Map(object)
  } else if (type(object) === 'Set') {
    return new Set(object)
  } else if (object && typeof object === 'object') {
    var prototype = object.constructor && object.constructor.prototype
    return assign(Object.create(prototype || null), object);
  } else {
    return object;
  }
}

function newContext() {
  var commands = assign({}, defaultCommands);
  update.extend = function(directive, fn) {
    commands[directive] = fn;
  };
  update.isEquals = function(a, b) { return a === b; };

  return update;

  function update(object, spec) {
    if (!(Array.isArray(object) && Array.isArray(spec))) {
      invariant(
        !Array.isArray(spec),
        'update(): You provided an invalid spec to update(). The spec may ' +
        'not contain an array except as the value of $set, $push, $unshift, ' +
        '$splice or any custom command allowing an array value.'
      );
    }

    invariant(
      typeof spec === 'object' && spec !== null,
      'update(): You provided an invalid spec to update(). The spec and ' +
      'every included key path must be plain objects containing one of the ' +
      'following commands: %s.',
      Object.keys(commands).join(', ')
    );

    var nextObject = object;
    var index, key;
    getAllKeys(spec).forEach(function(key) {
      if (hasOwnProperty.call(commands, key)) {
        var objectWasNextObject = object === nextObject;
        nextObject = commands[key](spec[key], nextObject, spec, object);
        if (objectWasNextObject && update.isEquals(nextObject, object)) {
          nextObject = object;
        }
      } else {
        var nextValueForKey = update(object[key], spec[key]);
        if (!update.isEquals(nextValueForKey, nextObject[key]) || typeof nextValueForKey === 'undefined' && !hasOwnProperty.call(object, key)) {
          if (nextObject === object) {
            nextObject = copy(object);
          }
          nextObject[key] = nextValueForKey;
        }
      }
    })
    return nextObject;
  }

}

var defaultCommands = {
  $push: function(value, nextObject, spec) {
    invariantPushAndUnshift(nextObject, spec, '$push');
    return value.length ? nextObject.concat(value) : nextObject;
  },
  $unshift: function(value, nextObject, spec) {
    invariantPushAndUnshift(nextObject, spec, '$unshift');
    return value.length ? value.concat(nextObject) : nextObject;
  },
  $splice: function(value, nextObject, spec, originalObject) {
    invariantSplices(nextObject, spec);
    value.forEach(function(args) {
      invariantSplice(args);
      if (nextObject === originalObject && args.length) nextObject = copy(originalObject);
      splice.apply(nextObject, args);
    });
    return nextObject;
  },
  $set: function(value, nextObject, spec) {
    invariantSet(spec);
    return value;
  },
  $toggle: function(targets, nextObject) {
    invariantSpecArray(targets, '$toggle');
    var nextObjectCopy = targets.length ? copy(nextObject) : nextObject;

    targets.forEach(function(target) {
      nextObjectCopy[target] = !nextObject[target];
    });

    return nextObjectCopy;
  },
  $unset: function(value, nextObject, spec, originalObject) {
    invariantSpecArray(value, '$unset');
    value.forEach(function(key) {
      if (Object.hasOwnProperty.call(nextObject, key)) {
        if (nextObject === originalObject) nextObject = copy(originalObject);
        delete nextObject[key];
      }
    });
    return nextObject;
  },
  $add: function(value, nextObject, spec, originalObject) {
    invariantMapOrSet(nextObject, '$add');
    invariantSpecArray(value, '$add');
    if (type(nextObject) === 'Map') {
      value.forEach(function(pair) {
        var key = pair[0];
        var value = pair[1];
        if (nextObject === originalObject && nextObject.get(key) !== value) nextObject = copy(originalObject);
        nextObject.set(key, value);
      });
    } else {
      value.forEach(function(value) {
        if (nextObject === originalObject && !nextObject.has(value)) nextObject = copy(originalObject);
        nextObject.add(value);
      });
    }
    return nextObject;
  },
  $remove: function(value, nextObject, spec, originalObject) {
    invariantMapOrSet(nextObject, '$remove');
    invariantSpecArray(value, '$remove');
    value.forEach(function(key) {
      if (nextObject === originalObject && nextObject.has(key)) nextObject = copy(originalObject);
      nextObject.delete(key);
    });
    return nextObject;
  },
  $merge: function(value, nextObject, spec, originalObject) {
    invariantMerge(nextObject, value);
    getAllKeys(value).forEach(function(key) {
      if (value[key] !== nextObject[key]) {
        if (nextObject === originalObject) nextObject = copy(originalObject);
        nextObject[key] = value[key];
      }
    });
    return nextObject;
  },
  $apply: function(value, original) {
    invariantApply(value);
    return value(original);
  }
};

module.exports = newContext();
module.exports.newContext = newContext;

// invariants

function invariantPushAndUnshift(value, spec, command) {
  invariant(
    Array.isArray(value),
    'update(): expected target of %s to be an array; got %s.',
    command,
    value
  );
  invariantSpecArray(spec[command], command)
}

function invariantSpecArray(spec, command) {
  invariant(
    Array.isArray(spec),
    'update(): expected spec of %s to be an array; got %s. ' +
    'Did you forget to wrap your parameter in an array?',
    command,
    spec
  );
}

function invariantSplices(value, spec) {
  invariant(
    Array.isArray(value),
    'Expected $splice target to be an array; got %s',
    value
  );
  invariantSplice(spec['$splice']);
}

function invariantSplice(value) {
  invariant(
    Array.isArray(value),
    'update(): expected spec of $splice to be an array of arrays; got %s. ' +
    'Did you forget to wrap your parameters in an array?',
    value
  );
}

function invariantApply(fn) {
  invariant(
    typeof fn === 'function',
    'update(): expected spec of $apply to be a function; got %s.',
    fn
  );
}

function invariantSet(spec) {
  invariant(
    Object.keys(spec).length === 1,
    'Cannot have more than one key in an object with $set'
  );
}

function invariantMerge(target, specValue) {
  invariant(
    specValue && typeof specValue === 'object',
    'update(): $merge expects a spec of type \'object\'; got %s',
    specValue
  );
  invariant(
    target && typeof target === 'object',
    'update(): $merge expects a target of type \'object\'; got %s',
    target
  );
}

function invariantMapOrSet(target, command) {
  var typeOfTarget = type(target);
  invariant(
    typeOfTarget === 'Map' || typeOfTarget === 'Set',
    'update(): %s expects a target of type Set or Map; got %s',
    command,
    typeOfTarget
  );
}


/***/ }),
/* 244 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var fnToStr = Function.prototype.toString;

var constructorRegex = /^\s*class\b/;
var isES6ClassFn = function isES6ClassFunction(value) {
	try {
		var fnStr = fnToStr.call(value);
		return constructorRegex.test(fnStr);
	} catch (e) {
		return false; // not a function
	}
};

var tryFunctionObject = function tryFunctionToStr(value) {
	try {
		if (isES6ClassFn(value)) { return false; }
		fnToStr.call(value);
		return true;
	} catch (e) {
		return false;
	}
};
var toStr = Object.prototype.toString;
var fnClass = '[object Function]';
var genClass = '[object GeneratorFunction]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';

module.exports = function isCallable(value) {
	if (!value) { return false; }
	if (typeof value !== 'function' && typeof value !== 'object') { return false; }
	if (typeof value === 'function' && !value.prototype) { return true; }
	if (hasToStringTag) { return tryFunctionObject(value); }
	if (isES6ClassFn(value)) { return false; }
	var strClass = toStr.call(value);
	return strClass === fnClass || strClass === genClass;
};


/***/ }),
/* 245 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

module.exports = {
  2:      'need dictionary',     /* Z_NEED_DICT       2  */
  1:      'stream end',          /* Z_STREAM_END      1  */
  0:      '',                    /* Z_OK              0  */
  '-1':   'file error',          /* Z_ERRNO         (-1) */
  '-2':   'stream error',        /* Z_STREAM_ERROR  (-2) */
  '-3':   'data error',          /* Z_DATA_ERROR    (-3) */
  '-4':   'insufficient memory', /* Z_MEM_ERROR     (-4) */
  '-5':   'buffer error',        /* Z_BUF_ERROR     (-5) */
  '-6':   'incompatible version' /* Z_VERSION_ERROR (-6) */
};


/***/ }),
/* 246 */
/***/ (function(module, exports) {

// shim for using process in browser
var process = module.exports = {};

// cached from whatever global is present so that test runners that stub it
// don't break things.  But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals.  It's inside a
// function because try/catches deoptimize in certain engines.

var cachedSetTimeout;
var cachedClearTimeout;

function defaultSetTimout() {
    throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
    throw new Error('clearTimeout has not been defined');
}
(function () {
    try {
        if (typeof setTimeout === 'function') {
            cachedSetTimeout = setTimeout;
        } else {
            cachedSetTimeout = defaultSetTimout;
        }
    } catch (e) {
        cachedSetTimeout = defaultSetTimout;
    }
    try {
        if (typeof clearTimeout === 'function') {
            cachedClearTimeout = clearTimeout;
        } else {
            cachedClearTimeout = defaultClearTimeout;
        }
    } catch (e) {
        cachedClearTimeout = defaultClearTimeout;
    }
} ())
function runTimeout(fun) {
    if (cachedSetTimeout === setTimeout) {
        //normal enviroments in sane situations
        return setTimeout(fun, 0);
    }
    // if setTimeout wasn't available but was latter defined
    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
        cachedSetTimeout = setTimeout;
        return setTimeout(fun, 0);
    }
    try {
        // when when somebody has screwed with setTimeout but no I.E. maddness
        return cachedSetTimeout(fun, 0);
    } catch(e){
        try {
            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
            return cachedSetTimeout.call(null, fun, 0);
        } catch(e){
            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
            return cachedSetTimeout.call(this, fun, 0);
        }
    }


}
function runClearTimeout(marker) {
    if (cachedClearTimeout === clearTimeout) {
        //normal enviroments in sane situations
        return clearTimeout(marker);
    }
    // if clearTimeout wasn't available but was latter defined
    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
        cachedClearTimeout = clearTimeout;
        return clearTimeout(marker);
    }
    try {
        // when when somebody has screwed with setTimeout but no I.E. maddness
        return cachedClearTimeout(marker);
    } catch (e){
        try {
            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
            return cachedClearTimeout.call(null, marker);
        } catch (e){
            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
            return cachedClearTimeout.call(this, marker);
        }
    }



}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;

function cleanUpNextTick() {
    if (!draining || !currentQueue) {
        return;
    }
    draining = false;
    if (currentQueue.length) {
        queue = currentQueue.concat(queue);
    } else {
        queueIndex = -1;
    }
    if (queue.length) {
        drainQueue();
    }
}

function drainQueue() {
    if (draining) {
        return;
    }
    var timeout = runTimeout(cleanUpNextTick);
    draining = true;

    var len = queue.length;
    while(len) {
        currentQueue = queue;
        queue = [];
        while (++queueIndex < len) {
            if (currentQueue) {
                currentQueue[queueIndex].run();
            }
        }
        queueIndex = -1;
        len = queue.length;
    }
    currentQueue = null;
    draining = false;
    runClearTimeout(timeout);
}

process.nextTick = function (fun) {
    var args = new Array(arguments.length - 1);
    if (arguments.length > 1) {
        for (var i = 1; i < arguments.length; i++) {
            args[i - 1] = arguments[i];
        }
    }
    queue.push(new Item(fun, args));
    if (queue.length === 1 && !draining) {
        runTimeout(drainQueue);
    }
};

// v8 likes predictible objects
function Item(fun, array) {
    this.fun = fun;
    this.array = array;
}
Item.prototype.run = function () {
    this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};

function noop() {}

process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.prependListener = noop;
process.prependOnceListener = noop;

process.listeners = function (name) { return [] }

process.binding = function (name) {
    throw new Error('process.binding is not supported');
};

process.cwd = function () { return '/' };
process.chdir = function (dir) {
    throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };


/***/ }),
/* 247 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(__webpack_require__(0));
var dnd_core_1 = __webpack_require__(936);
/**
 * Create the React Context
 */
exports.DndContext = React.createContext({
    dragDropManager: undefined,
});
/**
 * Creates the context object we're providing
 * @param backend
 * @param context
 */
function createDndContext(backend, context, options, debugMode) {
    return {
        dragDropManager: dnd_core_1.createDragDropManager(backend, context, options, debugMode),
    };
}
exports.createDndContext = createDndContext;


/***/ }),
/* 248 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var invariant_1 = __importDefault(__webpack_require__(32));
var DndContext_1 = __webpack_require__(247);
/**
 * A hook to retrieve the DragDropManager from Context
 */
function useDragDropManager() {
    var dragDropManager = react_1.useContext(DndContext_1.DndContext).dragDropManager;
    invariant_1.default(dragDropManager != null, 'Expected drag drop context');
    return dragDropManager;
}
exports.useDragDropManager = useDragDropManager;


/***/ }),
/* 249 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.FILE = '__NATIVE_FILE__';
exports.URL = '__NATIVE_URL__';
exports.TEXT = '__NATIVE_TEXT__';


/***/ }),
/* 250 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var HTML5Backend_1 = __importDefault(__webpack_require__(1349));
var NativeTypes = __importStar(__webpack_require__(249));
exports.NativeTypes = NativeTypes;
var getEmptyImage_1 = __webpack_require__(1357);
exports.getEmptyImage = getEmptyImage_1.getEmptyImage;
var createHTML5Backend = function (manager, context) { return new HTML5Backend_1.default(manager, context); };
exports.default = createHTML5Backend;


/***/ }),
/* 251 */
/***/ (function(module, exports) {

exports.createdStores = [];

exports.createdActions = [];

exports.reset = function() {
    while(exports.createdStores.length) {
        exports.createdStores.pop();
    }
    while(exports.createdActions.length) {
        exports.createdActions.pop();
    }
};


/***/ }),
/* 252 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var isProduction = "development" === 'production';
var prefix = 'Invariant failed';
function invariant(condition, message) {
  if (condition) {
    return;
  }

  if (isProduction) {
    throw new Error(prefix);
  } else {
    throw new Error(prefix + ": " + (message || ''));
  }
}

/* harmony default export */ __webpack_exports__["a"] = (invariant);


/***/ }),
/* 253 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var isProduction = "development" === 'production';
function warning(condition, message) {
  if (!isProduction) {
    if (condition) {
      return;
    }

    var text = "Warning: " + message;

    if (typeof console !== 'undefined') {
      console.warn(text);
    }

    try {
      throw Error(text);
    } catch (x) {}
  }
}

/* harmony default export */ __webpack_exports__["a"] = (warning);


/***/ }),
/* 254 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = _inheritsLoose;
function _inheritsLoose(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  subClass.__proto__ = superClass;
}

/***/ }),
/* 255 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutPropertiesLoose;
function _objectWithoutPropertiesLoose(source, excluded) {
  if (source == null) return {};
  var target = {};
  var sourceKeys = Object.keys(source);
  var key, i;

  for (i = 0; i < sourceKeys.length; i++) {
    key = sourceKeys[i];
    if (excluded.indexOf(key) >= 0) continue;
    target[key] = source[key];
  }

  return target;
}

/***/ }),
/* 256 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1014);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var InputNumber = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (this.state.isFocused && !this.props.error) return;
    this.setState({
      value: newProps.value
    });
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.setState({
        isFocused: true
      }, function () {
        setTimeout(function () {
          if (_this.state.isFocused) {
            var input = _this.my_input;
            input.select();
            input.addEventListener('mousewheel', _this._preventScroll);
          }
        }, 30);
      });
    }
  },
  _preventScroll: function _preventScroll(event) {
    event.preventDefault();
  },
  _handleBlur: function _handleBlur() {
    var input = this.my_input;
    input.removeEventListener('mousewheel', this._preventScroll);
    this.setState({
      isFocused: false
    }, function () {
      this._validateData();
    });
  },
  _handleChange: function _handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 13:
        // Enter
        this._validateData();
        break;
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    this.setState({
      isFocused: false,
      value: this.props.value
    });
  },
  _validateData: function _validateData() {
    // Maybe validate character length etc here?

    var newValue = this.state.value;
    if (newValue === this.props.value && !this.props.error || this.props.disabled) {
      // not valid?
      return;
    }

    // is valid
    return this._handleSubmitData();
  },
  _handleSubmitData: function _handleSubmitData() {
    // Send data out to smart handler
    this.props.onSubmit(this.state.value, this.props.id);
  },
  render: function render() {
    var _this2 = this;

    var classList = (0, _classnames2.default)({
      CCInputText: true,
      'is-disabled': this.props.disabled,
      'is-focused': this.state.isFocused,
      'is-error': this.props.error
    });

    return _react2.default.createElement(
      'div',
      { ref: function ref(_ref2) {
          return _this2.my_input_wrapper = _ref2;
        }, className: classList },
      _react2.default.createElement('input', {
        ref: function ref(_ref) {
          return _this2.my_input = _ref;
        },
        className: '_input',
        type: 'text',
        disabled: this.props.disabled,
        value: this.state.value,
        onFocus: this._handleFocus,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(InputNumber, 'InputNumber', 'C:/_repos_windows/dairybase/Frontend/app/_shared/CCTextInput/index.jsx');
}();

;

/***/ }),
/* 257 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = stripCCD;
function stripCCD(Name) {
  var _name = Name || '';
  var strArr = _name.split(' - CCD');
  var strippedName = strArr[0];

  return strippedName;
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(stripCCD, 'stripCCD', 'C:/_repos_windows/dairybase/Frontend/app/_shared/stripCCD/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 258 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GET__userSession = module.exports = function (callback) {

  (0, _xhr2.default)({
    url: "/" + "api/session/GetSessionWithFarmDataSetApis",
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var blobData = JSON.parse(resp.body);

    if (resp.statusCode === 200) {

      _Actions2.default.SET_DATA_PROPERTIES(blobData);
      _Actions2.default.SET_REPORT_PROPS(blobData.ReportProperties);
      _Actions2.default.NEW_USER_SESSION(blobData);
      _Actions2.default.UPDATE_CHART_SETTINGS(blobData.DataChartSettings);
      _Actions2.default.UPDATE_DATASET_LIST(blobData.DataSetList);
      _Actions2.default.UPDATE_GROUP_LIST(blobData.UserGroups);
      _Actions2.default.POPULATE_ACTIVE_DATASET(blobData);
      _Actions2.default.SET_REPORT_FILTERS(blobData);
    }

    if (resp.statusCode === 401) {
      _Actions2.default.SESSION_ERROR({
        'AccessDenied': true
      });
      localStorage.clear();
    }

    if (resp.statusCode !== 401 && resp.statusCode !== 200) {
      _Actions2.default.SESSION_ERROR({
        'ConnectionError': true
      });
    }

    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GET__userSession, 'GET__userSession', 'C:/_repos_windows/dairybase/Frontend/app/api/GET__userSession/index.js');
}();

;

/***/ }),
/* 259 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var pako = __webpack_require__(1223);

module.exports = function (_ref, callback) {
  var HtmlString = _ref.HtmlString,
      _ref$IsLandscape = _ref.IsLandscape,
      IsLandscape = _ref$IsLandscape === undefined ? false : _ref$IsLandscape,
      _ref$IsA = _ref.IsA3,
      IsA3 = _ref$IsA === undefined ? false : _ref$IsA,
      _ref$CSSString = _ref.CSSString,
      CSSString = _ref$CSSString === undefined ? false : _ref$CSSString;

  var binaryString = btoa(pako.deflate(HtmlString, { to: 'string' }));

  var _CSSSTring = '.nocss{}';

  if (CSSString) {
    var styleString = _.reduce(document.styleSheets, function (__string, sheet, i) {
      var firstAttr = sheet.ownerNode.attributes[0];

      if (typeof firstAttr === 'undefined') return __string;
      if (firstAttr.name === 'data-styled-components') {
        return __string + sheet.ownerNode.innerHTML;
      }
      return __string;
    }, '');

    _CSSSTring = styleString; // btoa(pako.deflate(styleString, { to: 'string' }))
  }

  (0, _xhr2.default)({
    url: "/" + 'api/file/PostPdfHtml',
    method: 'POST',
    json: {
      CSSString: _CSSSTring,
      HtmlString: binaryString,
      IsLandscape: IsLandscape,
      IsA3: IsA3
    },
    timeout: 1800000, // 30 min
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {
    // console.log(resp.body)

    if (resp.statusCode === 200) {
      window.location = "/" + 'api/file/GetReturnInputFileFromServer?filename=' + body;
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 260 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createData = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + 'api/session/PostDeleteGroup',
    method: 'POST',
    json: data,
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {

    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.UPDATE_GROUP_LIST(resp.body.UserGroups);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createData, 'POST__createData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__deleteGroup/index.js');
}();

;

/***/ }),
/* 261 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__editData = module.exports = function (data, callback) {

  _Actions2.default.SET_APP_STATUS("updating");

  (0, _xhr2.default)({
    url: "/" + "api/editor/PostEditDataSetAuthority",
    method: "POST",
    json: data,
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {
    var data = resp.body;
    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.RECEIVE_AUTH_UPDATE(data.IndustryDataList);
      _Actions2.default.UPDATE_DATASET_LIST(data.DataSetList);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__editData, 'POST__editData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__editDataSetAuthority/index.js');
}();

;

/***/ }),
/* 262 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  getBlankFeed: __webpack_require__(424),
  getBlankFertiliser: __webpack_require__(425)
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 263 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _requestLog = __webpack_require__(123);

var _requestLog2 = _interopRequireDefault(_requestLog);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var fieldGroupErrorMixin = module.exports = function (fieldList) {

  return {
    getInitialState: function getInitialState() {
      return {
        requestError: false
      };
    },
    componentWillMount: function componentWillMount() {
      this._handleRequestLogUpdate();
    },
    componentDidMount: function componentDidMount() {
      this.unsubscribeTofieldGroupErrorMixin = _requestLog2.default.listen(this._handleRequestLogUpdate);
    },
    componentWillUnmount: function componentWillUnmount() {
      this.unsubscribeTofieldGroupErrorMixin();
    },
    _handleRequestLogUpdate: function _handleRequestLogUpdate() {

      var errorRequestFound;
      var _fieldList = typeof fieldList === "undefined" ? this.props.fieldList : fieldList;
      var latestRequest = _.findLast(_requestLog2.default.store, function (item) {
        return _.includes(_fieldList, item.FieldId);
      });

      if (typeof latestRequest === "undefined") return;

      _fieldList.forEach(function (field) {
        var latestRequest = _.findLast(_requestLog2.default.store, function (item) {
          return field === item.FieldId;
        });
        if (typeof latestRequest === "undefined") return;
        if (latestRequest.error) errorRequestFound = true;
      });

      if (errorRequestFound) {
        this.setState({
          requestError: true
        });
      } else {
        if (this.state.requestError) {
          this.setState({
            requestError: false
          });
        }
      }
    }
  };
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(fieldGroupErrorMixin, 'fieldGroupErrorMixin', 'C:/_repos_windows/dairybase/Frontend/app/mixins/_fieldGroupErrorMixin/index.js');
}();

;

/***/ }),
/* 264 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function () {
  var sessionKey = localStorage.getItem('accessToken');
  if (!sessionKey) {
    return false;
  }
  return true;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 265 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function () {
  return _datasetList2.default.store.filter(function (item, index) {
    return item.ArchiveStatus && !item.Invisible;
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 266 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function () {

  var allFilters = [
  // groups
  _datasetListFilter2.default.store.groups.map(function (item, index) {
    var group = _.find(_datasetGroups2.default.store, { Id: item });
    return {
      title: group.Title,
      id: group.Id,
      filter: 'groups'
    };
  }),
  // actual
  _datasetListFilter2.default.store.actual.map(function (item, index) {
    var group = _.find(_datasetGroups2.default.store, { Id: item });
    return {
      title: item ? 'Actual' : 'Scenario',
      id: item,
      filter: 'actual'
    };
  }),
  // editable
  _datasetListFilter2.default.store.editable.map(function (item, index) {
    var group = _.find(_datasetGroups2.default.store, { Id: item });
    return {
      title: item ? 'Editable' : 'Not Editable',
      id: item,
      filter: 'editable'
    };
  }),
  // farms
  _datasetListFilter2.default.store.farms.map(function (item, index) {
    return {
      title: item,
      id: item,
      filter: 'farms'
    };
  }),
  // owners
  _datasetListFilter2.default.store.owners.map(function (item, index) {
    return {
      title: item,
      id: item,
      filter: 'owners'
    };
  }),
  // years
  _datasetListFilter2.default.store.years.map(function (item, index) {
    var group = _.find(_datasetGroups2.default.store, { Id: item });
    return {
      title: item,
      id: item,
      filter: 'years'
    };
  })];

  return _.flatten(allFilters);
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 267 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _DescriptionLabel = __webpack_require__(459);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LabelWrapper = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      _DescriptionLabel2.default,
      {
        label: this.props.label,
        description: this.props.description },
      this.props.children
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LabelWrapper, 'LabelWrapper', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CCPopup/index.jsx');
}();

;

/***/ }),
/* 268 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1018);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _RequestPortal = __webpack_require__(156);

var _RequestPortal2 = _interopRequireDefault(_RequestPortal);

var _POST__createDataset = __webpack_require__(145);

var _POST__createDataset2 = _interopRequireDefault(_POST__createDataset);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _POST__saveActiveDataset = __webpack_require__(121);

var _POST__saveActiveDataset2 = _interopRequireDefault(_POST__saveActiveDataset);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ConfirmActions = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {

  mixins: [_reflux2.default.listenTo(_activeDataset2.default, 'handleDatasetUpdate')],

  getInitialState: function getInitialState() {
    return {
      saveRequest: false,
      discardRequest: false,
      createPortalOpen: false,
      datasetName: '',
      farmId: undefined
    };
  },
  handleDatasetUpdate: function handleDatasetUpdate() {
    var datasetDetail = _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id });
    this.setState({
      datasetName: datasetDetail.Name,
      farmId: datasetDetail.DairyBaseId
    });
  },
  handleCreateSuccess: function handleCreateSuccess() {
    this.toggleCreatePortal();
    this.handleLoadDataset();
  },
  toggleCreatePortal: function toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  toggleSaveRequest: function toggleSaveRequest() {
    this.setState({
      saveRequest: !this.state.saveRequest
    });
  },
  toggleDiscardRequest: function toggleDiscardRequest() {
    this.setState({
      discardRequest: !this.state.discardRequest
    });
  },
  handleLoadDataset: function handleLoadDataset() {
    this.props.history.push('/editor');
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ConfirmActions-wrapper' },
      _react2.default.createElement(
        'div',
        { className: 'ConfirmActions' },
        _react2.default.createElement(
          'h2',
          { className: '_title' },
          'Your active editor data has diverged from the DairyBase server. This is usually because the data has been edited by another user with access to this dataset.'
        ),
        _react2.default.createElement(
          'p',
          { className: '_subtitle' },
          'Please save as a copy, discard your changes, or overwrite the original.'
        ),
        _react2.default.createElement(
          'div',
          { className: '_actions' },
          _react2.default.createElement(
            'button',
            {
              className: '_discardBtn',
              onClick: this.toggleDiscardRequest },
            'Discard my changes'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              onClick: this.toggleCreatePortal },
            'Save As'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_overwriteBtn',
              onClick: this.toggleSaveRequest },
            'Overwrite original'
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.createPortalOpen,
              className: 'Overlay' },
            _react2.default.createElement(
              'div',
              { className: '_modalBox' },
              _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.toggleCreatePortal }),
              _react2.default.createElement(_CreateDatasetModal2.default, {
                callback: this.handleCreateSuccess,
                bulkCallback: this.toggleCreatePortal,
                prefillFarm: this.state.farmId,
                prefillYear: _activeDataset2.default.FinancialYear,
                useActive: true })
            )
          ),
          _react2.default.createElement(_RequestPortal2.default, {
            isOpen: this.state.saveRequest,
            successHandler: this.toggleSaveRequest,
            failHandler: this.toggleSaveRequest,
            request: _POST__saveActiveDataset2.default,
            data: {
              Overwrite: true
            },
            pendingText: {
              title: 'Please wait',
              text: 'Saving Dataset...'
            },
            successText: {
              title: 'Success!',
              text: 'Dataset Saved.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'The Dataset could not be saved.'
            } }),
          _react2.default.createElement(_RequestPortal2.default, {
            isOpen: this.state.discardRequest,
            successHandler: this.toggleDiscardRequest,
            failHandler: this.toggleDiscardRequest,
            request: _POST__loadDataset2.default,
            data: _activeDataset2.default.id,
            pendingText: {
              title: 'Please wait',
              text: 'Discarding changes...'
            },
            successText: {
              title: 'Success!',
              text: 'Changes discarded.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'Your changes could not be discarded.'
            } })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ConfirmActions, 'ConfirmActions', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/ConfirmAlign/index.js');
}();

;

/***/ }),
/* 269 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(962);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'button',
      {
        type: this.props.type,
        disabled: this.props.disabled,
        className: _style2.default.root,
        onClick: this.props.onClick },
      _react2.default.createElement(
        'div',
        { className: _style2.default.content },
        _react2.default.createElement(_xchIcon2.default, {
          id: this.props.icon,
          classes: {
            icon: _style2.default.icon
          } }),
        _react2.default.createElement(
          'span',
          { className: _style2.default.text },
          this.props.text
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/IconButton/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 270 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(963);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchTextArea = __webpack_require__(466);

var _xchTextArea2 = _interopRequireDefault(_xchTextArea);

var _IconButton = __webpack_require__(269);

var _IconButton2 = _interopRequireDefault(_IconButton);

var _convertMdToHTML = __webpack_require__(199);

var _convertMdToHTML2 = _interopRequireDefault(_convertMdToHTML);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      notes: this.props.notes
    };
  },
  handleSubmit: function handleSubmit(id, value) {
    this.setState({
      notes: value
    });
  },
  handleCancel: function handleCancel() {
    this.setState({
      notes: this.props.notes
    }, this.props.onToggleEditing);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.controls },
        this.renderCancelButton(),
        this.renderSaveButton(),
        this.renderEditButton()
      ),
      this.renderPreview(),
      this.renderEditor()
    );
  },
  renderCancelButton: function renderCancelButton() {
    return !this.props.editing ? null : _react2.default.createElement(_IconButton2.default, {
      icon: 'close',
      text: 'cancel',
      onClick: this.handleCancel });
  },
  renderSaveButton: function renderSaveButton() {
    var _this = this;

    return !this.props.editing ? null : _react2.default.createElement(
      'div',
      { className: _style2.default.saveButton },
      _react2.default.createElement(_IconButton2.default, {
        icon: 'tick',
        text: 'save changes',
        onClick: function onClick() {
          _this.props.onSaveChanges(_this.state.notes);
        } })
    );
  },
  renderEditButton: function renderEditButton() {
    return this.props.editing || !this.props.editAuthority ? null : _react2.default.createElement(_IconButton2.default, {
      icon: 'edit',
      text: 'edit notes',
      onClick: this.props.onToggleEditing });
  },
  renderPreview: function renderPreview() {
    return this.props.editing ? null : _react2.default.createElement('div', { className: _style2.default.preview,
      dangerouslySetInnerHTML: (0, _convertMdToHTML2.default)(this.state.notes) });
  },
  renderEditor: function renderEditor() {
    return !this.props.editing ? null : _react2.default.createElement(_xchTextArea2.default, {
      id: 'someId',
      rows: 15,
      value: this.state.notes,
      onSubmit: this.handleSubmit });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/NotesEditor/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 271 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ActualIcon = module.exports = __webpack_require__(1)({
  render: function render() {
    return this.props.value ? _react2.default.createElement(_xchIcon2.default, { classes: this.props.classes, id: 'tick' }) : _react2.default.createElement(_xchIcon2.default, { classes: this.props.classes, id: 'close' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ActualIcon, 'ActualIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/_ActualIcon/index.jsx');
}();

;

/***/ }),
/* 272 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var EditableIcon = module.exports = __webpack_require__(1)({
  render: function render() {
    return this.props.value ? _react2.default.createElement(_xchIcon2.default, { classes: this.props.classes, id: 'edit' }) : _react2.default.createElement(_xchIcon2.default, { classes: this.props.classes, id: 'error' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(EditableIcon, 'EditableIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/_EditableIcon/index.jsx');
}();

;

/***/ }),
/* 273 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1024);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _requestLog = __webpack_require__(123);

var _requestLog2 = _interopRequireDefault(_requestLog);

var _SwitchableInput = __webpack_require__(276);

var _SwitchableInput2 = _interopRequireDefault(_SwitchableInput);

var _fieldErrorMixin = __webpack_require__(194);

var _fieldErrorMixin2 = _interopRequireDefault(_fieldErrorMixin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var OptimisticSwitchableInput = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, _fieldErrorMixin2.default],

  _handleSubmitData: function _handleSubmitData(newValue) {
    // passed validation? Set the new data in store:
    _Actions2.default.UPDATE_DATA_ELEMENT({
      "Table": this.props.data.Table,
      "Element": this.props.data.FieldId,
      "Value": newValue
    });
  },
  render: function render() {
    return _react2.default.createElement(_SwitchableInput2.default, {
      id: this.props.data.FieldId,
      value: this.props.data.Value,
      editable: this.props.editable,
      onSubmit: this._handleSubmitData,
      disabled: !this.state.editAuthority,
      error: this.props.data.error });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(OptimisticSwitchableInput, 'OptimisticSwitchableInput', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_OptimisticSwitchableInput/index.jsx');
}();

;

/***/ }),
/* 274 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1026);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var CheckBox = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (newProps.value !== this.props.value) {
      this.setState({
        value: newProps.value
      });
    }
  },
  _handleSubmitData: function _handleSubmitData() {
    if (!this.props.disabled) {
      this.props.onSubmit(this.props.value ? false : true, this.props.id);
    }
  },
  render: function render() {

    var checkClasses = (0, _classnames2.default)({
      "_box": true,
      "is-checked": this.props.value,
      "is-disabled": this.props.disabled
    });

    return _react2.default.createElement(
      'label',
      { className: 'InputSwitchbox' },
      _react2.default.createElement(
        'div',
        { className: checkClasses, onClick: this._handleSubmitData },
        _react2.default.createElement('div', { className: '_check' })
      ),
      _react2.default.createElement(
        'span',
        { className: '_title' },
        this.props.label
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(CheckBox, 'CheckBox', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_Boolean/index.jsx');
}();

;

/***/ }),
/* 275 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericTotal = __webpack_require__(203);

var _GenericTotal2 = _interopRequireDefault(_GenericTotal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Popup = __webpack_require__(157);

var _Popup2 = _interopRequireDefault(_Popup);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DescriptionTotal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      popupIsActive: false
    };
  },
  _togglePopup: function _togglePopup() {
    this.setState({
      popupIsActive: !this.state.popupIsActive,
      coords: (0, _getDomCoords3.default)(this.label, true)
    }, function () {
      this.state.popupIsActive ? document.addEventListener('click', this._togglePopup) : document.removeEventListener('click', this._togglePopup);
    });
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      {
        ref: function ref(_ref) {
          return _this.label = _ref;
        },
        className: '_total',
        onClick: this._togglePopup },
      _react2.default.createElement(_GenericTotal2.default, {
        preUnit: this.props.preUnit,
        label: this.props.label,
        value: this.props.value,
        postUnit: this.props.postUnit
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.popupIsActive,
          className: 'Popup' },
        _react2.default.createElement(_Popup2.default, { coords: this.state.coords, text: this.props.description })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DescriptionTotal, 'DescriptionTotal', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_DescriptionTotal/index.jsx');
}();

;

/***/ }),
/* 276 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1036);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SwitchableInput = module.exports = __webpack_require__(1)({
  render: function render() {
    return this.props.editable ? _react2.default.createElement(_InputNumber2.default, {
      id: this.props.id,
      value: this.props.value,
      onSubmit: this.props.onSubmit,
      decimal: this.props.decimal,
      disabled: this.props.disabled,
      error: this.props.error }) : _react2.default.createElement(
      'div',
      { className: '_paddedOutput' },
      _react2.default.createElement(_OutputSimple2.default, { value: this.props.value })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SwitchableInput, 'SwitchableInput', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_SwitchableInput/index.jsx');
}();

;

/***/ }),
/* 277 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1038);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (!this.state.isFocused) {
      this.setState({
        value: newProps.value
      });
    }
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.setState({
        isFocused: true,
        value: this.state.value
      }, function () {
        setTimeout(function () {
          var input = _this.my_input;
          input.select();
          input.addEventListener('mousewheel', function (event) {
            event.preventDefault();
          });
        }, 30);
      });
    }
  },
  _handleBlur: function _handleBlur() {
    this.setState({
      isFocused: false
    }, function () {
      this._handleSubmitData();
    });
  },
  _handleChange: function _handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    this.setState({
      isFocused: false,
      value: this.props.value
    });
  },
  _handleSubmitData: function _handleSubmitData() {
    var newValue = this.state.value;

    // validate all the things
    if (typeof newValue === 'undefined' || newValue === null || +newValue === +this.props.value || this.props.disabled) {
      if (!this.state.isFocused) {
        this.setState({
          value: this.props.value
        });
      }
      return;
    }

    // Passed validation? Send data out to smart handler
    this.props.onSubmit(newValue, this.props.id);
  },
  render: function render() {
    var _this2 = this;

    var classList = (0, _classnames2.default)({
      InputTextArea: true,
      'not-editable': this.props.disabled,
      'is-focused': this.state.isFocused
    });

    return _react2.default.createElement(
      'div',
      { ref: function ref(_ref2) {
          return _this2.my_input_wrapper = _ref2;
        }, className: classList },
      _react2.default.createElement('textarea', {
        ref: function ref(_ref) {
          return _this2.my_input = _ref;
        },
        className: '_input',
        disabled: this.props.disabled,
        value: this.state.value,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown,
        wrap: 'off'
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 278 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1043);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _SwitchableTextInput = __webpack_require__(472);

var _SwitchableTextInput2 = _interopRequireDefault(_SwitchableTextInput);

var _editForm = __webpack_require__(477);

var _editForm2 = _interopRequireDefault(_editForm);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _POST__editDataSetDetail = __webpack_require__(191);

var _POST__editDataSetDetail2 = _interopRequireDefault(_POST__editDataSetDetail);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _Notes = __webpack_require__(476);

var _Notes2 = _interopRequireDefault(_Notes);

var _convertMdToHTML = __webpack_require__(199);

var _convertMdToHTML2 = _interopRequireDefault(_convertMdToHTML);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DatasetDetail = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  getRegionList: function getRegionList(selectedCode) {

    var regionList = _dataDefinition2.default.selectOptions.RegionId;

    if (selectedCode === 'DA0001') return regionList;

    return regionList.filter(function (r) {
      var shortcode = selectedCode.substring(0, 2);
      return r.ShortCode === shortcode;
    });
  },
  getInitialState: function getInitialState() {
    return {
      notesPortalOpen: false,
      editDetailPortalOpen: false,
      requestPortalOpen: false,
      ReadOnlyAuthority: this.props.dataset.ReadOnlyAuthority,
      EditDetailAuthority: this.props.dataset.EditDetailAuthority,
      EditAuthority: this.props.dataset.EditAuthority,
      FarmDataSetId: this.props.dataset.Id,
      DairyBaseId: this.props.dataset.DairyBaseId,
      RegionId: this.props.dataset.RegionId,
      Name: this.props.dataset.Name,
      Description: this.props.dataset.Description,
      FinancialYearId: this.props.dataset.FinancialYearId,
      IsActual: this.props.dataset.IsActual,
      PrivacySettingId: this.props.dataset.PrivacySettingId,
      regionList: this.getRegionList(this.props.dataset.DairyBaseId)
    };
  },
  _clearDetails: function _clearDetails() {
    this.setState({
      DairyBaseId: this.props.dataset.DairyBaseId,
      RegionId: this.props.dataset.RegionId,
      Name: this.props.dataset.Name,
      Description: this.props.dataset.Description,
      FinancialYearId: this.props.dataset.FinancialYearId,
      IsActual: this.props.dataset.IsActual,
      PrivacySettingId: this.props.dataset.PrivacySettingId,
      regionList: this.getRegionList(this.props.dataset.DairyBaseId)
    }, this._toggleDetailEditor);
  },
  _updateField: function _updateField(value, id) {

    var obj = {};

    if (id === 'DairyBaseId') {
      value = _.find(_dataDefinition2.default.selectOptions.FarmId, { Id: value }).Title;
      var newRegionList = this.getRegionList(value);
      obj['regionList'] = newRegionList;
      obj['RegionId'] = newRegionList[0].Id;
    }

    obj[id] = value;
    this.setState(obj);
  },
  _toggleEditRequest: function _toggleEditRequest() {
    this.setState({
      requestPortalOpen: !this.state.requestPortalOpen
    });
  },
  toggleNotesPortal: function toggleNotesPortal() {
    this.setState({
      notesPortalOpen: !this.state.notesPortalOpen
    });
  },
  _handleEditSuccess: function _handleEditSuccess() {
    this._toggleEditRequest();
    this._toggleDetailEditor();
  },
  _toggleDetailEditor: function _toggleDetailEditor() {
    this.setState({
      editDetailPortalOpen: !this.state.editDetailPortalOpen
    });
  },
  _getSelectedLabel: function _getSelectedLabel(field) {
    var optionsList = _dataDefinition2.default.selectOptions[field];
    return _.find(optionsList, { Id: +this.state[field] }).Title;
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DatasetDetail' },
      this._renderEditBtn(),
      _react2.default.createElement(
        'h2',
        { className: 'DatasetDetail__Name' },
        this.state.Name
      ),
      _react2.default.createElement(
        'div',
        { className: 'DatasetDetail__rowGroup' },
        _react2.default.createElement(
          'div',
          null,
          this._getSelectedLabel('FinancialYearId')
        ),
        _react2.default.createElement(
          'div',
          null,
          _react2.default.createElement(
            'span',
            null,
            this.state.DairyBaseId
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'DatasetDetail__Actual' },
          this.state.IsActual ? _react2.default.createElement(
            'div',
            { className: '_display' },
            _react2.default.createElement(_Icon2.default, { id: 'tick', className: '_icon' }),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Actual'
            )
          ) : _react2.default.createElement(
            'div',
            { className: '_display' },
            _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' }),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Not Actual'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          null,
          this._getSelectedLabel('PrivacySettingId')
        )
      ),
      _react2.default.createElement(
        'p',
        { className: 'DatasetDetail__Description' },
        this.state.Description,
        _react2.default.createElement(
          'button',
          {
            className: 'DatasetDetail__NotesBtn',
            onClick: this.toggleNotesPortal },
          '...view notes'
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.notesPortalOpen,
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          { closePortal: this.toggleNotesPortal },
          _react2.default.createElement(_Notes2.default, {
            notes: this.props.dataset.DataSetNotes,
            editDetailAuthority: this.state.EditDetailAuthority,
            FarmDataSetId: this.state.FarmDataSetId,
            Name: this.state.Name,
            Description: this.state.Description,
            DairyBaseId: _.find(_dataDefinition2.default.selectOptions.FarmId, { Title: this.state.DairyBaseId }).Id,
            RegionId: this.state.RegionId,
            FinancialYearId: this.state.FinancialYearId,
            IsActual: this.state.IsActual,
            PrivacySettingId: this.state.PrivacySettingId })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.editDetailPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._clearDetails }),
          _react2.default.createElement(_editForm2.default, {
            DairyBaseId: this.state.DairyBaseId,
            Name: this.state.Name,
            Description: this.state.Description,
            FinancialYearId: this.state.FinancialYearId,
            IsActual: this.state.IsActual,
            PrivacySettingId: this.state.PrivacySettingId,
            updateField: this._updateField,
            submitDetails: this._toggleEditRequest,
            editAuthority: this.state.EditAuthority,
            regionList: this.state.regionList,
            RegionId: this.state.RegionId,
            toggleDetailEditor: this._toggleDetailEditor })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.requestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleEditSuccess,
          failHandler: this._toggleEditRequest,
          request: _POST__editDataSetDetail2.default,
          data: {
            DataSetNotes: this.props.dataset.DataSetNotes,
            FarmDataSetId: this.state.FarmDataSetId,
            Name: this.state.Name,
            Description: this.state.Description,
            DairyBaseId: _.find(_dataDefinition2.default.selectOptions.FarmId, { Title: this.state.DairyBaseId }).Id,
            RegionId: this.state.RegionId,
            FinancialYearId: this.state.FinancialYearId,
            IsActual: this.state.IsActual,
            PrivacySettingId: this.state.PrivacySettingId
          },
          pendingText: {
            title: 'Please wait',
            text: 'Saving new dataset details.'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset details were updated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Your details could not be saved.'
          } })
      )
    );
  },
  _renderEditBtn: function _renderEditBtn() {
    return !this.state.EditDetailAuthority ? null : _react2.default.createElement(
      'div',
      { className: 'DatasetDetail__editToggle' },
      _react2.default.createElement(
        'button',
        { className: '_btn', onClick: this._toggleDetailEditor },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { id: 'edit', className: '_icon' }),
          _react2.default.createElement(
            'span',
            { className: '_text' },
            'Edit'
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DatasetDetail, 'DatasetDetail', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_DatasetDetail/index.jsx');
}();

;

/***/ }),
/* 279 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilterModalTemplate = __webpack_require__(134);

var _FilterModalTemplate2 = _interopRequireDefault(_FilterModalTemplate);

var _FilterList = __webpack_require__(128);

var _FilterList2 = _interopRequireDefault(_FilterList);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var actualList = [{
  Id: true,
  Title: 'Actual'
}, {
  Id: false,
  Title: 'Scenario'
}];

var ActualFilter = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    this.setState({
      list: actualList.map(function (item, index) {
        return {
          title: item.Title,
          id: item.Id,
          active: _.includes(_datasetListFilter2.default.store.actual, item.Id)
        };
      })
    });
  },
  _onListItemClick: function _onListItemClick(itemId) {
    _Actions2.default.UPDATE_DATASETLIST_FILTER('actual', itemId);
  },
  render: function render() {
    return _react2.default.createElement(
      _FilterModalTemplate2.default,
      { title: 'Filter by data classification' },
      _react2.default.createElement(_FilterList2.default, {
        list: this.state.list,
        emitListItemClicked: this._onListItemClick })
    );
  }
});

module.exports = ActualFilter;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(actualList, 'actualList', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_ActualFilter/index.jsx');

  __REACT_HOT_LOADER__.register(ActualFilter, 'ActualFilter', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_ActualFilter/index.jsx');
}();

;

/***/ }),
/* 280 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilterModalTemplate = __webpack_require__(134);

var _FilterModalTemplate2 = _interopRequireDefault(_FilterModalTemplate);

var _FilterList = __webpack_require__(128);

var _FilterList2 = _interopRequireDefault(_FilterList);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var edtiableList = [{
  Id: true,
  Title: 'Editable'
}, {
  Id: false,
  Title: 'Not Editable'
}];

var EditableFilter = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    this.setState({
      list: edtiableList.map(function (item, index) {
        return {
          title: item.Title,
          id: item.Id,
          active: _.includes(_datasetListFilter2.default.store.editable, item.Id)
        };
      })
    });
  },
  _onListItemClick: function _onListItemClick(itemId) {
    _Actions2.default.UPDATE_DATASETLIST_FILTER('editable', itemId);
  },
  render: function render() {
    return _react2.default.createElement(
      _FilterModalTemplate2.default,
      { title: 'Filter by authority' },
      _react2.default.createElement(_FilterList2.default, {
        list: this.state.list,
        emitListItemClicked: this._onListItemClick })
    );
  }
});

module.exports = EditableFilter;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(edtiableList, 'edtiableList', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_EditableFilter/index.jsx');

  __REACT_HOT_LOADER__.register(EditableFilter, 'EditableFilter', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_EditableFilter/index.jsx');
}();

;

/***/ }),
/* 281 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilterModalTemplate = __webpack_require__(134);

var _FilterModalTemplate2 = _interopRequireDefault(_FilterModalTemplate);

var _FilterList = __webpack_require__(128);

var _FilterList2 = _interopRequireDefault(_FilterList);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FarmFilter = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleFilterUpdate'), _reflux2.default.listenTo(_datasetList2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var list = _.sortBy(_.uniq(_datasetList2.default.store.map(function (item, index) {
      return {
        Title: item.DairyBaseId
      };
    }), 'Title'), 'Title');

    this.setState({
      list: list.map(function (item, index) {
        return {
          title: item.Title,
          id: item.Title,
          active: _.includes(_datasetListFilter2.default.store.farms, item.Title)
        };
      })
    });
  },
  _onListItemClick: function _onListItemClick(itemId) {
    _Actions2.default.UPDATE_DATASETLIST_FILTER('farms', itemId);
  },
  render: function render() {
    return _react2.default.createElement(
      _FilterModalTemplate2.default,
      { title: 'Filter by farm' },
      _react2.default.createElement(_FilterList2.default, {
        list: this.state.list,
        emitListItemClicked: this._onListItemClick })
    );
  }
});

module.exports = FarmFilter;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FarmFilter, 'FarmFilter', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_FarmFilter/index.jsx');
}();

;

/***/ }),
/* 282 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilterModalTemplate = __webpack_require__(134);

var _FilterModalTemplate2 = _interopRequireDefault(_FilterModalTemplate);

var _FilterList = __webpack_require__(128);

var _FilterList2 = _interopRequireDefault(_FilterList);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var OwnerFilter = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleFilterUpdate'), _reflux2.default.listenTo(_datasetList2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var list = _.sortBy(_.uniq(_datasetList2.default.store.map(function (item, index) {
      return {
        Title: item.OwnerName
      };
    }), 'Title'), 'Title');

    this.setState({
      list: list.map(function (item, index) {
        return {
          title: item.Title,
          id: item.Title,
          active: _.includes(_datasetListFilter2.default.store.owners, item.Title)
        };
      })
    });
  },
  _onListItemClick: function _onListItemClick(itemId) {
    _Actions2.default.UPDATE_DATASETLIST_FILTER('owners', itemId);
  },
  render: function render() {
    return _react2.default.createElement(
      _FilterModalTemplate2.default,
      { title: 'Filter by financial year' },
      _react2.default.createElement(_FilterList2.default, {
        list: this.state.list,
        emitListItemClicked: this._onListItemClick })
    );
  }
});

module.exports = OwnerFilter;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(OwnerFilter, 'OwnerFilter', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_OwnerFilter/index.jsx');
}();

;

/***/ }),
/* 283 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilterModalTemplate = __webpack_require__(134);

var _FilterModalTemplate2 = _interopRequireDefault(_FilterModalTemplate);

var _FilterList = __webpack_require__(128);

var _FilterList2 = _interopRequireDefault(_FilterList);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var YearFilter = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleFilterUpdate'), _reflux2.default.listenTo(_datasetList2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var list = _.sortBy(_.uniq(_datasetList2.default.store.map(function (item, index) {
      return {
        Title: item.FinancialYear
      };
    }), 'Title'), 'Title');
    this.setState({
      list: list.map(function (item, index) {
        return {
          title: item.Title,
          id: item.Title,
          active: _.includes(_datasetListFilter2.default.store.years, item.Title)
        };
      })
    });
  },
  _onListItemClick: function _onListItemClick(itemId) {
    _Actions2.default.UPDATE_DATASETLIST_FILTER('years', itemId);
  },
  render: function render() {
    return _react2.default.createElement(
      _FilterModalTemplate2.default,
      { title: 'Filter by financial year' },
      _react2.default.createElement(_FilterList2.default, {
        list: this.state.list,
        emitListItemClicked: this._onListItemClick })
    );
  }
});

module.exports = YearFilter;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(YearFilter, 'YearFilter', 'C:/_repos_windows/dairybase/Frontend/app/views/global/filters/_YearFilter/index.jsx');
}();

;

/***/ }),
/* 284 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1077);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GroupModal = module.exports = __webpack_require__(1)({
  getDefaultProps: function getDefaultProps() {
    return {
      topOffset: 0,
      leftOffset: 0,
      rightOffset: 0,
      bottomOffset: 0
    };
  },
  _handleBackgroundClick: function _handleBackgroundClick(evt) {
    if (evt.target === this.modalBackground) {
      this.props.closePortal();
    }
  },
  render: function render() {
    var _this = this;

    var _arrow = (0, _classnames2.default)({
      _arrow: true,
      'is-left': this.props.arrowLeft,
      'is-right': this.props.arrowRight
    });
    return _react2.default.createElement(
      'div',
      {
        className: 'GroupModal',
        ref: function ref(_ref) {
          return _this.modalBackground = _ref;
        },
        onClick: this._handleBackgroundClick },
      _react2.default.createElement(
        'div',
        {
          className: 'GroupModal__innerContainer',
          style: {
            top: this.props.coords.top + 25 + this.props.topOffset - this.props.bottomOffset,
            left: this.props.coords.left - 175 - this.props.leftOffset + this.props.rightOffset
          } },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(
            'div',
            { className: _arrow },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'curvedtriangle' })
          ),
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.closePortal }),
          this.props.children
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GroupModal, 'GroupModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_GroupModal/index.jsx');
}();

;

/***/ }),
/* 285 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _style = __webpack_require__(553);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(_style.WarningIcon, null)
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCWarningIcon/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCWarningIcon/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 286 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _RatioInput = __webpack_require__(207);

var _RatioInput2 = _interopRequireDefault(_RatioInput);

var _style = __webpack_require__(560);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var editor = this.props.editor;


    return _react2.default.createElement(
      _react2.default.Fragment,
      null,
      _react2.default.createElement(
        _CCBanner2.default,
        {
          TitleText: 'Farm Operating Cash Surplus',
          TitleKey: 'CashFlowFarmOperatingSurplus' },
        _react2.default.createElement(
          _style.BannerOutputs,
          null,
          _react2.default.createElement(
            _style.Output,
            null,
            _react2.default.createElement(
              _style.OutputLabel,
              null,
              '$ value'
            ),
            _react2.default.createElement(
              _style.OutputValue,
              null,
              _react2.default.createElement(
                _ConnectedCCField2.default,
                { FieldKey: 'CashFlowFarmOperatingSurplus' },
                function (_ref) {
                  var Value = _ref.Value,
                      Decimal = _ref.Decimal;
                  return _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal });
                }
              )
            )
          ),
          _react2.default.createElement(
            _style.Output,
            null,
            _react2.default.createElement(
              _style.RatioBox,
              null,
              _react2.default.createElement(
                'div',
                { style: { transform: 'translateY(5px)' } },
                _react2.default.createElement(_RatioInput2.default, null)
              )
            ),
            _react2.default.createElement(
              _style.OutputValue,
              null,
              _react2.default.createElement(
                _ConnectedCCField2.default,
                {
                  FieldKey: 'CashFlowFarmOperatingSurplus',
                  ratio: 'switch' },
                function (_ref2) {
                  var Value = _ref2.Value,
                      Decimal = _ref2.Decimal;
                  return _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal });
                }
              )
            )
          ),
          _react2.default.createElement(
            _style.Output,
            null,
            _react2.default.createElement(
              _style.OutputLabel,
              null,
              '% Change'
            ),
            _react2.default.createElement(
              _style.OutputValue,
              null,
              _react2.default.createElement(
                _ConnectedCCField2.default,
                {
                  FieldKey: 'CashFlowFarmOperatingSurplus',
                  ratio: '%Change' },
                function (_ref3) {
                  var Value = _ref3.Value,
                      Decimal = _ref3.Decimal;
                  return _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal });
                }
              )
            )
          )
        )
      ),
      _react2.default.createElement(
        _ConnectedCCField2.default,
        { FieldKey: 'CcModelSwitchId' },
        function (_ref4) {
          var Value = _ref4.Value,
              onSubmit = _ref4.onSubmit;
          return _react2.default.createElement(_CCTable2.default, {
            isSummary: true,
            rows: [{
              IsHeader: true,
              cols: [{
                Label: 'Source Data'
              }, {
                Label: 'switch'
              }, {
                Label: 'New Budget',
                IsScenario: true
              }, {
                Label: 'switch',
                IsScenario: true
              }, {
                Label: '% Change',
                IsScenario: true
              }]
            }, {
              FieldKey: 'IncomeMilkTotal',
              cols: [{
                FieldKey: 'IncomeMilkTotal',
                IsSource: true
              }, {
                FieldKey: 'IncomeMilkTotal',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'IncomeMilkTotal',
                IsInput: editor,
                IsScenario: true
              }, {
                FieldKey: 'IncomeMilkTotal',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'IncomeMilkTotal',
                IsInput: editor,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              Label: 'Livestock Sales (net) ',
              Description: 'Change in total Farm Cash Income as a result of the budgeted milk income, livestock sales and livestock purchases',
              cols: [{
                FieldKey: 'IncomeLivestock',
                IsSource: true
              }, {
                FieldKey: 'IncomeLivestock',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'IncomeLivestock',
                IsInput: editor,
                IsScenario: true
              }, {
                FieldKey: 'IncomeLivestock',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'IncomeLivestock',
                IsInput: editor,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              FieldKey: 'CashFlowLivestockPurchase',
              BeforeTotal: true,
              cols: [{
                FieldKey: 'CashFlowLivestockPurchase',
                IsSource: true
              }, {
                FieldKey: 'CashFlowLivestockPurchase',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'CashFlowLivestockPurchase',
                IsInput: editor,
                IsScenario: true
              }, {
                FieldKey: 'CashFlowLivestockPurchase',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'CashFlowLivestockPurchase',
                IsInput: editor,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              Label: 'Change in Farm Cash Income',
              Description: 'Change in total Farm Cash Income as a result of the budgeted milk income, livestock sales and livestock purchases',
              IsTotal: true,
              cols: [{
                FieldKey: 'IncomeFarmCashTotal',
                IsDifference: true,
                IsScenario: true
              }, {
                FieldKey: 'IncomeFarmCashTotal',
                ratio: 'switch',
                IsDifference: true,
                IsScenario: true
              }, {
                FieldKey: 'IncomeFarmCashTotal',
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              FieldKey: 'ExpenseFertiliser',
              cols: [{
                FieldKey: 'ExpenseFertiliser',
                IsSource: true
              }, {
                FieldKey: 'ExpenseFertiliser',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'ExpenseFertiliser',
                IsInput: editor,
                IsScenario: true
              }, {
                FieldKey: 'ExpenseFertiliser',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'ExpenseFertiliser',
                IsInput: editor,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              FieldKey: 'ExpenseWaterPurchase',
              cols: [{
                FieldKey: 'ExpenseWaterPurchase',
                IsSource: true
              }, {
                FieldKey: 'ExpenseWaterPurchase',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'ExpenseWaterPurchase',
                IsInput: editor,
                IsScenario: true
              }, {
                FieldKey: 'ExpenseWaterPurchase',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'ExpenseWaterPurchase',
                IsInput: editor,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              FieldKey: 'ExpenseIrrigationOther',
              cols: [{
                FieldKey: 'ExpenseIrrigationOther',
                IsSource: true
              }, {
                FieldKey: 'ExpenseIrrigationOther',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'ExpenseIrrigationOther',
                IsInput: editor,
                IsScenario: true
              }, {
                FieldKey: 'ExpenseIrrigationOther',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'ExpenseIrrigationOther',
                IsInput: editor,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              Label: 'Purchased Fodder',
              FieldKey: 'ExpenseFodderPurchase',
              cols: [{
                FieldKey: 'ExpenseFodderPurchase',
                IsSource: true
              }, {
                FieldKey: 'ExpenseFodderPurchase',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: Value === 0 ? 'ExpenseFodderPurchase' : 'ExpenseFodderPhysicalPurchase',
                IsInput: editor && Value === 0,
                IsScenario: true
              }, {
                FieldKey: Value === 0 ? 'ExpenseFodderPurchase' : 'ExpenseFodderPhysicalPurchase',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: Value === 0 ? 'ExpenseFodderPurchase' : 'ExpenseFodderPhysicalPurchase',
                IsInput: editor && Value === 0,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              Label: 'Concentrates',
              FieldKey: 'ExpenseConcentratesPurchase',
              cols: [{
                FieldKey: 'ExpenseConcentratesPurchase',
                IsSource: true
              }, {
                FieldKey: 'ExpenseConcentratesPurchase',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: Value === 0 ? 'ExpenseConcentratesPurchase' : 'ExpenseConcentratesPhysicalPurchase',
                IsInput: editor && Value === 0,
                IsScenario: true
              }, {
                FieldKey: Value === 0 ? 'ExpenseConcentratesPurchase' : 'ExpenseConcentratesPhysicalPurchase',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: Value === 0 ? 'ExpenseConcentratesPurchase' : 'ExpenseConcentratesPhysicalPurchase',
                IsInput: editor && Value === 0,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              FieldKey: 'ExpenseOtherFeedPurchase',
              BeforeTotal: true,
              cols: [{
                FieldKey: 'ExpenseOtherFeedPurchase',
                IsSource: true
              }, {
                FieldKey: 'ExpenseOtherFeedPurchase',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: Value === 0 ? 'ExpenseOtherFeedPurchase' : 'ExpenseOtherFeedPhysicalPurchase',
                IsInput: editor && Value === 0,
                IsScenario: true
              }, {
                FieldKey: Value === 0 ? 'ExpenseOtherFeedPurchase' : 'ExpenseOtherFeedPhysicalPurchase',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: Value === 0 ? 'ExpenseOtherFeedPurchase' : 'ExpenseOtherFeedPhysicalPurchase',
                IsInput: editor && Value === 0,
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              Label: 'Change in Total Farm Working Expense',
              Description: 'Change in Farm Working Expenses based on the budget values for fertiliser, water and purchased feeds',
              IsTotal: true,
              cols: [{
                FieldKey: 'ExpenseFarmWorking',
                IsScenario: true,
                IsDifference: true
              }, {
                FieldKey: 'ExpenseFarmWorking',
                ratio: 'switch',
                IsScenario: true,
                IsDifference: true
              }, {
                FieldKey: 'ExpenseFarmWorking',
                ratio: '%Change',
                IsScenario: true,
                IsDifference: true
              }]
            }, {
              FieldKey: 'CashFlowFarmOperatingSurplus',
              BeforeTotal: true,
              Squeezed: true,
              cols: [{
                FieldKey: 'CashFlowFarmOperatingSurplus',
                IsSource: true
              }, {
                FieldKey: 'CashFlowFarmOperatingSurplus',
                IsSource: true,
                ratio: 'switch'
              }, {
                FieldKey: 'CashFlowFarmOperatingSurplus',
                IsScenario: true
              }, {
                FieldKey: 'CashFlowFarmOperatingSurplus',
                ratio: 'switch',
                IsScenario: true
              }, {
                FieldKey: 'CashFlowFarmOperatingSurplus',
                ratio: '%Change',
                IsScenario: true
              }]
            }, {
              Label: 'Change in Operating Cash Surplus',
              Description: 'Change in Farm Operating Cash Surplus based on the Farm Operating Cash Surplus from the historical year plus budgeted changes to cash income less the budgeted changes in Total Farm Working Expenses',
              IsTotal: true,
              cols: [{
                FieldKey: 'CashFlowFarmOperatingSurplus',
                IsScenario: true,
                IsDifference: true
              }, {
                FieldKey: 'CashFlowFarmOperatingSurplus',
                ratio: 'switch',
                IsScenario: true,
                IsDifference: true
              }, {
                FieldKey: 'CashFlowFarmOperatingSurplus',
                ratio: '%Change',
                IsScenario: true,
                IsDifference: true
              }]
            }]
          });
        }
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 287 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1089);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GroupModal = module.exports = __webpack_require__(1)({
  getDefaultProps: function getDefaultProps() {
    return {
      topOffset: 0,
      leftOffset: 0,
      rightOffset: 0,
      bottomOffset: 0
    };
  },
  _handleBackgroundClick: function _handleBackgroundClick(evt) {
    if (evt.target === this.modalBackground) {
      this.props.closePortal();
    }
  },
  render: function render() {
    var _this = this;

    var _arrow = (0, _classnames2.default)({
      _arrow: true,
      'is-left': this.props.arrowLeft,
      'is-right': this.props.arrowRight
    });
    return _react2.default.createElement(
      'div',
      {
        className: 'DownloadPortal__GroupModal',
        ref: function ref(_ref) {
          return _this.modalBackground = _ref;
        },
        onClick: this._handleBackgroundClick },
      _react2.default.createElement(
        'div',
        {
          className: 'DownloadPortal__GroupModal__innerContainer',
          style: {
            top: this.props.coords.top + 25 + this.props.topOffset - this.props.bottomOffset,
            left: this.props.coords.left - 175 - this.props.leftOffset + this.props.rightOffset
          } },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(
            'div',
            { className: _arrow },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'curvedtriangle' })
          ),
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.closePortal }),
          this.props.children
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GroupModal, 'GroupModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_SmallFilterbar/_FilterControls/_Col/_GroupModal/index.jsx');
}();

;

/***/ }),
/* 288 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames3 = __webpack_require__(7);

var _classnames4 = _interopRequireDefault(_classnames3);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _xchSpinner = __webpack_require__(200);

var _xchSpinner2 = _interopRequireDefault(_xchSpinner);

var _style = __webpack_require__(978);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var CheckBox = module.exports = __webpack_require__(1)({
  _handleSubmitData: function _handleSubmitData() {
    if (this.props.disabled) return;
    this.props.onSubmit(+this.props.value ? 0 : 1);
  },
  render: function render() {
    var _classnames, _classnames2;

    var InputSwitchbox = (0, _classnames4.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['InputSwitchbox'], true), _defineProperty(_classnames, _style2.default['is-error'], this.props.error), _classnames));

    var checkClasses = (0, _classnames4.default)((_classnames2 = {}, _defineProperty(_classnames2, _style2.default['_box'], true), _defineProperty(_classnames2, _style2.default['is-checked'], this.props.value), _defineProperty(_classnames2, _style2.default['is-pending'], this.props.pending), _defineProperty(_classnames2, _style2.default['is-disabled'], this.props.disabled), _classnames2));

    return _react2.default.createElement(
      'div',
      { className: InputSwitchbox },
      _react2.default.createElement(
        'div',
        { className: checkClasses, onClick: this._handleSubmitData },
        this.renderIcon()
      )
    );
  },
  renderIcon: function renderIcon() {
    if (this.props.pending) return _react2.default.createElement(
      'div',
      { className: _style2.default.spinner },
      _react2.default.createElement(_xchSpinner2.default, null)
    );

    return !this.props.value ? null : _react2.default.createElement(_Icon2.default, { id: 'tick',
      className: _style2.default.icon });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(CheckBox, 'CheckBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_IndustryAuthority/DatasetItem/_shared/CheckBox/index.jsx');
}();

;

/***/ }),
/* 289 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1102);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilterControls = __webpack_require__(107);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filterbar = module.exports = __webpack_require__(1)({
  _handleColumnClick: function _handleColumnClick(id) {
    console.log(id);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportSubRoute__Filterbar', style: { right: (0, _getScrollbarWidth2.default)() } },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_FilterControls2.default, {
          emitColumnClick: this._handleColumnClick })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filterbar, 'Filterbar', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_ReportSubRoute/_FilterBar/index.jsx');
}();

;

/***/ }),
/* 290 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1103);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilterControls = __webpack_require__(107);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SmallFilterbar = module.exports = __webpack_require__(1)({
  _handleColumnClick: function _handleColumnClick(id) {
    console.log(id);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportSubRoute__SmallFilterbar' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_FilterControls2.default, {
            emitColumnClick: this._handleColumnClick,
            hasCheckbox: this.props.hasCheckbox })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SmallFilterbar, 'SmallFilterbar', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_ReportSubRoute/_SmallFilterBar/index.jsx');
}();

;

/***/ }),
/* 291 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1113);

var _index2 = _interopRequireDefault(_index);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _RadioSwitch = __webpack_require__(471);

var _RadioSwitch2 = _interopRequireDefault(_RadioSwitch);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _RadioList = __webpack_require__(470);

var _RadioList2 = _interopRequireDefault(_RadioList);

var _groupTemplate = __webpack_require__(601);

var _groupTemplate2 = _interopRequireDefault(_groupTemplate);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _POST__createData = __webpack_require__(189);

var _POST__createData2 = _interopRequireDefault(_POST__createData);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LivestockForm = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_dataDefinition2.default, 'handleSelectOptionsUpdate')],

  getInitialState: function getInitialState() {
    return {
      feedGroupOptions: [],
      switchAsIsTdmOptions: [],
      IsPurchased: this.props.data.IsPurchased.Value,
      FeedGroupId: this.props.data.FeedGroupId.Value,
      FeedTypeId: this.props.data.FeedTypeId.Value,
      SwitchAsIsTdm: this.props.data.SwitchAsIsTdm.Value,
      QuantityOpening: this.props.data.QuantityOpening.Value,
      QuantityClosing: this.props.data.QuantityClosing.Value,
      QuantityPurchased: this.props.data.QuantityPurchased.Value,
      PricePerTonne: this.props.data.PricePerTonne.Value,
      QuantityFedMilkingArea: this.props.data.QuantityFedMilkingArea.Value,
      QuantityFedSupportArea: this.props.data.QuantityFedSupportArea.Value,
      QuantityProducedMilkingArea: this.props.data.QuantityProducedMilkingArea.Value,
      QuantityProducedSupportArea: this.props.data.QuantityProducedSupportArea.Value,
      DryMatterPercent: this.props.data.DryMatterPercent.Value,
      WastePercent: this.props.data.WastePercent.Value,
      QuantitySoldLost: this.props.data.QuantitySoldLost.Value,
      EnergyMJPerKgDM: this.props.data.EnergyMJPerKgDM.Value
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleSelectOptionsUpdate();
  },
  handleSelectOptionsUpdate: function handleSelectOptionsUpdate() {
    this.setState({
      feedGroupOptions: _dataDefinition2.default.selectOptions.FeedGroupId,
      switchAsIsTdmOptions: _dataDefinition2.default.selectOptions.SwitchAsIsTdm
    });
  },
  componentDidMount: function componentDidMount() {
    this.checkDefaults();
  },
  checkDefaults: function checkDefaults() {
    return this.state.DryMatterPercent === 0 ? this._handleInputSubmit(this.state.FeedTypeId, 'FeedTypeId') : null;
  },
  _handleInputSubmit: function _handleInputSubmit(value, id) {

    var obj = _.cloneDeep(this.state);
    obj[id] = value;

    // recalculate defaults, depending on the input changed
    if (id === 'FeedGroupId') {
      var newTypeId = this._findFeedTypeOptions(value)[0].Id;
      obj.FeedTypeId = newTypeId;
      obj.DryMatterPercent = (this._getDefaultObj(value, newTypeId, 'DryMatterPercent') * 100).toFixed(1);
      obj.WastePercent = (this._getDefaultObj(value, newTypeId, 'WastePercent') * 100).toFixed(1);
      obj.EnergyMJPerKgDM = this._getDefaultObj(value, newTypeId, 'EnergyMJPerKgDM');
      obj.PricePerTonne = this._getDefaultPurchasePrice(value, newTypeId, 'FeedPriceArray', obj).toFixed(0);
    }

    if (id === 'IsPurchased') {
      obj[id] = value === 0 ? false : true;
    }

    if (id === 'FeedTypeId') {
      obj.DryMatterPercent = (this._getDefaultObj(this.state.FeedGroupId, value, 'DryMatterPercent') * 100).toFixed(1);
      obj.WastePercent = (this._getDefaultObj(this.state.FeedGroupId, value, 'WastePercent') * 100).toFixed(1);
      obj.EnergyMJPerKgDM = this._getDefaultObj(this.state.FeedGroupId, value, 'EnergyMJPerKgDM');
      var result = this._getDefaultPurchasePrice(this.state.FeedGroupId, value, 'FeedPriceArray', obj).toFixed(0);
      obj.PricePerTonne = result;
    }

    if (id === 'SwitchAsIsTdm') {
      obj.PricePerTonne = this._getDefaultPurchasePrice(this.state.FeedGroupId, this.state.FeedTypeId, 'FeedPriceArray', obj).toFixed(0);
    }

    this.setState(obj);
  },
  _getDefaultPurchasePrice: function _getDefaultPurchasePrice(groupId, typeId, fieldId, stateObj) {
    var priceArray = this._getDefaultObj(groupId, typeId, fieldId);
    var yearId = _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id }).FinancialYearId;
    var priceObj = _.find(priceArray, { FinancialYearId: yearId });

    var feedPrice = +priceObj.FeedPrice;
    var dryMatter = +stateObj.DryMatterPercent;

    if (stateObj.SwitchAsIsTdm) {
      // selected asIs
      return priceObj.AsIs ? feedPrice : feedPrice * (dryMatter / 100);
    } else {
      // selected dryMatter
      return priceObj.AsIs ? feedPrice * 100 / dryMatter : feedPrice;
    }
  },
  _getDefaultObj: function _getDefaultObj(groupId, typeId, fieldId) {
    var groupOptions = this._findFeedTypeOptions(groupId);
    var typeObj = _.find(groupOptions, { Id: typeId });
    return typeObj[fieldId];
  },
  _findFeedTypeOptions: function _findFeedTypeOptions(value) {
    return _.find(this.state.feedGroupOptions, { Id: value }).Options;
  },
  _toggleSubmitRequestPortal: function _toggleSubmitRequestPortal() {
    if (!this.props.editAuthority) return;
    this.setState({
      submitRequestPortalOpen: !this.state.submitRequestPortalOpen
    });
  },
  _handleSubmitSuccess: function _handleSubmitSuccess() {
    this._toggleSubmitRequestPortal();
    this.props.closePortal();
  },
  _getPostData: function _getPostData() {
    var data = {
      Table: this.props.data.FeedGroupId.Table,
      Data: [{
        Fields: {
          IsPurchased: this.state.IsPurchased,
          FeedGroupId: this.state.FeedGroupId,
          FeedTypeId: this.state.FeedTypeId,
          SwitchAsIsTdm: this.state.SwitchAsIsTdm,
          QuantityOpening: this.state.QuantityOpening,
          QuantityClosing: this.state.QuantityClosing,
          QuantityPurchased: this.state.QuantityPurchased,
          PricePerTonne: this.state.PricePerTonne,
          QuantityFedMilkingArea: this.state.QuantityFedMilkingArea,
          QuantityFedSupportArea: this.state.QuantityFedSupportArea,
          QuantityProducedMilkingArea: this.state.QuantityProducedMilkingArea,
          QuantityProducedSupportArea: this.state.QuantityProducedSupportArea,
          DryMatterPercent: +this.state.DryMatterPercent / 100,
          WastePercent: +this.state.WastePercent / 100,
          QuantitySoldLost: this.state.QuantitySoldLost,
          EnergyMJPerKgDM: this.state.EnergyMJPerKgDM
        }
      }]
    };

    if (!this.props.newRow) data.Data[0].RowId = this.props.data.Id;

    return data;
  },
  _calculateSoldLost: function _calculateSoldLost() {
    var opening = +this.state.QuantityOpening;
    var purchased = +this.state.QuantityPurchased;
    var hMilking = +this.state.QuantityProducedMilkingArea;
    var hSupport = +this.state.QuantityProducedSupportArea;
    var fMilking = +this.state.QuantityFedMilkingArea;
    var fSupport = +this.state.QuantityFedSupportArea;
    var closing = +this.state.QuantityClosing;
    return (opening + purchased + hMilking + hSupport - fMilking - fSupport - closing).toFixed(1);
  },
  render: function render() {
    // TODO: Get descriptions for labels dynamically via a 'Description Store'
    return _react2.default.createElement(
      'div',
      { className: 'FeedForm' },
      _react2.default.createElement(
        _groupTemplate2.default,
        { className: 'FeedForm__group' },
        _react2.default.createElement(
          'div',
          null,
          _react2.default.createElement(
            'div',
            { className: '_radioInput' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: 'Feed Group:',
              description: this.props.data.FeedGroupId.Description }),
            _react2.default.createElement(_RadioList2.default, {
              id: 'FeedGroupId',
              value: this.state.FeedGroupId,
              options: this.state.feedGroupOptions,
              onSubmit: this._handleInputSubmit })
          )
        ),
        _react2.default.createElement(
          'div',
          null,
          _react2.default.createElement(
            'div',
            { className: '_selectInput' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: 'Feed Source:',
              description: this.props.data.IsPurchased.Description }),
            _react2.default.createElement(_InputSelect2.default, {
              id: 'IsPurchased',
              value: this.state.IsPurchased ? 1 : 0,
              options: [{ Id: 0, Title: 'Homegrown' }, { Id: 1, Title: 'Purchased' }],
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Dry Matter Selection',
              description: this.props.data.SwitchAsIsTdm.Description },
            _react2.default.createElement(_RadioSwitch2.default, {
              id: 'SwitchAsIsTdm',
              options: this.state.switchAsIsTdmOptions,
              value: this.state.SwitchAsIsTdm,
              onSubmit: this._handleInputSubmit })
          )
        ),
        _react2.default.createElement(
          'div',
          null,
          _react2.default.createElement(
            'div',
            { className: '_selectInput' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: 'Feed Type:',
              description: this.props.data.FeedTypeId.Description }),
            _react2.default.createElement(_InputSelect2.default, {
              id: 'FeedTypeId',
              value: this.state.FeedTypeId,
              options: this._findFeedTypeOptions(this.state.FeedGroupId),
              onSubmit: this._handleInputSubmit })
          )
        )
      ),
      _react2.default.createElement(
        _groupTemplate2.default,
        { className: 'FeedForm__group' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Opening Stock',
            description: this.props.data.QuantityOpening.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityOpening',
            decimal: this.props.data.QuantityOpening.Decimal,
            value: this.state.QuantityOpening,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Closing Stock',
            description: this.props.data.QuantityClosing.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityClosing',
            decimal: this.props.data.QuantityClosing.Decimal,
            value: this.state.QuantityClosing,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Quantity Purchased',
            description: this.props.data.QuantityPurchased.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityPurchased',
            decimal: this.props.data.QuantityPurchased.Decimal,
            value: this.state.QuantityPurchased,
            disabled: !this.state.IsPurchased && (this.state.QuantityPurchased === 0 || this.state.QuantityPurchased === '0.0'),
            onSubmit: this._handleInputSubmit })
        )
      ),
      _react2.default.createElement(
        _groupTemplate2.default,
        { className: 'FeedForm__group' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Fed on Milking Area',
            description: this.props.data.QuantityFedMilkingArea.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityFedMilkingArea',
            decimal: this.props.data.QuantityFedMilkingArea.Decimal,
            value: this.state.QuantityFedMilkingArea,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Fed on Support Area',
            description: this.props.data.QuantityFedSupportArea.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityFedSupportArea',
            decimal: this.props.data.QuantityFedSupportArea.Decimal,
            value: this.state.QuantityFedSupportArea,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: this.state.IsPurchased ? 'Purchase Price' : 'Feed Value',
            description: this.props.data.PricePerTonne.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'PricePerTonne',
            decimal: this.props.data.PricePerTonne.Decimal,
            value: this.state.PricePerTonne,
            onSubmit: this._handleInputSubmit })
        )
      ),
      _react2.default.createElement(
        _groupTemplate2.default,
        { className: 'FeedForm__group' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Harvested on Milking Area',
            description: this.props.data.QuantityProducedMilkingArea.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityProducedMilkingArea',
            decimal: this.props.data.QuantityProducedMilkingArea.Decimal,
            value: this.state.QuantityProducedMilkingArea,
            disabled: this.state.IsPurchased && (this.state.QuantityProducedMilkingArea === 0 || this.state.QuantityProducedMilkingArea === '0.0'),
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Harvested on Support Area',
            description: this.props.data.QuantityProducedSupportArea.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'QuantityProducedSupportArea',
            decimal: this.props.data.QuantityProducedSupportArea.Decimal,
            value: this.state.QuantityProducedSupportArea,
            disabled: this.state.IsPurchased && (this.state.QuantityProducedSupportArea === 0 || this.state.QuantityProducedSupportArea === '0.0'),
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Quantity Sold or Lost',
            description: 'Quantity of the selected feed type sold or lost through fire, flood etc. This is calculated from the total of opening, purchased and harvested less the total closing quantity and quantity fed' },
          _react2.default.createElement(
            'div',
            { className: '__physicalOutput' },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateSoldLost() })
          )
        )
      ),
      _react2.default.createElement(
        'h2',
        { className: '_title' },
        'Feed Defaults'
      ),
      _react2.default.createElement(
        _groupTemplate2.default,
        { className: 'FeedForm__group' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Dry Matter %',
            description: this.props.data.DryMatterPercent.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'DryMatterPercent',
            decimal: this.props.data.DryMatterPercent.Decimal,
            value: this.state.DryMatterPercent,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Wastage in Feeding %',
            description: this.props.data.WastePercent.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'WastePercent',
            decimal: this.props.data.WastePercent.Decimal,
            value: this.state.WastePercent,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Feed Energy ME / kg DM',
            description: this.props.data.EnergyMJPerKgDM.Description },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'EnergyMJPerKgDM',
            decimal: this.props.data.EnergyMJPerKgDM.Decimal,
            value: this.state.EnergyMJPerKgDM,
            onSubmit: this._handleInputSubmit })
        )
      ),
      _react2.default.createElement(
        'button',
        {
          className: 'generic__submitBtn',
          onClick: this._toggleSubmitRequestPortal },
        'Submit Feed'
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.submitRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleSubmitSuccess,
          failHandler: this._toggleSubmitRequestPortal,
          request: this.props.newRow ? _POST__createData2.default : _POST__editData2.default,
          data: this._getPostData(),
          pendingText: {
            title: 'Please wait',
            text: 'Saving feed item'
          },
          successText: {
            title: 'Feed item saved!',
            text: 'Updating feed list.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Feed item could not be saved.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LivestockForm, 'LivestockForm', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Feed/_Form/index.jsx');
}();

;

/***/ }),
/* 292 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1116);

var _index2 = _interopRequireDefault(_index);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _POST__createData = __webpack_require__(189);

var _POST__createData2 = _interopRequireDefault(_POST__createData);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var LivestockForm = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_dataDefinition2.default, 'handleSelectOptionsUpdate')],

  getInitialState: function getInitialState() {
    return {
      'fertTypeOptions': [],
      'TonnesAppliedMilkingArea': this.props.data.TonnesAppliedMilkingArea.Value,
      'TonnesApplied': this.props.data.TonnesApplied.Value,
      'FertiliserTypeId': this.props.data.FertiliserTypeId.Value,
      'NitrogenPercent': this.props.data.NitrogenPercent.Value,
      'PhosphorousPercent': this.props.data.PhosphorousPercent.Value,
      'PotassiumPercent': this.props.data.PotassiumPercent.Value,
      'SulphurPercent': this.props.data.SulphurPercent.Value
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleSelectOptionsUpdate();
  },
  componentDidMount: function componentDidMount() {
    this.checkDefaults();
  },
  checkDefaults: function checkDefaults() {
    return this.state.NitrogenPercent === 0 ? this._handleInputSubmit(this.state.FertiliserTypeId, 'FertiliserTypeId') : null;
  },
  handleSelectOptionsUpdate: function handleSelectOptionsUpdate() {
    this.setState({
      fertTypeOptions: _dataDefinition2.default.selectOptions.FertiliserTypeId
    });
  },
  _handleInputSubmit: function _handleInputSubmit(value, id) {
    var obj = _defineProperty({}, id, value);

    // recalculate defaults, depending on the input changed
    if (id === 'FertiliserTypeId') {
      obj.NitrogenPercent = (_.find(this.state.fertTypeOptions, { Id: value }).NitrogenPercent * 100).toFixed(1);
      obj.PhosphorousPercent = (_.find(this.state.fertTypeOptions, { Id: value }).PhosphorousPercent * 100).toFixed(1);
      obj.PotassiumPercent = (_.find(this.state.fertTypeOptions, { Id: value }).PotassiumPercent * 100).toFixed(1);
      obj.SulphurPercent = (_.find(this.state.fertTypeOptions, { Id: value }).SulphurPercent * 100).toFixed(1);
    }

    this.setState(obj);
  },
  _toggleSubmitRequestPortal: function _toggleSubmitRequestPortal() {
    if (!this.props.editAuthority) return;
    this.setState({
      submitRequestPortalOpen: !this.state.submitRequestPortalOpen
    });
  },
  _handleSubmitSuccess: function _handleSubmitSuccess() {
    this._toggleSubmitRequestPortal();
    this.props.closePortal();
  },
  _getPostData: function _getPostData() {
    var data = {
      Table: this.props.data.FertiliserTypeId.Table,
      Data: [{
        Fields: {
          'TonnesAppliedMilkingArea': this.state.TonnesAppliedMilkingArea,
          'TonnesApplied': this.state.TonnesApplied,
          'FertiliserTypeId': this.state.FertiliserTypeId,
          'NitrogenPercent': +this.state.NitrogenPercent / 100,
          'PhosphorousPercent': +this.state.PhosphorousPercent / 100,
          'PotassiumPercent': +this.state.PotassiumPercent / 100,
          'SulphurPercent': +this.state.SulphurPercent / 100
        }
      }]
    };

    if (!this.props.newRow) data.Data[0].RowId = this.props.data.Id;

    return data;
  },
  render: function render() {
    // TODO: Get descriptions for labels dynamically via a 'Description Store'
    return _react2.default.createElement(
      'div',
      { className: 'FertiliserForm' },
      _react2.default.createElement(
        _LabelWrapper2.default,
        {
          label: 'Fertiliser Type',
          description: 'Select the type of fertiliser applied from the dropdown box' },
        _react2.default.createElement(_InputSelect2.default, {
          id: 'FertiliserTypeId',
          value: this.state.FertiliserTypeId,
          options: this.state.fertTypeOptions,
          onSubmit: this._handleInputSubmit })
      ),
      _react2.default.createElement(
        _ColumnWrapper2.default,
        null,
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Total: Tonnes',
            description: 'Total tonnes of the selected fertiliser type applied on the farm' },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'TonnesApplied',
            decimal: this.props.data.TonnesApplied.Decimal,
            value: this.state.TonnesApplied,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Milking Area: Tonnes',
            description: 'Total tonnes of the selected fertiliser type applied to the milking area' },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'TonnesAppliedMilkingArea',
            decimal: this.props.data.TonnesAppliedMilkingArea.Decimal,
            value: this.state.TonnesAppliedMilkingArea,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Support Area: Tonnes',
            description: null },
          _react2.default.createElement(
            'div',
            { className: '__physicalOutput' },
            _react2.default.createElement(_OutputSimple2.default, { value: (+this.state.TonnesApplied - +this.state.TonnesAppliedMilkingArea).toFixed(1) })
          )
        )
      ),
      _react2.default.createElement(
        'h2',
        null,
        'Default Nurient Composition'
      ),
      _react2.default.createElement(
        _ColumnWrapper2.default,
        null,
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Nitrogen %',
            description: 'Percent of nitrogen in selected fertiliser' },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'NitrogenPercent',
            decimal: this.props.data.NitrogenPercent.Decimal,
            value: this.state.NitrogenPercent,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Phosphorous %',
            description: 'Percentage of phosphorous in selected fertiliser' },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'PhosphorousPercent',
            decimal: this.props.data.PhosphorousPercent.Decimal,
            value: this.state.PhosphorousPercent,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Potassium %',
            description: 'Percent of potassium in selected fertiliser' },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'PotassiumPercent',
            decimal: this.props.data.PotassiumPercent.Decimal,
            value: this.state.PotassiumPercent,
            onSubmit: this._handleInputSubmit })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          {
            label: 'Sulphur %',
            description: 'Percent of sulphur in selected fertiliser' },
          _react2.default.createElement(_InputNumber2.default, {
            id: 'SulphurPercent',
            decimal: this.props.data.SulphurPercent.Decimal,
            value: this.state.SulphurPercent,
            onSubmit: this._handleInputSubmit })
        )
      ),
      _react2.default.createElement(
        'button',
        {
          className: 'generic__submitBtn',
          onClick: this._toggleSubmitRequestPortal },
        'Submit Fertiliser'
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.submitRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleSubmitSuccess,
          failHandler: this._toggleSubmitRequestPortal,
          request: this.props.newRow ? _POST__createData2.default : _POST__editData2.default,
          data: this._getPostData(),
          pendingText: {
            title: 'Please wait',
            text: 'Saving fertiliser item'
          },
          successText: {
            title: 'Fertiliser item saved!',
            text: 'Updating fertiliser list.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Fertiliser item could not be saved.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LivestockForm, 'LivestockForm', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Fertiliser/_Form/index.jsx');
}();

;

/***/ }),
/* 293 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1141);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _PopupButton = __webpack_require__(153);

var _PopupButton2 = _interopRequireDefault(_PopupButton);

var _hexToRgb = __webpack_require__(149);

var _hexToRgb2 = _interopRequireDefault(_hexToRgb);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartHeader = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_container' },
      this.renderComparisonGroups(),
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'User Selected Datasets:'
        ),
        this.renderUserDatasets()
      )
    );
  },
  renderComparisonGroups: function renderComparisonGroups() {
    var _this = this;

    var stingifiedNumbers = ['First', 'Second', 'Third', 'Fourth'];
    var legend = _dataDefinition2.default.chartSettings[this.props.activeTab.settingsId].JsonSetting.graphs;
    var comparisonGroup1 = legend.slice(0, 4);
    var comparisonGroup2 = legend.slice(4, 8);

    return _.map([comparisonGroup1, comparisonGroup2], function (datasets, index) {

      var legendUnits = _.map(datasets, function (dataset, index) {
        var border = dataset.bulletBorderThickness;
        var alpha = dataset.bulletAlpha;
        var shape = dataset.bullet;
        var color = dataset.bulletColor;
        var id = dataset.id;
        var spanStyle = {
          borderRadius: shape === 'round' ? '50%' : null,
          backgroundColor: 'rgba(' + (0, _hexToRgb2.default)(color).rgb + ', ' + alpha + ')',
          border: border === 1 ? '1px solid ' + color : 'none',
          width: 10,
          display: 'inline-block',
          height: 10,
          marginRight: 5
        };
        return _react2.default.createElement(
          'div',
          { key: index, className: 'Legend__unit' },
          _react2.default.createElement('span', { style: spanStyle }),
          _react2.default.createElement(
            'span',
            null,
            stingifiedNumbers[index],
            ' Quartile'
          )
        );
      });
      return _react2.default.createElement(
        'div',
        { key: index, className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          index === 0 ? _this.state.group1 : _this.state.group2,
          ':'
        ),
        legendUnits
      );
    });
  },
  renderUserDatasets: function renderUserDatasets() {
    var _this2 = this;

    var legend = _dataDefinition2.default.chartSettings[this.props.activeTab.settingsId].JsonSetting.graphs;
    var userSelectedDatasets = legend.slice(8);

    return _.map(userSelectedDatasets, function (dataset, index) {

      var datasetList = _this2.props.selectedDatasets;
      if (index + 1 > datasetList.length) return null;

      var shape = dataset.bullet;
      var color = dataset.bulletColor;
      var datasetDetail = _.find(_datasetList2.default.store, { Id: datasetList[index] });
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        backgroundColor: color,
        border: '2px solid ' + color,
        width: 15,
        display: 'inline-block',
        height: 15,
        marginRight: 5,
        opacity: 0.8
      };
      return _react2.default.createElement(
        _PopupButton2.default,
        {
          key: index,
          description: datasetDetail.Name + '\n            <br/>\n            ' + datasetDetail.DairyBaseId + ' \u2014 ' + datasetDetail.FinancialYear + '\n            <br/>' },
        _react2.default.createElement(
          'div',
          { key: index, className: 'Legend__unit' },
          _react2.default.createElement('span', { style: spanStyle }),
          _react2.default.createElement(
            'span',
            null,
            datasetDetail.Name
          )
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartHeader, 'ChartHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_ChartHeader/index.jsx');
}();

;

/***/ }),
/* 294 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1149);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var index = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      filterRequestPortalOpen: false,
      filterRequestFields: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  _onFilterChange: function _onFilterChange(newValue, fieldId) {
    this.setState({
      filterRequestFields: _defineProperty({}, fieldId, newValue),
      filterRequestPortalOpen: true
    });
  },
  _toggleFilterRequestPortal: function _toggleFilterRequestPortal() {
    this.setState({
      filterRequestPortalOpen: !this.state.filterRequestPortalOpen
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      { key: this.props.tabKey, className: 'SingleReport__tableHeadings' },
      this._renderHeadings()
    );
  },
  _renderHeadings: function _renderHeadings() {
    var row = this.state.report.tables.TextTable[0];
    var filters = !this.props.activeTab.balanceSheet ? this.props.filters : _.take(this.props.filters, 3);
    return _react2.default.createElement(
      'div',
      { className: 'SingleReportTable__row is-heading' },
      _react2.default.createElement(
        'div',
        { className: 'SingleReportTable__label' },
        _react2.default.createElement(
          'div',
          { className: '_hierachy' },
          row.Props.Hierachy
        ),
        _react2.default.createElement(
          'div',
          { className: '_label' },
          row.Props.Label
        ),
        _react2.default.createElement(
          'div',
          { className: '_unit' },
          row.Props.Unit
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'SingleReportTable__data is-calculated-data' },
        _react2.default.createElement(
          'div',
          { className: '_col' },
          this.props.activeTab.balanceSheet ? 'Opening' : 'Value'
        ),
        !this.props.activeTab.balanceSheet ? null : _react2.default.createElement(
          'div',
          { className: '_col' },
          'Closing'
        ),
        !this.props.activeTab.balanceSheet ? null : _react2.default.createElement(
          'div',
          { className: '_col' },
          'Average'
        ),
        [1, 3, 2, 5, 4, 7].map(function (id, index) {
          var filterOptions = filters[0].Options;
          return _react2.default.createElement(
            'div',
            { key: index, className: 'SelectableReportHeader' },
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'span',
                { className: '_text' },
                _.find(filterOptions, { Id: id }).Title
              )
            )
          );
        })
      ),
      this._renderFilterRequestPortal()
    );
  },
  _renderFilterRequestPortal: function _renderFilterRequestPortal() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.filterRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._toggleFilterRequestPortal,
        failHandler: this._toggleFilterRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: 'UserReportSingles',
          Fields: this.state.filterRequestFields
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        }
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CalculatedHeader/index.jsx');
}();

;

/***/ }),
/* 295 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _lodash = __webpack_require__(118);

var _lodash2 = _interopRequireDefault(_lodash);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _DefaultComponent = __webpack_require__(654);

var _DefaultComponent2 = _interopRequireDefault(_DefaultComponent);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __ActionKey = 'FarmUpdateCarbonDataset';

var _default = __webpack_require__(1)({
    handleSubmit: function handleSubmit(value) {
        console.log(value, 'not submitting here');
        // const {
        //   FieldKey,
        //   DatasetId
        // } = this.props

        // dispatch(sendRequest({
        //   apiKey: 'remote',
        //   actionKey: __ActionKey,
        //   requestKey: FieldKey,
        //   data: [[{
        //     Id: DatasetId,
        //     [FieldKey]: value
        //   }]]
        // }))
    },
    render: function render() {
        var Component = this.props.Component;
        var _props2 = this.props,
            CarbonTable = _props2.CarbonTable,
            FieldKey = _props2.FieldKey;

        var Cell = CarbonTable[FieldKey] || {};
        var Decimal = Cell.Decimal,
            Description = Cell.Description,
            Dynamic = Cell.Dynamic,
            FieldId = Cell.FieldId,
            Label = Cell.Label,
            Percent = Cell.Percent,
            Text = Cell.Text,
            Unit = Cell.Unit,
            Value = Cell.Value;

        // const {
        //   DatasetId,
        //   TableKey,
        //   FieldKey,
        //   EditableSwitchField,
        //   EditableValue
        // } = this.props

        // const dataset = Tables.Farm.Datasets.List.RecordsById[DatasetId] || {}
        // const editAuthority = dataset.EditAuthority
        // const Record = Table.RecordsById[DatasetId]

        // const {FieldLabels} = Tables.Content.Static
        // const FieldLabel = _.find(FieldLabels.Records, (r) => (
        //   r.GroupKey === 'Farm'
        //   && r.FileKey === 'Datasets'
        //   && r.TableKey === TableKey
        //   && r.FieldKey === FieldKey
        // )) || {}

        // `${FieldLabel.Label || ''}`,

        // let unEditable = (this.props.unEditable || !editAuthority)

        var _props = {
            // fieldProps,
            // options,
            // unEditable,
            label: Label,
            value: Value
            // request: Actions[__ActionKey][FieldKey] || {},
        };

        var ComponentEl = Component || _DefaultComponent2.default;

        return _react2.default.createElement(ComponentEl, _extends({}, this.props, _props, { onSubmit: this.handleSubmit }));
    }
});

exports.default = _default;
;

var _temp = function () {
    if (typeof __REACT_HOT_LOADER__ === 'undefined') {
        return;
    }

    __REACT_HOT_LOADER__.register(__ActionKey, '__ActionKey', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/ConnectedField/index.js');

    __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/ConnectedField/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 296 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(298);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

var _Modal = __webpack_require__(297);

var _Modal2 = _interopRequireDefault(_Modal);

var _xchMdOutput = __webpack_require__(658);

var _xchMdOutput2 = _interopRequireDefault(_xchMdOutput);

var _style = __webpack_require__(1001);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      portalOpen: false
    };
  },
  toggleHelpPortal: function toggleHelpPortal() {
    return this.setState({ portalOpen: !this.state.portalOpen });
  },
  render: function render() {
    var text = this.props.text;


    return _react2.default.createElement(
      'button',
      { className: _style2.default.helpBtn, onClick: this.toggleHelpPortal },
      _react2.default.createElement(_xchIcon2.default, { id: 'help', classes: { icon: _style2.default.icon } }),
      _react2.default.createElement(
        _Modal2.default,
        {
          classes: { modal: _style2.default.modal },
          isOpen: this.state.portalOpen,
          onTogglePortal: this.toggleHelpPortal },
        _react2.default.createElement(_xchMdOutput2.default, { classes: { root: _style2.default.text }, text: text })
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/HelpPortal/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 297 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchPortal = __webpack_require__(660);

var _xchPortal2 = _interopRequireDefault(_xchPortal);

var _GenericCloseBtn = __webpack_require__(655);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _style = __webpack_require__(1003);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    return _react2.default.createElement(
      _xchPortal2.default,
      {
        element: document.body,
        isOpen: this.props.isOpen,
        classes: {
          root: this.getClasses('portal'),
          content: this.getClasses('portal__content')
        } },
      _react2.default.createElement(
        'div',
        { className: this.getClasses('modal') },
        _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.onTogglePortal }),
        this.props.children
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/Modal/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 298 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _iconList = __webpack_require__(657);

var _iconList2 = _interopRequireDefault(_iconList);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(1005);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    return _react2.default.createElement('div', {
      className: this.getClasses('icon'),
      dangerouslySetInnerHTML: { __html: _iconList2.default[this.props.id] }
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Icon/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 299 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(1007);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _xchCommas = __webpack_require__(662);

var _xchNumberParser = __webpack_require__(663);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = __webpack_require__(1)({
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    var _classnames;

    var value = (0, _xchCommas.addCommas)((0, _xchNumberParser.parseIn)(this.props.value, this.props));
    return _react2.default.createElement(
      'span',
      {
        className: (0, _classnames3.default)((_classnames = {}, _defineProperty(_classnames, this.getClasses('root'), true), _defineProperty(_classnames, this.getClasses('error'), this.props.error), _classnames)) },
      this.renderUnit('frontUnit'),
      value == null || value === 'NaN' || value === 'Infinity' ? '-' : value,
      this.renderUnit('backUnit')
    );
  },
  renderUnit: function renderUnit(position) {
    return !this.props[position] ? null : _react2.default.createElement(
      'span',
      null,
      this.props[position]
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-NumberField/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 300 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1155);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var tabular__Header = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    if (!this.state.report.hasData) return null;
    return _react2.default.createElement(
      'div',
      null,
      this.renderContent()
    );
  },
  renderContent: function renderContent() {
    var _this = this;

    var MAX_COLS = this.props.IsLandscape ? 15 : 8;
    return this.state.report.tables.TextTable.map(function (row, index) {
      if (row.Props.Label === 'Name') return null;
      if (row.Props.Label === 'Dataset Type') return null;
      if (row.Props.Hidden) return null;

      var _cols = row.cols;

      if (_this.props.isPrinting) {
        // 0    1     2
        // 0-7, 8-15, 16-...
        var startIndex = _this.props.tableSplitIndex * MAX_COLS;
        var endIndex = startIndex + MAX_COLS;

        _cols = row.cols.slice(startIndex, endIndex);
      }

      return _react2.default.createElement(
        'div',
        { key: index, className: 'FarmClientReportTable__row' },
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            row.Props.Label
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'ComparisonReportTable__data' },
          _cols.map(function (col, index) {
            if (col.props.FieldId === 'Name') {
              if (col.value === 'Comparison 1') return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                _this.state.group1
              );
              if (col.value === 'Comparison 2') return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                _this.state.group2
              );
            }
            return _react2.default.createElement(
              'div',
              { key: index, className: '_col' },
              col.value
            );
          })
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(tabular__Header, 'tabular__Header', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_TableHeader/index.jsx');
}();

;

/***/ }),
/* 301 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _commas = __webpack_require__(33);

var _style = __webpack_require__(672);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

var FarmDataItem = {};

var _default = (0, _xchReactClass2.default)({}, {
  render: function render() {
    var _this = this;

    var _props = this.props,
        barData = _props.barData,
        xAxis = _props.xAxis,
        yAxis = _props.yAxis,
        yAxis2 = _props.yAxis2,
        yData = _props.yData,
        yLabel = _props.yLabel;


    var multiRow = typeof yAxis === 'undefined';

    var _yAxis = !multiRow ? yAxis : yData.reduce(function (__obj, item, i) {
      return _extends({}, __obj, item, {
        data: [].concat(_toConsumableArray(__obj.data), _toConsumableArray(item.data))
      });
    }, { data: [] });

    var finalValues = calculateValues(typeof barData === 'undefined' ? _yAxis.data : barData.map(function (b) {
      return b.Value;
    }), _yAxis);

    var finalValues2 = {};

    if (typeof yAxis2 !== 'undefined') {
      finalValues2 = calculateValues(yAxis2.data, yAxis2);
    }

    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.Chart,
        null,
        this.renderLegend(),
        _react2.default.createElement(
          _style.YAxisLabel,
          null,
          _react2.default.createElement(
            _style.YAxisLabelText,
            null,
            yLabel || _yAxis.label
          )
        ),
        this.renderYAxis(finalValues),
        _react2.default.createElement(
          _style.Bars,
          null,
          _react2.default.createElement(
            _style.BarGroup,
            null,
            typeof barData !== 'undefined' && this.renderBars(barData, finalValues),
            typeof barData === 'undefined' && (!multiRow ? _react2.default.createElement(
              _style.FullHeightDiv,
              { key: 'y1' },
              this.renderPath(_yAxis.data, finalValues),
              this.renderDots(_yAxis.data, finalValues)
            ) : yData.map(function (row, index) {
              var values = calculateValues(row.data, row);

              return _react2.default.createElement(
                _style.FullHeightDiv,
                { key: index },
                _this.renderPath(row.data, values, finalValues),
                _this.renderDots(row.data, values, finalValues)
              );
            })),
            typeof yAxis2 !== 'undefined' && _react2.default.createElement(
              _style.FullHeightDiv,
              { key: 'y2' },
              this.renderPath(yAxis2.data, finalValues2),
              this.renderDots(yAxis2.data, finalValues2),
              _react2.default.createElement(
                _style.YAxisLabel,
                { isRight: true },
                _react2.default.createElement(
                  _style.YAxisLabelText,
                  null,
                  yAxis2.label
                )
              )
            ),
            this.renderXAxis(xAxis)
          )
        ),
        typeof yAxis2 !== 'undefined' && this.renderYAxis(finalValues2, true),
        _react2.default.createElement(_style.ZeroLine, { pos: finalValues.zeroPos })
      )
    );
  },
  renderLegend: function renderLegend() {
    var _props2 = this.props,
        yData = _props2.yData,
        yAxis = _props2.yAxis,
        yAxis2 = _props2.yAxis2,
        barData = _props2.barData;


    var noyData = typeof yData === 'undefined';
    var noyAxis = typeof yAxis === 'undefined';
    var noyAxis2 = typeof yAxis2 === 'undefined';

    if (typeof barData !== 'undefined') return null;

    var axiis = yData;

    if (noyData) {
      if (noyAxis2) {
        axiis = [yAxis];
      } else {
        axiis = [yAxis, yAxis2];
      }
    }

    return _react2.default.createElement(
      _style.LegendBox,
      null,
      _react2.default.createElement(
        _style.Legend,
        null,
        axiis.map(function (axis, i) {
          var label = axis.label,
              color = axis.color;

          return _react2.default.createElement(
            _style.LegendKey,
            { key: i },
            _react2.default.createElement(
              _style.LegendDot,
              { color: color },
              _react2.default.createElement(_style.LegendLine, { color: color })
            ),
            label
          );
        })
      )
    );
  },
  renderXAxis: function renderXAxis(axis) {
    var data = axis.data,
        rotate = axis.rotate;


    var numOfBars = data.length;
    var width = rotate ? 0 : 100 / (numOfBars + 2);

    return data.map(function (label, index) {
      var leftPos = index * (100 / numOfBars) + 5;

      return _react2.default.createElement(
        _style.XCol,
        { key: index, leftPos: leftPos, width: width },
        _react2.default.createElement(
          _style.XLabel,
          { 'data-rotate': rotate },
          label
        )
      );
    });
  },
  renderBars: function renderBars(data, axis) {
    var max = axis.max,
        min = axis.min,
        zeroPos = axis.zeroPos,
        frontUnit = axis.frontUnit,
        decimal = axis.decimal,
        backUnit = axis.backUnit;


    var numOfBars = data.length;
    var width = 100 / (numOfBars + 2);

    return data.map(function (bar, index) {
      var Value = bar.Value,
          Colour = bar.Colour,
          RefKey = bar.RefKey;


      var height = Math.abs(Value) / (max - min) * 100;

      var leftPos = index * (100 / numOfBars) + 5;

      return _react2.default.createElement(_style.Bar, {
        title: '' + (frontUnit || '') + (0, _commas.addCommas)(Value.toFixed(decimal)) + (backUnit || ''),
        key: RefKey,
        colour: Colour,
        height: height,
        width: width,
        isPositive: Value > 0,
        leftPos: leftPos,
        zeroPos: zeroPos
      });
    });
  },
  renderDots: function renderDots(data, axis, forcedRange) {
    var max = axis.max,
        min = axis.min,
        zeroPos = axis.zeroPos,
        color = axis.color,
        isNegative = axis.isNegative,
        decimal = axis.decimal,
        frontUnit = axis.frontUnit,
        backUnit = axis.backUnit;


    var _min = forcedRange ? forcedRange.min : min;
    var _max = forcedRange ? forcedRange.max : max;

    var numOfDots = data.length;
    var minToMax = _max + -_min;

    return data.map(function (value, index) {
      // const height = (Math.abs(value) / max) * 100

      var y = (value + -_min) / minToMax * 100;

      if (value < 0) {
        var difference = -_min - -value;
        y = difference / minToMax * 100;
      }

      var topPos = 100 - y.toFixed(3);
      var leftPos = index * (100 / numOfDots) + 5;

      return _react2.default.createElement(_style.Dot, {
        title: '' + (frontUnit || '') + (0, _commas.addCommas)(value.toFixed(decimal)) + (backUnit || ''),
        key: index,
        leftPos: leftPos,
        topPos: topPos,
        color: color,
        isNegative: isNegative
      });
    });
  },
  renderPath: function renderPath(data, axis, forcedRange) {
    var color = axis.color,
        max = axis.max,
        min = axis.min;


    var _min = forcedRange ? forcedRange.min : min;
    var _max = forcedRange ? forcedRange.max : max;

    var minToMax = _max + -_min;

    var numOfcoords = data.length;
    var coords = data.map(function (value, index) {
      var y = (value + -_min) / minToMax * 100;

      if (value < 0) {
        var difference = -_min - -value;
        y = difference / minToMax * 100;
      }

      var x = index * (100 / numOfcoords) + 5;
      return {
        x: x,
        y: 100 - y.toFixed(3)
      };
    });

    var coordMap = coords.filter(function (c, i) {
      return i > 0;
    }).map(function (coord, i) {
      return coord.x + ' ' + coord.y + ' ';
    });
    return _react2.default.createElement(
      _style.SVGContainer,
      null,
      _react2.default.createElement(
        'svg',
        {
          width: '100%',
          height: '100%',
          viewBox: '0 0 100 100',
          preserveAspectRatio: 'none' },
        _react2.default.createElement('path', {
          stroke: color,
          fill: 'none',
          strokeWidth: '2',
          vectorEffect: 'non-scaling-stroke',
          d: 'M ' + coords[0].x + ' ' + coords[0].y.toFixed(3) + ' L ' + coordMap
        })
      )
    );
  },
  renderYAxis: function renderYAxis(axis, isRight) {
    var max = axis.max,
        min = axis.min,
        step = axis.step,
        stepCount = axis.stepCount,
        negStepCount = axis.negStepCount,
        zeroPos = axis.zeroPos,
        isNegative = axis.isNegative,
        frontUnit = axis.frontUnit,
        backUnit = axis.backUnit,
        decimal = axis.decimal;


    var zero = 0;
    var _decimal = decimal || 0;

    var yAxisArr = [];

    for (var i = 1; i < stepCount + 1; i++) {
      yAxisArr.push(i);
    }

    var PositiveYAxisElements = yAxisArr.map(function (count) {
      var value = count * step;
      var pos = value / max * 100;
      return _react2.default.createElement(
        _style.YAxisValue,
        { key: count, pos: pos, isRight: isRight },
        frontUnit,
        (0, _commas.addCommas)(value.toFixed(decimal)),
        backUnit
      );
    });

    var NegativeYAxisElements = null;

    if (isNegative) {
      var negYAxisArr = [];

      for (var _i = 1; _i < negStepCount + 1; _i++) {
        negYAxisArr.push(_i);
      }

      NegativeYAxisElements = negYAxisArr.map(function (count) {
        var value = count * step;
        var pos = value / -min * 100;
        return _react2.default.createElement(
          _style.YAxisValue,
          { key: count, topPos: pos, isNegative: true, isRight: isRight },
          frontUnit,
          (0, _commas.addCommas)(-value.toFixed(decimal)),
          backUnit
        );
      });
    }

    return _react2.default.createElement(
      _style.YAxis,
      { isRight: isRight },
      _react2.default.createElement(
        _style.PositiveYAxis,
        { bottom: zeroPos, isRight: isRight },
        PositiveYAxisElements,
        _react2.default.createElement(
          _style.YAxisValue,
          { key: 'zero', pos: 0, isRight: isRight },
          frontUnit,
          (0, _commas.addCommas)(zero.toFixed(decimal)),
          backUnit
        )
      ),
      !isNegative ? null : _react2.default.createElement(
        _style.NegativeYAxis,
        { top: 100 - zeroPos, isRight: isRight },
        NegativeYAxisElements
      )
    );
  }
});

exports.default = _default;


function calculateValues(data, axis) {
  var label = axis.label,
      step = axis.step,
      max = axis.max,
      min = axis.min,
      backUnit = axis.backUnit,
      maxSteps = axis.maxSteps,
      frontUnit = axis.frontUnit;


  var highValue = _.max(data);
  var valueMax = Math.floor((highValue + step) / step) * step;
  var maxAxis = typeof max === 'undefined' ? valueMax : max;

  var lowValue = _.min(data);
  var isNegative = lowValue < 0;

  var minAxis = 0;

  if (isNegative) {
    var posNeg = -lowValue;
    var valueMin = Math.floor((posNeg + step) / step) * step;
    minAxis = typeof min === 'undefined' ? -valueMin : min;
  }

  var _max = maxAxis;
  var _min = minAxis;

  var _step = step;
  var stepCount = _max / step;
  var negStepCount = -_min / step;

  if (stepCount + negStepCount > maxSteps) {
    _step = (_max + -_min) / maxSteps;
    stepCount = Math.floor((_max + _step) / _step);
    _max = stepCount * _step;

    if (isNegative) {
      negStepCount = Math.floor((-_min + _step) / _step);
      _min = -(negStepCount * _step);
    }
  }

  var zeroPos = isNegative ? 100 - _max / (_max - _min) * 100 : 0;

  return _extends({}, axis, {
    max: _max,
    min: _min,
    step: _step,
    stepCount: stepCount,
    negStepCount: negStepCount,
    zeroPos: zeroPos,
    isNegative: isNegative
  });
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FarmDataItem, 'FarmDataItem', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/index.js');

  __REACT_HOT_LOADER__.register(calculateValues, 'calculateValues', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 302 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ProfitMap = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.SingleDataSetReport;
    if (typeof report === 'undefined') return;

    var flatFields = _.flatten(_.flatten(_.map(report.tables, function (value, key) {
      return _.flatten(value);
    })).map(function (item, index) {
      return item.cols.map(function (col, index) {
        if (typeof col.props !== 'undefined') {
          col.props.Description = item.Props.Description;
          col.props.Label = item.Props.Label;
          col.props.Unit = item.Props.Unit;
        }
        return col;
      });
    })).reduce(function (previousValue, currentValue) {
      if ((typeof currentValue === 'undefined' ? 'undefined' : _typeof(currentValue)) === 'object') {
        previousValue[currentValue.props.FieldId] = currentValue;
      }
      return previousValue;
    }, {});

    this.setState({
      report: {
        hasData: true,
        flatFields: flatFields
      }
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      null,
      this.renderChildren()
    );
  },


  renderChildren: function renderChildren() {
    var _this = this;

    return _react2.default.Children.map(this.props.children, function (child) {
      return _react2.default.cloneElement(child, {
        report: _this.state.report
      });
    });
  }

});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ProfitMap, 'ProfitMap', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_FlatFieldMap/index.jsx');
}();

;

/***/ }),
/* 303 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { key: this.props.tabKey, className: 'SingleReport__tableHeadings' },
      _react2.default.createElement('div', { className: 'SingleReport__MapHeader' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_MapHeader/index.jsx');
}();

;

/***/ }),
/* 304 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.SingleDataSetReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      { key: this.props.tabKey, className: 'SingleReport__tableHeadings' },
      this._renderRow()
    );
  },
  _renderRow: function _renderRow() {
    var row = this.state.report.tables.TextTable[0];
    return _react2.default.createElement(
      'div',
      { className: 'SingleReportTable__row is-heading' },
      _react2.default.createElement(
        'div',
        { className: 'SingleReportTable__label is-physical-label' },
        _react2.default.createElement(
          'div',
          { className: '_hierachy' },
          row.Props.Hierachy
        ),
        _react2.default.createElement(
          'div',
          { className: '_label' },
          row.Props.Label
        ),
        _react2.default.createElement(
          'div',
          { className: '_unit' },
          row.Props.Unit
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'SingleReportTable__data is-physical-data' },
        _react2.default.createElement(
          'div',
          { className: '_col' },
          'Value'
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_PhysicalHeader/index.jsx');
}();

;

/***/ }),
/* 305 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _financeCalculations = __webpack_require__(124);

var _financeCalculations2 = _interopRequireDefault(_financeCalculations);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Table = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.SingleDataSetReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        className: 'SingleReport__tableWrapper\n          ' + (this.props.activeTab.id === 'energy' ? '__condenseRows__' : '') + '\n        ' },
      _react2.default.createElement(
        'div',
        { key: this.props.tabKey, className: 'SingleReportTable' },
        this._renderRows()
      )
    );
  },
  _renderRows: function _renderRows() {
    return this.state.report.tables[this.props.activeTab.table].map(function (row, index) {
      var Cols = row.Props.Cols || [];
      var firstCol = Cols[0] || {};
      var isText = firstCol.Text;

      var isHeading = row.Props.Hierachy === 1 && row.cols.length === 0;
      var SingleReportTable__row = (0, _classnames2.default)({
        SingleReportTable__row: true,
        'is-total': row.Props.Hierachy === 5,
        'is-row-heading': isHeading || isText
      });

      var _colArr = [];

      if (isHeading) {
        var colLength = row.colLength;
        // const _maxColLength = this.props.isPrinting ? MAX_COLS : colLength

        for (var step = 0; step < colLength; step++) {
          // Runs 5 times, with values of step 0 through 4.
          _colArr.push(step);
        }
      }

      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: SingleReportTable__row + ' is-h' + row.Props.Hierachy },
        _react2.default.createElement(
          'div',
          { className: 'SingleReportTable__label is-physical-label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: row.Props.Label,
              description: row.Props.Description
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'SingleReportTable__data is-physical-data' },
          isHeading && _colArr.map(function (c) {
            return _react2.default.createElement('div', { key: c, style: { width: '80px' } });
          }),
          row.cols.map(function (col, index) {
            if (col.props !== undefined) {
              return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                (0, _commas.addCommas)(col.value),
                col.props.Percent ? '%' : null
              );
            } else {
              return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                col
              );
            }
          })
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Table, 'Table', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_PhysicalTable/index.jsx');
}();

;

/***/ }),
/* 306 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _index = __webpack_require__(1173);

var _index2 = _interopRequireDefault(_index);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _commas = __webpack_require__(33);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ReportMapBox = module.exports = __webpack_require__(1)({
  render: function render() {
    var ReportMapBox = (0, _classnames3.default)(_defineProperty({
      'ReportMapBox': true
    }, this.props.bg, typeof this.props.bg !== 'undefined'));
    return _react2.default.createElement(
      'div',
      { className: ReportMapBox },
      _react2.default.createElement(
        'h3',
        { className: '_label' },
        this.props.label
      ),
      this.renderValue(this.props.value, this.props.unit, this.props.dollars, this.props.decimal),
      this.renderSubValue()
    );
  },
  renderSubValue: function renderSubValue() {
    return typeof this.props.subValue === 'undefined' ? null : this.renderValue(this.props.subValue, this.props.subUnit, this.props.subDollars, this.props.subDecimal);
  },
  renderValue: function renderValue(value, unit, dollars, decimal) {
    var displayValue = typeof value === 'undefined' ? undefined : (0, _commas.addCommas)((+value).toFixed(decimal || 0));

    return _react2.default.createElement(
      'div',
      { className: '_value' },
      dollars ? '$' : null,
      displayValue,
      _react2.default.createElement(
        'span',
        { className: '_unit' },
        this.renderUnit(unit)
      )
    );
  },
  renderUnit: function renderUnit(unit) {
    if (unit === '$' || unit === null || unit === '' || unit === 'Number' || unit === undefined) {
      return null;
    }
    return unit;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportMapBox, 'ReportMapBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_shared/ReportMapBox/index.jsx');
}();

;

/***/ }),
/* 307 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1175);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _region = __webpack_require__(695);

var _region2 = _interopRequireDefault(_region);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _InputMultiSelect = __webpack_require__(204);

var _InputMultiSelect2 = _interopRequireDefault(_InputMultiSelect);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Fields = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_user2.default, "_handleNewData")],

  getInitialState: function getInitialState() {
    return {
      industryAuthorised: _user2.default.industryDataProvider || _user2.default.userAuthority <= 1,
      filterRequestPortalOpen: false,
      requestFields: undefined
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewData();
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      industryAuthorised: _user2.default.industryDataProvider || _user2.default.userAuthority <= 1
    });
  },
  _updateInput: function _updateInput(newValue, id) {
    this.props.emitFilterChange();
    var obj = this.checkFromTo(newValue, id);
    this.setState({
      requestFields: obj,
      filterRequestPortalOpen: true
    });
  },
  checkFromTo: function checkFromTo(newValue, id) {

    var obj = _defineProperty({}, id, newValue);

    if (id === 'Grp1FinYearFrom' && +this.props.fields.Grp1FinYearFrom.Value === 1) {
      obj['Grp1FinYearTo'] = newValue;
    }

    if (id === 'Grp2FinYearFrom' && +this.props.fields.Grp2FinYearFrom.Value === 1) {
      obj['Grp2FinYearTo'] = newValue;
    }

    if (id === 'Grp1FarmSizeFrom' && +this.props.fields.Grp1FarmSizeFrom.Value === 1) {
      obj['Grp1FarmSizeTo'] = newValue;
    }

    if (id === 'Grp2FarmSizeFrom' && +this.props.fields.Grp2FarmSizeFrom.Value === 1) {
      obj['Grp2FarmSizeTo'] = newValue;
    }

    return obj;
  },
  _toggleFilterRequestPortal: function _toggleFilterRequestPortal() {
    this.setState({
      filterRequestPortalOpen: !this.state.filterRequestPortalOpen
    });
  },
  render: function render() {

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2' },
      _react2.default.createElement(
        'div',
        { className: '_col1' },
        _react2.default.createElement(
          'div',
          { className: 'ReportFilter2__group' },
          _react2.default.createElement(
            'h3',
            { className: '_title' },
            'Chart Kpi'
          ),
          this._renderSingleField('ChartKpi', 'Chart Kpi Filter')
        )
      ),
      _react2.default.createElement(
        'div',
        { className: '_col2' },
        _react2.default.createElement(
          'div',
          { className: 'ReportFilter2__group' },
          _react2.default.createElement(
            'div',
            { className: '_colHeadings' },
            _react2.default.createElement(
              'h3',
              { className: '_title' },
              'Industry Selection'
            ),
            _react2.default.createElement(
              'h3',
              { className: '_col' },
              'Comparison Group 1'
            ),
            _react2.default.createElement(
              'h3',
              { className: '_col' },
              'Comparison Group 2'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: 'ReportFilter2__doubleField' },
            _react2.default.createElement(
              'div',
              { className: '_label' },
              _react2.default.createElement(_DescriptionLabel2.default, {
                label: this.props.fields['Grp1Count'].Label,
                description: this.props.fields['Grp1Count'].Description })
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: (0, _classnames2.default)({
                    '_field': true,
                    'is-error': this.props.fields['Grp1Count'].Value < 6
                  }) },
                _react2.default.createElement(_OutputSimple2.default, { value: this.props.fields['Grp1Count'].Value })
              )
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: (0, _classnames2.default)({
                    '_field': true,
                    'is-error': this.props.fields['Grp2Count'].Value < 6
                  }) },
                _react2.default.createElement(_OutputSimple2.default, { value: this.props.fields['Grp2Count'].Value })
              )
            )
          ),
          this._renderDoubleMultiField(['Grp1DataSource', 'Grp2DataSource']),
          this.renderIndustryField(),
          this._renderDoubleField(['Grp1Statistic', 'Grp2Statistic']),
          this._renderRegionTypeField(['Grp1RegionType', 'Grp2RegionType']),
          _react2.default.createElement(_region2.default, {
            emitUpdate: this._updateInput,
            fields: this.props.fields }),
          this._renderFromToField([{
            from: 'Grp1FarmSizeFrom',
            to: 'Grp1FarmSizeTo'
          }, {
            from: 'Grp2FarmSizeFrom',
            to: 'Grp2FarmSizeTo'
          }], 'Farm Size - Million Litres'),
          this._renderFromToField([{
            from: 'Grp1FinYearFrom',
            to: 'Grp1FinYearTo'
          }, {
            from: 'Grp2FinYearFrom',
            to: 'Grp2FinYearTo'
          }], 'Financial Years'),
          this._renderDoubleField(['Grp1Irrigation', 'Grp2Irrigation'], 'Irrigation Status'),
          this._renderDoubleField(['Grp1GrazedFeed', 'Grp2GrazedFeed'], 'Grazed Feed Percentage'),
          this._renderDoubleField(['Grp1Concentrate', 'Grp2Concentrate'], 'Grain Feeding Level'),
          this._renderDoubleField(['Grp1CalvingPattern', 'Grp2CalvingPattern'], 'Calving Pattern')
        )
      ),
      this._renderRequestPortal()
    );
  },
  renderIndustryField: function renderIndustryField() {
    return !this.state.industryAuthorised ? null : this._renderDoubleMultiField(['Grp1IndustryDataSelect', 'Grp2IndustryDataSelect'], 'Industry Data');
  },
  _renderRequestPortal: function _renderRequestPortal() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.filterRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._toggleFilterRequestPortal,
        failHandler: this._toggleFilterRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: this.props.table,
          Fields: this.state.requestFields
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        } })
    );
  },
  _renderSingleField: function _renderSingleField(fieldId, label) {
    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__singleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields[fieldId].Label,
          description: this.props.fields[fieldId].Description })
      ),
      _react2.default.createElement(
        'div',
        { className: '_field' },
        _react2.default.createElement(_InputSelect2.default, {
          id: fieldId,
          value: this.props.fields[fieldId].Value,
          options: this.props.fields[fieldId].Options,
          onSubmit: this._updateInput })
      )
    );
  },
  _renderDoubleField: function _renderDoubleField(fieldIds, label) {
    var _this = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            value: _this.props.fields[field].Value,
            options: _this.props.fields[field].Options,
            onSubmit: _this._updateInput })
        )
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields[fieldIds[0]].Label,
          description: this.props.fields[fieldIds[0]].Description })
      ),
      _cols
    );
  },
  _renderDoubleMultiField: function _renderDoubleMultiField(fieldIds, label) {
    var _this2 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputMultiSelect2.default, {
            id: field,
            value: _this2.props.fields[field].Value,
            options: _this2.props.fields[field].Options,
            onSubmit: _this2._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderToField: function _renderToField(fields, index) {

    var fromValue = this.props.fields[fields.from].Value;
    return fromValue < 2 ? null : _react2.default.createElement(
      'div',
      { className: '_to' },
      _react2.default.createElement(
        'span',
        { className: '_text' },
        ' - '
      ),
      _react2.default.createElement(_InputSelect2.default, {
        id: fields.to,
        value: this.props.fields[fields.to].Value,
        options: this.props.fields[fields.to].Options,
        onSubmit: this._updateInput })
    );
  },
  _renderFromToField: function _renderFromToField(fieldIds, label) {
    var _this3 = this;

    var _cols = fieldIds.map(function (fields, index) {

      // fields: [[from, to], [from,to]]
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_from' },
          _react2.default.createElement(_InputSelect2.default, {
            id: fields.from,
            value: _this3.props.fields[fields.from].Value,
            options: _this3.props.fields[fields.from].Options,
            onSubmit: _this3._updateInput })
        ),
        _this3._renderToField(fields, index)
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__fromToField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields[fieldIds[0].from].Label,
          description: this.props.fields[fieldIds[0].from].Description })
      ),
      _cols
    );
  },
  _renderRegionTypeField: function _renderRegionTypeField(fieldIds, label) {
    var _this4 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            value: _this4.props.fields[field].Value,
            options: _this4.props.fields[field].Options,
            onSubmit: _this4._updateInput })
        )
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields[fieldIds[0]].Label,
          description: this.props.fields[fieldIds[0]].Description })
      ),
      _cols
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields, 'Fields', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_shared/fields/index.jsx');
}();

;

/***/ }),
/* 308 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1176);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      this._renderTabs()
    );
  },
  _renderTabs: function _renderTabs() {
    var _this = this;

    return this.props.tabs.map(function (tab, index) {
      var TabHeader = tab.handlers.header;
      var TabBody = tab.handlers.body;
      return _react2.default.createElement(
        'div',
        { key: tab.id, className: 'PrintModal__tab' },
        _react2.default.createElement(
          'h1',
          { className: 'PrintableReport__title' },
          tab.title
        ),
        _react2.default.createElement(
          'div',
          { className: '_header' },
          _react2.default.createElement(
            'div',
            { className: 'ChartTabHeader' },
            _react2.default.createElement(TabHeader, _extends({}, _this.props, {
              activeTab: tab,
              isPrinting: true }))
          ),
          _react2.default.createElement(
            'div',
            { className: 'PrintLogo' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' })
          )
        ),
        _react2.default.createElement(TabBody, _extends({}, _this.props, {
          activeTab: tab,
          isPrinting: true }))
      );
    });
  },
  _renderPageBreak: function _renderPageBreak(index, length) {
    return index + 1 >= length ? null : _react2.default.createElement('div', { className: 'page-break' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_shared/singleChartPrintModal/index.jsx');
}();

;

/***/ }),
/* 309 */
/***/ (function(module, exports) {

module.exports = function(a, b, str) {
  var bal = 0;
  var m = {};

  for (var i = 0; i < str.length; i++) {
    if (a == str.substr(i, a.length)) {
      if (!('start' in m)) m.start = i;
      bal++;
    }
    else if (b == str.substr(i, b.length) && 'start' in m) {
      bal--;
      if (!bal) {
        m.end = i;
        m.pre = str.substr(0, m.start);
        m.body = (m.end - m.start > 1)
          ? str.substring(m.start + a.length, m.end)
          : '';
        m.post = str.slice(m.end + b.length);
        return m;
      }
    }
  }
};



/***/ }),
/* 310 */
/***/ (function(module, exports, __webpack_require__) {

/* MIT license */
var cssKeywords = __webpack_require__(714);

// NOTE: conversions should only return primitive values (i.e. arrays, or
//       values that give correct `typeof` results).
//       do not use box values types (i.e. Number(), String(), etc.)

var reverseKeywords = {};
for (var key in cssKeywords) {
	if (cssKeywords.hasOwnProperty(key)) {
		reverseKeywords[cssKeywords[key]] = key;
	}
}

var convert = module.exports = {
	rgb: {channels: 3, labels: 'rgb'},
	hsl: {channels: 3, labels: 'hsl'},
	hsv: {channels: 3, labels: 'hsv'},
	hwb: {channels: 3, labels: 'hwb'},
	cmyk: {channels: 4, labels: 'cmyk'},
	xyz: {channels: 3, labels: 'xyz'},
	lab: {channels: 3, labels: 'lab'},
	lch: {channels: 3, labels: 'lch'},
	hex: {channels: 1, labels: ['hex']},
	keyword: {channels: 1, labels: ['keyword']},
	ansi16: {channels: 1, labels: ['ansi16']},
	ansi256: {channels: 1, labels: ['ansi256']},
	hcg: {channels: 3, labels: ['h', 'c', 'g']},
	apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
	gray: {channels: 1, labels: ['gray']}
};

// hide .channels and .labels properties
for (var model in convert) {
	if (convert.hasOwnProperty(model)) {
		if (!('channels' in convert[model])) {
			throw new Error('missing channels property: ' + model);
		}

		if (!('labels' in convert[model])) {
			throw new Error('missing channel labels property: ' + model);
		}

		if (convert[model].labels.length !== convert[model].channels) {
			throw new Error('channel and label counts mismatch: ' + model);
		}

		var channels = convert[model].channels;
		var labels = convert[model].labels;
		delete convert[model].channels;
		delete convert[model].labels;
		Object.defineProperty(convert[model], 'channels', {value: channels});
		Object.defineProperty(convert[model], 'labels', {value: labels});
	}
}

convert.rgb.hsl = function (rgb) {
	var r = rgb[0] / 255;
	var g = rgb[1] / 255;
	var b = rgb[2] / 255;
	var min = Math.min(r, g, b);
	var max = Math.max(r, g, b);
	var delta = max - min;
	var h;
	var s;
	var l;

	if (max === min) {
		h = 0;
	} else if (r === max) {
		h = (g - b) / delta;
	} else if (g === max) {
		h = 2 + (b - r) / delta;
	} else if (b === max) {
		h = 4 + (r - g) / delta;
	}

	h = Math.min(h * 60, 360);

	if (h < 0) {
		h += 360;
	}

	l = (min + max) / 2;

	if (max === min) {
		s = 0;
	} else if (l <= 0.5) {
		s = delta / (max + min);
	} else {
		s = delta / (2 - max - min);
	}

	return [h, s * 100, l * 100];
};

convert.rgb.hsv = function (rgb) {
	var rdif;
	var gdif;
	var bdif;
	var h;
	var s;

	var r = rgb[0] / 255;
	var g = rgb[1] / 255;
	var b = rgb[2] / 255;
	var v = Math.max(r, g, b);
	var diff = v - Math.min(r, g, b);
	var diffc = function (c) {
		return (v - c) / 6 / diff + 1 / 2;
	};

	if (diff === 0) {
		h = s = 0;
	} else {
		s = diff / v;
		rdif = diffc(r);
		gdif = diffc(g);
		bdif = diffc(b);

		if (r === v) {
			h = bdif - gdif;
		} else if (g === v) {
			h = (1 / 3) + rdif - bdif;
		} else if (b === v) {
			h = (2 / 3) + gdif - rdif;
		}
		if (h < 0) {
			h += 1;
		} else if (h > 1) {
			h -= 1;
		}
	}

	return [
		h * 360,
		s * 100,
		v * 100
	];
};

convert.rgb.hwb = function (rgb) {
	var r = rgb[0];
	var g = rgb[1];
	var b = rgb[2];
	var h = convert.rgb.hsl(rgb)[0];
	var w = 1 / 255 * Math.min(r, Math.min(g, b));

	b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));

	return [h, w * 100, b * 100];
};

convert.rgb.cmyk = function (rgb) {
	var r = rgb[0] / 255;
	var g = rgb[1] / 255;
	var b = rgb[2] / 255;
	var c;
	var m;
	var y;
	var k;

	k = Math.min(1 - r, 1 - g, 1 - b);
	c = (1 - r - k) / (1 - k) || 0;
	m = (1 - g - k) / (1 - k) || 0;
	y = (1 - b - k) / (1 - k) || 0;

	return [c * 100, m * 100, y * 100, k * 100];
};

/**
 * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
 * */
function comparativeDistance(x, y) {
	return (
		Math.pow(x[0] - y[0], 2) +
		Math.pow(x[1] - y[1], 2) +
		Math.pow(x[2] - y[2], 2)
	);
}

convert.rgb.keyword = function (rgb) {
	var reversed = reverseKeywords[rgb];
	if (reversed) {
		return reversed;
	}

	var currentClosestDistance = Infinity;
	var currentClosestKeyword;

	for (var keyword in cssKeywords) {
		if (cssKeywords.hasOwnProperty(keyword)) {
			var value = cssKeywords[keyword];

			// Compute comparative distance
			var distance = comparativeDistance(rgb, value);

			// Check if its less, if so set as closest
			if (distance < currentClosestDistance) {
				currentClosestDistance = distance;
				currentClosestKeyword = keyword;
			}
		}
	}

	return currentClosestKeyword;
};

convert.keyword.rgb = function (keyword) {
	return cssKeywords[keyword];
};

convert.rgb.xyz = function (rgb) {
	var r = rgb[0] / 255;
	var g = rgb[1] / 255;
	var b = rgb[2] / 255;

	// assume sRGB
	r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
	g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
	b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);

	var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
	var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
	var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);

	return [x * 100, y * 100, z * 100];
};

convert.rgb.lab = function (rgb) {
	var xyz = convert.rgb.xyz(rgb);
	var x = xyz[0];
	var y = xyz[1];
	var z = xyz[2];
	var l;
	var a;
	var b;

	x /= 95.047;
	y /= 100;
	z /= 108.883;

	x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
	y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
	z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);

	l = (116 * y) - 16;
	a = 500 * (x - y);
	b = 200 * (y - z);

	return [l, a, b];
};

convert.hsl.rgb = function (hsl) {
	var h = hsl[0] / 360;
	var s = hsl[1] / 100;
	var l = hsl[2] / 100;
	var t1;
	var t2;
	var t3;
	var rgb;
	var val;

	if (s === 0) {
		val = l * 255;
		return [val, val, val];
	}

	if (l < 0.5) {
		t2 = l * (1 + s);
	} else {
		t2 = l + s - l * s;
	}

	t1 = 2 * l - t2;

	rgb = [0, 0, 0];
	for (var i = 0; i < 3; i++) {
		t3 = h + 1 / 3 * -(i - 1);
		if (t3 < 0) {
			t3++;
		}
		if (t3 > 1) {
			t3--;
		}

		if (6 * t3 < 1) {
			val = t1 + (t2 - t1) * 6 * t3;
		} else if (2 * t3 < 1) {
			val = t2;
		} else if (3 * t3 < 2) {
			val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
		} else {
			val = t1;
		}

		rgb[i] = val * 255;
	}

	return rgb;
};

convert.hsl.hsv = function (hsl) {
	var h = hsl[0];
	var s = hsl[1] / 100;
	var l = hsl[2] / 100;
	var smin = s;
	var lmin = Math.max(l, 0.01);
	var sv;
	var v;

	l *= 2;
	s *= (l <= 1) ? l : 2 - l;
	smin *= lmin <= 1 ? lmin : 2 - lmin;
	v = (l + s) / 2;
	sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);

	return [h, sv * 100, v * 100];
};

convert.hsv.rgb = function (hsv) {
	var h = hsv[0] / 60;
	var s = hsv[1] / 100;
	var v = hsv[2] / 100;
	var hi = Math.floor(h) % 6;

	var f = h - Math.floor(h);
	var p = 255 * v * (1 - s);
	var q = 255 * v * (1 - (s * f));
	var t = 255 * v * (1 - (s * (1 - f)));
	v *= 255;

	switch (hi) {
		case 0:
			return [v, t, p];
		case 1:
			return [q, v, p];
		case 2:
			return [p, v, t];
		case 3:
			return [p, q, v];
		case 4:
			return [t, p, v];
		case 5:
			return [v, p, q];
	}
};

convert.hsv.hsl = function (hsv) {
	var h = hsv[0];
	var s = hsv[1] / 100;
	var v = hsv[2] / 100;
	var vmin = Math.max(v, 0.01);
	var lmin;
	var sl;
	var l;

	l = (2 - s) * v;
	lmin = (2 - s) * vmin;
	sl = s * vmin;
	sl /= (lmin <= 1) ? lmin : 2 - lmin;
	sl = sl || 0;
	l /= 2;

	return [h, sl * 100, l * 100];
};

// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
convert.hwb.rgb = function (hwb) {
	var h = hwb[0] / 360;
	var wh = hwb[1] / 100;
	var bl = hwb[2] / 100;
	var ratio = wh + bl;
	var i;
	var v;
	var f;
	var n;

	// wh + bl cant be > 1
	if (ratio > 1) {
		wh /= ratio;
		bl /= ratio;
	}

	i = Math.floor(6 * h);
	v = 1 - bl;
	f = 6 * h - i;

	if ((i & 0x01) !== 0) {
		f = 1 - f;
	}

	n = wh + f * (v - wh); // linear interpolation

	var r;
	var g;
	var b;
	switch (i) {
		default:
		case 6:
		case 0: r = v; g = n; b = wh; break;
		case 1: r = n; g = v; b = wh; break;
		case 2: r = wh; g = v; b = n; break;
		case 3: r = wh; g = n; b = v; break;
		case 4: r = n; g = wh; b = v; break;
		case 5: r = v; g = wh; b = n; break;
	}

	return [r * 255, g * 255, b * 255];
};

convert.cmyk.rgb = function (cmyk) {
	var c = cmyk[0] / 100;
	var m = cmyk[1] / 100;
	var y = cmyk[2] / 100;
	var k = cmyk[3] / 100;
	var r;
	var g;
	var b;

	r = 1 - Math.min(1, c * (1 - k) + k);
	g = 1 - Math.min(1, m * (1 - k) + k);
	b = 1 - Math.min(1, y * (1 - k) + k);

	return [r * 255, g * 255, b * 255];
};

convert.xyz.rgb = function (xyz) {
	var x = xyz[0] / 100;
	var y = xyz[1] / 100;
	var z = xyz[2] / 100;
	var r;
	var g;
	var b;

	r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
	g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
	b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);

	// assume sRGB
	r = r > 0.0031308
		? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
		: r * 12.92;

	g = g > 0.0031308
		? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
		: g * 12.92;

	b = b > 0.0031308
		? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
		: b * 12.92;

	r = Math.min(Math.max(0, r), 1);
	g = Math.min(Math.max(0, g), 1);
	b = Math.min(Math.max(0, b), 1);

	return [r * 255, g * 255, b * 255];
};

convert.xyz.lab = function (xyz) {
	var x = xyz[0];
	var y = xyz[1];
	var z = xyz[2];
	var l;
	var a;
	var b;

	x /= 95.047;
	y /= 100;
	z /= 108.883;

	x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
	y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
	z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);

	l = (116 * y) - 16;
	a = 500 * (x - y);
	b = 200 * (y - z);

	return [l, a, b];
};

convert.lab.xyz = function (lab) {
	var l = lab[0];
	var a = lab[1];
	var b = lab[2];
	var x;
	var y;
	var z;

	y = (l + 16) / 116;
	x = a / 500 + y;
	z = y - b / 200;

	var y2 = Math.pow(y, 3);
	var x2 = Math.pow(x, 3);
	var z2 = Math.pow(z, 3);
	y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
	x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
	z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;

	x *= 95.047;
	y *= 100;
	z *= 108.883;

	return [x, y, z];
};

convert.lab.lch = function (lab) {
	var l = lab[0];
	var a = lab[1];
	var b = lab[2];
	var hr;
	var h;
	var c;

	hr = Math.atan2(b, a);
	h = hr * 360 / 2 / Math.PI;

	if (h < 0) {
		h += 360;
	}

	c = Math.sqrt(a * a + b * b);

	return [l, c, h];
};

convert.lch.lab = function (lch) {
	var l = lch[0];
	var c = lch[1];
	var h = lch[2];
	var a;
	var b;
	var hr;

	hr = h / 360 * 2 * Math.PI;
	a = c * Math.cos(hr);
	b = c * Math.sin(hr);

	return [l, a, b];
};

convert.rgb.ansi16 = function (args) {
	var r = args[0];
	var g = args[1];
	var b = args[2];
	var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization

	value = Math.round(value / 50);

	if (value === 0) {
		return 30;
	}

	var ansi = 30
		+ ((Math.round(b / 255) << 2)
		| (Math.round(g / 255) << 1)
		| Math.round(r / 255));

	if (value === 2) {
		ansi += 60;
	}

	return ansi;
};

convert.hsv.ansi16 = function (args) {
	// optimization here; we already know the value and don't need to get
	// it converted for us.
	return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
};

convert.rgb.ansi256 = function (args) {
	var r = args[0];
	var g = args[1];
	var b = args[2];

	// we use the extended greyscale palette here, with the exception of
	// black and white. normal palette only has 4 greyscale shades.
	if (r === g && g === b) {
		if (r < 8) {
			return 16;
		}

		if (r > 248) {
			return 231;
		}

		return Math.round(((r - 8) / 247) * 24) + 232;
	}

	var ansi = 16
		+ (36 * Math.round(r / 255 * 5))
		+ (6 * Math.round(g / 255 * 5))
		+ Math.round(b / 255 * 5);

	return ansi;
};

convert.ansi16.rgb = function (args) {
	var color = args % 10;

	// handle greyscale
	if (color === 0 || color === 7) {
		if (args > 50) {
			color += 3.5;
		}

		color = color / 10.5 * 255;

		return [color, color, color];
	}

	var mult = (~~(args > 50) + 1) * 0.5;
	var r = ((color & 1) * mult) * 255;
	var g = (((color >> 1) & 1) * mult) * 255;
	var b = (((color >> 2) & 1) * mult) * 255;

	return [r, g, b];
};

convert.ansi256.rgb = function (args) {
	// handle greyscale
	if (args >= 232) {
		var c = (args - 232) * 10 + 8;
		return [c, c, c];
	}

	args -= 16;

	var rem;
	var r = Math.floor(args / 36) / 5 * 255;
	var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
	var b = (rem % 6) / 5 * 255;

	return [r, g, b];
};

convert.rgb.hex = function (args) {
	var integer = ((Math.round(args[0]) & 0xFF) << 16)
		+ ((Math.round(args[1]) & 0xFF) << 8)
		+ (Math.round(args[2]) & 0xFF);

	var string = integer.toString(16).toUpperCase();
	return '000000'.substring(string.length) + string;
};

convert.hex.rgb = function (args) {
	var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
	if (!match) {
		return [0, 0, 0];
	}

	var colorString = match[0];

	if (match[0].length === 3) {
		colorString = colorString.split('').map(function (char) {
			return char + char;
		}).join('');
	}

	var integer = parseInt(colorString, 16);
	var r = (integer >> 16) & 0xFF;
	var g = (integer >> 8) & 0xFF;
	var b = integer & 0xFF;

	return [r, g, b];
};

convert.rgb.hcg = function (rgb) {
	var r = rgb[0] / 255;
	var g = rgb[1] / 255;
	var b = rgb[2] / 255;
	var max = Math.max(Math.max(r, g), b);
	var min = Math.min(Math.min(r, g), b);
	var chroma = (max - min);
	var grayscale;
	var hue;

	if (chroma < 1) {
		grayscale = min / (1 - chroma);
	} else {
		grayscale = 0;
	}

	if (chroma <= 0) {
		hue = 0;
	} else
	if (max === r) {
		hue = ((g - b) / chroma) % 6;
	} else
	if (max === g) {
		hue = 2 + (b - r) / chroma;
	} else {
		hue = 4 + (r - g) / chroma + 4;
	}

	hue /= 6;
	hue %= 1;

	return [hue * 360, chroma * 100, grayscale * 100];
};

convert.hsl.hcg = function (hsl) {
	var s = hsl[1] / 100;
	var l = hsl[2] / 100;
	var c = 1;
	var f = 0;

	if (l < 0.5) {
		c = 2.0 * s * l;
	} else {
		c = 2.0 * s * (1.0 - l);
	}

	if (c < 1.0) {
		f = (l - 0.5 * c) / (1.0 - c);
	}

	return [hsl[0], c * 100, f * 100];
};

convert.hsv.hcg = function (hsv) {
	var s = hsv[1] / 100;
	var v = hsv[2] / 100;

	var c = s * v;
	var f = 0;

	if (c < 1.0) {
		f = (v - c) / (1 - c);
	}

	return [hsv[0], c * 100, f * 100];
};

convert.hcg.rgb = function (hcg) {
	var h = hcg[0] / 360;
	var c = hcg[1] / 100;
	var g = hcg[2] / 100;

	if (c === 0.0) {
		return [g * 255, g * 255, g * 255];
	}

	var pure = [0, 0, 0];
	var hi = (h % 1) * 6;
	var v = hi % 1;
	var w = 1 - v;
	var mg = 0;

	switch (Math.floor(hi)) {
		case 0:
			pure[0] = 1; pure[1] = v; pure[2] = 0; break;
		case 1:
			pure[0] = w; pure[1] = 1; pure[2] = 0; break;
		case 2:
			pure[0] = 0; pure[1] = 1; pure[2] = v; break;
		case 3:
			pure[0] = 0; pure[1] = w; pure[2] = 1; break;
		case 4:
			pure[0] = v; pure[1] = 0; pure[2] = 1; break;
		default:
			pure[0] = 1; pure[1] = 0; pure[2] = w;
	}

	mg = (1.0 - c) * g;

	return [
		(c * pure[0] + mg) * 255,
		(c * pure[1] + mg) * 255,
		(c * pure[2] + mg) * 255
	];
};

convert.hcg.hsv = function (hcg) {
	var c = hcg[1] / 100;
	var g = hcg[2] / 100;

	var v = c + g * (1.0 - c);
	var f = 0;

	if (v > 0.0) {
		f = c / v;
	}

	return [hcg[0], f * 100, v * 100];
};

convert.hcg.hsl = function (hcg) {
	var c = hcg[1] / 100;
	var g = hcg[2] / 100;

	var l = g * (1.0 - c) + 0.5 * c;
	var s = 0;

	if (l > 0.0 && l < 0.5) {
		s = c / (2 * l);
	} else
	if (l >= 0.5 && l < 1.0) {
		s = c / (2 * (1 - l));
	}

	return [hcg[0], s * 100, l * 100];
};

convert.hcg.hwb = function (hcg) {
	var c = hcg[1] / 100;
	var g = hcg[2] / 100;
	var v = c + g * (1.0 - c);
	return [hcg[0], (v - c) * 100, (1 - v) * 100];
};

convert.hwb.hcg = function (hwb) {
	var w = hwb[1] / 100;
	var b = hwb[2] / 100;
	var v = 1 - b;
	var c = v - w;
	var g = 0;

	if (c < 1) {
		g = (v - c) / (1 - c);
	}

	return [hwb[0], c * 100, g * 100];
};

convert.apple.rgb = function (apple) {
	return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
};

convert.rgb.apple = function (rgb) {
	return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
};

convert.gray.rgb = function (args) {
	return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
};

convert.gray.hsl = convert.gray.hsv = function (args) {
	return [0, 0, args[0]];
};

convert.gray.hwb = function (gray) {
	return [0, 100, gray[0]];
};

convert.gray.cmyk = function (gray) {
	return [0, 0, 0, gray[0]];
};

convert.gray.lab = function (gray) {
	return [gray[0], 0, 0];
};

convert.gray.hex = function (gray) {
	var val = Math.round(gray[0] / 100 * 255) & 0xFF;
	var integer = (val << 16) + (val << 8) + val;

	var string = integer.toString(16).toUpperCase();
	return '000000'.substring(string.length) + string;
};

convert.rgb.gray = function (rgb) {
	var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
	return [val / 255 * 100];
};


/***/ }),
/* 311 */
/***/ (function(module, exports, __webpack_require__) {

/* MIT license */
var clone = __webpack_require__(711);
var convert = __webpack_require__(712);
var string = __webpack_require__(715);

var Color = function (obj) {
	if (obj instanceof Color) {
		return obj;
	}
	if (!(this instanceof Color)) {
		return new Color(obj);
	}

	this.values = {
		rgb: [0, 0, 0],
		hsl: [0, 0, 0],
		hsv: [0, 0, 0],
		hwb: [0, 0, 0],
		cmyk: [0, 0, 0, 0],
		alpha: 1
	};

	// parse Color() argument
	var vals;
	if (typeof obj === 'string') {
		vals = string.getRgba(obj);
		if (vals) {
			this.setValues('rgb', vals);
		} else if (vals = string.getHsla(obj)) {
			this.setValues('hsl', vals);
		} else if (vals = string.getHwb(obj)) {
			this.setValues('hwb', vals);
		} else {
			throw new Error('Unable to parse color from string "' + obj + '"');
		}
	} else if (typeof obj === 'object') {
		vals = obj;
		if (vals.r !== undefined || vals.red !== undefined) {
			this.setValues('rgb', vals);
		} else if (vals.l !== undefined || vals.lightness !== undefined) {
			this.setValues('hsl', vals);
		} else if (vals.v !== undefined || vals.value !== undefined) {
			this.setValues('hsv', vals);
		} else if (vals.w !== undefined || vals.whiteness !== undefined) {
			this.setValues('hwb', vals);
		} else if (vals.c !== undefined || vals.cyan !== undefined) {
			this.setValues('cmyk', vals);
		} else {
			throw new Error('Unable to parse color from object ' + JSON.stringify(obj));
		}
	}
};

Color.prototype = {
	rgb: function () {
		return this.setSpace('rgb', arguments);
	},
	hsl: function () {
		return this.setSpace('hsl', arguments);
	},
	hsv: function () {
		return this.setSpace('hsv', arguments);
	},
	hwb: function () {
		return this.setSpace('hwb', arguments);
	},
	cmyk: function () {
		return this.setSpace('cmyk', arguments);
	},

	rgbArray: function () {
		return this.values.rgb;
	},
	hslArray: function () {
		return this.values.hsl;
	},
	hsvArray: function () {
		return this.values.hsv;
	},
	hwbArray: function () {
		if (this.values.alpha !== 1) {
			return this.values.hwb.concat([this.values.alpha]);
		}
		return this.values.hwb;
	},
	cmykArray: function () {
		return this.values.cmyk;
	},
	rgbaArray: function () {
		var rgb = this.values.rgb;
		return rgb.concat([this.values.alpha]);
	},
	rgbaArrayNormalized: function () {
		var rgb = this.values.rgb;
		var glRgba = [];
		for (var i = 0; i < 3; i++) {
			glRgba[i] = rgb[i] / 255;
		}
		glRgba.push(this.values.alpha);
		return glRgba;
	},
	hslaArray: function () {
		var hsl = this.values.hsl;
		return hsl.concat([this.values.alpha]);
	},
	alpha: function (val) {
		if (val === undefined) {
			return this.values.alpha;
		}
		this.setValues('alpha', val);
		return this;
	},

	red: function (val) {
		return this.setChannel('rgb', 0, val);
	},
	green: function (val) {
		return this.setChannel('rgb', 1, val);
	},
	blue: function (val) {
		return this.setChannel('rgb', 2, val);
	},
	hue: function (val) {
		if (val) {
			val %= 360;
			val = val < 0 ? 360 + val : val;
		}
		return this.setChannel('hsl', 0, val);
	},
	saturation: function (val) {
		return this.setChannel('hsl', 1, val);
	},
	lightness: function (val) {
		return this.setChannel('hsl', 2, val);
	},
	saturationv: function (val) {
		return this.setChannel('hsv', 1, val);
	},
	whiteness: function (val) {
		return this.setChannel('hwb', 1, val);
	},
	blackness: function (val) {
		return this.setChannel('hwb', 2, val);
	},
	value: function (val) {
		return this.setChannel('hsv', 2, val);
	},
	cyan: function (val) {
		return this.setChannel('cmyk', 0, val);
	},
	magenta: function (val) {
		return this.setChannel('cmyk', 1, val);
	},
	yellow: function (val) {
		return this.setChannel('cmyk', 2, val);
	},
	black: function (val) {
		return this.setChannel('cmyk', 3, val);
	},

	hexString: function () {
		return string.hexString(this.values.rgb);
	},
	rgbString: function () {
		return string.rgbString(this.values.rgb, this.values.alpha);
	},
	rgbaString: function () {
		return string.rgbaString(this.values.rgb, this.values.alpha);
	},
	percentString: function () {
		return string.percentString(this.values.rgb, this.values.alpha);
	},
	hslString: function () {
		return string.hslString(this.values.hsl, this.values.alpha);
	},
	hslaString: function () {
		return string.hslaString(this.values.hsl, this.values.alpha);
	},
	hwbString: function () {
		return string.hwbString(this.values.hwb, this.values.alpha);
	},
	keyword: function () {
		return string.keyword(this.values.rgb, this.values.alpha);
	},

	rgbNumber: function () {
		return (this.values.rgb[0] << 16) | (this.values.rgb[1] << 8) | this.values.rgb[2];
	},

	luminosity: function () {
		// http://www.w3.org/TR/WCAG20/#relativeluminancedef
		var rgb = this.values.rgb;
		var lum = [];
		for (var i = 0; i < rgb.length; i++) {
			var chan = rgb[i] / 255;
			lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
		}
		return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
	},

	contrast: function (color2) {
		// http://www.w3.org/TR/WCAG20/#contrast-ratiodef
		var lum1 = this.luminosity();
		var lum2 = color2.luminosity();
		if (lum1 > lum2) {
			return (lum1 + 0.05) / (lum2 + 0.05);
		}
		return (lum2 + 0.05) / (lum1 + 0.05);
	},

	level: function (color2) {
		var contrastRatio = this.contrast(color2);
		if (contrastRatio >= 7.1) {
			return 'AAA';
		}

		return (contrastRatio >= 4.5) ? 'AA' : '';
	},

	dark: function () {
		// YIQ equation from http://24ways.org/2010/calculating-color-contrast
		var rgb = this.values.rgb;
		var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
		return yiq < 128;
	},

	light: function () {
		return !this.dark();
	},

	negate: function () {
		var rgb = [];
		for (var i = 0; i < 3; i++) {
			rgb[i] = 255 - this.values.rgb[i];
		}
		this.setValues('rgb', rgb);
		return this;
	},

	lighten: function (ratio) {
		this.values.hsl[2] += this.values.hsl[2] * ratio;
		this.setValues('hsl', this.values.hsl);
		return this;
	},

	darken: function (ratio) {
		this.values.hsl[2] -= this.values.hsl[2] * ratio;
		this.setValues('hsl', this.values.hsl);
		return this;
	},

	saturate: function (ratio) {
		this.values.hsl[1] += this.values.hsl[1] * ratio;
		this.setValues('hsl', this.values.hsl);
		return this;
	},

	desaturate: function (ratio) {
		this.values.hsl[1] -= this.values.hsl[1] * ratio;
		this.setValues('hsl', this.values.hsl);
		return this;
	},

	whiten: function (ratio) {
		this.values.hwb[1] += this.values.hwb[1] * ratio;
		this.setValues('hwb', this.values.hwb);
		return this;
	},

	blacken: function (ratio) {
		this.values.hwb[2] += this.values.hwb[2] * ratio;
		this.setValues('hwb', this.values.hwb);
		return this;
	},

	greyscale: function () {
		var rgb = this.values.rgb;
		// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
		var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
		this.setValues('rgb', [val, val, val]);
		return this;
	},

	clearer: function (ratio) {
		this.setValues('alpha', this.values.alpha - (this.values.alpha * ratio));
		return this;
	},

	opaquer: function (ratio) {
		this.setValues('alpha', this.values.alpha + (this.values.alpha * ratio));
		return this;
	},

	rotate: function (degrees) {
		var hue = this.values.hsl[0];
		hue = (hue + degrees) % 360;
		hue = hue < 0 ? 360 + hue : hue;
		this.values.hsl[0] = hue;
		this.setValues('hsl', this.values.hsl);
		return this;
	},

	/**
	 * Ported from sass implementation in C
	 * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
	 */
	mix: function (mixinColor, weight) {
		var color1 = this;
		var color2 = mixinColor;
		var p = weight === undefined ? 0.5 : weight;

		var w = 2 * p - 1;
		var a = color1.alpha() - color2.alpha();

		var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
		var w2 = 1 - w1;

		return this
			.rgb(
				w1 * color1.red() + w2 * color2.red(),
				w1 * color1.green() + w2 * color2.green(),
				w1 * color1.blue() + w2 * color2.blue()
			)
			.alpha(color1.alpha() * p + color2.alpha() * (1 - p));
	},

	toJSON: function () {
		return this.rgb();
	},

	clone: function () {
		var col = new Color();
		col.values = clone(this.values);
		return col;
	}
};

Color.prototype.getValues = function (space) {
	var vals = {};

	for (var i = 0; i < space.length; i++) {
		vals[space.charAt(i)] = this.values[space][i];
	}

	if (this.values.alpha !== 1) {
		vals.a = this.values.alpha;
	}

	// {r: 255, g: 255, b: 255, a: 0.4}
	return vals;
};

Color.prototype.setValues = function (space, vals) {
	var spaces = {
		rgb: ['red', 'green', 'blue'],
		hsl: ['hue', 'saturation', 'lightness'],
		hsv: ['hue', 'saturation', 'value'],
		hwb: ['hue', 'whiteness', 'blackness'],
		cmyk: ['cyan', 'magenta', 'yellow', 'black']
	};

	var maxes = {
		rgb: [255, 255, 255],
		hsl: [360, 100, 100],
		hsv: [360, 100, 100],
		hwb: [360, 100, 100],
		cmyk: [100, 100, 100, 100]
	};

	var i;
	var alpha = 1;
	if (space === 'alpha') {
		alpha = vals;
	} else if (vals.length) {
		// [10, 10, 10]
		this.values[space] = vals.slice(0, space.length);
		alpha = vals[space.length];
	} else if (vals[space.charAt(0)] !== undefined) {
		// {r: 10, g: 10, b: 10}
		for (i = 0; i < space.length; i++) {
			this.values[space][i] = vals[space.charAt(i)];
		}

		alpha = vals.a;
	} else if (vals[spaces[space][0]] !== undefined) {
		// {red: 10, green: 10, blue: 10}
		var chans = spaces[space];

		for (i = 0; i < space.length; i++) {
			this.values[space][i] = vals[chans[i]];
		}

		alpha = vals.alpha;
	}

	this.values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? this.values.alpha : alpha)));

	if (space === 'alpha') {
		return false;
	}

	var capped;

	// cap values of the space prior converting all values
	for (i = 0; i < space.length; i++) {
		capped = Math.max(0, Math.min(maxes[space][i], this.values[space][i]));
		this.values[space][i] = Math.round(capped);
	}

	// convert to all the other color spaces
	for (var sname in spaces) {
		if (sname !== space) {
			this.values[sname] = convert[space][sname](this.values[space]);
		}

		// cap values
		for (i = 0; i < sname.length; i++) {
			capped = Math.max(0, Math.min(maxes[sname][i], this.values[sname][i]));
			this.values[sname][i] = Math.round(capped);
		}
	}

	return true;
};

Color.prototype.setSpace = function (space, args) {
	var vals = args[0];

	if (vals === undefined) {
		// color.rgb()
		return this.getValues(space);
	}

	// color.rgb(10, 10, 10)
	if (typeof vals === 'number') {
		vals = Array.prototype.slice.call(args);
	}

	this.setValues(space, vals);
	return this;
};

Color.prototype.setChannel = function (space, index, val) {
	if (val === undefined) {
		// color.red()
		return this.values[space][index];
	} else if (val === this.values[space][index]) {
		// color.red(color.red())
		return this;
	}

	// color.red(100)
	this.values[space][index] = val;
	this.setValues(space, this.values[space]);

	return this;
};

module.exports = Color;


/***/ }),
/* 312 */
/***/ (function(module, exports, __webpack_require__) {

var cof = __webpack_require__(56);
module.exports = function (it, msg) {
  if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
  return +it;
};


/***/ }),
/* 313 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)

var toObject = __webpack_require__(35);
var toAbsoluteIndex = __webpack_require__(102);
var toLength = __webpack_require__(27);

module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
  var O = toObject(this);
  var len = toLength(O.length);
  var to = toAbsoluteIndex(target, len);
  var from = toAbsoluteIndex(start, len);
  var end = arguments.length > 2 ? arguments[2] : undefined;
  var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
  var inc = 1;
  if (from < to && to < from + count) {
    inc = -1;
    from += count - 1;
    to += count - 1;
  }
  while (count-- > 0) {
    if (from in O) O[to] = O[from];
    else delete O[to];
    to += inc;
    from += inc;
  } return O;
};


/***/ }),
/* 314 */
/***/ (function(module, exports, __webpack_require__) {

var forOf = __webpack_require__(95);

module.exports = function (iter, ITERATOR) {
  var result = [];
  forOf(iter, false, result.push, result, ITERATOR);
  return result;
};


/***/ }),
/* 315 */
/***/ (function(module, exports, __webpack_require__) {

var aFunction = __webpack_require__(42);
var toObject = __webpack_require__(35);
var IObject = __webpack_require__(136);
var toLength = __webpack_require__(27);

module.exports = function (that, callbackfn, aLen, memo, isRight) {
  aFunction(callbackfn);
  var O = toObject(that);
  var self = IObject(O);
  var length = toLength(O.length);
  var index = isRight ? length - 1 : 0;
  var i = isRight ? -1 : 1;
  if (aLen < 2) for (;;) {
    if (index in self) {
      memo = self[index];
      index += i;
      break;
    }
    index += i;
    if (isRight ? index < 0 : length <= index) {
      throw TypeError('Reduce of empty array with no initial value');
    }
  }
  for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
    memo = callbackfn(memo, self[index], index, O);
  }
  return memo;
};


/***/ }),
/* 316 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var aFunction = __webpack_require__(42);
var isObject = __webpack_require__(22);
var invoke = __webpack_require__(322);
var arraySlice = [].slice;
var factories = {};

var construct = function (F, len, args) {
  if (!(len in factories)) {
    for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
    // eslint-disable-next-line no-new-func
    factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
  } return factories[len](F, args);
};

module.exports = Function.bind || function bind(that /* , ...args */) {
  var fn = aFunction(this);
  var partArgs = arraySlice.call(arguments, 1);
  var bound = function (/* args... */) {
    var args = partArgs.concat(arraySlice.call(arguments));
    return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
  };
  if (isObject(fn.prototype)) bound.prototype = fn.prototype;
  return bound;
};


/***/ }),
/* 317 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var dP = __webpack_require__(31).f;
var create = __webpack_require__(96);
var redefineAll = __webpack_require__(100);
var ctx = __webpack_require__(58);
var anInstance = __webpack_require__(94);
var forOf = __webpack_require__(95);
var $iterDefine = __webpack_require__(225);
var step = __webpack_require__(325);
var setSpecies = __webpack_require__(101);
var DESCRIPTORS = __webpack_require__(30);
var fastKey = __webpack_require__(82).fastKey;
var validate = __webpack_require__(104);
var SIZE = DESCRIPTORS ? '_s' : 'size';

var getEntry = function (that, key) {
  // fast case
  var index = fastKey(key);
  var entry;
  if (index !== 'F') return that._i[index];
  // frozen object case
  for (entry = that._f; entry; entry = entry.n) {
    if (entry.k == key) return entry;
  }
};

module.exports = {
  getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
    var C = wrapper(function (that, iterable) {
      anInstance(that, C, NAME, '_i');
      that._t = NAME;         // collection type
      that._i = create(null); // index
      that._f = undefined;    // first entry
      that._l = undefined;    // last entry
      that[SIZE] = 0;         // size
      if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
    });
    redefineAll(C.prototype, {
      // 23.1.3.1 Map.prototype.clear()
      // 23.2.3.2 Set.prototype.clear()
      clear: function clear() {
        for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
          entry.r = true;
          if (entry.p) entry.p = entry.p.n = undefined;
          delete data[entry.i];
        }
        that._f = that._l = undefined;
        that[SIZE] = 0;
      },
      // 23.1.3.3 Map.prototype.delete(key)
      // 23.2.3.4 Set.prototype.delete(value)
      'delete': function (key) {
        var that = validate(this, NAME);
        var entry = getEntry(that, key);
        if (entry) {
          var next = entry.n;
          var prev = entry.p;
          delete that._i[entry.i];
          entry.r = true;
          if (prev) prev.n = next;
          if (next) next.p = prev;
          if (that._f == entry) that._f = next;
          if (that._l == entry) that._l = prev;
          that[SIZE]--;
        } return !!entry;
      },
      // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
      // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
      forEach: function forEach(callbackfn /* , that = undefined */) {
        validate(this, NAME);
        var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
        var entry;
        while (entry = entry ? entry.n : this._f) {
          f(entry.v, entry.k, this);
          // revert to the last existing entry
          while (entry && entry.r) entry = entry.p;
        }
      },
      // 23.1.3.7 Map.prototype.has(key)
      // 23.2.3.7 Set.prototype.has(value)
      has: function has(key) {
        return !!getEntry(validate(this, NAME), key);
      }
    });
    if (DESCRIPTORS) dP(C.prototype, 'size', {
      get: function () {
        return validate(this, NAME)[SIZE];
      }
    });
    return C;
  },
  def: function (that, key, value) {
    var entry = getEntry(that, key);
    var prev, index;
    // change existing entry
    if (entry) {
      entry.v = value;
    // create new entry
    } else {
      that._l = entry = {
        i: index = fastKey(key, true), // <- index
        k: key,                        // <- key
        v: value,                      // <- value
        p: prev = that._l,             // <- previous entry
        n: undefined,                  // <- next entry
        r: false                       // <- removed
      };
      if (!that._f) that._f = entry;
      if (prev) prev.n = entry;
      that[SIZE]++;
      // add to index
      if (index !== 'F') that._i[index] = entry;
    } return that;
  },
  getEntry: getEntry,
  setStrong: function (C, NAME, IS_MAP) {
    // add .keys, .values, .entries, [@@iterator]
    // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
    $iterDefine(C, NAME, function (iterated, kind) {
      this._t = validate(iterated, NAME); // target
      this._k = kind;                     // kind
      this._l = undefined;                // previous
    }, function () {
      var that = this;
      var kind = that._k;
      var entry = that._l;
      // revert to the last existing entry
      while (entry && entry.r) entry = entry.p;
      // get next entry
      if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
        // or finish the iteration
        that._t = undefined;
        return step(1);
      }
      // return step by kind
      if (kind == 'keys') return step(0, entry.k);
      if (kind == 'values') return step(0, entry.v);
      return step(0, [entry.k, entry.v]);
    }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);

    // add [@@species], 23.1.2.2, 23.2.2.2
    setSpecies(NAME);
  }
};


/***/ }),
/* 318 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var classof = __webpack_require__(113);
var from = __webpack_require__(314);
module.exports = function (NAME) {
  return function toJSON() {
    if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
    return from(this);
  };
};


/***/ }),
/* 319 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var redefineAll = __webpack_require__(100);
var getWeak = __webpack_require__(82).getWeak;
var anObject = __webpack_require__(11);
var isObject = __webpack_require__(22);
var anInstance = __webpack_require__(94);
var forOf = __webpack_require__(95);
var createArrayMethod = __webpack_require__(65);
var $has = __webpack_require__(52);
var validate = __webpack_require__(104);
var arrayFind = createArrayMethod(5);
var arrayFindIndex = createArrayMethod(6);
var id = 0;

// fallback for uncaught frozen keys
var uncaughtFrozenStore = function (that) {
  return that._l || (that._l = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function () {
  this.a = [];
};
var findUncaughtFrozen = function (store, key) {
  return arrayFind(store.a, function (it) {
    return it[0] === key;
  });
};
UncaughtFrozenStore.prototype = {
  get: function (key) {
    var entry = findUncaughtFrozen(this, key);
    if (entry) return entry[1];
  },
  has: function (key) {
    return !!findUncaughtFrozen(this, key);
  },
  set: function (key, value) {
    var entry = findUncaughtFrozen(this, key);
    if (entry) entry[1] = value;
    else this.a.push([key, value]);
  },
  'delete': function (key) {
    var index = arrayFindIndex(this.a, function (it) {
      return it[0] === key;
    });
    if (~index) this.a.splice(index, 1);
    return !!~index;
  }
};

module.exports = {
  getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
    var C = wrapper(function (that, iterable) {
      anInstance(that, C, NAME, '_i');
      that._t = NAME;      // collection type
      that._i = id++;      // collection id
      that._l = undefined; // leak store for uncaught frozen objects
      if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
    });
    redefineAll(C.prototype, {
      // 23.3.3.2 WeakMap.prototype.delete(key)
      // 23.4.3.3 WeakSet.prototype.delete(value)
      'delete': function (key) {
        if (!isObject(key)) return false;
        var data = getWeak(key);
        if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
        return data && $has(data, this._i) && delete data[this._i];
      },
      // 23.3.3.4 WeakMap.prototype.has(key)
      // 23.4.3.4 WeakSet.prototype.has(value)
      has: function has(key) {
        if (!isObject(key)) return false;
        var data = getWeak(key);
        if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
        return data && $has(data, this._i);
      }
    });
    return C;
  },
  def: function (that, key, value) {
    var data = getWeak(anObject(key), true);
    if (data === true) uncaughtFrozenStore(that).set(key, value);
    else data[that._i] = value;
    return that;
  },
  ufstore: uncaughtFrozenStore
};


/***/ }),
/* 320 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
var isArray = __webpack_require__(168);
var isObject = __webpack_require__(22);
var toLength = __webpack_require__(27);
var ctx = __webpack_require__(58);
var IS_CONCAT_SPREADABLE = __webpack_require__(26)('isConcatSpreadable');

function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
  var targetIndex = start;
  var sourceIndex = 0;
  var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
  var element, spreadable;

  while (sourceIndex < sourceLen) {
    if (sourceIndex in source) {
      element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];

      spreadable = false;
      if (isObject(element)) {
        spreadable = element[IS_CONCAT_SPREADABLE];
        spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
      }

      if (spreadable && depth > 0) {
        targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
      } else {
        if (targetIndex >= 0x1fffffffffffff) throw TypeError();
        target[targetIndex] = element;
      }

      targetIndex++;
    }
    sourceIndex++;
  }
  return targetIndex;
}

module.exports = flattenIntoArray;


/***/ }),
/* 321 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = !__webpack_require__(30) && !__webpack_require__(20)(function () {
  return Object.defineProperty(__webpack_require__(218)('div'), 'a', { get: function () { return 7; } }).a != 7;
});


/***/ }),
/* 322 */
/***/ (function(module, exports) {

// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function (fn, args, that) {
  var un = that === undefined;
  switch (args.length) {
    case 0: return un ? fn()
                      : fn.call(that);
    case 1: return un ? fn(args[0])
                      : fn.call(that, args[0]);
    case 2: return un ? fn(args[0], args[1])
                      : fn.call(that, args[0], args[1]);
    case 3: return un ? fn(args[0], args[1], args[2])
                      : fn.call(that, args[0], args[1], args[2]);
    case 4: return un ? fn(args[0], args[1], args[2], args[3])
                      : fn.call(that, args[0], args[1], args[2], args[3]);
  } return fn.apply(that, args);
};


/***/ }),
/* 323 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.3 Number.isInteger(number)
var isObject = __webpack_require__(22);
var floor = Math.floor;
module.exports = function isInteger(it) {
  return !isObject(it) && isFinite(it) && floor(it) === it;
};


/***/ }),
/* 324 */
/***/ (function(module, exports, __webpack_require__) {

// call something on iterator step with safe closing on error
var anObject = __webpack_require__(11);
module.exports = function (iterator, fn, value, entries) {
  try {
    return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  // 7.4.6 IteratorClose(iterator, completion)
  } catch (e) {
    var ret = iterator['return'];
    if (ret !== undefined) anObject(ret.call(iterator));
    throw e;
  }
};


/***/ }),
/* 325 */
/***/ (function(module, exports) {

module.exports = function (done, value) {
  return { value: value, done: !!done };
};


/***/ }),
/* 326 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.16 Math.fround(x)
var sign = __webpack_require__(227);
var pow = Math.pow;
var EPSILON = pow(2, -52);
var EPSILON32 = pow(2, -23);
var MAX32 = pow(2, 127) * (2 - EPSILON32);
var MIN32 = pow(2, -126);

var roundTiesToEven = function (n) {
  return n + 1 / EPSILON - 1 / EPSILON;
};

module.exports = Math.fround || function fround(x) {
  var $abs = Math.abs(x);
  var $sign = sign(x);
  var a, result;
  if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
  a = (1 + EPSILON32 / EPSILON) * $abs;
  result = a - (a - $abs);
  // eslint-disable-next-line no-self-compare
  if (result > MAX32 || result != result) return $sign * Infinity;
  return $sign * result;
};


/***/ }),
/* 327 */
/***/ (function(module, exports) {

// 20.2.2.20 Math.log1p(x)
module.exports = Math.log1p || function log1p(x) {
  return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
};


/***/ }),
/* 328 */
/***/ (function(module, exports) {

// https://rwaldron.github.io/proposal-math-extensions/
module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
  if (
    arguments.length === 0
      // eslint-disable-next-line no-self-compare
      || x != x
      // eslint-disable-next-line no-self-compare
      || inLow != inLow
      // eslint-disable-next-line no-self-compare
      || inHigh != inHigh
      // eslint-disable-next-line no-self-compare
      || outLow != outLow
      // eslint-disable-next-line no-self-compare
      || outHigh != outHigh
  ) return NaN;
  if (x === Infinity || x === -Infinity) return x;
  return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
};


/***/ }),
/* 329 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = __webpack_require__(30);
var getKeys = __webpack_require__(98);
var gOPS = __webpack_require__(172);
var pIE = __webpack_require__(137);
var toObject = __webpack_require__(35);
var IObject = __webpack_require__(136);
var $assign = Object.assign;

// should work with symbols and should have deterministic property order (V8 bug)
module.exports = !$assign || __webpack_require__(20)(function () {
  var A = {};
  var B = {};
  // eslint-disable-next-line no-undef
  var S = Symbol();
  var K = 'abcdefghijklmnopqrst';
  A[S] = 7;
  K.split('').forEach(function (k) { B[k] = k; });
  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  var T = toObject(target);
  var aLen = arguments.length;
  var index = 1;
  var getSymbols = gOPS.f;
  var isEnum = pIE.f;
  while (aLen > index) {
    var S = IObject(arguments[index++]);
    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
    var length = keys.length;
    var j = 0;
    var key;
    while (length > j) {
      key = keys[j++];
      if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
    }
  } return T;
} : $assign;


/***/ }),
/* 330 */
/***/ (function(module, exports, __webpack_require__) {

var dP = __webpack_require__(31);
var anObject = __webpack_require__(11);
var getKeys = __webpack_require__(98);

module.exports = __webpack_require__(30) ? Object.defineProperties : function defineProperties(O, Properties) {
  anObject(O);
  var keys = getKeys(Properties);
  var length = keys.length;
  var i = 0;
  var P;
  while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  return O;
};


/***/ }),
/* 331 */
/***/ (function(module, exports, __webpack_require__) {

// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
var toIObject = __webpack_require__(55);
var gOPN = __webpack_require__(97).f;
var toString = {}.toString;

var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  ? Object.getOwnPropertyNames(window) : [];

var getWindowNames = function (it) {
  try {
    return gOPN(it);
  } catch (e) {
    return windowNames.slice();
  }
};

module.exports.f = function getOwnPropertyNames(it) {
  return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
};


/***/ }),
/* 332 */
/***/ (function(module, exports, __webpack_require__) {

var has = __webpack_require__(52);
var toIObject = __webpack_require__(55);
var arrayIndexOf = __webpack_require__(165)(false);
var IE_PROTO = __webpack_require__(232)('IE_PROTO');

module.exports = function (object, names) {
  var O = toIObject(object);
  var i = 0;
  var result = [];
  var key;
  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  // Don't enum bug & hidden keys
  while (names.length > i) if (has(O, key = names[i++])) {
    ~arrayIndexOf(result, key) || result.push(key);
  }
  return result;
};


/***/ }),
/* 333 */
/***/ (function(module, exports, __webpack_require__) {

var DESCRIPTORS = __webpack_require__(30);
var getKeys = __webpack_require__(98);
var toIObject = __webpack_require__(55);
var isEnum = __webpack_require__(137).f;
module.exports = function (isEntries) {
  return function (it) {
    var O = toIObject(it);
    var keys = getKeys(O);
    var length = keys.length;
    var i = 0;
    var result = [];
    var key;
    while (length > i) {
      key = keys[i++];
      if (!DESCRIPTORS || isEnum.call(O, key)) {
        result.push(isEntries ? [key, O[key]] : O[key]);
      }
    }
    return result;
  };
};


/***/ }),
/* 334 */
/***/ (function(module, exports, __webpack_require__) {

// all object keys, includes non-enumerable and symbols
var gOPN = __webpack_require__(97);
var gOPS = __webpack_require__(172);
var anObject = __webpack_require__(11);
var Reflect = __webpack_require__(16).Reflect;
module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
  var keys = gOPN.f(anObject(it));
  var getSymbols = gOPS.f;
  return getSymbols ? keys.concat(getSymbols(it)) : keys;
};


/***/ }),
/* 335 */
/***/ (function(module, exports, __webpack_require__) {

var $parseFloat = __webpack_require__(16).parseFloat;
var $trim = __webpack_require__(116).trim;

module.exports = 1 / $parseFloat(__webpack_require__(235) + '-0') !== -Infinity ? function parseFloat(str) {
  var string = $trim(String(str), 3);
  var result = $parseFloat(string);
  return result === 0 && string.charAt(0) == '-' ? -0 : result;
} : $parseFloat;


/***/ }),
/* 336 */
/***/ (function(module, exports, __webpack_require__) {

var $parseInt = __webpack_require__(16).parseInt;
var $trim = __webpack_require__(116).trim;
var ws = __webpack_require__(235);
var hex = /^[-+]?0[xX]/;

module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
  var string = $trim(String(str), 3);
  return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
} : $parseInt;


/***/ }),
/* 337 */
/***/ (function(module, exports) {

module.exports = function (exec) {
  try {
    return { e: false, v: exec() };
  } catch (e) {
    return { e: true, v: e };
  }
};


/***/ }),
/* 338 */
/***/ (function(module, exports, __webpack_require__) {

var anObject = __webpack_require__(11);
var isObject = __webpack_require__(22);
var newPromiseCapability = __webpack_require__(229);

module.exports = function (C, x) {
  anObject(C);
  if (isObject(x) && x.constructor === C) return x;
  var promiseCapability = newPromiseCapability.f(C);
  var resolve = promiseCapability.resolve;
  resolve(x);
  return promiseCapability.promise;
};


/***/ }),
/* 339 */
/***/ (function(module, exports) {

// 7.2.9 SameValue(x, y)
module.exports = Object.is || function is(x, y) {
  // eslint-disable-next-line no-self-compare
  return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};


/***/ }),
/* 340 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/tc39/proposal-string-pad-start-end
var toLength = __webpack_require__(27);
var repeat = __webpack_require__(234);
var defined = __webpack_require__(66);

module.exports = function (that, maxLength, fillString, left) {
  var S = String(defined(that));
  var stringLength = S.length;
  var fillStr = fillString === undefined ? ' ' : String(fillString);
  var intMaxLength = toLength(maxLength);
  if (intMaxLength <= stringLength || fillStr == '') return S;
  var fillLen = intMaxLength - stringLength;
  var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
  if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
  return left ? stringFiller + S : S + stringFiller;
};


/***/ }),
/* 341 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/ecma262/#sec-toindex
var toInteger = __webpack_require__(60);
var toLength = __webpack_require__(27);
module.exports = function (it) {
  if (it === undefined) return 0;
  var number = toInteger(it);
  var length = toLength(number);
  if (number !== length) throw RangeError('Wrong length!');
  return length;
};


/***/ }),
/* 342 */
/***/ (function(module, exports, __webpack_require__) {

exports.f = __webpack_require__(26);


/***/ }),
/* 343 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var strong = __webpack_require__(317);
var validate = __webpack_require__(104);
var MAP = 'Map';

// 23.1 Map Objects
module.exports = __webpack_require__(166)(MAP, function (get) {
  return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
  // 23.1.3.6 Map.prototype.get(key)
  get: function get(key) {
    var entry = strong.getEntry(validate(this, MAP), key);
    return entry && entry.v;
  },
  // 23.1.3.9 Map.prototype.set(key, value)
  set: function set(key, value) {
    return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
  }
}, strong, true);


/***/ }),
/* 344 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var regexpExec = __webpack_require__(230);
__webpack_require__(2)({
  target: 'RegExp',
  proto: true,
  forced: regexpExec !== /./.exec
}, {
  exec: regexpExec
});


/***/ }),
/* 345 */
/***/ (function(module, exports, __webpack_require__) {

// 21.2.5.3 get RegExp.prototype.flags()
if (__webpack_require__(30) && /./g.flags != 'g') __webpack_require__(31).f(RegExp.prototype, 'flags', {
  configurable: true,
  get: __webpack_require__(135)
});


/***/ }),
/* 346 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var strong = __webpack_require__(317);
var validate = __webpack_require__(104);
var SET = 'Set';

// 23.2 Set Objects
module.exports = __webpack_require__(166)(SET, function (get) {
  return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
  // 23.2.3.1 Set.prototype.add(value)
  add: function add(value) {
    return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  }
}, strong);


/***/ }),
/* 347 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var global = __webpack_require__(16);
var each = __webpack_require__(65)(0);
var redefine = __webpack_require__(49);
var meta = __webpack_require__(82);
var assign = __webpack_require__(329);
var weak = __webpack_require__(319);
var isObject = __webpack_require__(22);
var validate = __webpack_require__(104);
var NATIVE_WEAK_MAP = __webpack_require__(104);
var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
var WEAK_MAP = 'WeakMap';
var getWeak = meta.getWeak;
var isExtensible = Object.isExtensible;
var uncaughtFrozenStore = weak.ufstore;
var InternalMap;

var wrapper = function (get) {
  return function WeakMap() {
    return get(this, arguments.length > 0 ? arguments[0] : undefined);
  };
};

var methods = {
  // 23.3.3.3 WeakMap.prototype.get(key)
  get: function get(key) {
    if (isObject(key)) {
      var data = getWeak(key);
      if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
      return data ? data[this._i] : undefined;
    }
  },
  // 23.3.3.5 WeakMap.prototype.set(key, value)
  set: function set(key, value) {
    return weak.def(validate(this, WEAK_MAP), key, value);
  }
};

// 23.3 WeakMap Objects
var $WeakMap = module.exports = __webpack_require__(166)(WEAK_MAP, wrapper, methods, weak, true, true);

// IE11 WeakMap frozen keys fix
if (NATIVE_WEAK_MAP && IS_IE11) {
  InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
  assign(InternalMap.prototype, methods);
  meta.NEED = true;
  each(['delete', 'has', 'get', 'set'], function (key) {
    var proto = $WeakMap.prototype;
    var method = proto[key];
    redefine(proto, key, function (a, b) {
      // store frozen objects on internal weakmap shim
      if (isObject(a) && !isExtensible(a)) {
        if (!this._f) this._f = new InternalMap();
        var result = this._f[key](a, b);
        return key == 'set' ? this : result;
      // store all the rest on native weakmap
      } return method.call(this, a, b);
    });
  });
}


/***/ }),
/* 348 */
/***/ (function(module, exports, __webpack_require__) {


var convert = __webpack_require__(921);
var parse = __webpack_require__(349);

/**
 * Expose `convert`.
 */

exports.convert = convert;

/**
 * Expose `parse`.
 */

exports.parse = parse;

/***/ }),
/* 349 */
/***/ (function(module, exports, __webpack_require__) {

var balanced = __webpack_require__(309);
var debug = __webpack_require__(922)('css-color-function:parse');

/**
 * Expose `parse`.
 */

module.exports = parse;

/**
 * Parse a CSS color function string.
 *
 * @param {String} string
 * @return {Array}
 */

function parse (string) {
  if ('string' != typeof string) string = string.toString();
  debug('string %s', string);

  /**
   * Match the current position in the string against a `regexp`, returning the
   * match if one exists.
   *
   * @param {RegExp} regexp
   * @return {Undefined or Array}
   */

  function match (regexp) {
    var m = regexp.exec(string);
    if (!m) return;
    string = string.slice(m[0].length);
    return m.slice(1);
  }

  /**
   * Match whitespace.
   */

  function whitespace () {
    match(/^\s+/);
  }

  /**
   * Match a right parentheses.
   *
   * @return {Array or Undefined}
   */

  function rparen () {
    var m = match(/^\)/);
    if (!m) return;
    debug('rparen');
    return m;
  }

  /**
   * Match a modifier: '+' '-' '*'.
   *
   * @return {Object or Undefined}
   */

  function modifier () {
    var m = match(/^([\+\-\*])/);
    if (!m) return;
    var ret = {};
    ret.type = 'modifier';
    ret.value = m[0];
    debug('modifier %o', ret);
    return ret;
  }

  /**
   * Match a generic number function argument.
   *
   * @return {Object or Undefined}
   */

  function number () {
    var m = match(/^([^\)\s]+)/);
    if (!m) return;
    var ret = {};
    ret.type = 'number';
    ret.value = m[0];
    debug('number %o', ret);
    return ret;
  }

  /**
   * Match a function's arguments.
   *
   * @return {Array}
   */

  function args () {
    var ret = [];
    var el;
    while (el = modifier() || fn() || number()) {
      ret.push(el);
      whitespace();
    }
    debug('args %o', ret);
    return ret;
  }

  /**
   * Match an adjuster function.
   *
   * @return {Object or Undefined}
   */

  function adjuster () {
    var m = match(/^(\w+)\(/);
    if (!m) return;
    whitespace();
    var el;
    var ret = {};
    ret.type = 'function';
    ret.name = m[0];
    ret.arguments = args();
    rparen()
    debug('adjuster %o', ret);
    return ret;
  }

  /**
   * Match a color.
   *
   * @return {Object}
   */

  function color () {
    var ret = {};
    ret.type = 'color';

    var col = match(/([^\)\s]+)/)[0];
    if (col.indexOf('(') != -1) {
      var piece = match(/([^\)]*?\))/)[0];
      col = col + piece;
    }

    ret.value = col;
    whitespace();
    return ret;
  }

  /**
   * Match a color function, capturing the first color argument and any adjuster
   * functions after it.
   *
   * @return {Object or Undefined}
   */

  function fn () {
    if (!string.match(/^color\(/)) return;

    var colorRef = balanced('(', ')', string)
    if (!colorRef) throw new SyntaxError('Missing closing parenthese for \'' + string + '\'');
    if (colorRef.body === '') throw new SyntaxError('color() function cannot be empty');
    string = colorRef.body
    whitespace();

    var ret = {};
    ret.type = 'function';
    ret.name = 'color';
    ret.arguments = [fn() || color()];
    debug('function arguments %o', ret.arguments);

    var el;
    while (el = adjuster()) {
      ret.arguments.push(el);
      whitespace();
    }

    // pass the rest of the string in case of recursive color()
    string = colorRef.post
    whitespace();
    debug('function %o', ret);

    return ret;
  }

  /**
   * Return the parsed color function.
   */

  return fn();
}


/***/ }),
/* 350 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var keys = __webpack_require__(1222);
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';

var toStr = Object.prototype.toString;
var concat = Array.prototype.concat;
var origDefineProperty = Object.defineProperty;

var isFunction = function (fn) {
	return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
};

var arePropertyDescriptorsSupported = function () {
	var obj = {};
	try {
		origDefineProperty(obj, 'x', { enumerable: false, value: obj });
		// eslint-disable-next-line no-unused-vars, no-restricted-syntax
		for (var _ in obj) { // jscs:ignore disallowUnusedVariables
			return false;
		}
		return obj.x === obj;
	} catch (e) { /* this is IE 8. */
		return false;
	}
};
var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();

var defineProperty = function (object, name, value, predicate) {
	if (name in object && (!isFunction(predicate) || !predicate())) {
		return;
	}
	if (supportsDescriptors) {
		origDefineProperty(object, name, {
			configurable: true,
			enumerable: false,
			value: value,
			writable: true
		});
	} else {
		object[name] = value;
	}
};

var defineProperties = function (object, map) {
	var predicates = arguments.length > 2 ? arguments[2] : {};
	var props = keys(map);
	if (hasSymbols) {
		props = concat.call(props, Object.getOwnPropertySymbols(map));
	}
	for (var i = 0; i < props.length; i += 1) {
		defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
	}
};

defineProperties.supportsDescriptors = !!supportsDescriptors;

module.exports = defineProperties;


/***/ }),
/* 351 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var HandlerRole;
(function (HandlerRole) {
    HandlerRole["SOURCE"] = "SOURCE";
    HandlerRole["TARGET"] = "TARGET";
})(HandlerRole = exports.HandlerRole || (exports.HandlerRole = {}));


/***/ }),
/* 352 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var js_utils_1 = __webpack_require__(117);
exports.NONE = [];
exports.ALL = [];
exports.NONE.__IS_NONE__ = true;
exports.ALL.__IS_ALL__ = true;
/**
 * Determines if the given handler IDs are dirty or not.
 *
 * @param dirtyIds The set of dirty handler ids
 * @param handlerIds The set of handler ids to check
 */
function areDirty(dirtyIds, handlerIds) {
    if (dirtyIds === exports.NONE) {
        return false;
    }
    if (dirtyIds === exports.ALL || typeof handlerIds === 'undefined') {
        return true;
    }
    var commonIds = js_utils_1.intersection(handlerIds, dirtyIds);
    return commonIds.length > 0;
}
exports.areDirty = areDirty;


/***/ }),
/* 353 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.strictEquality = function (a, b) { return a === b; };
/**
 * Determine if two cartesian coordinate offsets are equal
 * @param offsetA
 * @param offsetB
 */
function areCoordsEqual(offsetA, offsetB) {
    if (!offsetA && !offsetB) {
        return true;
    }
    else if (!offsetA || !offsetB) {
        return false;
    }
    else {
        return offsetA.x === offsetB.x && offsetA.y === offsetB.y;
    }
}
exports.areCoordsEqual = areCoordsEqual;
/**
 * Determines if two arrays of items are equal
 * @param a The first array of items
 * @param b The second array of items
 */
function areArraysEqual(a, b, isEqual) {
    if (isEqual === void 0) { isEqual = exports.strictEquality; }
    if (a.length !== b.length) {
        return false;
    }
    for (var i = 0; i < a.length; ++i) {
        if (!isEqual(a[i], b[i])) {
            return false;
        }
    }
    return true;
}
exports.areArraysEqual = areArraysEqual;


/***/ }),
/* 354 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function matchesType(targetType, draggedItemType) {
    if (draggedItemType === null) {
        return targetType === null;
    }
    return Array.isArray(targetType)
        ? targetType.some(function (t) { return t === draggedItemType; })
        : targetType === draggedItemType;
}
exports.default = matchesType;


/***/ }),
/* 355 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/* globals
	Set,
	Map,
	WeakSet,
	WeakMap,

	Promise,

	Symbol,
	Proxy,

	Atomics,
	SharedArrayBuffer,

	ArrayBuffer,
	DataView,
	Uint8Array,
	Float32Array,
	Float64Array,
	Int8Array,
	Int16Array,
	Int32Array,
	Uint8ClampedArray,
	Uint16Array,
	Uint32Array,
*/

var undefined; // eslint-disable-line no-shadow-restricted-names

var ThrowTypeError = Object.getOwnPropertyDescriptor
	? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }())
	: function () { throw new TypeError(); };

var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';

var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto

var generator; // = function * () {};
var generatorFunction = generator ? getProto(generator) : undefined;
var asyncFn; // async function() {};
var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
var asyncGen; // async function * () {};
var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
var asyncGenIterator = asyncGen ? asyncGen() : undefined;

var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);

var INTRINSICS = {
	'$ %Array%': Array,
	'$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
	'$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
	'$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
	'$ %ArrayPrototype%': Array.prototype,
	'$ %ArrayProto_entries%': Array.prototype.entries,
	'$ %ArrayProto_forEach%': Array.prototype.forEach,
	'$ %ArrayProto_keys%': Array.prototype.keys,
	'$ %ArrayProto_values%': Array.prototype.values,
	'$ %AsyncFromSyncIteratorPrototype%': undefined,
	'$ %AsyncFunction%': asyncFunction,
	'$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
	'$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
	'$ %AsyncGeneratorFunction%': asyncGenFunction,
	'$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
	'$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
	'$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
	'$ %Boolean%': Boolean,
	'$ %BooleanPrototype%': Boolean.prototype,
	'$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView,
	'$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
	'$ %Date%': Date,
	'$ %DatePrototype%': Date.prototype,
	'$ %decodeURI%': decodeURI,
	'$ %decodeURIComponent%': decodeURIComponent,
	'$ %encodeURI%': encodeURI,
	'$ %encodeURIComponent%': encodeURIComponent,
	'$ %Error%': Error,
	'$ %ErrorPrototype%': Error.prototype,
	'$ %eval%': eval, // eslint-disable-line no-eval
	'$ %EvalError%': EvalError,
	'$ %EvalErrorPrototype%': EvalError.prototype,
	'$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
	'$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
	'$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
	'$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
	'$ %Function%': Function,
	'$ %FunctionPrototype%': Function.prototype,
	'$ %Generator%': generator ? getProto(generator()) : undefined,
	'$ %GeneratorFunction%': generatorFunction,
	'$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
	'$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
	'$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
	'$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
	'$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
	'$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
	'$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
	'$ %isFinite%': isFinite,
	'$ %isNaN%': isNaN,
	'$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
	'$ %JSON%': JSON,
	'$ %JSONParse%': JSON.parse,
	'$ %Map%': typeof Map === 'undefined' ? undefined : Map,
	'$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
	'$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
	'$ %Math%': Math,
	'$ %Number%': Number,
	'$ %NumberPrototype%': Number.prototype,
	'$ %Object%': Object,
	'$ %ObjectPrototype%': Object.prototype,
	'$ %ObjProto_toString%': Object.prototype.toString,
	'$ %ObjProto_valueOf%': Object.prototype.valueOf,
	'$ %parseFloat%': parseFloat,
	'$ %parseInt%': parseInt,
	'$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise,
	'$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
	'$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
	'$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
	'$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
	'$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
	'$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
	'$ %RangeError%': RangeError,
	'$ %RangeErrorPrototype%': RangeError.prototype,
	'$ %ReferenceError%': ReferenceError,
	'$ %ReferenceErrorPrototype%': ReferenceError.prototype,
	'$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
	'$ %RegExp%': RegExp,
	'$ %RegExpPrototype%': RegExp.prototype,
	'$ %Set%': typeof Set === 'undefined' ? undefined : Set,
	'$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
	'$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
	'$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
	'$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
	'$ %String%': String,
	'$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
	'$ %StringPrototype%': String.prototype,
	'$ %Symbol%': hasSymbols ? Symbol : undefined,
	'$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
	'$ %SyntaxError%': SyntaxError,
	'$ %SyntaxErrorPrototype%': SyntaxError.prototype,
	'$ %ThrowTypeError%': ThrowTypeError,
	'$ %TypedArray%': TypedArray,
	'$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
	'$ %TypeError%': TypeError,
	'$ %TypeErrorPrototype%': TypeError.prototype,
	'$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
	'$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
	'$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
	'$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
	'$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
	'$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
	'$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
	'$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
	'$ %URIError%': URIError,
	'$ %URIErrorPrototype%': URIError.prototype,
	'$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
	'$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
	'$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
	'$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
};

module.exports = function GetIntrinsic(name, allowMissing) {
	if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
		throw new TypeError('"allowMissing" argument must be a boolean');
	}

	var key = '$ ' + name;
	if (!(key in INTRINSICS)) {
		throw new SyntaxError('intrinsic ' + name + ' does not exist!');
	}

	// istanbul ignore if // hopefully this is impossible to test :-)
	if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) {
		throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
	}
	return INTRINSICS[key];
};


/***/ }),
/* 356 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2014-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */



var emptyFunction = __webpack_require__(1209);

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warning = emptyFunction;

if (true) {
  var printWarning = function printWarning(format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  warning = function warning(condition, format) {
    if (format === undefined) {
      throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
    }

    if (format.indexOf('Failed Composite propType: ') === 0) {
      return; // Ignore CompositeComponent proptype check.
    }

    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

module.exports = warning;

/***/ }),
/* 357 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(241);

module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);


/***/ }),
/* 358 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return createBrowserHistory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return createHashHistory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createMemoryHistory; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createLocation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return locationsAreEqual; });
/* unused harmony export parsePath */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return createPath; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(187);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_resolve_pathname__ = __webpack_require__(1377);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_value_equal__ = __webpack_require__(1392);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_tiny_warning__ = __webpack_require__(253);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tiny_invariant__ = __webpack_require__(252);






function addLeadingSlash(path) {
  return path.charAt(0) === '/' ? path : '/' + path;
}
function stripLeadingSlash(path) {
  return path.charAt(0) === '/' ? path.substr(1) : path;
}
function hasBasename(path, prefix) {
  return new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path);
}
function stripBasename(path, prefix) {
  return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
}
function stripTrailingSlash(path) {
  return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
}
function parsePath(path) {
  var pathname = path || '/';
  var search = '';
  var hash = '';
  var hashIndex = pathname.indexOf('#');

  if (hashIndex !== -1) {
    hash = pathname.substr(hashIndex);
    pathname = pathname.substr(0, hashIndex);
  }

  var searchIndex = pathname.indexOf('?');

  if (searchIndex !== -1) {
    search = pathname.substr(searchIndex);
    pathname = pathname.substr(0, searchIndex);
  }

  return {
    pathname: pathname,
    search: search === '?' ? '' : search,
    hash: hash === '#' ? '' : hash
  };
}
function createPath(location) {
  var pathname = location.pathname,
      search = location.search,
      hash = location.hash;
  var path = pathname || '/';
  if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
  if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
  return path;
}

function createLocation(path, state, key, currentLocation) {
  var location;

  if (typeof path === 'string') {
    // Two-arg form: push(path, state)
    location = parsePath(path);
    location.state = state;
  } else {
    // One-arg form: push(location)
    location = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, path);
    if (location.pathname === undefined) location.pathname = '';

    if (location.search) {
      if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
    } else {
      location.search = '';
    }

    if (location.hash) {
      if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
    } else {
      location.hash = '';
    }

    if (state !== undefined && location.state === undefined) location.state = state;
  }

  try {
    location.pathname = decodeURI(location.pathname);
  } catch (e) {
    if (e instanceof URIError) {
      throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
    } else {
      throw e;
    }
  }

  if (key) location.key = key;

  if (currentLocation) {
    // Resolve incomplete/relative pathname relative to current location.
    if (!location.pathname) {
      location.pathname = currentLocation.pathname;
    } else if (location.pathname.charAt(0) !== '/') {
      location.pathname = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_resolve_pathname__["a" /* default */])(location.pathname, currentLocation.pathname);
    }
  } else {
    // When there is no prior location and pathname is empty, set it to /
    if (!location.pathname) {
      location.pathname = '/';
    }
  }

  return location;
}
function locationsAreEqual(a, b) {
  return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2_value_equal__["a" /* default */])(a.state, b.state);
}

function createTransitionManager() {
  var prompt = null;

  function setPrompt(nextPrompt) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(prompt == null, 'A history supports only one prompt at a time') : void 0;
    prompt = nextPrompt;
    return function () {
      if (prompt === nextPrompt) prompt = null;
    };
  }

  function confirmTransitionTo(location, action, getUserConfirmation, callback) {
    // TODO: If another transition starts while we're still confirming
    // the previous one, we may end up in a weird state. Figure out the
    // best way to handle this.
    if (prompt != null) {
      var result = typeof prompt === 'function' ? prompt(location, action) : prompt;

      if (typeof result === 'string') {
        if (typeof getUserConfirmation === 'function') {
          getUserConfirmation(result, callback);
        } else {
           true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
          callback(true);
        }
      } else {
        // Return false from a transition hook to cancel the transition.
        callback(result !== false);
      }
    } else {
      callback(true);
    }
  }

  var listeners = [];

  function appendListener(fn) {
    var isActive = true;

    function listener() {
      if (isActive) fn.apply(void 0, arguments);
    }

    listeners.push(listener);
    return function () {
      isActive = false;
      listeners = listeners.filter(function (item) {
        return item !== listener;
      });
    };
  }

  function notifyListeners() {
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    listeners.forEach(function (listener) {
      return listener.apply(void 0, args);
    });
  }

  return {
    setPrompt: setPrompt,
    confirmTransitionTo: confirmTransitionTo,
    appendListener: appendListener,
    notifyListeners: notifyListeners
  };
}

var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
function getConfirmation(message, callback) {
  callback(window.confirm(message)); // eslint-disable-line no-alert
}
/**
 * Returns true if the HTML5 history API is supported. Taken from Modernizr.
 *
 * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
 * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
 * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
 */

function supportsHistory() {
  var ua = window.navigator.userAgent;
  if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
  return window.history && 'pushState' in window.history;
}
/**
 * Returns true if browser fires popstate on hash change.
 * IE10 and IE11 do not.
 */

function supportsPopStateOnHashChange() {
  return window.navigator.userAgent.indexOf('Trident') === -1;
}
/**
 * Returns false if using go(n) with hash history causes a full page reload.
 */

function supportsGoWithoutReloadUsingHash() {
  return window.navigator.userAgent.indexOf('Firefox') === -1;
}
/**
 * Returns true if a given popstate event is an extraneous WebKit event.
 * Accounts for the fact that Chrome on iOS fires real popstate events
 * containing undefined state when pressing the back button.
 */

function isExtraneousPopstateEvent(event) {
  event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
}

var PopStateEvent = 'popstate';
var HashChangeEvent = 'hashchange';

function getHistoryState() {
  try {
    return window.history.state || {};
  } catch (e) {
    // IE 11 sometimes throws when accessing window.history.state
    // See https://github.com/ReactTraining/history/pull/289
    return {};
  }
}
/**
 * Creates a history object that uses the HTML5 history API including
 * pushState, replaceState, and the popstate event.
 */


function createBrowserHistory(props) {
  if (props === void 0) {
    props = {};
  }

  !canUseDOM ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false, 'Browser history needs a DOM') : invariant(false) : void 0;
  var globalHistory = window.history;
  var canUseHistory = supportsHistory();
  var needsHashChangeListener = !supportsPopStateOnHashChange();
  var _props = props,
      _props$forceRefresh = _props.forceRefresh,
      forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
      _props$getUserConfirm = _props.getUserConfirmation,
      getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
      _props$keyLength = _props.keyLength,
      keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
  var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';

  function getDOMLocation(historyState) {
    var _ref = historyState || {},
        key = _ref.key,
        state = _ref.state;

    var _window$location = window.location,
        pathname = _window$location.pathname,
        search = _window$location.search,
        hash = _window$location.hash;
    var path = pathname + search + hash;
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
    if (basename) path = stripBasename(path, basename);
    return createLocation(path, state, key);
  }

  function createKey() {
    return Math.random().toString(36).substr(2, keyLength);
  }

  var transitionManager = createTransitionManager();

  function setState(nextState) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);

    history.length = globalHistory.length;
    transitionManager.notifyListeners(history.location, history.action);
  }

  function handlePopState(event) {
    // Ignore extraneous popstate events in WebKit.
    if (isExtraneousPopstateEvent(event)) return;
    handlePop(getDOMLocation(event.state));
  }

  function handleHashChange() {
    handlePop(getDOMLocation(getHistoryState()));
  }

  var forceNextPop = false;

  function handlePop(location) {
    if (forceNextPop) {
      forceNextPop = false;
      setState();
    } else {
      var action = 'POP';
      transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
        if (ok) {
          setState({
            action: action,
            location: location
          });
        } else {
          revertPop(location);
        }
      });
    }
  }

  function revertPop(fromLocation) {
    var toLocation = history.location; // TODO: We could probably make this more reliable by
    // keeping a list of keys we've seen in sessionStorage.
    // Instead, we just default to 0 for keys we don't know.

    var toIndex = allKeys.indexOf(toLocation.key);
    if (toIndex === -1) toIndex = 0;
    var fromIndex = allKeys.indexOf(fromLocation.key);
    if (fromIndex === -1) fromIndex = 0;
    var delta = toIndex - fromIndex;

    if (delta) {
      forceNextPop = true;
      go(delta);
    }
  }

  var initialLocation = getDOMLocation(getHistoryState());
  var allKeys = [initialLocation.key]; // Public interface

  function createHref(location) {
    return basename + createPath(location);
  }

  function push(path, state) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
    var action = 'PUSH';
    var location = createLocation(path, state, createKey(), history.location);
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (!ok) return;
      var href = createHref(location);
      var key = location.key,
          state = location.state;

      if (canUseHistory) {
        globalHistory.pushState({
          key: key,
          state: state
        }, null, href);

        if (forceRefresh) {
          window.location.href = href;
        } else {
          var prevIndex = allKeys.indexOf(history.location.key);
          var nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
          nextKeys.push(location.key);
          allKeys = nextKeys;
          setState({
            action: action,
            location: location
          });
        }
      } else {
         true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
        window.location.href = href;
      }
    });
  }

  function replace(path, state) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
    var action = 'REPLACE';
    var location = createLocation(path, state, createKey(), history.location);
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (!ok) return;
      var href = createHref(location);
      var key = location.key,
          state = location.state;

      if (canUseHistory) {
        globalHistory.replaceState({
          key: key,
          state: state
        }, null, href);

        if (forceRefresh) {
          window.location.replace(href);
        } else {
          var prevIndex = allKeys.indexOf(history.location.key);
          if (prevIndex !== -1) allKeys[prevIndex] = location.key;
          setState({
            action: action,
            location: location
          });
        }
      } else {
         true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
        window.location.replace(href);
      }
    });
  }

  function go(n) {
    globalHistory.go(n);
  }

  function goBack() {
    go(-1);
  }

  function goForward() {
    go(1);
  }

  var listenerCount = 0;

  function checkDOMListeners(delta) {
    listenerCount += delta;

    if (listenerCount === 1 && delta === 1) {
      window.addEventListener(PopStateEvent, handlePopState);
      if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
    } else if (listenerCount === 0) {
      window.removeEventListener(PopStateEvent, handlePopState);
      if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
    }
  }

  var isBlocked = false;

  function block(prompt) {
    if (prompt === void 0) {
      prompt = false;
    }

    var unblock = transitionManager.setPrompt(prompt);

    if (!isBlocked) {
      checkDOMListeners(1);
      isBlocked = true;
    }

    return function () {
      if (isBlocked) {
        isBlocked = false;
        checkDOMListeners(-1);
      }

      return unblock();
    };
  }

  function listen(listener) {
    var unlisten = transitionManager.appendListener(listener);
    checkDOMListeners(1);
    return function () {
      checkDOMListeners(-1);
      unlisten();
    };
  }

  var history = {
    length: globalHistory.length,
    action: 'POP',
    location: initialLocation,
    createHref: createHref,
    push: push,
    replace: replace,
    go: go,
    goBack: goBack,
    goForward: goForward,
    block: block,
    listen: listen
  };
  return history;
}

var HashChangeEvent$1 = 'hashchange';
var HashPathCoders = {
  hashbang: {
    encodePath: function encodePath(path) {
      return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
    },
    decodePath: function decodePath(path) {
      return path.charAt(0) === '!' ? path.substr(1) : path;
    }
  },
  noslash: {
    encodePath: stripLeadingSlash,
    decodePath: addLeadingSlash
  },
  slash: {
    encodePath: addLeadingSlash,
    decodePath: addLeadingSlash
  }
};

function getHashPath() {
  // We can't use window.location.hash here because it's not
  // consistent across browsers - Firefox will pre-decode it!
  var href = window.location.href;
  var hashIndex = href.indexOf('#');
  return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
}

function pushHashPath(path) {
  window.location.hash = path;
}

function replaceHashPath(path) {
  var hashIndex = window.location.href.indexOf('#');
  window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
}

function createHashHistory(props) {
  if (props === void 0) {
    props = {};
  }

  !canUseDOM ?  true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false, 'Hash history needs a DOM') : invariant(false) : void 0;
  var globalHistory = window.history;
  var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
  var _props = props,
      _props$getUserConfirm = _props.getUserConfirmation,
      getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
      _props$hashType = _props.hashType,
      hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
  var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
  var _HashPathCoders$hashT = HashPathCoders[hashType],
      encodePath = _HashPathCoders$hashT.encodePath,
      decodePath = _HashPathCoders$hashT.decodePath;

  function getDOMLocation() {
    var path = decodePath(getHashPath());
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
    if (basename) path = stripBasename(path, basename);
    return createLocation(path);
  }

  var transitionManager = createTransitionManager();

  function setState(nextState) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);

    history.length = globalHistory.length;
    transitionManager.notifyListeners(history.location, history.action);
  }

  var forceNextPop = false;
  var ignorePath = null;

  function handleHashChange() {
    var path = getHashPath();
    var encodedPath = encodePath(path);

    if (path !== encodedPath) {
      // Ensure we always have a properly-encoded hash.
      replaceHashPath(encodedPath);
    } else {
      var location = getDOMLocation();
      var prevLocation = history.location;
      if (!forceNextPop && locationsAreEqual(prevLocation, location)) return; // A hashchange doesn't always == location change.

      if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.

      ignorePath = null;
      handlePop(location);
    }
  }

  function handlePop(location) {
    if (forceNextPop) {
      forceNextPop = false;
      setState();
    } else {
      var action = 'POP';
      transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
        if (ok) {
          setState({
            action: action,
            location: location
          });
        } else {
          revertPop(location);
        }
      });
    }
  }

  function revertPop(fromLocation) {
    var toLocation = history.location; // TODO: We could probably make this more reliable by
    // keeping a list of paths we've seen in sessionStorage.
    // Instead, we just default to 0 for paths we don't know.

    var toIndex = allPaths.lastIndexOf(createPath(toLocation));
    if (toIndex === -1) toIndex = 0;
    var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
    if (fromIndex === -1) fromIndex = 0;
    var delta = toIndex - fromIndex;

    if (delta) {
      forceNextPop = true;
      go(delta);
    }
  } // Ensure the hash is encoded properly before doing anything else.


  var path = getHashPath();
  var encodedPath = encodePath(path);
  if (path !== encodedPath) replaceHashPath(encodedPath);
  var initialLocation = getDOMLocation();
  var allPaths = [createPath(initialLocation)]; // Public interface

  function createHref(location) {
    return '#' + encodePath(basename + createPath(location));
  }

  function push(path, state) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
    var action = 'PUSH';
    var location = createLocation(path, undefined, undefined, history.location);
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (!ok) return;
      var path = createPath(location);
      var encodedPath = encodePath(basename + path);
      var hashChanged = getHashPath() !== encodedPath;

      if (hashChanged) {
        // We cannot tell if a hashchange was caused by a PUSH, so we'd
        // rather setState here and ignore the hashchange. The caveat here
        // is that other hash histories in the page will consider it a POP.
        ignorePath = path;
        pushHashPath(encodedPath);
        var prevIndex = allPaths.lastIndexOf(createPath(history.location));
        var nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
        nextPaths.push(path);
        allPaths = nextPaths;
        setState({
          action: action,
          location: location
        });
      } else {
         true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;
        setState();
      }
    });
  }

  function replace(path, state) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
    var action = 'REPLACE';
    var location = createLocation(path, undefined, undefined, history.location);
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (!ok) return;
      var path = createPath(location);
      var encodedPath = encodePath(basename + path);
      var hashChanged = getHashPath() !== encodedPath;

      if (hashChanged) {
        // We cannot tell if a hashchange was caused by a REPLACE, so we'd
        // rather setState here and ignore the hashchange. The caveat here
        // is that other hash histories in the page will consider it a POP.
        ignorePath = path;
        replaceHashPath(encodedPath);
      }

      var prevIndex = allPaths.indexOf(createPath(history.location));
      if (prevIndex !== -1) allPaths[prevIndex] = path;
      setState({
        action: action,
        location: location
      });
    });
  }

  function go(n) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
    globalHistory.go(n);
  }

  function goBack() {
    go(-1);
  }

  function goForward() {
    go(1);
  }

  var listenerCount = 0;

  function checkDOMListeners(delta) {
    listenerCount += delta;

    if (listenerCount === 1 && delta === 1) {
      window.addEventListener(HashChangeEvent$1, handleHashChange);
    } else if (listenerCount === 0) {
      window.removeEventListener(HashChangeEvent$1, handleHashChange);
    }
  }

  var isBlocked = false;

  function block(prompt) {
    if (prompt === void 0) {
      prompt = false;
    }

    var unblock = transitionManager.setPrompt(prompt);

    if (!isBlocked) {
      checkDOMListeners(1);
      isBlocked = true;
    }

    return function () {
      if (isBlocked) {
        isBlocked = false;
        checkDOMListeners(-1);
      }

      return unblock();
    };
  }

  function listen(listener) {
    var unlisten = transitionManager.appendListener(listener);
    checkDOMListeners(1);
    return function () {
      checkDOMListeners(-1);
      unlisten();
    };
  }

  var history = {
    length: globalHistory.length,
    action: 'POP',
    location: initialLocation,
    createHref: createHref,
    push: push,
    replace: replace,
    go: go,
    goBack: goBack,
    goForward: goForward,
    block: block,
    listen: listen
  };
  return history;
}

function clamp(n, lowerBound, upperBound) {
  return Math.min(Math.max(n, lowerBound), upperBound);
}
/**
 * Creates a history object that stores locations in memory.
 */


function createMemoryHistory(props) {
  if (props === void 0) {
    props = {};
  }

  var _props = props,
      getUserConfirmation = _props.getUserConfirmation,
      _props$initialEntries = _props.initialEntries,
      initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
      _props$initialIndex = _props.initialIndex,
      initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
      _props$keyLength = _props.keyLength,
      keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
  var transitionManager = createTransitionManager();

  function setState(nextState) {
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);

    history.length = history.entries.length;
    transitionManager.notifyListeners(history.location, history.action);
  }

  function createKey() {
    return Math.random().toString(36).substr(2, keyLength);
  }

  var index = clamp(initialIndex, 0, initialEntries.length - 1);
  var entries = initialEntries.map(function (entry) {
    return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
  }); // Public interface

  var createHref = createPath;

  function push(path, state) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
    var action = 'PUSH';
    var location = createLocation(path, state, createKey(), history.location);
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (!ok) return;
      var prevIndex = history.index;
      var nextIndex = prevIndex + 1;
      var nextEntries = history.entries.slice(0);

      if (nextEntries.length > nextIndex) {
        nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
      } else {
        nextEntries.push(location);
      }

      setState({
        action: action,
        location: location,
        index: nextIndex,
        entries: nextEntries
      });
    });
  }

  function replace(path, state) {
     true ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
    var action = 'REPLACE';
    var location = createLocation(path, state, createKey(), history.location);
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (!ok) return;
      history.entries[history.index] = location;
      setState({
        action: action,
        location: location
      });
    });
  }

  function go(n) {
    var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
    var action = 'POP';
    var location = history.entries[nextIndex];
    transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
      if (ok) {
        setState({
          action: action,
          location: location,
          index: nextIndex
        });
      } else {
        // Mimic the behavior of DOM histories by
        // causing a render after a cancelled POP.
        setState();
      }
    });
  }

  function goBack() {
    go(-1);
  }

  function goForward() {
    go(1);
  }

  function canGo(n) {
    var nextIndex = history.index + n;
    return nextIndex >= 0 && nextIndex < history.entries.length;
  }

  function block(prompt) {
    if (prompt === void 0) {
      prompt = false;
    }

    return transitionManager.setPrompt(prompt);
  }

  function listen(listener) {
    return transitionManager.appendListener(listener);
  }

  var history = {
    length: entries.length,
    action: 'POP',
    location: entries[index],
    index: index,
    entries: entries,
    createHref: createHref,
    push: push,
    replace: replace,
    go: go,
    goBack: goBack,
    goForward: goForward,
    canGo: canGo,
    block: block,
    listen: listen
  };
  return history;
}




/***/ }),
/* 359 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var toStr = Object.prototype.toString;

module.exports = function isArguments(value) {
	var str = toStr.call(value);
	var isArgs = str === '[object Arguments]';
	if (!isArgs) {
		isArgs = str !== '[object Array]' &&
			value !== null &&
			typeof value === 'object' &&
			typeof value.length === 'number' &&
			value.length >= 0 &&
			toStr.call(value.callee) === '[object Function]';
	}
	return isArgs;
};


/***/ }),
/* 360 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// String encode/decode helpers



var utils = __webpack_require__(83);


// Quick check if we can use fast array to bin string conversion
//
// - apply(Array) can fail on Android 2.2
// - apply(Uint8Array) can fail on iOS 5.1 Safari
//
var STR_APPLY_OK = true;
var STR_APPLY_UIA_OK = true;

try { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }
try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }


// Table with utf8 lengths (calculated by first byte of sequence)
// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
// because max possible codepoint is 0x10ffff
var _utf8len = new utils.Buf8(256);
for (var q = 0; q < 256; q++) {
  _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
}
_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start


// convert string to array (typed, when possible)
exports.string2buf = function (str) {
  var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;

  // count binary size
  for (m_pos = 0; m_pos < str_len; m_pos++) {
    c = str.charCodeAt(m_pos);
    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
      c2 = str.charCodeAt(m_pos + 1);
      if ((c2 & 0xfc00) === 0xdc00) {
        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
        m_pos++;
      }
    }
    buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
  }

  // allocate buffer
  buf = new utils.Buf8(buf_len);

  // convert
  for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
    c = str.charCodeAt(m_pos);
    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
      c2 = str.charCodeAt(m_pos + 1);
      if ((c2 & 0xfc00) === 0xdc00) {
        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
        m_pos++;
      }
    }
    if (c < 0x80) {
      /* one byte */
      buf[i++] = c;
    } else if (c < 0x800) {
      /* two bytes */
      buf[i++] = 0xC0 | (c >>> 6);
      buf[i++] = 0x80 | (c & 0x3f);
    } else if (c < 0x10000) {
      /* three bytes */
      buf[i++] = 0xE0 | (c >>> 12);
      buf[i++] = 0x80 | (c >>> 6 & 0x3f);
      buf[i++] = 0x80 | (c & 0x3f);
    } else {
      /* four bytes */
      buf[i++] = 0xf0 | (c >>> 18);
      buf[i++] = 0x80 | (c >>> 12 & 0x3f);
      buf[i++] = 0x80 | (c >>> 6 & 0x3f);
      buf[i++] = 0x80 | (c & 0x3f);
    }
  }

  return buf;
};

// Helper (used in 2 places)
function buf2binstring(buf, len) {
  // On Chrome, the arguments in a function call that are allowed is `65534`.
  // If the length of the buffer is smaller than that, we can use this optimization,
  // otherwise we will take a slower path.
  if (len < 65534) {
    if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {
      return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));
    }
  }

  var result = '';
  for (var i = 0; i < len; i++) {
    result += String.fromCharCode(buf[i]);
  }
  return result;
}


// Convert byte array to binary string
exports.buf2binstring = function (buf) {
  return buf2binstring(buf, buf.length);
};


// Convert binary string (typed, when possible)
exports.binstring2buf = function (str) {
  var buf = new utils.Buf8(str.length);
  for (var i = 0, len = buf.length; i < len; i++) {
    buf[i] = str.charCodeAt(i);
  }
  return buf;
};


// convert array to string
exports.buf2string = function (buf, max) {
  var i, out, c, c_len;
  var len = max || buf.length;

  // Reserve max possible length (2 words per char)
  // NB: by unknown reasons, Array is significantly faster for
  //     String.fromCharCode.apply than Uint16Array.
  var utf16buf = new Array(len * 2);

  for (out = 0, i = 0; i < len;) {
    c = buf[i++];
    // quick process ascii
    if (c < 0x80) { utf16buf[out++] = c; continue; }

    c_len = _utf8len[c];
    // skip 5 & 6 byte codes
    if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }

    // apply mask on first byte
    c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
    // join the rest
    while (c_len > 1 && i < len) {
      c = (c << 6) | (buf[i++] & 0x3f);
      c_len--;
    }

    // terminated by end of string?
    if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }

    if (c < 0x10000) {
      utf16buf[out++] = c;
    } else {
      c -= 0x10000;
      utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
      utf16buf[out++] = 0xdc00 | (c & 0x3ff);
    }
  }

  return buf2binstring(utf16buf, out);
};


// Calculate max possible position in utf8 buffer,
// that will not break sequence. If that's not possible
// - (very small limits) return max size as is.
//
// buf[] - utf8 bytes array
// max   - length limit (mandatory);
exports.utf8border = function (buf, max) {
  var pos;

  max = max || buf.length;
  if (max > buf.length) { max = buf.length; }

  // go back from last position, until start of sequence found
  pos = max - 1;
  while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }

  // Very small and broken sequence,
  // return max, because we should return something anyway.
  if (pos < 0) { return max; }

  // If we came to start of buffer - that means buffer is too small,
  // return max too.
  if (pos === 0) { return max; }

  return (pos + _utf8len[buf[pos]] > max) ? pos : max;
};


/***/ }),
/* 361 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// Note: adler32 takes 12% for level 0 and 2% for level 6.
// It isn't worth it to make additional optimizations as in original.
// Small size is preferable.

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function adler32(adler, buf, len, pos) {
  var s1 = (adler & 0xffff) |0,
      s2 = ((adler >>> 16) & 0xffff) |0,
      n = 0;

  while (len !== 0) {
    // Set limit ~ twice less than 5552, to keep
    // s2 in 31-bits, because we force signed ints.
    // in other case %= will fail.
    n = len > 2000 ? 2000 : len;
    len -= n;

    do {
      s1 = (s1 + buf[pos++]) |0;
      s2 = (s2 + s1) |0;
    } while (--n);

    s1 %= 65521;
    s2 %= 65521;
  }

  return (s1 | (s2 << 16)) |0;
}


module.exports = adler32;


/***/ }),
/* 362 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

module.exports = {

  /* Allowed flush values; see deflate() and inflate() below for details */
  Z_NO_FLUSH:         0,
  Z_PARTIAL_FLUSH:    1,
  Z_SYNC_FLUSH:       2,
  Z_FULL_FLUSH:       3,
  Z_FINISH:           4,
  Z_BLOCK:            5,
  Z_TREES:            6,

  /* Return codes for the compression/decompression functions. Negative values
  * are errors, positive values are used for special but normal events.
  */
  Z_OK:               0,
  Z_STREAM_END:       1,
  Z_NEED_DICT:        2,
  Z_ERRNO:           -1,
  Z_STREAM_ERROR:    -2,
  Z_DATA_ERROR:      -3,
  //Z_MEM_ERROR:     -4,
  Z_BUF_ERROR:       -5,
  //Z_VERSION_ERROR: -6,

  /* compression levels */
  Z_NO_COMPRESSION:         0,
  Z_BEST_SPEED:             1,
  Z_BEST_COMPRESSION:       9,
  Z_DEFAULT_COMPRESSION:   -1,


  Z_FILTERED:               1,
  Z_HUFFMAN_ONLY:           2,
  Z_RLE:                    3,
  Z_FIXED:                  4,
  Z_DEFAULT_STRATEGY:       0,

  /* Possible values of the data_type field (though see inflate()) */
  Z_BINARY:                 0,
  Z_TEXT:                   1,
  //Z_ASCII:                1, // = Z_TEXT (deprecated)
  Z_UNKNOWN:                2,

  /* The deflate compression method */
  Z_DEFLATED:               8
  //Z_NULL:                 null // Use -1 or null inline, depending on var type
};


/***/ }),
/* 363 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// Note: we can't get significant speed boost here.
// So write code to minimize size - no pregenerated tables
// and array tools dependencies.

// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

// Use ordinary array, since untyped makes no boost here
function makeTable() {
  var c, table = [];

  for (var n = 0; n < 256; n++) {
    c = n;
    for (var k = 0; k < 8; k++) {
      c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
    }
    table[n] = c;
  }

  return table;
}

// Create table on load. Just 255 signed longs. Not a problem.
var crcTable = makeTable();


function crc32(crc, buf, len, pos) {
  var t = crcTable,
      end = pos + len;

  crc ^= -1;

  for (var i = pos; i < end; i++) {
    crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
  }

  return (crc ^ (-1)); // >>> 0;
}


module.exports = crc32;


/***/ }),
/* 364 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function ZStream() {
  /* next input byte */
  this.input = null; // JS specific, because we have no pointers
  this.next_in = 0;
  /* number of bytes available at input */
  this.avail_in = 0;
  /* total number of input bytes read so far */
  this.total_in = 0;
  /* next output byte should be put there */
  this.output = null; // JS specific, because we have no pointers
  this.next_out = 0;
  /* remaining free space at output */
  this.avail_out = 0;
  /* total number of bytes output so far */
  this.total_out = 0;
  /* last error message, NULL if no error */
  this.msg = ''/*Z_NULL*/;
  /* not visible by applications */
  this.state = null;
  /* best guess about the data type: binary or text */
  this.data_type = 2/*Z_UNKNOWN*/;
  /* adler32 value of the uncompressed data */
  this.adler = 0;
}

module.exports = ZStream;


/***/ }),
/* 365 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';

module.exports = ReactPropTypesSecret;


/***/ }),
/* 366 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var isCallingCanDrag = false;
var isCallingIsDragging = false;
var DragSourceMonitorImpl = /** @class */ (function () {
    function DragSourceMonitorImpl(manager) {
        this.sourceId = null;
        this.internalMonitor = manager.getMonitor();
    }
    DragSourceMonitorImpl.prototype.receiveHandlerId = function (sourceId) {
        this.sourceId = sourceId;
    };
    DragSourceMonitorImpl.prototype.getHandlerId = function () {
        return this.sourceId;
    };
    DragSourceMonitorImpl.prototype.canDrag = function () {
        invariant_1.default(!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');
        try {
            isCallingCanDrag = true;
            return this.internalMonitor.canDragSource(this.sourceId);
        }
        finally {
            isCallingCanDrag = false;
        }
    };
    DragSourceMonitorImpl.prototype.isDragging = function () {
        if (!this.sourceId) {
            return false;
        }
        invariant_1.default(!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor');
        try {
            isCallingIsDragging = true;
            return this.internalMonitor.isDraggingSource(this.sourceId);
        }
        finally {
            isCallingIsDragging = false;
        }
    };
    DragSourceMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {
        return this.internalMonitor.subscribeToStateChange(listener, options);
    };
    DragSourceMonitorImpl.prototype.isDraggingSource = function (sourceId) {
        return this.internalMonitor.isDraggingSource(sourceId);
    };
    DragSourceMonitorImpl.prototype.isOverTarget = function (targetId, options) {
        return this.internalMonitor.isOverTarget(targetId, options);
    };
    DragSourceMonitorImpl.prototype.getTargetIds = function () {
        return this.internalMonitor.getTargetIds();
    };
    DragSourceMonitorImpl.prototype.isSourcePublic = function () {
        return this.internalMonitor.isSourcePublic();
    };
    DragSourceMonitorImpl.prototype.getSourceId = function () {
        return this.internalMonitor.getSourceId();
    };
    DragSourceMonitorImpl.prototype.subscribeToOffsetChange = function (listener) {
        return this.internalMonitor.subscribeToOffsetChange(listener);
    };
    DragSourceMonitorImpl.prototype.canDragSource = function (sourceId) {
        return this.internalMonitor.canDragSource(sourceId);
    };
    DragSourceMonitorImpl.prototype.canDropOnTarget = function (targetId) {
        return this.internalMonitor.canDropOnTarget(targetId);
    };
    DragSourceMonitorImpl.prototype.getItemType = function () {
        return this.internalMonitor.getItemType();
    };
    DragSourceMonitorImpl.prototype.getItem = function () {
        return this.internalMonitor.getItem();
    };
    DragSourceMonitorImpl.prototype.getDropResult = function () {
        return this.internalMonitor.getDropResult();
    };
    DragSourceMonitorImpl.prototype.didDrop = function () {
        return this.internalMonitor.didDrop();
    };
    DragSourceMonitorImpl.prototype.getInitialClientOffset = function () {
        return this.internalMonitor.getInitialClientOffset();
    };
    DragSourceMonitorImpl.prototype.getInitialSourceClientOffset = function () {
        return this.internalMonitor.getInitialSourceClientOffset();
    };
    DragSourceMonitorImpl.prototype.getSourceClientOffset = function () {
        return this.internalMonitor.getSourceClientOffset();
    };
    DragSourceMonitorImpl.prototype.getClientOffset = function () {
        return this.internalMonitor.getClientOffset();
    };
    DragSourceMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {
        return this.internalMonitor.getDifferenceFromInitialOffset();
    };
    return DragSourceMonitorImpl;
}());
exports.DragSourceMonitorImpl = DragSourceMonitorImpl;


/***/ }),
/* 367 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var isCallingCanDrop = false;
var DropTargetMonitorImpl = /** @class */ (function () {
    function DropTargetMonitorImpl(manager) {
        this.targetId = null;
        this.internalMonitor = manager.getMonitor();
    }
    DropTargetMonitorImpl.prototype.receiveHandlerId = function (targetId) {
        this.targetId = targetId;
    };
    DropTargetMonitorImpl.prototype.getHandlerId = function () {
        return this.targetId;
    };
    DropTargetMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {
        return this.internalMonitor.subscribeToStateChange(listener, options);
    };
    DropTargetMonitorImpl.prototype.canDrop = function () {
        // Cut out early if the target id has not been set. This should prevent errors
        // where the user has an older version of dnd-core like in
        // https://github.com/react-dnd/react-dnd/issues/1310
        if (!this.targetId) {
            return false;
        }
        invariant_1.default(!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor');
        try {
            isCallingCanDrop = true;
            return this.internalMonitor.canDropOnTarget(this.targetId);
        }
        finally {
            isCallingCanDrop = false;
        }
    };
    DropTargetMonitorImpl.prototype.isOver = function (options) {
        if (!this.targetId) {
            return false;
        }
        return this.internalMonitor.isOverTarget(this.targetId, options);
    };
    DropTargetMonitorImpl.prototype.getItemType = function () {
        return this.internalMonitor.getItemType();
    };
    DropTargetMonitorImpl.prototype.getItem = function () {
        return this.internalMonitor.getItem();
    };
    DropTargetMonitorImpl.prototype.getDropResult = function () {
        return this.internalMonitor.getDropResult();
    };
    DropTargetMonitorImpl.prototype.didDrop = function () {
        return this.internalMonitor.didDrop();
    };
    DropTargetMonitorImpl.prototype.getInitialClientOffset = function () {
        return this.internalMonitor.getInitialClientOffset();
    };
    DropTargetMonitorImpl.prototype.getInitialSourceClientOffset = function () {
        return this.internalMonitor.getInitialSourceClientOffset();
    };
    DropTargetMonitorImpl.prototype.getSourceClientOffset = function () {
        return this.internalMonitor.getSourceClientOffset();
    };
    DropTargetMonitorImpl.prototype.getClientOffset = function () {
        return this.internalMonitor.getClientOffset();
    };
    DropTargetMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {
        return this.internalMonitor.getDifferenceFromInitialOffset();
    };
    return DropTargetMonitorImpl;
}());
exports.DropTargetMonitorImpl = DropTargetMonitorImpl;


/***/ }),
/* 368 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var wrapConnectorHooks_1 = __importDefault(__webpack_require__(370));
var isRef_1 = __webpack_require__(374);
var shallowequal_1 = __importDefault(__webpack_require__(143));
var SourceConnector = /** @class */ (function () {
    function SourceConnector(backend) {
        var _this = this;
        this.hooks = wrapConnectorHooks_1.default({
            dragSource: function (node, options) {
                _this.clearDragSource();
                _this.dragSourceOptions = options || null;
                if (isRef_1.isRef(node)) {
                    _this.dragSourceRef = node;
                }
                else {
                    _this.dragSourceNode = node;
                }
                _this.reconnectDragSource();
            },
            dragPreview: function (node, options) {
                _this.clearDragPreview();
                _this.dragPreviewOptions = options || null;
                if (isRef_1.isRef(node)) {
                    _this.dragPreviewRef = node;
                }
                else {
                    _this.dragPreviewNode = node;
                }
                _this.reconnectDragPreview();
            },
        });
        this.handlerId = null;
        // The drop target may either be attached via ref or connect function
        this.dragSourceRef = null;
        this.dragSourceOptionsInternal = null;
        // The drag preview may either be attached via ref or connect function
        this.dragPreviewRef = null;
        this.dragPreviewOptionsInternal = null;
        this.lastConnectedHandlerId = null;
        this.lastConnectedDragSource = null;
        this.lastConnectedDragSourceOptions = null;
        this.lastConnectedDragPreview = null;
        this.lastConnectedDragPreviewOptions = null;
        this.backend = backend;
    }
    SourceConnector.prototype.receiveHandlerId = function (newHandlerId) {
        if (this.handlerId === newHandlerId) {
            return;
        }
        this.handlerId = newHandlerId;
        this.reconnect();
    };
    Object.defineProperty(SourceConnector.prototype, "connectTarget", {
        get: function () {
            return this.dragSource;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SourceConnector.prototype, "dragSourceOptions", {
        get: function () {
            return this.dragSourceOptionsInternal;
        },
        set: function (options) {
            this.dragSourceOptionsInternal = options;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SourceConnector.prototype, "dragPreviewOptions", {
        get: function () {
            return this.dragPreviewOptionsInternal;
        },
        set: function (options) {
            this.dragPreviewOptionsInternal = options;
        },
        enumerable: true,
        configurable: true
    });
    SourceConnector.prototype.reconnect = function () {
        this.reconnectDragSource();
        this.reconnectDragPreview();
    };
    SourceConnector.prototype.reconnectDragSource = function () {
        var dragSource = this.dragSource;
        // if nothing has changed then don't resubscribe
        var didChange = this.didHandlerIdChange() ||
            this.didConnectedDragSourceChange() ||
            this.didDragSourceOptionsChange();
        if (didChange) {
            this.disconnectDragSource();
        }
        if (!this.handlerId) {
            return;
        }
        if (!dragSource) {
            this.lastConnectedDragSource = dragSource;
            return;
        }
        if (didChange) {
            this.lastConnectedHandlerId = this.handlerId;
            this.lastConnectedDragSource = dragSource;
            this.lastConnectedDragSourceOptions = this.dragSourceOptions;
            this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, dragSource, this.dragSourceOptions);
        }
    };
    SourceConnector.prototype.reconnectDragPreview = function () {
        var dragPreview = this.dragPreview;
        // if nothing has changed then don't resubscribe
        var didChange = this.didHandlerIdChange() ||
            this.didConnectedDragPreviewChange() ||
            this.didDragPreviewOptionsChange();
        if (!this.handlerId) {
            this.disconnectDragPreview();
        }
        else if (this.dragPreview && didChange) {
            this.lastConnectedHandlerId = this.handlerId;
            this.lastConnectedDragPreview = dragPreview;
            this.lastConnectedDragPreviewOptions = this.dragPreviewOptions;
            this.disconnectDragPreview();
            this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, dragPreview, this.dragPreviewOptions);
        }
    };
    SourceConnector.prototype.didHandlerIdChange = function () {
        return this.lastConnectedHandlerId !== this.handlerId;
    };
    SourceConnector.prototype.didConnectedDragSourceChange = function () {
        return this.lastConnectedDragSource !== this.dragSource;
    };
    SourceConnector.prototype.didConnectedDragPreviewChange = function () {
        return this.lastConnectedDragPreview !== this.dragPreview;
    };
    SourceConnector.prototype.didDragSourceOptionsChange = function () {
        return !shallowequal_1.default(this.lastConnectedDragSourceOptions, this.dragSourceOptions);
    };
    SourceConnector.prototype.didDragPreviewOptionsChange = function () {
        return !shallowequal_1.default(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);
    };
    SourceConnector.prototype.disconnectDragSource = function () {
        if (this.dragSourceUnsubscribe) {
            this.dragSourceUnsubscribe();
            this.dragSourceUnsubscribe = undefined;
        }
    };
    SourceConnector.prototype.disconnectDragPreview = function () {
        if (this.dragPreviewUnsubscribe) {
            this.dragPreviewUnsubscribe();
            this.dragPreviewUnsubscribe = undefined;
            this.dragPreviewNode = null;
            this.dragPreviewRef = null;
        }
    };
    Object.defineProperty(SourceConnector.prototype, "dragSource", {
        get: function () {
            return (this.dragSourceNode || (this.dragSourceRef && this.dragSourceRef.current));
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(SourceConnector.prototype, "dragPreview", {
        get: function () {
            return (this.dragPreviewNode ||
                (this.dragPreviewRef && this.dragPreviewRef.current));
        },
        enumerable: true,
        configurable: true
    });
    SourceConnector.prototype.clearDragSource = function () {
        this.dragSourceNode = null;
        this.dragSourceRef = null;
    };
    SourceConnector.prototype.clearDragPreview = function () {
        this.dragPreviewNode = null;
        this.dragPreviewRef = null;
    };
    return SourceConnector;
}());
exports.SourceConnector = SourceConnector;


/***/ }),
/* 369 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var shallowequal_1 = __importDefault(__webpack_require__(143));
var wrapConnectorHooks_1 = __importDefault(__webpack_require__(370));
var isRef_1 = __webpack_require__(374);
var TargetConnector = /** @class */ (function () {
    function TargetConnector(backend) {
        var _this = this;
        this.hooks = wrapConnectorHooks_1.default({
            dropTarget: function (node, options) {
                _this.clearDropTarget();
                _this.dropTargetOptions = options;
                if (isRef_1.isRef(node)) {
                    _this.dropTargetRef = node;
                }
                else {
                    _this.dropTargetNode = node;
                }
                _this.reconnect();
            },
        });
        this.handlerId = null;
        // The drop target may either be attached via ref or connect function
        this.dropTargetRef = null;
        this.dropTargetOptionsInternal = null;
        this.lastConnectedHandlerId = null;
        this.lastConnectedDropTarget = null;
        this.lastConnectedDropTargetOptions = null;
        this.backend = backend;
    }
    Object.defineProperty(TargetConnector.prototype, "connectTarget", {
        get: function () {
            return this.dropTarget;
        },
        enumerable: true,
        configurable: true
    });
    TargetConnector.prototype.reconnect = function () {
        // if nothing has changed then don't resubscribe
        var didChange = this.didHandlerIdChange() ||
            this.didDropTargetChange() ||
            this.didOptionsChange();
        if (didChange) {
            this.disconnectDropTarget();
        }
        var dropTarget = this.dropTarget;
        if (!this.handlerId) {
            return;
        }
        if (!dropTarget) {
            this.lastConnectedDropTarget = dropTarget;
            return;
        }
        if (didChange) {
            this.lastConnectedHandlerId = this.handlerId;
            this.lastConnectedDropTarget = dropTarget;
            this.lastConnectedDropTargetOptions = this.dropTargetOptions;
            this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, dropTarget, this.dropTargetOptions);
        }
    };
    TargetConnector.prototype.receiveHandlerId = function (newHandlerId) {
        if (newHandlerId === this.handlerId) {
            return;
        }
        this.handlerId = newHandlerId;
        this.reconnect();
    };
    Object.defineProperty(TargetConnector.prototype, "dropTargetOptions", {
        get: function () {
            return this.dropTargetOptionsInternal;
        },
        set: function (options) {
            this.dropTargetOptionsInternal = options;
        },
        enumerable: true,
        configurable: true
    });
    TargetConnector.prototype.didHandlerIdChange = function () {
        return this.lastConnectedHandlerId !== this.handlerId;
    };
    TargetConnector.prototype.didDropTargetChange = function () {
        return this.lastConnectedDropTarget !== this.dropTarget;
    };
    TargetConnector.prototype.didOptionsChange = function () {
        return !shallowequal_1.default(this.lastConnectedDropTargetOptions, this.dropTargetOptions);
    };
    TargetConnector.prototype.disconnectDropTarget = function () {
        if (this.unsubscribeDropTarget) {
            this.unsubscribeDropTarget();
            this.unsubscribeDropTarget = undefined;
        }
    };
    Object.defineProperty(TargetConnector.prototype, "dropTarget", {
        get: function () {
            return (this.dropTargetNode || (this.dropTargetRef && this.dropTargetRef.current));
        },
        enumerable: true,
        configurable: true
    });
    TargetConnector.prototype.clearDropTarget = function () {
        this.dropTargetRef = null;
        this.dropTargetNode = null;
    };
    return TargetConnector;
}());
exports.TargetConnector = TargetConnector;


/***/ }),
/* 370 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var cloneWithRef_1 = __webpack_require__(1347);
function throwIfCompositeComponentElement(element) {
    // Custom components can no longer be wrapped directly in React DnD 2.0
    // so that we don't need to depend on findDOMNode() from react-dom.
    if (typeof element.type === 'string') {
        return;
    }
    var displayName = element.type.displayName || element.type.name || 'the component';
    throw new Error('Only native element nodes can now be passed to React DnD connectors.' +
        ("You can either wrap " + displayName + " into a <div>, or turn it into a ") +
        'drag source or a drop target itself.');
}
function wrapHookToRecognizeElement(hook) {
    return function (elementOrNode, options) {
        if (elementOrNode === void 0) { elementOrNode = null; }
        if (options === void 0) { options = null; }
        // When passed a node, call the hook straight away.
        if (!react_1.isValidElement(elementOrNode)) {
            var node = elementOrNode;
            hook(node, options);
            // return the node so it can be chained (e.g. when within callback refs
            // <div ref={node => connectDragSource(connectDropTarget(node))}/>
            return node;
        }
        // If passed a ReactElement, clone it and attach this function as a ref.
        // This helps us achieve a neat API where user doesn't even know that refs
        // are being used under the hood.
        var element = elementOrNode;
        throwIfCompositeComponentElement(element);
        // When no options are passed, use the hook directly
        var ref = options ? function (node) { return hook(node, options); } : hook;
        return cloneWithRef_1.cloneWithRef(element, ref);
    };
}
function wrapConnectorHooks(hooks) {
    var wrappedHooks = {};
    Object.keys(hooks).forEach(function (key) {
        var hook = hooks[key];
        // ref objects should be passed straight through without wrapping
        if (key.endsWith('Ref')) {
            wrappedHooks[key] = hooks[key];
        }
        else {
            var wrappedHook_1 = wrapHookToRecognizeElement(hook);
            wrappedHooks[key] = function () { return wrappedHook_1; };
        }
    });
    return wrappedHooks;
}
exports.default = wrapConnectorHooks;


/***/ }),
/* 371 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(__webpack_require__(0));
var shallowequal_1 = __importDefault(__webpack_require__(143));
var invariant_1 = __importDefault(__webpack_require__(32));
var hoist_non_react_statics_1 = __importDefault(__webpack_require__(242));
var index_1 = __webpack_require__(84);
var js_utils_1 = __webpack_require__(106);
var disposables_1 = __webpack_require__(1339);
var utils_1 = __webpack_require__(119);
function decorateHandler(_a) {
    var DecoratedComponent = _a.DecoratedComponent, createHandler = _a.createHandler, createMonitor = _a.createMonitor, createConnector = _a.createConnector, registerHandler = _a.registerHandler, containerDisplayName = _a.containerDisplayName, getType = _a.getType, collect = _a.collect, options = _a.options;
    var _b = options.arePropsEqual, arePropsEqual = _b === void 0 ? shallowequal_1.default : _b;
    var Decorated = DecoratedComponent;
    var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
    var DragDropContainer = /** @class */ (function (_super) {
        __extends(DragDropContainer, _super);
        function DragDropContainer(props) {
            var _this = _super.call(this, props) || this;
            _this.decoratedRef = React.createRef();
            _this.handleChange = function () {
                var nextState = _this.getCurrentState();
                if (!shallowequal_1.default(nextState, _this.state)) {
                    _this.setState(nextState);
                }
            };
            _this.disposable = new disposables_1.SerialDisposable();
            _this.receiveProps(props);
            _this.dispose();
            return _this;
        }
        DragDropContainer.prototype.getHandlerId = function () {
            return this.handlerId;
        };
        DragDropContainer.prototype.getDecoratedComponentInstance = function () {
            invariant_1.default(this.decoratedRef.current, 'In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()');
            return this.decoratedRef.current;
        };
        DragDropContainer.prototype.shouldComponentUpdate = function (nextProps, nextState) {
            return (!arePropsEqual(nextProps, this.props) ||
                !shallowequal_1.default(nextState, this.state));
        };
        DragDropContainer.prototype.componentDidMount = function () {
            this.disposable = new disposables_1.SerialDisposable();
            this.currentType = undefined;
            this.receiveProps(this.props);
            this.handleChange();
        };
        DragDropContainer.prototype.componentDidUpdate = function (prevProps) {
            if (!arePropsEqual(this.props, prevProps)) {
                this.receiveProps(this.props);
                this.handleChange();
            }
        };
        DragDropContainer.prototype.componentWillUnmount = function () {
            this.dispose();
        };
        DragDropContainer.prototype.receiveProps = function (props) {
            if (!this.handler) {
                return;
            }
            this.handler.receiveProps(props);
            this.receiveType(getType(props));
        };
        DragDropContainer.prototype.receiveType = function (type) {
            if (!this.handlerMonitor || !this.manager || !this.handlerConnector) {
                return;
            }
            if (type === this.currentType) {
                return;
            }
            this.currentType = type;
            var _a = registerHandler(type, this.handler, this.manager), handlerId = _a[0], unregister = _a[1];
            this.handlerId = handlerId;
            this.handlerMonitor.receiveHandlerId(handlerId);
            this.handlerConnector.receiveHandlerId(handlerId);
            var globalMonitor = this.manager.getMonitor();
            var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] });
            this.disposable.setDisposable(new disposables_1.CompositeDisposable(new disposables_1.Disposable(unsubscribe), new disposables_1.Disposable(unregister)));
        };
        DragDropContainer.prototype.dispose = function () {
            this.disposable.dispose();
            if (this.handlerConnector) {
                this.handlerConnector.receiveHandlerId(null);
            }
        };
        DragDropContainer.prototype.getCurrentState = function () {
            if (!this.handlerConnector) {
                return {};
            }
            var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor, this.props);
            if (true) {
                invariant_1.default(js_utils_1.isPlainObject(nextState), 'Expected `collect` specified as the second argument to ' +
                    '%s for %s to return a plain object of props to inject. ' +
                    'Instead, received %s.', containerDisplayName, displayName, nextState);
            }
            return nextState;
        };
        DragDropContainer.prototype.render = function () {
            var _this = this;
            return (React.createElement(index_1.DndContext.Consumer, null, function (_a) {
                var dragDropManager = _a.dragDropManager;
                _this.receiveDragDropManager(dragDropManager);
                if (typeof requestAnimationFrame !== 'undefined') {
                    requestAnimationFrame(function () { return _this.handlerConnector.reconnect(); });
                }
                return (React.createElement(Decorated, __assign({}, _this.props, _this.getCurrentState(), { 
                    // NOTE: if Decorated is a Function Component, decoratedRef will not be populated unless it's a refforwarding component.
                    ref: utils_1.isRefable(Decorated) ? _this.decoratedRef : null })));
            }));
        };
        DragDropContainer.prototype.receiveDragDropManager = function (dragDropManager) {
            if (this.manager !== undefined) {
                return;
            }
            invariant_1.default(dragDropManager !== undefined, 'Could not find the drag and drop manager in the context of %s. ' +
                'Make sure to render a DndProvider component in your top-level component. ' +
                'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
            if (dragDropManager === undefined) {
                return;
            }
            this.manager = dragDropManager;
            this.handlerMonitor = createMonitor(dragDropManager);
            this.handlerConnector = createConnector(dragDropManager.getBackend());
            this.handler = createHandler(this.handlerMonitor, this.decoratedRef);
        };
        DragDropContainer.DecoratedComponent = DecoratedComponent;
        DragDropContainer.displayName = containerDisplayName + "(" + displayName + ")";
        return DragDropContainer;
    }(React.Component));
    return hoist_non_react_statics_1.default(DragDropContainer, DecoratedComponent);
}
exports.default = decorateHandler;


/***/ }),
/* 372 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var shallowequal_1 = __importDefault(__webpack_require__(143));
var react_1 = __webpack_require__(0);
var useIsomorphicLayoutEffect_1 = __webpack_require__(120);
/**
 *
 * @param monitor The monitor to collect state from
 * @param collect The collecting function
 * @param onUpdate A method to invoke when updates occur
 */
function useCollector(monitor, collect, onUpdate) {
    var _a = react_1.useState(function () { return collect(monitor); }), collected = _a[0], setCollected = _a[1];
    var updateCollected = react_1.useCallback(function () {
        var nextValue = collect(monitor);
        if (!shallowequal_1.default(collected, nextValue)) {
            setCollected(nextValue);
            if (onUpdate) {
                onUpdate();
            }
        }
    }, [collected, monitor, onUpdate]);
    // update the collected properties after the first render
    // and the components are attached to dnd-core
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(updateCollected, []);
    return [collected, updateCollected];
}
exports.useCollector = useCollector;


/***/ }),
/* 373 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var useIsomorphicLayoutEffect_1 = __webpack_require__(120);
var useCollector_1 = __webpack_require__(372);
function useMonitorOutput(monitor, collect, onCollect) {
    var _a = useCollector_1.useCollector(monitor, collect, onCollect), collected = _a[0], updateCollected = _a[1];
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function subscribeToMonitorStateChange() {
        var handlerId = monitor.getHandlerId();
        if (handlerId == null) {
            return undefined;
        }
        return monitor.subscribeToStateChange(updateCollected, {
            handlerIds: [handlerId],
        });
    }, [monitor, updateCollected]);
    return collected;
}
exports.useMonitorOutput = useMonitorOutput;


/***/ }),
/* 374 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function isRef(obj) {
    return (
    // eslint-disable-next-line no-prototype-builtins
    obj !== null && typeof obj === 'object' && obj.hasOwnProperty('current'));
}
exports.isRef = isRef;


/***/ }),
/* 375 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function isValidType(type, allowArray) {
    return (typeof type === 'string' ||
        typeof type === 'symbol' ||
        (!!allowArray &&
            Array.isArray(type) &&
            type.every(function (t) { return isValidType(t, false); })));
}
exports.isValidType = isValidType;


/***/ }),
/* 376 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var js_utils_1 = __webpack_require__(377);
exports.isFirefox = js_utils_1.memoize(function () {
    return /firefox/i.test(navigator.userAgent);
});
exports.isSafari = js_utils_1.memoize(function () { return Boolean(window.safari); });


/***/ }),
/* 377 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// cheap lodash replacements
Object.defineProperty(exports, "__esModule", { value: true });
function memoize(fn) {
    var result = null;
    var memoized = function () {
        if (result == null) {
            result = fn();
        }
        return result;
    };
    return memoized;
}
exports.memoize = memoize;
/**
 * drop-in replacement for _.without
 */
function without(items, item) {
    return items.filter(function (i) { return i !== item; });
}
exports.without = without;
function union(itemsA, itemsB) {
    var set = new Set();
    var insertItem = function (item) { return set.add(item); };
    itemsA.forEach(insertItem);
    itemsB.forEach(insertItem);
    var result = [];
    set.forEach(function (key) { return result.push(key); });
    return result;
}
exports.union = union;


/***/ }),
/* 378 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {
  module.exports = require('./cjs/react-dom-server.browser.production.min.js');
} else {
  module.exports = __webpack_require__(1358);
}


/***/ }),
/* 379 */
/***/ (function(module, exports, __webpack_require__) {

var _ = __webpack_require__(85);

/**
 * A module of methods related to listening.
 */
module.exports = {

    /**
     * An internal utility function used by `validateListening`
     *
     * @param {Action|Store} listenable The listenable we want to search for
     * @returns {Boolean} The result of a recursive search among `this.subscriptions`
     */
    hasListener: function(listenable) {
        var i = 0,
            listener;
        for (;i < (this.subscriptions||[]).length; ++i) {
            listener = this.subscriptions[i].listenable;
            if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) {
                return true;
            }
        }
        return false;
    },

    /**
     * A convenience method that listens to all listenables in the given object.
     *
     * @param {Object} listenables An object of listenables. Keys will be used as callback method names.
     */
    listenToMany: function(listenables){
        for(var key in listenables){
            var cbname = _.callbackName(key),
                localname = this[cbname] ? cbname : this[key] ? key : undefined;
            if (localname){
                this.listenTo(listenables[key],localname,this[cbname+"Default"]||this[localname+"Default"]||localname);
            }
        }
    },

    /**
     * Checks if the current context can listen to the supplied listenable
     *
     * @param {Action|Store} listenable An Action or Store that should be
     *  listened to.
     * @returns {String|Undefined} An error message, or undefined if there was no problem.
     */
    validateListening: function(listenable){
        if (listenable === this) {
            return "Listener is not able to listen to itself";
        }
        if (!_.isFunction(listenable.listen)) {
            return listenable + " is missing a listen method";
        }
        if (this.hasListener(listenable)) {
            return "Listener cannot listen to this listenable because of circular loop";
        }
    },

    /**
     * Sets up a subscription to the given listenable for the context object
     *
     * @param {Action|Store} listenable An Action or Store that should be
     *  listened to.
     * @param {Function|String} callback The callback to register as event handler
     * @param {Function|String} defaultCallback The callback to register as default handler
     * @returns {Object} A subscription obj where `stop` is an unsub function and `listenable` is the object being listened to
     */
    listenTo: function(listenable, callback, defaultCallback) {
        var err = this.validateListening(listenable),
            self = this;
        if (err){
            throw Error(err);
        }
        this.fetchDefaultData(listenable, defaultCallback);
        if (!this.subscriptions) { this.subscriptions = [];}
        var desub = listenable.listen(this[callback]||callback, this),
            unsubscriber = function (dontupdatearr) {
                desub();
                if (!dontupdatearr) {
                    self.subscriptions.splice(self.subscriptions.indexOf(listenable), 1);
                }
            },
            subscriptionobj = {
                stop: unsubscriber,
                listenable: listenable
            };
        this.subscriptions.push(subscriptionobj);
        return subscriptionobj;
    },

    /**
     * Stops listening to a single listenable
     *
     * @param {Action|Store} listenable The action or store we no longer want to listen to
     * @param {Boolean} dontupdatearr If true, we don't remove the subscription object from this.subscriptions
     * @returns {Boolean} True if a subscription was found and removed, otherwise false.
     */
    stopListeningTo: function(listenable, dontupdatearr){
        for(var i=0; i<(this.subscriptions||[]).length;i++){
            if (this.subscriptions[i].listenable === listenable){
                this.subscriptions[i].stop(dontupdatearr);
                return true;
            }
        }
        return false;
    },

    /**
     * Stops all subscriptions and empties subscriptions array
     *
     */
    stopListeningToAll: function(){
        (this.subscriptions||[]).forEach(function(subscription) {
            subscription.stop(true);
        });
        this.subscriptions = [];
    },

    /**
     * Used in `listenTo`. Fetches initial data from a publisher if it has a `getDefaultData` method.
     * @param {Action|Store} listenable The publisher we want to get default data from
     * @param {Function|String} defaultCallback The method to receive the data
     */
    fetchDefaultData: function (listenable, defaultCallback) {
        defaultCallback = (defaultCallback && this[defaultCallback]) || defaultCallback;
        var me = this;
        if (_.isFunction(defaultCallback) && _.isFunction(listenable.getDefaultData)) {
            data = listenable.getDefaultData();
            if (data && _.isFunction(data.then)) {
                data.then(function() {
                    defaultCallback.apply(me, arguments);
                });
            } else {
                defaultCallback.call(this, data);
            }
        }
    }
};



/***/ }),
/* 380 */
/***/ (function(module, exports, __webpack_require__) {

var _ = __webpack_require__(85),
    Reflux = __webpack_require__(3),
    Keep = __webpack_require__(251);

/**
 * Creates an action functor object. It is mixed in with functions
 * from the `PublisherMethods` mixin. `preEmit` and `shouldEmit` may
 * be overridden in the definition object.
 *
 * @param {Object} definition The action object definition
 */
module.exports = function(definition) {

    definition = definition || {};

    var context = _.extend({
        eventLabel: "action",
        emitter: new _.EventEmitter()
    },definition,Reflux.PublisherMethods,{
        preEmit: definition.preEmit || Reflux.PublisherMethods.preEmit,
        shouldEmit: definition.shouldEmit || Reflux.PublisherMethods.shouldEmit
    });

    var functor = function() {
        context.triggerAsync.apply(context, arguments);
    };

    _.extend(functor,context);

    Keep.createdActions.push(functor);

    return functor;

};


/***/ }),
/* 381 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(241);
var ES = __webpack_require__(945);
var replace = bind.call(Function.call, String.prototype.replace);

/* eslint-disable no-control-regex */
var leftWhitespace = /^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/;
var rightWhitespace = /[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;
/* eslint-enable no-control-regex */

module.exports = function trim() {
	var S = ES.ToString(ES.CheckObjectCoercible(this));
	return replace(replace(S, leftWhitespace, ''), rightWhitespace, '');
};


/***/ }),
/* 382 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var implementation = __webpack_require__(381);

var zeroWidthSpace = '\u200b';

module.exports = function getPolyfill() {
	if (String.prototype.trim && zeroWidthSpace.trim() === zeroWidthSpace) {
		return String.prototype.trim;
	}
	return implementation;
};


/***/ }),
/* 383 */
/***/ (function(module, exports) {

module.exports = function(originalModule) {
	if(!originalModule.webpackPolyfill) {
		var module = Object.create(originalModule);
		// module.parent = undefined by default
		if(!module.children) module.children = [];
		Object.defineProperty(module, "loaded", {
			enumerable: true,
			get: function() {
				return module.l;
			}
		});
		Object.defineProperty(module, "id", {
			enumerable: true,
			get: function() {
				return module.i;
			}
		});
		Object.defineProperty(module, "exports", {
			enumerable: true,
		});
		module.webpackPolyfill = 1;
	}
	return module;
};


/***/ }),
/* 384 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _lodash = __webpack_require__(118);

var _lodash2 = _interopRequireDefault(_lodash);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(141);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _reactHotLoader = __webpack_require__(1360);

__webpack_require__(709);

var _App = __webpack_require__(388);

var _App2 = _interopRequireDefault(_App);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// const App = <div>hello new webpack version</div>
var render = function render(Component) {
  _reactDom2.default.render(_react2.default.createElement(
    _reactHotLoader.AppContainer,
    { warnings: false },
    _react2.default.createElement(Component, null)
  ), document.getElementById('react-root'));
};

// AppContainer is a necessary wrapper component for HMR


render(_App2.default);

// Hot Module Replacement API
if (false) {
  module.hot.accept(function () {
    render(_App2.default);
  });
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(render, 'render', 'C:/_repos_windows/dairybase/Frontend/app/Entry.js');
}();

;

/***/ }),
/* 385 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reset2 = __webpack_require__(1012);

var _reset3 = _interopRequireDefault(_reset2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 386 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// rawAsap provides everything we need except exception management.
var rawAsap = __webpack_require__(387);
// RawTasks are recycled to reduce GC churn.
var freeTasks = [];
// We queue errors to ensure they are thrown in right order (FIFO).
// Array-as-queue is good enough here, since we are just dealing with exceptions.
var pendingErrors = [];
var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);

function throwFirstError() {
    if (pendingErrors.length) {
        throw pendingErrors.shift();
    }
}

/**
 * Calls a task as soon as possible after returning, in its own event, with priority
 * over other events like animation, reflow, and repaint. An error thrown from an
 * event will not interrupt, nor even substantially slow down the processing of
 * other events, but will be rather postponed to a lower priority event.
 * @param {{call}} task A callable object, typically a function that takes no
 * arguments.
 */
module.exports = asap;
function asap(task) {
    var rawTask;
    if (freeTasks.length) {
        rawTask = freeTasks.pop();
    } else {
        rawTask = new RawTask();
    }
    rawTask.task = task;
    rawAsap(rawTask);
}

// We wrap tasks with recyclable task objects.  A task object implements
// `call`, just like a function.
function RawTask() {
    this.task = null;
}

// The sole purpose of wrapping the task is to catch the exception and recycle
// the task object after its single use.
RawTask.prototype.call = function () {
    try {
        this.task.call();
    } catch (error) {
        if (asap.onerror) {
            // This hook exists purely for testing purposes.
            // Its name will be periodically randomized to break any code that
            // depends on its existence.
            asap.onerror(error);
        } else {
            // In a web browser, exceptions are not fatal. However, to avoid
            // slowing down the queue of pending tasks, we rethrow the error in a
            // lower priority turn.
            pendingErrors.push(error);
            requestErrorThrow();
        }
    } finally {
        this.task = null;
        freeTasks[freeTasks.length] = this;
    }
};


/***/ }),
/* 387 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {

// Use the fastest means possible to execute a task in its own turn, with
// priority over other events including IO, animation, reflow, and redraw
// events in browsers.
//
// An exception thrown by a task will permanently interrupt the processing of
// subsequent tasks. The higher level `asap` function ensures that if an
// exception is thrown by a task, that the task queue will continue flushing as
// soon as possible, but if you use `rawAsap` directly, you are responsible to
// either ensure that no exceptions are thrown from your task, or to manually
// call `rawAsap.requestFlush` if an exception is thrown.
module.exports = rawAsap;
function rawAsap(task) {
    if (!queue.length) {
        requestFlush();
        flushing = true;
    }
    // Equivalent to push, but avoids a function call.
    queue[queue.length] = task;
}

var queue = [];
// Once a flush has been requested, no further calls to `requestFlush` are
// necessary until the next `flush` completes.
var flushing = false;
// `requestFlush` is an implementation-specific method that attempts to kick
// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
// the event queue before yielding to the browser's own event loop.
var requestFlush;
// The position of the next task to execute in the task queue. This is
// preserved between calls to `flush` so that it can be resumed if
// a task throws an exception.
var index = 0;
// If a task schedules additional tasks recursively, the task queue can grow
// unbounded. To prevent memory exhaustion, the task queue will periodically
// truncate already-completed tasks.
var capacity = 1024;

// The flush function processes all tasks that have been scheduled with
// `rawAsap` unless and until one of those tasks throws an exception.
// If a task throws an exception, `flush` ensures that its state will remain
// consistent and will resume where it left off when called again.
// However, `flush` does not make any arrangements to be called again if an
// exception is thrown.
function flush() {
    while (index < queue.length) {
        var currentIndex = index;
        // Advance the index before calling the task. This ensures that we will
        // begin flushing on the next task the task throws an error.
        index = index + 1;
        queue[currentIndex].call();
        // Prevent leaking memory for long chains of recursive calls to `asap`.
        // If we call `asap` within tasks scheduled by `asap`, the queue will
        // grow, but to avoid an O(n) walk for every task we execute, we don't
        // shift tasks off the queue after they have been executed.
        // Instead, we periodically shift 1024 tasks off the queue.
        if (index > capacity) {
            // Manually shift all values starting at the index back to the
            // beginning of the queue.
            for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
                queue[scan] = queue[scan + index];
            }
            queue.length -= index;
            index = 0;
        }
    }
    queue.length = 0;
    index = 0;
    flushing = false;
}

// `requestFlush` is implemented using a strategy based on data collected from
// every available SauceLabs Selenium web driver worker at time of writing.
// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593

// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
// have WebKitMutationObserver but not un-prefixed MutationObserver.
// Must use `global` or `self` instead of `window` to work in both frames and web
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.

/* globals self */
var scope = typeof global !== "undefined" ? global : self;
var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;

// MutationObservers are desirable because they have high priority and work
// reliably everywhere they are implemented.
// They are implemented in all modern browsers.
//
// - Android 4-4.3
// - Chrome 26-34
// - Firefox 14-29
// - Internet Explorer 11
// - iPad Safari 6-7.1
// - iPhone Safari 7-7.1
// - Safari 6-7
if (typeof BrowserMutationObserver === "function") {
    requestFlush = makeRequestCallFromMutationObserver(flush);

// MessageChannels are desirable because they give direct access to the HTML
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
// 11-12, and in web workers in many engines.
// Although message channels yield to any queued rendering and IO tasks, they
// would be better than imposing the 4ms delay of timers.
// However, they do not work reliably in Internet Explorer or Safari.

// Internet Explorer 10 is the only browser that has setImmediate but does
// not have MutationObservers.
// Although setImmediate yields to the browser's renderer, it would be
// preferrable to falling back to setTimeout since it does not have
// the minimum 4ms penalty.
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
// Desktop to a lesser extent) that renders both setImmediate and
// MessageChannel useless for the purposes of ASAP.
// https://github.com/kriskowal/q/issues/396

// Timers are implemented universally.
// We fall back to timers in workers in most engines, and in foreground
// contexts in the following browsers.
// However, note that even this simple case requires nuances to operate in a
// broad spectrum of browsers.
//
// - Firefox 3-13
// - Internet Explorer 6-9
// - iPad Safari 4.3
// - Lynx 2.8.7
} else {
    requestFlush = makeRequestCallFromTimer(flush);
}

// `requestFlush` requests that the high priority event queue be flushed as
// soon as possible.
// This is useful to prevent an error thrown in a task from stalling the event
// queue if the exception handled by Node.js’s
// `process.on("uncaughtException")` or by a domain.
rawAsap.requestFlush = requestFlush;

// To request a high priority event, we induce a mutation observer by toggling
// the text of a text node between "1" and "-1".
function makeRequestCallFromMutationObserver(callback) {
    var toggle = 1;
    var observer = new BrowserMutationObserver(callback);
    var node = document.createTextNode("");
    observer.observe(node, {characterData: true});
    return function requestCall() {
        toggle = -toggle;
        node.data = toggle;
    };
}

// The message channel technique was discovered by Malte Ubl and was the
// original foundation for this library.
// http://www.nonblocking.io/2011/06/windownexttick.html

// Safari 6.0.5 (at least) intermittently fails to create message ports on a
// page's first load. Thankfully, this version of Safari supports
// MutationObservers, so we don't need to fall back in that case.

// function makeRequestCallFromMessageChannel(callback) {
//     var channel = new MessageChannel();
//     channel.port1.onmessage = callback;
//     return function requestCall() {
//         channel.port2.postMessage(0);
//     };
// }

// For reasons explained above, we are also unable to use `setImmediate`
// under any circumstances.
// Even if we were, there is another bug in Internet Explorer 10.
// It is not sufficient to assign `setImmediate` to `requestFlush` because
// `setImmediate` must be called *by name* and therefore must be wrapped in a
// closure.
// Never forget.

// function makeRequestCallFromSetImmediate(callback) {
//     return function requestCall() {
//         setImmediate(callback);
//     };
// }

// Safari 6.0 has a problem where timers will get lost while the user is
// scrolling. This problem does not impact ASAP because Safari 6.0 supports
// mutation observers, so that implementation is used instead.
// However, if we ever elect to use timers in Safari, the prevalent work-around
// is to add a scroll event listener that calls for a flush.

// `setTimeout` does not call the passed callback if the delay is less than
// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
// even then.

function makeRequestCallFromTimer(callback) {
    return function requestCall() {
        // We dispatch a timeout with a specified delay of 0 for engines that
        // can reliably accommodate that request. This will usually be snapped
        // to a 4 milisecond delay, but once we're flushing, there's no delay
        // between events.
        var timeoutHandle = setTimeout(handleTimer, 0);
        // However, since this timer gets frequently dropped in Firefox
        // workers, we enlist an interval handle that will try to fire
        // an event 20 times per second until it succeeds.
        var intervalHandle = setInterval(handleTimer, 50);

        function handleTimer() {
            // Whichever timer succeeds will cancel both timers and
            // execute the callback.
            clearTimeout(timeoutHandle);
            clearInterval(intervalHandle);
            callback();
        }
    };
}

// This is for `asap.js` only.
// Its name will be periodically randomized to break any code that depends on
// its existence.
rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;

// ASAP was originally a nextTick shim included in Q. This was factored out
// into this ASAP package. It was later adapted to RSVP which made further
// amendments. These decisions, particularly to marginalize MessageChannel and
// to capture the MutationObserver implementation in a closure, were integrated
// back into ASAP proper.
// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 388 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _lodash = __webpack_require__(118);

var _lodash2 = _interopRequireDefault(_lodash);

var _amcharts = __webpack_require__(443);

var _amcharts2 = _interopRequireDefault(_amcharts);

var _fastclick = __webpack_require__(1208);

var _fastclick2 = _interopRequireDefault(_fastclick);

var _reactRouterDom = __webpack_require__(12);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _GET__userSession = __webpack_require__(258);

var _GET__userSession2 = _interopRequireDefault(_GET__userSession);

var _POST__fetchAuthorityToken = __webpack_require__(419);

var _POST__fetchAuthorityToken2 = _interopRequireDefault(_POST__fetchAuthorityToken);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _Login = __webpack_require__(511);

var _Login2 = _interopRequireDefault(_Login);

var _Banner = __webpack_require__(475);

var _Banner2 = _interopRequireDefault(_Banner);

var _IndustryAuthority = __webpack_require__(584);

var _IndustryAuthority2 = _interopRequireDefault(_IndustryAuthority);

var _Budget = __webpack_require__(561);

var _Budget2 = _interopRequireDefault(_Budget);

var _Datasets = __webpack_require__(578);

var _Datasets2 = _interopRequireDefault(_Datasets);

var _Editor = __webpack_require__(580);

var _Editor2 = _interopRequireDefault(_Editor);

var _Reports = __webpack_require__(588);

var _Reports2 = _interopRequireDefault(_Reports);

var _getUrlParameterByName = __webpack_require__(452);

var _getUrlParameterByName2 = _interopRequireDefault(_getUrlParameterByName);

var _checkForToken = __webpack_require__(451);

var _checkForToken2 = _interopRequireDefault(_checkForToken);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Basic styling
__webpack_require__(1204);
__webpack_require__(1198);
__webpack_require__(1199);
__webpack_require__(1205);
__webpack_require__(1207);
__webpack_require__(1200);
__webpack_require__(1206);
__webpack_require__(1197);
__webpack_require__(1196);
__webpack_require__(1202);
__webpack_require__(1203);
__webpack_require__(1201);
__webpack_require__(1013);

// global libs


// import Router, { Routes, Route, DefaultRoute, Redirect } from 'react-router'

(0, _amcharts2.default)();
_fastclick2.default.attach(document.body);

var TOKEN = (0, _checkForToken2.default)();
var LoginId = (0, _getUrlParameterByName2.default)('LoginId');
var HasCookie = (0, _getUrlParameterByName2.default)('HasCookie');

var App = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      authModalActive: true
    };
  },
  componentWillMount: function componentWillMount() {
    if (typeof LoginId === 'string') return (0, _POST__fetchAuthorityToken2.default)(LoginId);
    if (typeof HasCookie === 'string') return this.handleCookie();
    if (typeof TOKEN === 'string') return (0, _GET__userSession2.default)();

    _Actions2.default.SESSION_ERROR({
      AccessDenied: true
    });
  },
  handleCookie: function handleCookie() {
    var uri = window.location.toString();
    var clean_uri = uri.split('?')[0];
    window.history.replaceState({}, document.title, clean_uri);

    (0, _GET__userSession2.default)();
    window.localStorage.setItem('accessToken', 'true');
  },
  _handleAuth: function _handleAuth() {
    this.setState({
      authModalActive: false
    });
  },
  render: function render() {
    var LoginComponent = this.state.authModalActive ? _react2.default.createElement(_Login2.default, { handleAuth: this._handleAuth }) : null;

    return _react2.default.createElement(
      _reactRouterDom.BrowserRouter,
      null,
      _react2.default.createElement(
        'div',
        { className: 'App' },
        _react2.default.createElement(_Banner2.default, {
          title: this.state.title,
          userName: this.state.userName,
          dataset: this.state.dataset,
          datasetEditable: this.state.datasetEditable,
          datasetStatus: this.state.datasetStatus
        }),
        this.state.authModalActive ? null : this.renderRoutes(),
        LoginComponent
      )
    );
  },
  renderRoutes: function renderRoutes() {
    return _react2.default.createElement(
      _reactRouterDom.Switch,
      null,
      _react2.default.createElement(_reactRouterDom.Redirect, { exact: true, from: '/editor', to: '/editor/land' }),
      _react2.default.createElement(_reactRouterDom.Redirect, { exact: true, from: '/editor/', to: '/editor/land' }),
      _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/', component: _Datasets2.default }),
      _react2.default.createElement(_reactRouterDom.Route, { path: '/industry-authority', component: _IndustryAuthority2.default }),
      _react2.default.createElement(_reactRouterDom.Route, { path: '/reports', component: _Reports2.default }),
      _react2.default.createElement(_reactRouterDom.Route, { path: '/editor', component: _Editor2.default }),
      _react2.default.createElement(_reactRouterDom.Route, { path: '/budget/:budgetId', component: _Budget2.default })
    );
  }
});

module.exports = App;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TOKEN, 'TOKEN', 'C:/_repos_windows/dairybase/Frontend/app/App.js');

  __REACT_HOT_LOADER__.register(LoginId, 'LoginId', 'C:/_repos_windows/dairybase/Frontend/app/App.js');

  __REACT_HOT_LOADER__.register(HasCookie, 'HasCookie', 'C:/_repos_windows/dairybase/Frontend/app/App.js');

  __REACT_HOT_LOADER__.register(App, 'App', 'C:/_repos_windows/dairybase/Frontend/app/App.js');
}();

;

/***/ }),
/* 389 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CloseIcon = exports.CloseButton = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'DAStandardPortal__Root'
})(['position:relative;z-index:1;']);

var CloseButton = exports.CloseButton = _styledComponents2.default.div.withConfig({
  displayName: 'DAStandardPortal__CloseButton'
})(['font-family:', ';cursor:pointer;position:absolute;top:10px;right:10px;z-index:1;display:flex;align-items:center;padding:5px 10px;color:', ';border:1px solid ', ';border-radius:22px;font-size:14px;font-weight:700;&:hover{border:1px solid ', ';}&:active{background:', ';}'], _css.vars.Gilroy, _css.vars.DA_accent_blue, _css.vars.a(_css.vars.DA_sky_blue, 0), _css.vars.a(_css.vars.DA_sky_blue, 50), _css.vars.a(_css.vars.DA_sky_blue, 50));

var CloseIcon = exports.CloseIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_close' }).withConfig({
  displayName: 'DAStandardPortal__CloseIcon'
})(['', ';margin-left:4px;'], _css.mixins.icon('24px', '24px'));
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/style.js');

  __REACT_HOT_LOADER__.register(CloseButton, 'CloseButton', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/style.js');

  __REACT_HOT_LOADER__.register(CloseIcon, 'CloseIcon', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DAStandardPortal/style.js');
}();

;

/***/ }),
/* 390 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _SearchBox = __webpack_require__(399);

var _SearchBox2 = _interopRequireDefault(_SearchBox);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _fuzzysort = __webpack_require__(1216);

var _fuzzysort2 = _interopRequireDefault(_fuzzysort);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = (0, _xchReactClass2.default)({}, {
  mixins: [_reflux2.default.listenTo(_datasetList2.default, '_handleNewData')],

  componentWillMount: function componentWillMount() {
    this._handleNewData();
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      list: _datasetList2.default.store
    });
  },
  getInitialState: function getInitialState() {
    return {
      list: [],
      selectedDataset: undefined,
      searchString: '',
      searchResults: []
    };
  },
  _handleDatasetSelection: function _handleDatasetSelection(dataset) {
    this.props.onSelectDataset(dataset);
    // this.setState({
    //   selectedDataset: dataset.Id,
    // })
  },


  _getSelectedDataset: function _getSelectedDataset() {
    if (typeof this.state.selectedDataset === 'undefined') return;
    return _.find(this.props.list, { Id: this.state.selectedDataset });
  },

  handleUpdateSearchString: function handleUpdateSearchString(newString) {
    if (newString.length === 0) {
      return this.setState({
        searchString: '',
        searchResults: []
      });
    }

    var list = this.state.list;


    var results = _fuzzysort2.default.go(newString, list, {
      keys: ['Name', 'DairyBaseId', 'FinancialYear']
    });

    var mappedResults = results.map(function (result) {
      return result.obj;
    }).filter(function (d) {
      return !d.ArchiveStatus;
    });

    return this.setState({
      searchString: newString,
      searchResults: mappedResults
    });
  },
  render: function render() {
    var _state = this.state,
        searchString = _state.searchString,
        searchResults = _state.searchResults,
        selectedDataset = _state.selectedDataset;


    return _react2.default.createElement(_SearchBox2.default, {
      isZZtop: this.props.isZZtop,
      searchString: searchString,
      filteredDatasets: searchResults,
      selectedDatasets: !selectedDataset ? [] : [this._getSelectedDataset(selectedDataset)],
      onUpdateSearchString: this.handleUpdateSearchString,
      onSelect: this._handleDatasetSelection
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/DatasetSearch/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 391 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var scrollDiv = document.createElement("div");
scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;');
document.body.appendChild(scrollDiv);

// Get the scrollbar width
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;

// Delete the DIV
document.body.removeChild(scrollDiv);

var _default = function _default() {
  return scrollbarWidth;
};

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(scrollDiv, 'scrollDiv', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/bodyScroll/getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(scrollbarWidth, 'scrollbarWidth', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/bodyScroll/getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/bodyScroll/getScrollbarWidth/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 392 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.removeBodyScroll = removeBodyScroll;
exports.restoreBodyScroll = restoreBodyScroll;

var _getScrollbarWidth = __webpack_require__(391);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function createFakeScrollbar() {
  var element = document.createElement('div');

  element.classList.add('xch-mootools-portal-fake-scrollbar');
  element.style.cssText = '\n    display: none;\n    position: fixed;\n    z-index: 1;\n    top: 0;\n    bottom: 0;\n    right: 0;\n    width: ' + (0, _getScrollbarWidth2.default)() + 'px;\n    overflow-y: scroll;\n    overflow-x: hidden;\n  ';
  return element;
}

function removeBodyScroll(node) {
  var element = node || document.getElementsByTagName('body')[0];
  var scrollTop = node ? element.scrollTop : window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
  var scrollHeight = element.scrollHeight;

  element.style.paddingRight = (0, _getScrollbarWidth2.default)() + 'px';
  element.style.overflowY = 'hidden';

  var fakeScrollbar = element.getElementsByClassName('xch-mootools-portal-fake-scrollbar')[0];

  if (!fakeScrollbar) {
    fakeScrollbar = createFakeScrollbar();
    element.insertBefore(fakeScrollbar, element.firstChild);
  }

  fakeScrollbar.style.display = 'block';
  fakeScrollbar.innerHTML = '<div style=\'height: ' + scrollHeight + 'px\'></div>';
  fakeScrollbar.scrollTop = scrollTop;
}

function restoreBodyScroll(node) {
  var element = node || document.getElementsByTagName('body')[0];

  element.style.paddingRight = 0;
  element.style.overflowY = !node ? '' : 'scroll';

  var fakeScrollbar = element.getElementsByClassName('xch-mootools-portal-fake-scrollbar')[0];

  if (fakeScrollbar) {
    fakeScrollbar.style.display = 'none';
  }
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(createFakeScrollbar, 'createFakeScrollbar', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/bodyScroll/index.js');

  __REACT_HOT_LOADER__.register(removeBodyScroll, 'removeBodyScroll', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/bodyScroll/index.js');

  __REACT_HOT_LOADER__.register(restoreBodyScroll, 'restoreBodyScroll', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/bodyScroll/index.js');
}();

;

/***/ }),
/* 393 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (evt, node) {
  var _evt = evt.nativeEvent || evt; // account for React evts from onClick etc
  var target = _evt.target,
      path = _evt.path,
      composedPath = _evt.composedPath;


  var _path = path || composedPath ? _evt.composedPath() : [];

  if (target === node) return true;

  var targetIndex = _.indexOf(_path, target);
  var nodeIndex = _.indexOf(_path, node);

  if (targetIndex === -1 || nodeIndex === -1) return false;

  if (targetIndex <= nodeIndex) return true;

  return false;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 394 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.openPortal = openPortal;
exports.closePortal = closePortal;
exports.getPopupCoords = getPopupCoords;

var _bodyScroll = __webpack_require__(392);

var counter = 0;
var list = [];

function openPortal(_ref) {
  var node = _ref.node,
      isMobile = _ref.isMobile;

  var newId = counter + 1;
  counter++;

  if (list.length === 0) {
    (0, _bodyScroll.removeBodyScroll)(node);
  }

  list.push(newId);

  return newId;
}

function closePortal(_ref2) {
  var portalId = _ref2.portalId,
      node = _ref2.node,
      isMobile = _ref2.isMobile;

  list = list.filter(function (id) {
    return id !== portalId;
  });

  if (list.length === 0) {
    return (0, _bodyScroll.restoreBodyScroll)(node);
    // isMobile ? enableBodyScroll(node) : restoreBodyScroll(node)
  }
}

function getPopupCoords(elem) {
  // crossbrowser version
  if (!elem) return {};

  var box = elem.getBoundingClientRect();

  var body = document.body;
  var docEl = document.documentElement;

  var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
  var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;

  var clientTop = docEl.clientTop || body.clientTop || 0;
  var clientLeft = docEl.clientLeft || body.clientLeft || 0;

  var top = box.top + scrollTop - clientTop;
  var left = box.left + scrollLeft - clientLeft;
  var bottom = box.bottom + scrollTop - clientTop;
  var right = box.right + scrollLeft - clientLeft;

  return {
    top: Math.round(top),
    left: Math.round(left),
    bottom: Math.round(bottom),
    right: Math.round(right),
    xCenter: Math.round(left) + elem.offsetWidth / 2,
    yCenter: Math.round(top) + elem.offsetHeight / 2
  };
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(counter, 'counter', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/portal-utils.js');

  __REACT_HOT_LOADER__.register(list, 'list', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/portal-utils.js');

  __REACT_HOT_LOADER__.register(openPortal, 'openPortal', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/portal-utils.js');

  __REACT_HOT_LOADER__.register(closePortal, 'closePortal', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/portal-utils.js');

  __REACT_HOT_LOADER__.register(getPopupCoords, 'getPopupCoords', 'C:/_repos_windows/dairybase/Frontend/app/_shared/Portal/portal-utils.js');
}();

;

/***/ }),
/* 395 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _style = __webpack_require__(954);

var _style2 = _interopRequireDefault(_style);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = (0, _xchReactClass2.default)({}, {
  render: function render() {
    var _props = this.props,
        dataset = _props.dataset,
        onSelect = _props.onSelect;


    return _react2.default.createElement(
      'button',
      {
        onClick: function onClick() {
          return onSelect(dataset);
        },
        className: (0, _classnames3.default)(_style2.default.row, _defineProperty({}, _style2.default.selected, dataset._selected)) },
      _react2.default.createElement(
        'div',
        { className: _style2.default.row_content },
        _react2.default.createElement(
          'div',
          { className: (0, _classnames3.default)(_style2.default.cell, _style2.default.header) },
          dataset.Name
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.cell },
          dataset.DairyBaseId
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.cell },
          dataset.FinancialYear
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.cell },
          dataset.OwnerName
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/List/Dataset/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 396 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactRouter = __webpack_require__(185);

var _Dataset = __webpack_require__(395);

var _Dataset2 = _interopRequireDefault(_Dataset);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _style = __webpack_require__(955);

var _style2 = _interopRequireDefault(_style);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = (0, _xchReactClass2.default)({}, {
  getInitialState: function getInitialState() {
    return {
      displayNum: 10
    };
  },
  handleDisplayMore: function handleDisplayMore() {
    return this.setState({ displayNum: this.state.displayNum + 10 });
  },
  render: function render() {
    var _props = this.props,
        datasets = _props.datasets,
        selectedDatasets = _props.selectedDatasets,
        hasCheckBox = _props.hasCheckBox,
        onSelect = _props.onSelect;
    var displayNum = this.state.displayNum;


    return _react2.default.createElement(
      'div',
      { className: _style2.default.list },
      _.take(datasets, displayNum).map(function (dataset) {
        if (typeof selectedDatasets !== 'undefined') {
          dataset._selected = false;

          if (typeof _.find(selectedDatasets, { Id: dataset.Id }) !== 'undefined') {
            dataset._selected = true;
          }
        }

        return _react2.default.createElement(_Dataset2.default, {
          key: dataset.Id,
          dataset: dataset,
          hasCheckBox: hasCheckBox,
          onSelect: onSelect
        });
      }),
      _react2.default.createElement(
        'div',
        {
          className: (0, _classnames3.default)(_style2.default.num, _defineProperty({}, _style2.default.hidden, displayNum >= datasets.length)) },
        'Displayed ',
        displayNum,
        ' / ',
        datasets.length,
        ' results.',
        _react2.default.createElement(
          'button',
          { className: _style2.default.btn, onClick: this.handleDisplayMore },
          'More Results...'
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/List/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 397 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (evt, node) {
  var target = evt.target;

  if (target === node) return true;

  while (target && target.parentElement) {
    if (target.parentElement === node) return true;
    target = target.parentElement;
  }

  return false;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 398 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function getCoords(elem, topMod, leftMod) {
  // crossbrowser version
  var box = elem.getBoundingClientRect();

  var body = document.body;
  var docEl = document.documentElement;

  var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;
  var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;

  var clientTop = docEl.clientTop || body.clientTop || 0;
  var clientLeft = docEl.clientLeft || body.clientLeft || 0;

  var top = box.top + scrollTop - clientTop;
  var left = box.left + scrollLeft - clientLeft;

  if (typeof topMod !== 'undefined') {
    top = top + topMod;
  }
  if (typeof leftMod !== 'undefined') {
    left = left + leftMod;
  }

  return { top: Math.round(top), left: Math.round(left) + elem.offsetWidth / 2 };
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 399 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchInputText = __webpack_require__(401);

var _xchInputText2 = _interopRequireDefault(_xchInputText);

var _xchIcon = __webpack_require__(400);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

var _xchPortal = __webpack_require__(403);

var _xchPortal2 = _interopRequireDefault(_xchPortal);

var _checkDomTargetPath = __webpack_require__(397);

var _checkDomTargetPath2 = _interopRequireDefault(_checkDomTargetPath);

var _getDomCoords2 = __webpack_require__(398);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

var _List = __webpack_require__(396);

var _List2 = _interopRequireDefault(_List);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _style = __webpack_require__(956);

var _style2 = _interopRequireDefault(_style);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = (0, _xchReactClass2.default)({}, {
  getInitialState: function getInitialState() {
    return {
      portalOpen: false,
      modalPos: {},
      iconPos: {}
    };
  },
  componentDidMount: function componentDidMount() {
    var box = this.refs.box;


    var inputBox = box.refs.my_input;

    var _getDomCoords = (0, _getDomCoords3.default)(inputBox),
        top = _getDomCoords.top,
        left = _getDomCoords.left;

    return this.setState({
      modalPos: {
        top: top + inputBox.offsetHeight + 1 + 'px',
        left: left - inputBox.offsetWidth / 2 + 'px'
      },
      iconPos: {
        top: top + 'px',
        left: left + inputBox.offsetWidth / 2 - 36 + 'px'
      }
    });
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    var _this = this;

    var searchString = this.props.searchString;


    if (searchString.length === 0 && newProps.searchString.length > 0) {
      return this.setState({
        portalOpen: true
      }, function () {
        return _this.toggleSearchList(_this.state.portalOpen);
      });
    }

    if (searchString.length > 0 && newProps.searchString.length === 0) {
      return this.setState({
        portalOpen: false
      }, function () {
        return _this.toggleSearchList(_this.state.portalOpen);
      });
    }
  },
  componentWillUnmount: function componentWillUnmount() {
    if (this.state.portalOpen) {
      return document.removeEventListener('click', this.clearSearchString);
    }
  },
  toggleSearchList: function toggleSearchList(listState) {
    if (listState) return document.addEventListener('click', this.clearSearchString);

    return document.removeEventListener('click', this.clearSearchString);
  },
  clearSearchString: function clearSearchString(evt) {
    if (this.props.selectedDatasets.length !== 0) return;
    if ((0, _checkDomTargetPath2.default)(evt, this.refs.search)) return;
    if ((0, _checkDomTargetPath2.default)(evt, this.refs.box.refs.my_input)) return;

    return this.props.onUpdateSearchString('');
  },
  handleSelectDataset: function handleSelectDataset(dataset) {
    return this.props.onSelect(dataset);
  },
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    var _props = this.props,
        searchString = _props.searchString,
        onUpdateSearchString = _props.onUpdateSearchString;


    return _react2.default.createElement(
      'div',
      { className: this.getClasses('root') },
      _react2.default.createElement(_xchInputText2.default, {
        ref: 'box',
        classes: {
          root: this.getClasses('input'),
          button: this.getClasses('inputWrapper'),
          input: this.getClasses('inputWrapper')
        },
        value: searchString,
        onChange: onUpdateSearchString,
        onSubmit: onUpdateSearchString
      }),
      this.renderPortal()
    );
  },
  renderPortal: function renderPortal() {
    var _props2 = this.props,
        filteredDatasets = _props2.filteredDatasets,
        selectedDatasets = _props2.selectedDatasets,
        hasCheckBox = _props2.hasCheckBox;
    var _state = this.state,
        portalOpen = _state.portalOpen,
        iconPos = _state.iconPos,
        modalPos = _state.modalPos;


    return _react2.default.createElement(
      _xchPortal2.default,
      {
        allowScroll: true,
        isZZtop: this.props.isZZtop,
        element: document.body,
        isOpen: portalOpen,
        classes: {
          root: this.getClasses('portal'),
          content: this.getClasses('portalContent')
        } },
      _react2.default.createElement(
        'button',
        {
          className: this.getClasses('cross'),
          style: iconPos,
          onClick: this.clearSearchString },
        _react2.default.createElement(_xchIcon2.default, { id: 'close', classes: { icon: this.getClasses('icon') } })
      ),
      _react2.default.createElement(
        'div',
        {
          ref: 'search',
          className: this.getClasses('list'),
          style: modalPos },
        _react2.default.createElement(_List2.default, {
          datasets: filteredDatasets,
          selectedDatasets: selectedDatasets,
          onSelect: this.handleSelectDataset,
          hasCheckBox: hasCheckBox
        })
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 400 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _iconList = __webpack_require__(193);

var _iconList2 = _interopRequireDefault(_iconList);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(957);

var _style2 = _interopRequireDefault(_style);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = (0, _xchReactClass2.default)({}, {
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    return _react2.default.createElement('div', {
      className: this.getClasses('icon'),
      dangerouslySetInnerHTML: { __html: _iconList2.default[this.props.id] }
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Icon/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 401 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(958);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = (0, _xchReactClass2.default)({}, {
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (this.state.isFocused && !this.props.error) return;
    this.setState({
      value: newProps.value
    });
  },
  parentFn: function parentFn(fn) {
    if (typeof fn !== 'undefined') fn();
  },
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.parentFn(this.props.onFocus);
      this.setState({
        isFocused: true
      }, function () {
        setTimeout(function () {
          if (_this.state.isFocused) {
            var input = _this.refs.my_input;
            input.select();
            input.addEventListener('mousewheel', _this._preventScroll);
          }
        }, 30);
      });
    }
  },
  _preventScroll: function _preventScroll(event) {
    event.preventDefault();
  },
  _handleBlur: function _handleBlur() {
    this.parentFn(this.props.onBlur);
    var input = this.refs.my_input;
    input.removeEventListener('mousewheel', this._preventScroll);
    this.setState({
      isFocused: false
    }, function () {
      this._validateData();
    });
  },
  _handleChange: function _handleChange(evt) {
    if (typeof this.props.onChange !== 'undefined') this.props.onChange(evt.target.value);
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 13:
        // Enter
        this._validateData();
        break;
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    this.setState({
      isFocused: false,
      value: this.props.value
    });
  },
  _validateData: function _validateData() {
    // Maybe validate character length etc here?

    var newValue = this.state.value;
    if (typeof newValue === 'undefined' || newValue === null || newValue === '' || newValue === this.props.value && !this.props.error || typeof newValue !== 'string' || this.props.disabled) {
      // not valid?
      return this._handleCancel();
    }
    // is valid
    return this._handleSubmitData();
  },
  _handleSubmitData: function _handleSubmitData() {
    // Send data out to smart handler
    this.props.onSubmit(this.state.value);
  },
  render: function render() {
    var _classnames;

    var classList = (0, _classnames3.default)((_classnames = {}, _defineProperty(_classnames, this.getClasses('root'), true), _defineProperty(_classnames, this.getClasses('output'), this.props.unEditable), _defineProperty(_classnames, this.getClasses('disabled'), this.props.disabled && !this.props.unEditable), _defineProperty(_classnames, this.getClasses('focused'), this.state.isFocused), _defineProperty(_classnames, this.getClasses('error'), this.props.error), _classnames));

    return _react2.default.createElement(
      'div',
      { ref: 'my_input_wrapper', className: classList },
      !this.props.unEditable ? _react2.default.createElement('input', {
        ref: 'my_input',
        className: this.getClasses('input'),
        type: 'text',
        value: this.state.value,
        onFocus: this._handleFocus,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown
      }) : null,
      _react2.default.createElement(
        'div',
        { className: this.getClasses('button') },
        this.state.value
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-InputText/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 402 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var scrollDiv = document.createElement("div");
scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;');
document.body.appendChild(scrollDiv);

// Get the scrollbar width
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;

// Delete the DIV
document.body.removeChild(scrollDiv);

var _default = function _default() {
  return scrollbarWidth;
};

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(scrollDiv, 'scrollDiv', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(scrollbarWidth, 'scrollbarWidth', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/getScrollbarWidth/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 403 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(141);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _portalManager = __webpack_require__(404);

var _style = __webpack_require__(959);

var _style2 = _interopRequireDefault(_style);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = (0, _xchReactClass2.default)({}, {
  getInitialState: function getInitialState() {
    return {
      created: false
    };
  },
  componentWillMount: function componentWillMount() {
    this.tryRender(this.props);
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.tryRender(newProps);
  },
  componentWillUnmount: function componentWillUnmount() {
    if (this.props.isOpen || this.props.alwaysOpen) {
      this.destroyPortal(this.props);
    }
  },
  tryRender: function tryRender(props) {
    var _this = this;

    if (props.element === null || typeof props.element === 'undefined') return null; // props.onPortalReady()

    if (props.alwaysOpen) {
      if (this.state.created) return this.renderPortal(props);
      return this.setState({
        created: true
      }, function () {
        return _this.createPortal(props);
      });
    }

    if (props.isOpen === this.props.isOpen) {
      if (!this.state.created) return;
      return this.renderPortal(props);
    }
    // always open could impact perf?
    if (props.isOpen) {
      this.setState({
        created: true
      });
      this.createPortal(props);
    } else {
      this.setState({
        created: false
      });
      this.destroyPortal(props);
    }
  },
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  createPortal: function createPortal(props) {
    if (!props.allowScroll) this.portalId = (0, _portalManager.openPortal)();

    this.node = document.createElement('div');
    this.node.className = this.getClasses('root');
    this.node.style = props.isZZtop ? 'z-index: 1000' : '';
    props.element.appendChild(this.node);
    this.renderPortal(props);
  },
  destroyPortal: function destroyPortal(props) {
    if (typeof this.node === 'undefined') return;
    // remove portal id from manager
    if (!props.allowScroll) (0, _portalManager.closePortal)(this.portalId);
    // unmount the node in virtual dom
    _reactDom2.default.unmountComponentAtNode(this.node);
    // remove the node from real dom
    props.element.removeChild(this.node);
  },
  renderPortal: function renderPortal(props) {
    var compId = props.compId;


    (0, _reactDom.unstable_renderSubtreeIntoContainer)(this, _react2.default.createElement(
      'div',
      {
        id: compId || 'portalContent',
        className: this.getClasses('content') },
      props.children
    ), this.node);
  },
  render: function render() {
    return null;
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 404 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.openPortal = openPortal;
exports.closePortal = closePortal;

var _getScrollbarWidth = __webpack_require__(402);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var counter = 0;
var list = [];

function openPortal() {
  var newId = counter + 1;
  counter++;

  if (list.length === 0) {
    document.getElementsByTagName('body')[0].style.paddingRight = (0, _getScrollbarWidth2.default)() + 'px';
    document.getElementsByTagName('body')[0].style.overflow = 'hidden';
  }

  list.push(newId);
  return newId;
}

function closePortal(portalId) {
  list = list.filter(function (id) {
    return id !== portalId;
  });
  if (list.length === 0) {
    document.getElementsByTagName('body')[0].style.paddingRight = 0;
    document.getElementsByTagName('body')[0].style.overflow = '';
  }
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(counter, 'counter', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/portal-manager.js');

  __REACT_HOT_LOADER__.register(list, 'list', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/portal-manager.js');

  __REACT_HOT_LOADER__.register(openPortal, 'openPortal', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/portal-manager.js');

  __REACT_HOT_LOADER__.register(closePortal, 'closePortal', 'C:/_repos_windows/dairybase/Frontend/app/_shared/SearchBox/xch-Portal/portal-manager.js');
}();

;

/***/ }),
/* 405 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.scrollContext = undefined;

var _react = __webpack_require__(0);

var scrollContext = exports.scrollContext = (0, _react.createContext)({});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(scrollContext, 'scrollContext', 'C:/_repos_windows/dairybase/Frontend/app/_shared/contexts/index.js');
}();

;

/***/ }),
/* 406 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _cssColorFunction = __webpack_require__(348);

var _cssColorFunction2 = _interopRequireDefault(_cssColorFunction);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = {
  shade: function shade(c, p) {
    return _cssColorFunction2.default.convert('color(' + c + ' shade(' + p + '%))');
  },
  tint: function tint(c, p) {
    return _cssColorFunction2.default.convert('color(' + c + ' tint(' + p + '%))');
  },
  opacity: function opacity(c, p) {
    return _cssColorFunction2.default.convert('color(' + c + ' a(' + p + '%))');
  },
  appWidth: function appWidth() {
    return '\n      max-width: 1000px;\n      margin: 0 auto;\n    ';
  },
  absolut: function absolut() {
    return '\n      position: absolute;\n      z-index: 1;\n      top:0;\n      bottom:0;\n      right:0;\n      left:0;\n    ';
  },
  absolutBox: function absolutBox(unit) {
    return '\n      position: absolute;\n      width: ' + unit + 'px;\n      height: ' + unit + 'px;\n      top: 50%;\n      left: 50%;\n      margin-top: -' + unit / 2 + 'px;\n      margin-left: -' + unit / 2 + 'px;\n    ';
  },
  absoluticon: function absoluticon(unit) {
    return '\n      position: absolute;\n      z-index: 1;\n      display: block;\n      width: ' + unit + 'px;\n      height: ' + unit + 'px;\n      top: 50%;\n      left: 50%;\n      margin-top: -' + unit / 2 + 'px;\n      margin-left: -' + unit / 2 + 'px;\n\n      svg {\n        position: absolute;\n        z-index: 1;\n        top: 0;\n        left: 0;\n        right: 0;\n        bottom: 0;\n        width: ' + unit + 'px;\n        height: ' + unit + 'px;\n      }\n    ';
  },
  clearfixfunction: function clearfixfunction() {
    return '\n      zoom 1;\n      &:before, &:after {\n          content: "";\n          display: table;\n      }\n      &:after {\n          clear: both;\n      }\n    ';
  },
  ellipsis: function ellipsis() {
    return '\n      white-space: nowrap;\n      overflow: hidden;\n      text-overflow: ellipsis;\n    ';
  },
  icon: function icon() {
    var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '20px';
    var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '20px';
    var display = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'block';

    return '\n      position: relative;\n      z-index: 1;\n      display: ' + display + ';\n      width: ' + width + ';\n      height: ' + height + ';\n\n      svg {\n        position: absolute;\n        z-index: 1;\n        top: 0;\n        left: 0;\n        right: 0;\n        bottom: 0;\n        width: ' + width + ';\n        height: ' + height + ';\n      }\n    ';
  },
  mediaObj: function mediaObj() {
    return '\n      overflow: hidden;\n      _overflow: visible;\n      zoom: 1;\n    ';
  },
  minContainer: function minContainer() {
    return '\n      min-width: 300px;\n      padding-left: 15px;\n      padding-right: 15px;\n    ';
  },
  noselect: function noselect() {
    return '\n      user-select: none;\n    ';
  },
  noZ: function noZ() {
    return '\n      transform: translateZ(0px);\n    ';
  },
  scrollbox: function scrollbox() {
    return '\n      position: absolute;\n      z-index: 1;\n      top: 0;\n      bottom: 0;\n      left: 0;\n      right: 0;\n      overflow-y: auto;\n      -webkit-overflow-scrolling: touch;\n    ';
  },
  wrapdat: function wrapdat() {
    return '\n      white-space: pre;\n      white-space: pre-wrap;\n      white-space: pre-line;\n      white-space: -pre-wrap;\n      white-space: -o-pre-wrap;\n      white-space: -moz-pre-wrap;\n      white-space: -hp-pre-wrap;\n      word-wrap: break-word;\n    ';
  }
};
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/_shared/css/mixins/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 407 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _cssColorFunction = __webpack_require__(348);

var _cssColorFunction2 = _interopRequireDefault(_cssColorFunction);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var vars = __webpack_require__(708);

// var vars = {
//   DA_sky_blue: '#B8DDE1',
//   DA_Dairy_blue: '#0C2340',
//   DA_Dairy_grey: '#EEEEED',
//   DA_pasture_green: '#C3DC93',
//   DA_sun_yellow: '#FBDB65',
//   DA_Jersey_tan: '#DDCBA4',
//   DA_dusk_pink: '#FCD2BF',
//   DA_accent_blue: '#407EC9',
//   DA_accent_green: '#6CC24A',
//   DA_accent_yellow: '#EAAA00',
//   DA_accent_pink: '#F09491',
//   DA_white: '#FFFFFF',
//   DA_black: '#000000',
//   DA_hay_report_red: '#E73B3B',
//   DA_text: 'rgba(0, 0, 0, 0.65)',
// }

vars.a = function (c, p) {
  return _cssColorFunction2.default.convert('color(' + c + ' a(' + p + '%))');
};

module.exports = vars;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 408 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Icon = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Icon = exports.Icon = _styledComponents2.default.div.withConfig({
  displayName: 'xch-Icon__Icon'
})(['', ''], function (props) {
  var overrides = props.styled || {};
  var Icon = overrides.Icon;

  if (Icon) return Icon(props);
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Icon, 'Icon', 'C:/_repos_windows/dairybase/Frontend/app/_shared/xch-Icon/style.js');
}();

;

/***/ }),
/* 409 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GET__bulkDatasetDownload = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + "api/session/GetSaveUserDatasetsToServer",
    method: "GET",
    timeout: 0,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var respData = JSON.parse(resp.body);

    if (resp.statusCode === 200) {
      window.location = "/" + 'api/file/GetReturnInputFileFromServer?filename=' + respData.FileName;
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GET__bulkDatasetDownload, 'GET__bulkDatasetDownload', 'C:/_repos_windows/dairybase/Frontend/app/api/GET__bulkDatasetDownload/index.js');
}();

;

/***/ }),
/* 410 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (errCallback) {
  (0, _xhr2.default)({
    url: "/" + "api/session/logout",
    method: "GET",
    timeout: 30000
  }, function (err, resp, body) {
    if (resp.statusCode === 200) {
      localStorage.clear();
      document.location.assign('/');
    } else {
      if (typeof errCallback !== "undefined") {
        errCallback();
      }
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 411 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GET__userSession = module.exports = function () {

  (0, _xhr2.default)({
    url: "/" + "api/session/GetUsersDetails",
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var blobData = JSON.parse(resp.body);

    if (resp.statusCode === 200) {
      _Actions2.default.UPDATE_USER_NAME(blobData.UserName);
      _Actions2.default.UPDATE_DATASET_LIST(blobData.DataSetList);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GET__userSession, 'GET__userSession', 'C:/_repos_windows/dairybase/Frontend/app/api/GET__usersDetails/index.js');
}();

;

/***/ }),
/* 412 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__bulkDatasetDownload = module.exports = function (data, callback) {
  (0, _xhr2.default)({
    url: "/" + 'api/session/PostSaveBenchmarkCsvDataToServer',
    method: 'POST',
    json: {},
    timeout: 0,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {
    if (resp.statusCode === 200) {
      window.location = "/" + 'api/file/GetReturnInputFileFromServer?filename=' + body.FileName;
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__bulkDatasetDownload, 'POST__bulkDatasetDownload', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__BenchmarkCSVDownload/index.js');
}();

;

/***/ }),
/* 413 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__bulkDatasetDownload = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + "api/session/PostSaveUserDatasetsToServer",
    method: "POST",
    json: {
      FarmDataSetList: data
    },
    timeout: 0,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    if (resp.statusCode === 200) {
      window.location = "/" + 'api/file/GetReturnInputFileFromServer?filename=' + body.FileName;
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__bulkDatasetDownload, 'POST__bulkDatasetDownload', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__bulkDatasetDownload/index.js');
}();

;

/***/ }),
/* 414 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__confirmUploadExcelFile = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + "api/session/PostConfirmLoadFileToDatabase",
    method: "POST",
    json: data,
    timeout: 1800000, // 30 min in case the import takes ages
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {
    var respData = resp.body;
    if (resp.statusCode === 200 && data.Confirm) {
      _Actions2.default.UPDATE_DATASET_LIST(respData.DataSetList);
      _Actions2.default.REPLACE_ACTIVE_DATASET(respData);
    }
    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__confirmUploadExcelFile, 'POST__confirmUploadExcelFile', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__confirmUploadExcelFile/index.js');
}();

;

/***/ }),
/* 415 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (datasetId, callback) {
  (0, _xhr2.default)({
    url: "/" + "api/session/PostSaveInputFileToServer",
    method: "POST",
    json: {
      "farmDataSetId": datasetId
    },
    timeout: 300000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    if (resp.statusCode === 200) {
      window.location = "/" + 'api/file/GetReturnInputFileFromServer?filename=' + resp.body.FileName;
    }

    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 416 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createData = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + 'api/session/PostCreateGroup',
    method: 'POST',
    json: data,
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {

    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.UPDATE_GROUP_LIST(resp.body.UserGroups);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createData, 'POST__createData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__createGroup/index.js');
}();

;

/***/ }),
/* 417 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__downloadReport = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + "api/report/PostDownloadReport",
    method: "POST",
    json: data,
    timeout: 40000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    if (resp.statusCode === 200) {
      window.location = "/" + 'api/file/GetReturnInputFileFromServer?filename=' + resp.body.FileName;
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__downloadReport, 'POST__downloadReport', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__downloadReport/index.js');
}();

;

/***/ }),
/* 418 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createData = module.exports = function (data, callback) {

  (0, _xhr2.default)({
    url: "/" + 'api/session/PostEditGroup',
    method: 'POST',
    json: data,
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {

    if (resp.statusCode === (200 || 201)) {
      _Actions2.default.UPDATE_GROUP_LIST(resp.body.UserGroups);
    }

    callback(resp);
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createData, 'POST__createData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__editGroup/index.js');
}();

;

/***/ }),
/* 419 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _GET__userSession = __webpack_require__(258);

var _GET__userSession2 = _interopRequireDefault(_GET__userSession);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createData = module.exports = function (loginId) {
  var uri = window.location.toString();
  var clean_uri = uri.split("?")[0];
  window.history.replaceState({}, document.title, clean_uri);

  (0, _xhr2.default)({
    url: "/" + "api/session/PostAuthorityToken",
    method: "POST",
    json: {
      "LoginId": loginId
    },
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var respData = body;

    if (resp.statusCode === 200) {
      if (loginId !== respData.LoginId) {
        denyAccess();
      } else {
        (0, _GET__userSession2.default)();
        window.localStorage.setItem('accessToken', 'true');
      }
    }

    if (resp.statusCode === 401) {
      denyAccess();
    }

    if (resp.statusCode !== 401 && resp.statusCode !== 200) {
      _Actions2.default.SESSION_ERROR({
        'ConnectionError': true
      });
    }

    function denyAccess() {
      _Actions2.default.SESSION_ERROR({
        'AccessDenied': true
      });
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createData, 'POST__createData', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__fetchAuthorityToken/index.js');
}();

;

/***/ }),
/* 420 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createBudget = module.exports = function (data, callback) {
  var URL = 'api/session/PostReadCompCalculatorDataSet';

  (0, _xhr2.default)({
    url: "/" + URL,
    method: 'POST',
    json: data,
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {
    var data = resp.body;

    if (resp.statusCode === 200) {
      _Actions2.default.READ_BUDGET_DATA(data);
    }

    if (typeof callback !== 'undefined') {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createBudget, 'POST__createBudget', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__readBudget/index.js');
}();

;

/***/ }),
/* 421 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__unArchiveDataset = module.exports = function (datasetId, callback) {
  (0, _xhr2.default)({
    url: "/" + "api/session/PostUnArchiveDataSet",
    method: "POST",
    json: {
      "FarmDataSetId": datasetId
    },
    timeout: 30000,
    headers: {
      "Content-Type": "application/json"
    }
  }, function (err, resp, body) {

    var data = resp.body;

    if (resp.statusCode === 200) {
      _Actions2.default.UPDATE_DATASET_LIST(data.DataSetList);
    }

    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__unArchiveDataset, 'POST__unArchiveDataset', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__unArchiveDataset/index.js');
}();

;

/***/ }),
/* 422 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var POST__createBudget = module.exports = function (data, callback) {
  var URL = 'api/session/PostUpdateCompCalculatorDataSet';

  var _data = data;
  if (_data.CcModelSwitchId === 1) {
    _data = _extends({}, _data, {
      ExpenseFodderPurchase: _data.ExpenseFodderPhysicalPurchase,
      ExpenseConcentratesPurchase: _data.ExpenseConcentratesPhysicalPurchase,
      ExpenseOtherFeedPurchase: _data.ExpenseOtherFeedPhysicalPurchase
    });
  }

  (0, _xhr2.default)({
    url: "/" + URL,
    method: 'POST',
    json: _data,
    timeout: 30000,
    headers: {
      'Content-Type': 'application/json'
    }
  }, function (err, resp, body) {
    var data = resp.body;

    if (resp.statusCode === 200) {
      _Actions2.default.READ_BUDGET_DATA(data.CompCalculatorOutput);
    }

    if (typeof callback !== 'undefined') {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(POST__createBudget, 'POST__createBudget', 'C:/_repos_windows/dairybase/Frontend/app/api/POST__updateBudget/index.js');
}();

;

/***/ }),
/* 423 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _xhr = __webpack_require__(23);

var _xhr2 = _interopRequireDefault(_xhr);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (file, callback) {
  (0, _xhr2.default)({
    url: "/" + "api/session/PostLoadInputFileToDatabase",
    method: "POST",
    timeout: 1800000, // 30 min
    body: file,
    headers: {
      "ContentType": "multipart/form-data",
      "filename": file.name
    }
  }, function (err, resp, body) {

    var data = JSON.parse(resp.body);

    // all good
    if (resp.statusCode === 200) {
      _Actions2.default.UPDATE_DATASET_LIST(data.DataSetList);
      _Actions2.default.REPLACE_ACTIVE_DATASET(data);
    }

    // can't read this file
    if (resp.statusCode === 400) {
      console.log('error occured in upload');
    }

    // 202 will return { filename, datasets }
    if (typeof callback !== "undefined") {
      callback(resp);
    }
  });
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 424 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function () {
  if (typeof _dataDefinition2.default.properties.Data === 'undefined') return {};
  var fields = _dataDefinition2.default.properties.Data.Fields.filter(function (field, index) {
    return field.Table === 'FarmFeeds';
  });

  var flatFields = {};

  fields.forEach(function (item, index) {
    if (item.Type === "Select") {
      item.Value = getFirstVisibleItem(item).Id;
    } else {
      item.Value = 0;
    }
    flatFields[item.FieldId] = item;
  });

  return flatFields;
};

function getFirstVisibleItem(item) {

  var options = _dataDefinition2.default.selectOptions[item.SelectList];
  var hasOrder = typeof options[0].Order === 'number';
  var orderKey = hasOrder ? 'Order' : 'Id';
  var filteredList = !hasOrder ? options : options.filter(function (item) {
    return item.Order > 0;
  });

  return filteredList[0];
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(getFirstVisibleItem, 'getFirstVisibleItem', 'C:/_repos_windows/dairybase/Frontend/app/data/_blankItems/_feed.js');
}();

;

/***/ }),
/* 425 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function () {
  if (typeof _dataDefinition2.default.properties.Data === 'undefined') return {};
  var fields = _dataDefinition2.default.properties.Data.Fields.filter(function (field, index) {
    return field.Table === 'FarmFertilisers';
  });

  var flatFields = {};

  fields.forEach(function (item, index) {
    if (item.Type === "Select") {
      item.Value = getFirstVisibleItem(item).Id;
    } else {
      item.Value = 0;
    }
    flatFields[item.FieldId] = item;
  });

  return flatFields;
};

function getFirstVisibleItem(item) {

  var options = _dataDefinition2.default.selectOptions[item.SelectList];
  var hasOrder = typeof options[0].Order === 'number';
  var orderKey = hasOrder ? 'Order' : 'Id';
  var filteredList = !hasOrder ? options : options.filter(function (item) {
    return item.Order > 0;
  });

  return filteredList[0];
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(getFirstVisibleItem, 'getFirstVisibleItem', 'C:/_repos_windows/dairybase/Frontend/app/data/_blankItems/_fertiliser.js');
}();

;

/***/ }),
/* 426 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _Feed2 = __webpack_require__(603);

var _Feed3 = _interopRequireDefault(_Feed2);

var _Fertiliser2 = __webpack_require__(605);

var _Fertiliser3 = _interopRequireDefault(_Fertiliser2);

var _LabourAndManagement2 = __webpack_require__(606);

var _LabourAndManagement3 = _interopRequireDefault(_LabourAndManagement2);

var _Land2 = __webpack_require__(607);

var _Land3 = _interopRequireDefault(_Land2);

var _Livestock2 = __webpack_require__(612);

var _Livestock3 = _interopRequireDefault(_Livestock2);

var _MilkProduction2 = __webpack_require__(615);

var _MilkProduction3 = _interopRequireDefault(_MilkProduction2);

var _RainfallAndIrrigation2 = __webpack_require__(616);

var _RainfallAndIrrigation3 = _interopRequireDefault(_RainfallAndIrrigation2);

var _Assets2 = __webpack_require__(590);

var _Assets3 = _interopRequireDefault(_Assets2);

var _FinanceCosts2 = __webpack_require__(592);

var _FinanceCosts3 = _interopRequireDefault(_FinanceCosts2);

var _Income2 = __webpack_require__(594);

var _Income3 = _interopRequireDefault(_Income2);

var _Liabilities2 = __webpack_require__(596);

var _Liabilities3 = _interopRequireDefault(_Liabilities2);

var _OverheadCosts2 = __webpack_require__(598);

var _OverheadCosts3 = _interopRequireDefault(_OverheadCosts2);

var _VariableCosts2 = __webpack_require__(600);

var _VariableCosts3 = _interopRequireDefault(_VariableCosts2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var handlerMap = module.exports = {
  feed: _Feed3.default,
  fertiliser: _Fertiliser3.default,
  'labour-and-management': _LabourAndManagement3.default,
  land: _Land3.default,
  livestock: _Livestock3.default,
  'milk-production': _MilkProduction3.default,
  'rainfall-and-irrigation': _RainfallAndIrrigation3.default,
  assets: _Assets3.default,
  'finance-costs': _FinanceCosts3.default,
  income: _Income3.default,
  liabilities: _Liabilities3.default,
  'overhead-costs': _OverheadCosts3.default,
  'variable-costs': _VariableCosts3.default
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(handlerMap, 'handlerMap', 'C:/_repos_windows/dairybase/Frontend/app/data/_handlerMap/index.js');
}();

;

/***/ }),
/* 427 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var TypeLookup = module.exports = [{
  id: 9,
  type: 'Milking Herd'
}, {
  id: 6,
  type: 'Rising 2 Year Heifers'
}, {
  id: 4,
  type: 'Rising 1 Year Heifers'
}, {
  id: 15,
  type: 'Bulls'
}, {
  id: 16,
  type: 'Other'
}];
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TypeLookup, 'TypeLookup', 'C:/_repos_windows/dairybase/Frontend/app/data/_livestockTypeLookup/index.js');
}();

;

/***/ }),
/* 428 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Assets',
  location: 'assets',
  category: 'financial',
  fields: {
    'AssetsCarryoverWaterOpening': {},
    'AssetsCarryoverWaterClosing': {},
    'AssetsCurrentOtherOpening': {},
    'AssetsCurrentOtherClosing': {},
    'AssetsLandAndBuildingsOpening': {},
    'AssetsLandAndBuildingsClosing': {},
    'AssetsOwnedWaterOpening': {},
    'AssetsOwnedWaterClosing': {},
    'AssetsLivestockOpening': {},
    'AssetsLivestockClosing': {},
    'AssetsFeedOpening': {},
    'AssetsFeedClosing': {},
    'AssetsPlantEquipmentOpening': {},
    'AssetsPlantEquipmentClosing': {},
    'AssetsFactorySharesOpening': {},
    'AssetsFactorySharesClosing': {},
    'AssetsFmdOpening': {},
    'AssetsFmdClosing': {},
    'AssetsFarmOtherOpening': {},
    'AssetsFarmOtherClosing': {},
    'AssetsLeasedTotalOpening': {},
    'AssetsLeasedTotalClosing': {},
    'AssetsOwnedTotalOpening': {},
    'AssetsOwnedTotalClosing': {},
    'AssetsOtherBusinessTotalOpening': {},
    'AssetsOtherBusinessTotalClosing': {},
    'AssetsAllCapitalOpening': {},
    'AssetsOperatingTotalOpening': {},
    'AssetsOperatingTotalClosing': {},
    'AssetsAllCapitalAvg': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 429 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Feed',
  location: 'feed',
  category: 'physical',
  fields: {
    'FeedGrazedTDMPerMilkingHa': {},
    'FeedConservedTDMPerMilkingHa': {},
    'FeedHomegrownTDMPerMilkingHa': {},
    'FeedFedConcMilkingAreaTAsIsPerCow': {},
    'FeedFedFodderTotalMilkingAreaTDMPerCow': {},
    'FarmFeeds': [{
      'Id': {},
      'IsPurchased': {
        Value: false
      },
      'FeedGroupId': {
        Value: 1,
        Options: [{
          Id: 1,
          Options: [{
            Id: 1
          }]
        }]
      },
      'FeedTypeId': {
        Value: 1
      },
      'SwitchAsIsTdm': {},
      'QuantityOpening': {},
      'QuantityPurchased': {},
      'QuantityProducedMilkingArea': {},
      'QuantityProducedSupportArea': {},
      'QuantityProducedTotal': {},
      'QuantityFedMilkingArea': {},
      'QuantityFedSupportArea': {},
      'QuantityFedTotal': {},
      'QuantityClosing': {},
      'PricePerTonne': {},
      'EnergyMJPerKgDM': {},
      'DryMatterPercent': {},
      'WastePercent': {},
      'FeedType': {},
      'QuantitySoldLost': {}
    }],
    '__nullfield__': {}
  },
  dbcclocation: 'feed'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 430 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Fertiliser',
  location: 'fertiliser',
  category: 'physical',
  fields: {
    'FarmFertilisers': [{
      'Id': {},
      'FertiliserTypeId': {
        Value: 1,
        Options: [{
          Id: 1
        }]
      },
      'TonnesApplied': {},
      'TonnesAppliedMilkingArea': {}
    }],
    'FertiliserNKgPerMilkingHa': {},
    'FertiliserPKgPerMilkingHa': {},
    'FertiliserKKgPerMilkingHa': {},
    'FertiliserSKgPerMilkingHa': {},
    'PhosphorousPercent': {},
    'NitrogenPercent': {},
    'PotassiumPercent': {},
    'SulphurPercent': {},
    '__nullfield__': {}
  },
  dbcclocation: 'fertiliser'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 431 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Finance Costs',
  location: 'finance-costs',
  category: 'financial',
  fields: {
    'ExpenseInterest': {},
    'ExpenseLease': {},
    'CashFlowPrincipalRepayment': {},
    'CashFlowOwnerDrawings': {},
    'CashFlowLivestockPurchase': {},
    'CashFlowCapitalPurchase': {},
    'ExpenseInterestLease': {},
    'CashFlowCapitalPurchaseTotal': {},
    'ExpenseInterestLeasePercent': {},
    'ExpenseInterestPercent': {},
    'ExpenseLeasePercent': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 432 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Income',
  location: 'income',
  category: 'financial',
  fields: {
    'IncomeMilkTotal': {},
    'IncomeLivestock': {},
    'IncomeFeedSale': {},
    'IncomeWaterSale': {},
    'IncomeFarmOther': {},
    'IncomeFarmCashTotal': {},
    'IncomeNonFarm': {},
    'IncomeTotalCash': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 433 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Labour & Management',
  location: 'labour-and-management',
  category: 'physical',
  fields: {
    'LabourFteEmployed': {},
    'LabourFteOwner': {},
    'LabourCowsPerFte': {},
    'LabourFteEmployedHours': {},
    'LabourFteOwnerHours': {},
    'LabourFtePerCow': {},
    'LabourFteTotal': {},
    'LabourFteTotalHours': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 434 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Land',
  location: 'land',
  category: 'physical',
  fields: {
    'TerrainId': {},
    'AreaOwnedWtdAvg': {},
    'AreaLeasedNet': {},
    'AreaMilking': {},
    'AreaUsable': {},
    'AreaIrrigatedMilking': {},
    'AreaIrrigatedSupport': {},
    'CowDistanceWalked': {},
    'AreaUnusable': {},
    'AreaSupport': {},
    'AreaDryLandMilking': {},
    'AreaDryLandSupport': {},

    'AreaAvailable': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 435 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Liabilities',
  location: 'liabilities',
  category: 'financial',
  fields: {
    'LiabilitiesCurrentOpening': {},
    'LiabilitiesCurrentClosing': {},
    'LiabilitiesEquipmentLoansOpening': {},
    'LiabilitiesEquipmentLoansClosing': {},
    'LiabilitiesLongTermLoansOpening': {},
    'LiabilitiesLongTermLoansClosing': {},
    'LiabilitiesTotalOpening': {},
    'LiabilitiesTotalClosing': {},
    'LiabilitiesTotalAvg': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 436 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Livestock',
  location: 'livestock',
  category: 'physical',
  fields: {
    CowMilkerNumber: {},
    MilkLitresTotalPerCow: {},
    MilkSolidsKgTotalPerCow: {},
    CowNumberPerMilkingHa: {},
    MilkSolidsKgPerKgLw: {},
    SwitchCowCalvingMonthly: {},
    CalvingPatternTypeId: {},
    FarmCalvings: [{
      CowsMilking: {},
      CowsDry: {},
      CowsCalving: {}
    }],
    FarmLivestocks: [{
      Id: {},
      UserDataSetId: {},
      LivestockTypeId: {
        Value: 1,
        Options: [{
          Id: 1
        }]
      },
      LivestockGroupId: [{}],
      LivestockBreedTypeId: {},
      NumberOpening: {},
      NumberClosing: {},
      NumberAverage: {},
      WeeksOnSupportArea: {},
      WeeksOnAgistment: {},
      WeeksOnMilkingArea: {},
      PriceOpening: {},
      LiveweightAverage: {},
      AgeAverage: {}
    }],
    __nullfield__: {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 437 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Milk Production',
  location: 'milk-production',
  category: 'physical',
  fields: {
    'SwitchMilkMonthlyAnnual': {},
    'SwitchMilkComposition': {},
    'SwitchMilkCompositionMonthly': {},
    'MilkFatKgTotal': {},
    'MilkFatPercentAnnual': {},
    'MilkLitresTotal': {},
    'MilkProteinKgTotal': {},
    'MilkProteinPercentAnnual': {},
    'MilkSolidsKgTotal': {},
    'MilkSolidsPercentAnnual': {},
    'MilkLitresTotalPerCow': {},
    'MilkFatKgTotalPerCow': {},
    'MilkProteinKgTotalPerCow': {},
    'MilkSolidsKgTotalPerCow': {},
    'MilkLitresTotalPerMilkingHa': {},
    'MilkFatKgTotalPerMilkingHa': {},
    'MilkProteinKgTotalPerMilkingHa': {},
    'MilkSolidsKgTotalPerMilkingHa': {},
    'FarmMilks': {
      'Litres': {},
      'FatKg': {},
      'ProteinKg': {},
      'FatPercent': {},
      'ProteinPercent': {}
    },
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 438 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Overhead Costs',
  location: 'overhead-costs',
  category: 'financial',
  fields: {
    'SwitchDepreciation': {},
    'ExpenseRates': {},
    'ExpenseRegistrationInsurance': {},
    'ExpenseMotorVehicles': {},
    'ExpenseRepairsMaintenance': {},
    'ExpenseEmployedPeople': {},
    'ExpenseDepreciationPercent': {},
    'ExpenseDepreciation': {},
    'ExpenseOtherOverheads': {},
    'ExpenseCashOverheadsTotal': {},
    'ExpenseImputedPeople': {},
    'ExpenseNonCashOverheadsTotal': {},
    'ExpenseOverheadsTotal': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 439 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Rainfall & Irrigation',
  location: 'rainfall-and-irrigation',
  category: 'physical',
  fields: {
    'WaterTotalUsedMmPerHa': {},
    'WaterMmPerHaIrrigated': {},
    'FeedHomegrownTDMPer100MmWater': {},
    'RainfallAnnualMm': {},
    'RainfallAnnualAvgMm': {},
    'WaterIrrigationTotalML': {},
    'WaterCarryoverOpeningML': {},
    'WaterCarryoverClosingML': {},
    'WaterCarryoverOpeningPricePerML': {},
    'WaterCarryoverClosingPricePerML': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 440 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
  name: 'Variable Costs',
  location: 'variable-costs',
  category: 'financial',
  fields: {
    'ExpenseAIHerdTest': {},
    'ExpenseAnimalHealth': {},
    'ExpenseCalfRearing': {},
    'ExpenseOtherHerd': {},
    'ExpenseShedPower': {},
    'ExpenseDairySupplies': {},
    'ExpenseOtherShed': {},
    'ExpenseFertiliser': {},
    'ExpenseIrrigation': {},
    'ExpenseHaySilage': {},
    'ExpenseFodderPurchase': {},
    'ExpenseConcentratesPurchase': {},
    'ExpenseOtherFeedPurchase': {},
    'ExpensePastureCropping': {},
    'ExpenseFuelOil': {},
    'ExpenseAgistment': {},
    'ExpenseOtherFeed': {},
    'ExpenseFeedTotal': {},
    'ExpenseShedTotal': {},
    'ExpenseHerdTotal': {},
    'ExpenseCarryoverWater': {},
    'ExpenseFeedInventoryChange': {},
    'ExpenseVariableTotal': {},
    'ExpenseWaterPurchase': {},
    'ExpenseIrrigationOther': {},
    '__nullfield__': {}
  },
  dbcclocation: 'livestock'
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 441 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _default = [{
  Id: 1,
  OrderId: 1,
  Label: 'Feed Input Switch',
  FieldKey: 'CcModelSwitchId',
  Description: 'Switch for selection of editing feed expense directly or indirectly via the individual feed records'
}, {
  Id: 2,
  OrderId: 2,
  Label: 'Milk Production ',
  FieldKey: 'MilkLitresTotal',
  Description: 'The total litres of milk supplied to the factory for the financial year'
}, {
  Id: 3,
  OrderId: 3,
  Label: 'Milk Production ',
  FieldKey: 'MilkSolidsKgTotal',
  Description: 'Total kilograms of milksolids (fat + protein) supplied to the factory'
}, {
  Id: 4,
  OrderId: 4,
  Label: 'Milk Income',
  FieldKey: 'IncomeMilkTotal',
  Description: 'Income from the sale of milk less levies and transport charges'
}, {
  Id: 5,
  OrderId: 5,
  Label: 'Livestock Sales',
  FieldKey: 'IncomeLivestock',
  Description: 'Income from the sale of livestock less any selling levies and freight for sale animals'
}, {
  Id: 6,
  OrderId: 6,
  Label: 'Livestock Purchases',
  FieldKey: 'CashFlowLivestockPurchase',
  Description: 'Total value of livestock purchases'
}, {
  Id: 7,
  OrderId: 7,
  Label: 'Livestock Sales - Purchases',
  FieldKey: 'CashFlowLivestockNet',
  Description: 'Income from the sale of livestock less any selling levies and freight for sale animals less the purchase cost of livestock'
}, {
  Id: 8,
  OrderId: 8,
  Label: 'Livestock Inventory Change',
  FieldKey: 'LivestockInventoryChange',
  Description: 'Livestock Inventory Change = Livestock Asset Closing Value - Livestock Asset Opening Value'
}, {
  Id: 9,
  OrderId: 9,
  Label: 'Livestock Trading Profit',
  FieldKey: 'IncomeLivestockTrading',
  Description: 'The livestock trading profit is the total of net livestock sales plus closing stock less any livestock purchases and opening stock'
}, {
  Id: 10,
  OrderId: 10,
  Label: 'Fertiliser',
  FieldKey: 'ExpenseFertiliser',
  Description: 'All NPKS fertilisers and trace element fertiliser products and compounds including blending and mixing, cartage, bin hire and spreading less any fertiliser rebates'
}, {
  Id: 11,
  OrderId: 11,
  Label: 'Total Fertiliser Applied - tonnes',
  FieldKey: 'FertiliserTonnesAppliedTotal',
  Description: 'Total tonnage of all fertilisers applied to the farm'
}, {
  Id: 12,
  OrderId: 12,
  Label: 'Fertiliser Type',
  FieldKey: 'FertiliserTypeId ',
  Description: 'Fertiliser type applied'
}, {
  Id: 13,
  OrderId: 13,
  Label: 'Tonnes Applied',
  FieldKey: 'TonnesApplied ',
  Description: 'Tonnes of fertiliser applied'
}, {
  Id: 14,
  OrderId: 14,
  Label: 'Annual Water Use',
  FieldKey: 'WaterIrrigationTotalML',
  Description: 'Total megalitres of irrigation water applied to the total usable farm area'
}, {
  Id: 15,
  OrderId: 15,
  Label: 'Water Purchase',
  FieldKey: 'ExpenseWaterPurchase',
  Description: 'Temporary water purchased cost'
}, {
  Id: 16,
  OrderId: 16,
  Label: 'Other Irrigation Costs',
  FieldKey: 'ExpenseIrrigationOther',
  Description: 'Irrigation - Water costs, including water rights, pumping costs and rates for supply and drainage'
}, {
  Id: 17,
  OrderId: 17,
  Label: 'Total Water Cost',
  FieldKey: 'ExpenseIrrigation',
  Description: 'Total water costs including temporary water purchases and all other irrigation costs'
}, {
  Id: 18,
  OrderId: 18,
  Label: '$ / ML Water Applied',
  FieldKey: 'ExpenseIrrigationPerMlApplied',
  Description: 'Total irrigation expense per megalitre of water applied'
}, {
  Id: 19,
  OrderId: 19,
  Label: 'Fodder Purchase',
  FieldKey: 'ExpenseFodderPurchase',
  Description: 'Total purchased fodder expense'
}, {
  Id: 20,
  OrderId: 20,
  Label: 'Concentrates Purchase',
  FieldKey: 'ExpenseConcentratesPurchase',
  Description: 'Total purchased concentrate expense'
}, {
  Id: 21,
  OrderId: 21,
  Label: 'Other Feed Purchase',
  FieldKey: 'ExpenseOtherFeedPurchase',
  Description: 'Total expense for other purchased feeds. This excludes concentrates and fodder'
}, {
  Id: 22,
  OrderId: 22,
  Label: '$ Value Financial Detail',
  FieldKey: 'ExpenseFeedPurchaseTotal',
  Description: 'Total $ value for each feed as entered in the Financial - Variable costs section in the source dataset'
}, {
  Id: 23,
  OrderId: 23,
  Label: 'Fodder Purchase',
  FieldKey: 'ExpenseFodderPhysicalPurchase',
  Description: 'Total purchased fodder expense'
}, {
  Id: 24,
  OrderId: 24,
  Label: 'Concentrates Purchase',
  FieldKey: 'ExpenseConcentratesPhysicalPurchase',
  Description: 'Total purchased concentrate expense'
}, {
  Id: 25,
  OrderId: 25,
  Label: 'Other Feed Purchase',
  FieldKey: 'ExpenseOtherFeedPhysicalPurchase',
  Description: 'Total expense for other purchased feeds. This excludes concentrates and fodder'
}, {
  Id: 26,
  OrderId: 26,
  Label: '$ Value Physical Detail',
  FieldKey: 'ExpenseFeedPhysicalPurchaseTotal',
  Description: 'Total $ value for each feed based on the combined quantities purchased and purchase price per tonne for each feed type as entered in the Physical - Feed tab for the historical dataset'
}, {
  Id: 27,
  OrderId: 27,
  Label: 'Fodder Purchase - tDM',
  FieldKey: 'FeedPurchasedFodderTDM',
  Description: 'Total tonnes dry matter of fodder purchased'
}, {
  Id: 28,
  OrderId: 28,
  Label: 'Concentrates Purchase - tDM',
  FieldKey: 'FeedPurchasedConcTDM',
  Description: 'Total tonnes dry matter of cocentrates purchased'
}, {
  Id: 29,
  OrderId: 29,
  Label: 'Other Feed Purchase - tDM',
  FieldKey: 'FeedPurchasedOtherTDM',
  Description: 'Total tonnes dry matter of byproducts and other feeds purchased'
}, {
  Id: 30,
  OrderId: 30,
  Label: 'Total Feed Purchases - tDM',
  FieldKey: 'FeedPurchasedTotalTDM',
  Description: 'Total tonnes dry matter of all feeds purchased'
}, {
  Id: 31,
  OrderId: 31,
  Label: 'Average Fodder Price - $ / tDM',
  FieldKey: 'FeedFodderCostPerTDM',
  Description: 'The cost per tonne dry matter of purchased fodder'
}, {
  Id: 32,
  OrderId: 32,
  Label: 'Average Concentrate Price - $ / tDM',
  FieldKey: 'FeedConcCostPerTDM',
  Description: 'The cost per tonne dry matter of purchased concentrates'
}, {
  Id: 33,
  OrderId: 33,
  Label: 'Average Other Feed Price - $ / tDM',
  FieldKey: 'FeedOtherCostPerTDM',
  Description: 'The cost per tonne dry matter of other purchased feed'
}, {
  Id: 34,
  OrderId: 34,
  Label: 'Average Price of All Feeds - $ / tDM',
  FieldKey: 'FeedTotalCostPerTDM',
  Description: 'The total cost per tonne dry matter of purchased feed'
}, {
  Id: 35,
  OrderId: 35,
  Label: 'Average Fodder Price - $ / tDM',
  FieldKey: 'FeedFodderPhysicalCostPerTDM',
  Description: 'The cost per tonne dry matter of purchased fodder'
}, {
  Id: 36,
  OrderId: 36,
  Label: 'Average Concentrate Price - $ / tDM',
  FieldKey: 'FeedConcPhysicalPurchaseCostPerTDM',
  Description: 'The cost per tonne dry matter of purchased concentrates'
}, {
  Id: 37,
  OrderId: 37,
  Label: 'Average Other Feed Price - $ / tDM',
  FieldKey: 'FeedOtherPhysicalPurchaseCostPerTDM',
  Description: 'The cost per tonne dry matter of other purchased feed'
}, {
  Id: 38,
  OrderId: 38,
  Label: 'Average Price of All Feeds - $ / tDM',
  FieldKey: 'FeedTotalPhysicalCostPerTDM',
  Description: 'The total cost per tonne dry matter of purchased feed'
}, {
  Id: 39,
  OrderId: 39,
  Label: 'Feed Type',
  FieldKey: 'FeedTypeId ',
  Description: 'Type of feed'
}, {
  Id: 40,
  OrderId: 40,
  Label: 'Feed Group',
  FieldKey: 'FeedGroupId ',
  Description: 'Feed group - Concentrates, Silage, Hay or Other'
}, {
  Id: 41,
  OrderId: 41,
  Label: 'Feed Cost Group',
  FieldKey: 'FeedCostGroupKey ',
  Description: 'Feed cost group - Concentrates, Fodder or Other'
}, {
  Id: 42,
  OrderId: 42,
  Label: 'As Is or Dry Matter Switch',
  FieldKey: 'SwitchAsIsTdm ',
  Description: 'Switch for selection of declaration of feed tonnes as Dry Matter Basis or As Fed'
}, {
  Id: 43,
  OrderId: 43,
  Label: 'Tonnes Purchased',
  FieldKey: 'QuantityPurchased ',
  Description: 'Tonnes of feed purchased'
}, {
  Id: 44,
  OrderId: 44,
  Label: '$ / Tonne',
  FieldKey: 'PricePerTonne ',
  Description: 'Feed price as dollars per tonne.'
}, {
  Id: 45,
  OrderId: 45,
  Label: 'Tonnes Dry Matter Purchased',
  FieldKey: 'QuantityPurchasedTDM ',
  Description: 'Tonnes of feed purchased expressed as tonnes of dry matter'
}, {
  Id: 46,
  OrderId: 46,
  Label: 'Feed Purchase Cost',
  FieldKey: 'FeedPurchaseCost ',
  Description: 'Cost of feed purchase = Tonnes Purchased x Feed Price'
}, {
  Id: 47,
  OrderId: 47,
  Label: 'Other Farm Income',
  FieldKey: 'IncomeFarmCashTotalAdjustment',
  Description: 'Other farm cash income excluding milk and net livestock sales'
}, {
  Id: 48,
  OrderId: 48,
  Label: 'Total Farm Cash Income',
  FieldKey: 'IncomeFarmCashTotal',
  Description: 'Total farm cash income which is the total of net milk income, net livestock sales, feed sales and other farm income'
}, {
  Id: 49,
  OrderId: 49,
  Label: 'Other Farm Cash Expenses',
  FieldKey: 'ExpenseFarmWorkingAdjustment',
  Description: 'Other farm cash expenses excluding purchased feed, water and fertiliser'
}, {
  Id: 50,
  OrderId: 50,
  Label: 'Total Farm Working Expenses',
  FieldKey: 'ExpenseFarmWorking',
  Description: 'Total farm working expeneses which includes variable costs and cash overheads'
}, {
  Id: 51,
  OrderId: 51,
  Label: 'Farm Operating Cash Surplus',
  FieldKey: 'CashFlowFarmOperatingSurplus',
  Description: 'Farm operating cash surplus is calculated from total farm cash income less total farm working expenses'
}].reduce(function (__obj, item) {
  __obj[item.FieldKey] = item;
  return __obj;
}, {});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/data/ccProperties/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 442 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

// version="3.20.0"

module.exports = function () {
  var d;
  window.AmCharts ? d = window.AmCharts : (d = {}, window.AmCharts = d, d.themes = {}, d.maps = {}, d.inheriting = {}, d.charts = [], d.onReadyArray = [], d.useUTC = !1, d.updateRate = 60, d.uid = 0, d.lang = {}, d.translations = {}, d.mapTranslations = {}, d.windows = {}, d.initHandlers = [], d.amString = 'am', d.pmString = 'pm');
  d.Class = function (a) {
    var b = function b() {
      arguments[0] !== d.inheriting && (this.events = {}, this.construct.apply(this, arguments));
    };
    a.inherits ? (b.prototype = new a.inherits(d.inheriting), b.base = a.inherits.prototype, delete a.inherits) : (b.prototype.createEvents = function () {
      for (var a = 0; a < arguments.length; a++) {
        this.events[arguments[a]] = [];
      }
    }, b.prototype.listenTo = function (a, b, c) {
      this.removeListener(a, b, c);
      a.events[b].push({ handler: c, scope: this });
    }, b.prototype.addListener = function (a, b, c) {
      this.removeListener(this, a, b);
      a && this.events[a] && this.events[a].push({ handler: b, scope: c });
    }, b.prototype.removeListener = function (a, b, c) {
      if (a && a.events && (a = a.events[b])) for (b = a.length - 1; 0 <= b; b--) {
        a[b].handler === c && a.splice(b, 1);
      }
    }, b.prototype.fire = function (a) {
      for (var b = this.events[a.type], c = 0; c < b.length; c++) {
        var d = b[c];
        d.handler.call(d.scope, a);
      }
    });
    for (var c in a) {
      b.prototype[c] = a[c];
    }return b;
  };
  d.addChart = function (a) {
    window.requestAnimationFrame ? d.animationRequested || (d.animationRequested = !0, window.requestAnimationFrame(d.update)) : d.updateInt || (d.updateInt = setInterval(function () {
      d.update();
    }, Math.round(1e3 / d.updateRate)));
    d.charts.push(a);
  };
  d.removeChart = function (a) {
    for (var b = d.charts, c = b.length - 1; 0 <= c; c--) {
      b[c] == a && b.splice(c, 1);
    }0 === b.length && d.updateInt && (clearInterval(d.updateInt), d.updateInt = NaN);
  };
  d.isModern = !0;
  d.getIEVersion = function () {
    var a = 0,
        b,
        c;
    'Microsoft Internet Explorer' == navigator.appName && (b = navigator.userAgent, c = /MSIE ([0-9]{1,}[.0-9]{0,})/, null !== c.exec(b) && (a = parseFloat(RegExp.$1)));
    return a;
  };
  d.applyLang = function (a, b) {
    var c = d.translations;
    b.dayNames = d.extend({}, d.dayNames);
    b.shortDayNames = d.extend({}, d.shortDayNames);
    b.monthNames = d.extend({}, d.monthNames);
    b.shortMonthNames = d.extend({}, d.shortMonthNames);
    b.amString = 'am';
    b.pmString = 'pm';
    c && (c = c[a]) && (d.lang = c, c.monthNames && (b.dayNames = d.extend({}, c.dayNames), b.shortDayNames = d.extend({}, c.shortDayNames), b.monthNames = d.extend({}, c.monthNames), b.shortMonthNames = d.extend({}, c.shortMonthNames)), c.am && (b.amString = c.am), c.pm && (b.pmString = c.pm));
    d.amString = b.amString;
    d.pmString = b.amString;
  };
  d.IEversion = d.getIEVersion();
  9 > d.IEversion && 0 < d.IEversion && (d.isModern = !1, d.isIE = !0);
  d.dx = 0;
  d.dy = 0;
  if (document.addEventListener || window.opera) d.isNN = !0, d.isIE = !1, d.dx = 0.5, d.dy = 0.5;
  document.attachEvent && (d.isNN = !1, d.isIE = !0, d.isModern || (d.dx = 0, d.dy = 0));
  window.chrome && (d.chrome = !0);
  d.handleMouseUp = function (a) {
    for (var b = d.charts, c = 0; c < b.length; c++) {
      var e = b[c];
      e && e.handleReleaseOutside && e.handleReleaseOutside(a);
    }
  };
  d.handleMouseMove = function (a) {
    for (var b = d.charts, c = 0; c < b.length; c++) {
      var e = b[c];
      e && e.handleMouseMove && e.handleMouseMove(a);
    }
  };
  d.handleWheel = function (a) {
    for (var b = d.charts, c = 0; c < b.length; c++) {
      var e = b[c];
      if (e && e.mouseIsOver) {
        e.mouseWheelScrollEnabled || e.mouseWheelZoomEnabled ? e.handleWheel && e.handleWheel(a) : a.stopPropagation && a.stopPropagation();
        break;
      }
    }
  };
  d.resetMouseOver = function () {
    for (var a = d.charts, b = 0; b < a.length; b++) {
      var c = a[b];
      c && (c.mouseIsOver = !1);
    }
  };
  d.ready = function (a) {
    d.onReadyArray.push(a);
  };
  d.handleLoad = function () {
    d.isReady = !0;
    for (var a = d.onReadyArray, b = 0; b < a.length; b++) {
      var c = a[b];
      isNaN(d.processDelay) ? c() : setTimeout(c, d.processDelay * b);
    }
  };
  d.addInitHandler = function (a, b) {
    d.initHandlers.push({ method: a, types: b });
  };
  d.callInitHandler = function (a) {
    var b = d.initHandlers;
    if (d.initHandlers) for (var c = 0; c < b.length; c++) {
      var e = b[c];
      e.types ? d.isInArray(e.types, a.type) && e.method(a) : e.method(a);
    }
  };
  d.getUniqueId = function () {
    d.uid++;
    return 'AmChartsEl-' + d.uid;
  };
  d.isNN && (document.addEventListener('mousemove', d.handleMouseMove), document.addEventListener('mouseup', d.handleMouseUp, !0), window.addEventListener('load', d.handleLoad, !0), window.addEventListener('DOMMouseScroll', d.handleWheel, !0), document.addEventListener('mousewheel', d.handleWheel, !0));
  d.isIE && (document.attachEvent('onmousemove', d.handleMouseMove), document.attachEvent('onmouseup', d.handleMouseUp), window.attachEvent('onload', d.handleLoad), document.attachEvent('onmousewheel', d.handleWheel));
  d.clear = function () {
    var a = d.charts;
    if (a) for (var b = a.length - 1; 0 <= b; b--) {
      a[b].clear();
    }d.updateInt && clearInterval(d.updateInt);
    d.charts = [];
    d.isNN && (document.removeEventListener('mousemove', d.handleMouseMove, !0), document.removeEventListener('mouseup', d.handleMouseUp, !0), window.removeEventListener('load', d.handleLoad, !0), window.removeEventListener('DOMMouseScroll', d.handleWheel, !0), document.removeEventListener('mousewheel', d.handleWheel, !0));
    d.isIE && (document.detachEvent('onmousemove', d.handleMouseMove), document.detachEvent('onmouseup', d.handleMouseUp), window.detachEvent('onload', d.handleLoad));
  };
  d.makeChart = function (a, b, c) {
    var e = b.type,
        h = b.theme;
    d.isString(h) && (h = d.themes[h], b.theme = h);
    var f;
    switch (e) {
      case 'serial':
        f = new d.AmSerialChart(h);
        break;
      case 'xy':
        f = new d.AmXYChart(h);
        break;
      case 'pie':
        f = new d.AmPieChart(h);
        break;
      case 'radar':
        f = new d.AmRadarChart(h);
        break;
      case 'gauge':
        f = new d.AmAngularGauge(h);
        break;
      case 'funnel':
        f = new d.AmFunnelChart(h);
        break;
      case 'map':
        f = new d.AmMap(h);
        break;
      case 'stock':
        f = new d.AmStockChart(h);
        break;
      case 'gantt':
        f = new d.AmGanttChart(h);
    }
    d.extend(f, b);
    d.isReady ? isNaN(c) ? f.write(a) : setTimeout(function () {
      d.realWrite(f, a);
    }, c) : d.ready(function () {
      isNaN(c) ? f.write(a) : setTimeout(function () {
        d.realWrite(f, a);
      }, c);
    });
    return f;
  };
  d.realWrite = function (a, b) {
    a.write(b);
  };
  d.updateCount = 0;
  d.validateAt = Math.round(d.updateRate / 10);
  d.update = function () {
    var a = d.charts;
    d.updateCount++;
    var b = !1;
    d.updateCount == d.validateAt && (b = !0, d.updateCount = 0);
    if (a) for (var c = a.length - 1; 0 <= c; c--) {
      a[c].update && a[c].update(), b && (a[c].autoResize ? a[c].validateSize && a[c].validateSize() : a[c].premeasure && a[c].premeasure());
    }window.requestAnimationFrame && window.requestAnimationFrame(d.update);
  };
  d.bezierX = 3;
  d.bezierY = 6;
  'complete' == document.readyState && d.handleLoad();
}();(function () {
  var d = window.AmCharts;
  d.toBoolean = function (a, b) {
    if (void 0 === a) return b;
    switch (String(a).toLowerCase()) {
      case 'true':
      case 'yes':
      case '1':
        return !0;
      case 'false':
      case 'no':
      case '0':
      case null:
        return !1;
      default:
        return !!a;
    }
  };
  d.removeFromArray = function (a, b) {
    var c;
    if (void 0 !== b && void 0 !== a) for (c = a.length - 1; 0 <= c; c--) {
      a[c] == b && a.splice(c, 1);
    }
  };
  d.getPath = function () {
    var a = document.getElementsByTagName('script');
    if (a) for (var b = 0; b < a.length; b++) {
      var c = a[b].src;
      if (-1 !== c.search(/\/(amcharts|ammap)\.js/)) return c.replace(/\/(amcharts|ammap)\.js.*/, '/');
    }
  };
  d.normalizeUrl = function (a) {
    return '' !== a && -1 === a.search(/\/$/) ? a + '/' : a;
  };
  d.isAbsolute = function (a) {
    return 0 === a.search(/^http[s]?:|^\//);
  };
  d.isInArray = function (a, b) {
    for (var c = 0; c < a.length; c++) {
      if (a[c] == b) return !0;
    }return !1;
  };
  d.getDecimals = function (a) {
    var b = 0;
    isNaN(a) || (a = String(a), -1 != a.indexOf('e-') ? b = Number(a.split('-')[1]) : -1 != a.indexOf('.') && (b = a.split('.')[1].length));
    return b;
  };
  d.wordwrap = function (a, b, c, e) {
    var h, f, g, k;
    a += '';
    if (1 > b) return a;
    h = -1;
    for (a = (k = a.split(/\r\n|\n|\r/)).length; ++h < a; k[h] += g) {
      g = k[h];
      for (k[h] = ''; g.length > b; k[h] += d.trim(g.slice(0, f)) + ((g = g.slice(f)).length ? c : '')) {
        f = 2 == e || (f = g.slice(0, b + 1).match(/\S*(\s)?$/))[1] ? b : f.input.length - f[0].length || 1 == e && b || f.input.length + (f = g.slice(b).match(/^\S*/))[0].length;
      }g = d.trim(g);
    }
    return k.join(c);
  };
  d.trim = function (a) {
    return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
  };
  d.wrappedText = function (a, b, c, e, h, f, g, k) {
    var l = d.text(a, b, c, e, h, f, g);
    if (l) {
      var m = l.getBBox();
      if (m.width > k) {
        var n = '\n';
        d.isModern || (n = '<br>');
        k = Math.floor(k / (m.width / b.length));
        2 < k && (k -= 2);
        b = d.wordwrap(b, k, n, !0);
        l.remove();
        l = d.text(a, b, c, e, h, f, g);
      }
    }
    return l;
  };
  d.getStyle = function (a, b) {
    var c = '';
    if (document.defaultView && document.defaultView.getComputedStyle) try {
      c = document.defaultView.getComputedStyle(a, '').getPropertyValue(b);
    } catch (e) {} else a.currentStyle && (b = b.replace(/\-(\w)/g, function (a, b) {
      return b.toUpperCase();
    }), c = a.currentStyle[b]);
    return c;
  };
  d.removePx = function (a) {
    if (void 0 !== a) return Number(a.substring(0, a.length - 2));
  };
  d.getURL = function (a, b) {
    if (a) if ('_self' != b && b) {
      if ('_top' == b && window.top) window.top.location.href = a;else if ('_parent' == b && window.parent) window.parent.location.href = a;else if ('_blank' == b) window.open(a);else {
        var c = document.getElementsByName(b)[0];
        c ? c.src = a : (c = d.windows[b]) ? c.opener && !c.opener.closed ? c.location.href = a : d.windows[b] = window.open(a) : d.windows[b] = window.open(a);
      }
    } else window.location.href = a;
  };
  d.ifArray = function (a) {
    return a && 'object' == (typeof a === 'undefined' ? 'undefined' : _typeof(a)) && 0 < a.length ? !0 : !1;
  };
  d.callMethod = function (a, b) {
    var c;
    for (c = 0; c < b.length; c++) {
      var e = b[c];
      if (e) {
        if (e[a]) e[a]();
        var d = e.length;
        if (0 < d) {
          var f;
          for (f = 0; f < d; f++) {
            var g = e[f];
            if (g && g[a]) g[a]();
          }
        }
      }
    }
  };
  d.toNumber = function (a) {
    return 'number' == typeof a ? a : Number(String(a).replace(/[^0-9\-.]+/g, ''));
  };
  d.toColor = function (a) {
    if ('' !== a && void 0 !== a) if (-1 != a.indexOf(',')) {
      a = a.split(',');
      var b;
      for (b = 0; b < a.length; b++) {
        var c = a[b].substring(a[b].length - 6, a[b].length);
        a[b] = '#' + c;
      }
    } else a = a.substring(a.length - 6, a.length), a = '#' + a;
    return a;
  };
  d.toCoordinate = function (a, b, c) {
    var e;
    void 0 !== a && (a = String(a), c && c < b && (b = c), e = Number(a), -1 != a.indexOf('!') && (e = b - Number(a.substr(1))), -1 != a.indexOf('%') && (e = b * Number(a.substr(0, a.length - 1)) / 100));
    return e;
  };
  d.fitToBounds = function (a, b, c) {
    a < b && (a = b);
    a > c && (a = c);
    return a;
  };
  d.isDefined = function (a) {
    return void 0 === a ? !1 : !0;
  };
  d.stripNumbers = function (a) {
    return a.replace(/[0-9]+/g, '');
  };
  d.roundTo = function (a, b) {
    if (0 > b) return a;
    var c = Math.pow(10, b);
    return Math.round(a * c) / c;
  };
  d.toFixed = function (a, b) {
    var c = String(Math.round(a * Math.pow(10, b)));
    if (0 < b) {
      var e = c.length;
      if (e < b) {
        var d;
        for (d = 0; d < b - e; d++) {
          c = '0' + c;
        }
      }
      e = c.substring(0, c.length - b);
      '' === e && (e = 0);
      return e + '.' + c.substring(c.length - b, c.length);
    }
    return String(c);
  };
  d.formatDuration = function (a, b, c, e, h, f) {
    var g = d.intervals,
        k = f.decimalSeparator;
    if (a >= g[b].contains) {
      var l = a - Math.floor(a / g[b].contains) * g[b].contains;
      'ss' == b ? (l = d.formatNumber(l, f), 1 == l.split(k)[0].length && (l = '0' + l)) : l = d.roundTo(l, f.precision);('mm' == b || 'hh' == b) && 10 > l && (l = '0' + l);
      c = l + '' + e[b] + '' + c;
      a = Math.floor(a / g[b].contains);
      b = g[b].nextInterval;
      return d.formatDuration(a, b, c, e, h, f);
    }
    'ss' == b && (a = d.formatNumber(a, f), 1 == a.split(k)[0].length && (a = '0' + a));('mm' == b || 'hh' == b) && 10 > a && (a = '0' + a);
    c = a + '' + e[b] + '' + c;
    if (g[h].count > g[b].count) for (a = g[b].count; a < g[h].count; a++) {
      b = g[b].nextInterval, 'ss' == b || 'mm' == b || 'hh' == b ? c = '00' + e[b] + '' + c : 'DD' == b && (c = '0' + e[b] + '' + c);
    }':' == c.charAt(c.length - 1) && (c = c.substring(0, c.length - 1));
    return c;
  };
  d.formatNumber = function (a, b, c, e, h) {
    a = d.roundTo(a, b.precision);
    isNaN(c) && (c = b.precision);
    var f = b.decimalSeparator;
    b = b.thousandsSeparator;
    var g;
    g = 0 > a ? '-' : '';
    a = Math.abs(a);
    var k = String(a),
        l = !1;-1 != k.indexOf('e') && (l = !0);
    0 <= c && !l && (k = d.toFixed(a, c));
    var m = '';
    if (l) m = k;else {
      var k = k.split('.'),
          l = String(k[0]),
          n;
      for (n = l.length; 0 <= n; n -= 3) {
        m = n != l.length ? 0 !== n ? l.substring(n - 3, n) + b + m : l.substring(n - 3, n) + m : l.substring(n - 3, n);
      }void 0 !== k[1] && (m = m + f + k[1]);
      void 0 !== c && 0 < c && '0' != m && (m = d.addZeroes(m, f, c));
    }
    m = g + m;
    '' === g && !0 === e && 0 !== a && (m = '+' + m);
    !0 === h && (m += '%');
    return m;
  };
  d.addZeroes = function (a, b, c) {
    a = a.split(b);
    void 0 === a[1] && 0 < c && (a[1] = '0');
    return a[1].length < c ? (a[1] += '0', d.addZeroes(a[0] + b + a[1], b, c)) : void 0 !== a[1] ? a[0] + b + a[1] : a[0];
  };
  d.scientificToNormal = function (a) {
    var b;
    a = String(a).split('e');
    var c;
    if ('-' == a[1].substr(0, 1)) {
      b = '0.';
      for (c = 0; c < Math.abs(Number(a[1])) - 1; c++) {
        b += '0';
      }b += a[0].split('.').join('');
    } else {
      var e = 0;
      b = a[0].split('.');
      b[1] && (e = b[1].length);
      b = a[0].split('.').join('');
      for (c = 0; c < Math.abs(Number(a[1])) - e; c++) {
        b += '0';
      }
    }
    return b;
  };
  d.toScientific = function (a, b) {
    if (0 === a) return '0';
    var c = Math.floor(Math.log(Math.abs(a)) * Math.LOG10E),
        e = String(e).split('.').join(b);
    return String(e) + 'e' + c;
  };
  d.randomColor = function () {
    return '#' + ('00000' + (16777216 * Math.random() << 0).toString(16)).substr(-6);
  };
  d.hitTest = function (a, b, c) {
    var e = !1,
        h = a.x,
        f = a.x + a.width,
        g = a.y,
        k = a.y + a.height,
        l = d.isInRectangle;
    e || (e = l(h, g, b));
    e || (e = l(h, k, b));
    e || (e = l(f, g, b));
    e || (e = l(f, k, b));
    e || !0 === c || (e = d.hitTest(b, a, !0));
    return e;
  };
  d.isInRectangle = function (a, b, c) {
    return a >= c.x - 5 && a <= c.x + c.width + 5 && b >= c.y - 5 && b <= c.y + c.height + 5 ? !0 : !1;
  };
  d.isPercents = function (a) {
    if (-1 != String(a).indexOf('%')) return !0;
  };
  d.formatValue = function (a, b, c, e, h, f, g, k) {
    if (b) {
      void 0 === h && (h = '');
      var l;
      for (l = 0; l < c.length; l++) {
        var m = c[l],
            n = b[m];
        void 0 !== n && (n = f ? d.addPrefix(n, k, g, e) : d.formatNumber(n, e), a = a.replace(new RegExp('\\[\\[' + h + '' + m + '\\]\\]', 'g'), n));
      }
    }
    return a;
  };
  d.formatDataContextValue = function (a, b) {
    if (a) {
      var c = a.match(/\[\[.*?\]\]/g),
          e;
      for (e = 0; e < c.length; e++) {
        var d = c[e],
            d = d.substr(2, d.length - 4);
        void 0 !== b[d] && (a = a.replace(new RegExp('\\[\\[' + d + '\\]\\]', 'g'), b[d]));
      }
    }
    return a;
  };
  d.massReplace = function (a, b) {
    for (var c in b) {
      if (b.hasOwnProperty(c)) {
        var e = b[c];
        void 0 === e && (e = '');
        a = a.replace(c, e);
      }
    }return a;
  };
  d.cleanFromEmpty = function (a) {
    return a.replace(/\[\[[^\]]*\]\]/g, '');
  };
  d.addPrefix = function (a, b, c, e, h) {
    var f = d.formatNumber(a, e),
        g = '',
        k,
        l,
        m;
    if (0 === a) return '0';
    0 > a && (g = '-');
    a = Math.abs(a);
    if (1 < a) for (k = b.length - 1; -1 < k; k--) {
      if (a >= b[k].number && (l = a / b[k].number, m = Number(e.precision), 1 > m && (m = 1), c = d.roundTo(l, m), m = d.formatNumber(c, {
        precision: -1,
        decimalSeparator: e.decimalSeparator,
        thousandsSeparator: e.thousandsSeparator
      }), !h || l == c)) {
        f = g + '' + m + '' + b[k].prefix;
        break;
      }
    } else for (k = 0; k < c.length; k++) {
      if (a <= c[k].number) {
        l = a / c[k].number;
        m = Math.abs(Math.floor(Math.log(l) * Math.LOG10E));
        l = d.roundTo(l, m);
        f = g + '' + l + '' + c[k].prefix;
        break;
      }
    }return f;
  };
  d.remove = function (a) {
    a && a.remove();
  };
  d.getEffect = function (a) {
    '>' == a && (a = 'easeOutSine');
    '<' == a && (a = 'easeInSine');
    'elastic' == a && (a = 'easeOutElastic');
    return a;
  };
  d.getObjById = function (a, b) {
    var c, e;
    for (e = 0; e < a.length; e++) {
      var d = a[e];
      if (d.id == b) {
        c = d;
        break;
      }
    }
    return c;
  };
  d.applyTheme = function (a, b, c) {
    b || (b = d.theme);
    b && b[c] && d.extend(a, b[c]);
  };
  d.isString = function (a) {
    return 'string' == typeof a ? !0 : !1;
  };
  d.extend = function (a, b, c) {
    var e;
    a || (a = {});
    for (e in b) {
      c ? a.hasOwnProperty(e) || (a[e] = b[e]) : a[e] = b[e];
    }return a;
  };
  d.copyProperties = function (a, b) {
    for (var c in a) {
      a.hasOwnProperty(c) && 'events' != c && void 0 !== a[c] && 'function' != typeof a[c] && 'cname' != c && (b[c] = a[c]);
    }
  };
  d.processObject = function (a, b, c, e) {
    if (!1 === a instanceof b && (a = e ? d.extend(new b(c), a) : d.extend(a, new b(c), !0), a.listeners)) for (var h in a.listeners) {
      b = a.listeners[h], a.addListener(b.event, b.method);
    }return a;
  };
  d.fixNewLines = function (a) {
    var b = RegExp('\\n', 'g');
    a && (a = a.replace(b, '<br />'));
    return a;
  };
  d.fixBrakes = function (a) {
    if (d.isModern) {
      var b = RegExp('<br>', 'g');
      a && (a = a.replace(b, '\n'));
    } else a = d.fixNewLines(a);
    return a;
  };
  d.deleteObject = function (a, b) {
    if (a) {
      if (void 0 === b || null === b) b = 20;
      if (0 !== b) if ('[object Array]' === Object.prototype.toString.call(a)) for (var c = 0; c < a.length; c++) {
        d.deleteObject(a[c], b - 1), a[c] = null;
      } else if (a && !a.tagName) try {
        for (c in a) {
          a[c] && ('object' == _typeof(a[c]) && d.deleteObject(a[c], b - 1), 'function' != typeof a[c] && (a[c] = null));
        }
      } catch (e) {}
    }
  };
  d.bounce = function (a, b, c, e, d) {
    return (b /= d) < 1 / 2.75 ? 7.5625 * e * b * b + c : b < 2 / 2.75 ? e * (7.5625 * (b -= 1.5 / 2.75) * b + 0.75) + c : b < 2.5 / 2.75 ? e * (7.5625 * (b -= 2.25 / 2.75) * b + 0.9375) + c : e * (7.5625 * (b -= 2.625 / 2.75) * b + 0.984375) + c;
  };
  d.easeInOutQuad = function (a, b, c, e, d) {
    b /= d / 2;
    if (1 > b) return e / 2 * b * b + c;
    b--;
    return -e / 2 * (b * (b - 2) - 1) + c;
  };
  d.easeInSine = function (a, b, c, e, d) {
    return -e * Math.cos(b / d * (Math.PI / 2)) + e + c;
  };
  d.easeOutSine = function (a, b, c, e, d) {
    return e * Math.sin(b / d * (Math.PI / 2)) + c;
  };
  d.easeOutElastic = function (a, b, c, e, d) {
    a = 1.70158;
    var f = 0,
        g = e;
    if (0 === b) return c;
    if (1 == (b /= d)) return c + e;
    f || (f = 0.3 * d);
    g < Math.abs(e) ? (g = e, a = f / 4) : a = f / (2 * Math.PI) * Math.asin(e / g);
    return g * Math.pow(2, -10 * b) * Math.sin(2 * (b * d - a) * Math.PI / f) + e + c;
  };
  d.fixStepE = function (a) {
    a = a.toExponential(0).split('e');
    var b = Number(a[1]);
    9 == Number(a[0]) && b++;
    return d.generateNumber(1, b);
  };
  d.generateNumber = function (a, b) {
    var c = '',
        e;
    e = 0 > b ? Math.abs(b) - 1 : Math.abs(b);
    var d;
    for (d = 0; d < e; d++) {
      c += '0';
    }return 0 > b ? Number('0.' + c + String(a)) : Number(String(a) + c);
  };
  d.setCN = function (a, b, c, e) {
    if (a.addClassNames && b && (b = b.node) && c) {
      var d = b.getAttribute('class');
      a = a.classNamePrefix + '-';
      e && (a = '');
      d ? b.setAttribute('class', d + ' ' + a + c) : b.setAttribute('class', a + c);
    }
  };
  d.parseDefs = function (a, b) {
    for (var c in a) {
      var e = _typeof(a[c]);
      if (0 < a[c].length && 'object' == e) for (var h = 0; h < a[c].length; h++) {
        e = document.createElementNS(d.SVG_NS, c), b.appendChild(e), d.parseDefs(a[c][h], e);
      } else 'object' == e ? (e = document.createElementNS(d.SVG_NS, c), b.appendChild(e), d.parseDefs(a[c], e)) : b.setAttribute(c, a[c]);
    }
  };
})();(function () {
  var d = window.AmCharts;
  d.AxisBase = d.Class({
    construct: function construct(a) {
      this.createEvents('clickItem', 'rollOverItem', 'rollOutItem');
      this.titleDY = this.y = this.x = this.dy = this.dx = 0;
      this.axisThickness = 1;
      this.axisColor = '#000000';
      this.axisAlpha = 1;
      this.gridCount = this.tickLength = 5;
      this.gridAlpha = 0.15;
      this.gridThickness = 1;
      this.gridColor = '#000000';
      this.dashLength = 0;
      this.labelFrequency = 1;
      this.showLastLabel = this.showFirstLabel = !0;
      this.fillColor = '#FFFFFF';
      this.fillAlpha = 0;
      this.labelsEnabled = !0;
      this.labelRotation = 0;
      this.autoGridCount = !0;
      this.offset = 0;
      this.guides = [];
      this.visible = !0;
      this.counter = 0;
      this.guides = [];
      this.ignoreAxisWidth = this.inside = !1;
      this.minHorizontalGap = 75;
      this.minVerticalGap = 35;
      this.titleBold = !0;
      this.minorGridEnabled = !1;
      this.minorGridAlpha = 0.07;
      this.autoWrap = !1;
      this.titleAlign = 'middle';
      this.labelOffset = 0;
      this.bcn = 'axis-';
      this.centerLabels = !1;
      this.firstDayOfWeek = 1;
      this.centerLabelOnFullPeriod = this.markPeriodChange = this.boldPeriodBeginning = !0;
      this.periods = [{ period: 'ss', count: 1 }, { period: 'ss', count: 5 }, { period: 'ss', count: 10 }, { period: 'ss', count: 30 }, { period: 'mm', count: 1 }, { period: 'mm', count: 5 }, { period: 'mm', count: 10 }, { period: 'mm', count: 30 }, { period: 'hh', count: 1 }, { period: 'hh', count: 3 }, { period: 'hh', count: 6 }, { period: 'hh', count: 12 }, { period: 'DD', count: 1 }, { period: 'DD', count: 2 }, { period: 'DD', count: 3 }, { period: 'DD', count: 4 }, { period: 'DD', count: 5 }, { period: 'WW', count: 1 }, { period: 'MM', count: 1 }, { period: 'MM', count: 2 }, { period: 'MM', count: 3 }, { period: 'MM', count: 6 }, { period: 'YYYY', count: 1 }, { period: 'YYYY', count: 2 }, { period: 'YYYY', count: 5 }, { period: 'YYYY', count: 10 }, { period: 'YYYY', count: 50 }, { period: 'YYYY', count: 100 }];
      this.dateFormats = [{ period: 'fff', format: 'JJ:NN:SS' }, { period: 'ss', format: 'JJ:NN:SS' }, { period: 'mm', format: 'JJ:NN' }, { period: 'hh', format: 'JJ:NN' }, { period: 'DD', format: 'MMM DD' }, { period: 'WW', format: 'MMM DD' }, { period: 'MM', format: 'MMM' }, { period: 'YYYY', format: 'YYYY' }];
      this.nextPeriod = {
        fff: 'ss',
        ss: 'mm',
        mm: 'hh',
        hh: 'DD',
        DD: 'MM',
        MM: 'YYYY'
      };
      d.applyTheme(this, a, 'AxisBase');
    },
    zoom: function zoom(a, b) {
      this.start = a;
      this.end = b;
      this.dataChanged = !0;
      this.draw();
    },
    fixAxisPosition: function fixAxisPosition() {
      var a = this.position;
      'H' == this.orientation ? ('left' == a && (a = 'bottom'), 'right' == a && (a = 'top')) : ('bottom' == a && (a = 'left'), 'top' == a && (a = 'right'));
      this.position = a;
    },
    init: function init() {
      this.createBalloon();
    },
    draw: function draw() {
      var a = this.chart;
      this.prevBY = this.prevBX = NaN;
      this.allLabels = [];
      this.counter = 0;
      this.destroy();
      this.fixAxisPosition();
      this.setBalloonBounds();
      this.labels = [];
      var b = a.container,
          c = b.set();
      a.gridSet.push(c);
      this.set = c;
      b = b.set();
      a.axesLabelsSet.push(b);
      this.labelsSet = b;
      this.axisLine = new this.axisRenderer(this);
      this.autoGridCount ? ('V' == this.orientation ? (a = this.height / this.minVerticalGap, 3 > a && (a = 3)) : a = this.width / this.minHorizontalGap, this.gridCountR = Math.max(a, 1)) : this.gridCountR = this.gridCount;
      this.axisWidth = this.axisLine.axisWidth;
      this.addTitle();
    },
    setOrientation: function setOrientation(a) {
      this.orientation = a ? 'H' : 'V';
    },
    addTitle: function addTitle() {
      var a = this.title;
      this.titleLabel = null;
      if (a) {
        var b = this.chart,
            c = this.titleColor;
        void 0 === c && (c = b.color);
        var e = this.titleFontSize;
        isNaN(e) && (e = b.fontSize + 1);
        a = d.text(b.container, a, c, b.fontFamily, e, this.titleAlign, this.titleBold);
        d.setCN(b, a, this.bcn + 'title');
        this.titleLabel = a;
      }
    },
    positionTitle: function positionTitle() {
      var a = this.titleLabel;
      if (a) {
        var b,
            c,
            e = this.labelsSet,
            h = {};
        0 < e.length() ? h = e.getBBox() : (h.x = 0, h.y = 0, h.width = this.width, h.height = this.height, d.VML && (h.y += this.y, h.x += this.x));
        e.push(a);
        var e = h.x,
            f = h.y;
        d.VML && (this.rotate ? e -= this.x : f -= this.y);
        var g = h.width,
            h = h.height,
            k = this.width,
            l = this.height,
            m = 0,
            n = a.getBBox().height / 2,
            q = this.inside,
            p = this.titleAlign;
        switch (this.position) {
          case 'top':
            b = 'left' == p ? -1 : 'right' == p ? k : k / 2;
            c = f - 10 - n;
            break;
          case 'bottom':
            b = 'left' == p ? -1 : 'right' == p ? k : k / 2;
            c = f + h + 10 + n;
            break;
          case 'left':
            b = e - 10 - n;
            q && (b -= 5);
            m = -90;
            c = ('left' == p ? l + 1 : 'right' == p ? -1 : l / 2) + this.titleDY;
            break;
          case 'right':
            ;b = e + g + 10 + n, q && (b += 7), c = ('left' == p ? l + 2 : 'right' == p ? -2 : l / 2) + this.titleDY, m = -90;
        }
        this.marginsChanged ? (a.translate(b, c), this.tx = b, this.ty = c) : a.translate(this.tx, this.ty);
        this.marginsChanged = !1;
        isNaN(this.titleRotation) || (m = this.titleRotation);
        0 !== m && a.rotate(m);
      }
    },
    pushAxisItem: function pushAxisItem(a, b) {
      var c = this,
          e = a.graphics();
      0 < e.length() && (b ? c.labelsSet.push(e) : c.set.push(e));
      if (e = a.getLabel()) this.labelsSet.push(e), e.click(function (b) {
        c.handleMouse(b, a, 'clickItem');
      }).mouseover(function (b) {
        c.handleMouse(b, a, 'rollOverItem');
      }).mouseout(function (b) {
        c.handleMouse(b, a, 'rollOutItem');
      });
    },
    handleMouse: function handleMouse(a, b, c) {
      this.fire({
        type: c,
        value: b.value,
        serialDataItem: b.serialDataItem,
        axis: this,
        target: b.label,
        chart: this.chart,
        event: a
      });
    },
    addGuide: function addGuide(a) {
      for (var b = this.guides, c = !1, e = b.length, h = 0; h < b.length; h++) {
        b[h] == a && (c = !0, e = h);
      }a = d.processObject(a, d.Guide, this.theme);
      a.id || (a.id = 'guideAuto' + e + '_' + new Date().getTime());
      c || b.push(a);
    },
    removeGuide: function removeGuide(a) {
      var b = this.guides,
          c;
      for (c = 0; c < b.length; c++) {
        b[c] == a && b.splice(c, 1);
      }
    },
    handleGuideOver: function handleGuideOver(a) {
      clearTimeout(this.chart.hoverInt);
      var b = a.graphics.getBBox(),
          c = this.x + b.x + b.width / 2,
          b = this.y + b.y + b.height / 2,
          e = a.fillColor;
      void 0 === e && (e = a.lineColor);
      this.chart.showBalloon(a.balloonText, e, !0, c, b);
    },
    handleGuideOut: function handleGuideOut() {
      this.chart.hideBalloon();
    },
    addEventListeners: function addEventListeners(a, b) {
      var c = this;
      a.mouseover(function () {
        c.handleGuideOver(b);
      });
      a.touchstart(function () {
        c.handleGuideOver(b);
      });
      a.mouseout(function () {
        c.handleGuideOut(b);
      });
    },
    getBBox: function getBBox() {
      var a;
      this.labelsSet && (a = this.labelsSet.getBBox());
      a ? d.VML || (a = {
        x: a.x + this.x,
        y: a.y + this.y,
        width: a.width,
        height: a.height
      }) : a = { x: 0, y: 0, width: 0, height: 0 };
      return a;
    },
    destroy: function destroy() {
      d.remove(this.set);
      d.remove(this.labelsSet);
      var a = this.axisLine;
      a && d.remove(a.axisSet);
      d.remove(this.grid0);
    },
    chooseMinorFrequency: function chooseMinorFrequency(a) {
      for (var b = 10; 0 < b; b--) {
        if (a / b == Math.round(a / b)) return a / b;
      }
    },
    parseDatesDraw: function parseDatesDraw() {
      var a,
          b = this.chart,
          c = this.showFirstLabel,
          e = this.showLastLabel,
          h,
          f = '',
          g = d.extractPeriod(this.minPeriod),
          k = d.getPeriodDuration(g.period, g.count),
          l,
          m,
          n,
          q,
          p,
          t = this.firstDayOfWeek,
          r = this.boldPeriodBeginning;
      a = this.minorGridEnabled;
      var u,
          x = this.gridAlpha,
          y,
          w = this.choosePeriod(0),
          z = w.period,
          w = w.count,
          A = d.getPeriodDuration(z, w);
      A < k && (z = g.period, w = g.count, A = k);
      g = z;
      'WW' == g && (g = 'DD');
      this.stepWidth = this.getStepWidth(this.timeDifference);
      var B = Math.ceil(this.timeDifference / A) + 5,
          C = l = d.resetDateToMin(new Date(this.startTime - A), z, w, t).getTime();
      if (g == z && 1 == w && this.centerLabelOnFullPeriod || this.autoWrap || this.centerLabels) n = A * this.stepWidth, this.autoWrap && !this.centerLabels && (n = -n);
      this.cellWidth = k * this.stepWidth;
      q = Math.round(l / A);
      k = -1;
      q / 2 == Math.round(q / 2) && (k = -2, l -= A);
      q = this.firstTime;
      var D = 0,
          L = 0;
      a && 1 < w && (u = this.chooseMinorFrequency(w), y = d.getPeriodDuration(z, u), 'DD' == z && (y += d.getPeriodDuration('hh')));
      if (0 < this.gridCountR) for (B - 5 - k > this.autoRotateCount && !isNaN(this.autoRotateAngle) && (this.labelRotationR = this.autoRotateAngle), a = k; a <= B; a++) {
        p = q + A * (a + Math.floor((C - q) / A)) - D;
        'DD' == z && (p += 36e5);
        p = d.resetDateToMin(new Date(p), z, w, t).getTime();
        'MM' == z && (h = (p - l) / A, 1.5 <= (p - l) / A && (p = p - (h - 1) * A + d.getPeriodDuration('DD', 3), p = d.resetDateToMin(new Date(p), z, 1).getTime(), D += A));
        h = (p - this.startTime) * this.stepWidth;
        if ('radar' == b.type) {
          if (h = this.axisWidth - h, 0 > h || h > this.axisWidth) continue;
        } else this.rotate ? 'date' == this.type && 'middle' == this.gridPosition && (L = -A * this.stepWidth / 2) : 'date' == this.type && (h = this.axisWidth - h);
        f = !1;
        this.nextPeriod[g] && (f = this.checkPeriodChange(this.nextPeriod[g], 1, p, l, g));
        l = !1;
        f && this.markPeriodChange ? (f = this.dateFormatsObject[this.nextPeriod[g]], this.twoLineMode && (f = this.dateFormatsObject[g] + '\n' + f, f = d.fixBrakes(f)), l = !0) : f = this.dateFormatsObject[g];
        r || (l = !1);
        this.currentDateFormat = f;
        f = d.formatDate(new Date(p), f, b);
        if (a == k && !c || a == B && !e) f = ' ';
        this.labelFunction && (f = this.labelFunction(f, new Date(p), this, z, w, m).toString());
        this.boldLabels && (l = !0);
        m = new this.axisItemRenderer(this, h, f, !1, n, L, !1, l);
        this.pushAxisItem(m);
        m = l = p;
        if (!isNaN(u)) for (h = 1; h < w; h += u) {
          this.gridAlpha = this.minorGridAlpha, f = p + y * h, f = d.resetDateToMin(new Date(f), z, u, t).getTime(), f = new this.axisItemRenderer(this, (f - this.startTime) * this.stepWidth, void 0, void 0, void 0, void 0, void 0, void 0, void 0, !0), this.pushAxisItem(f);
        }this.gridAlpha = x;
      }
    },
    choosePeriod: function choosePeriod(a) {
      var b = d.getPeriodDuration(this.periods[a].period, this.periods[a].count),
          c = this.periods;
      return this.timeDifference < b && 0 < a ? c[a - 1] : Math.ceil(this.timeDifference / b) <= this.gridCountR ? c[a] : a + 1 < c.length ? this.choosePeriod(a + 1) : c[a];
    },
    getStepWidth: function getStepWidth(a) {
      var b;
      this.startOnAxis ? (b = this.axisWidth / (a - 1), 1 == a && (b = this.axisWidth)) : b = this.axisWidth / a;
      return b;
    },
    timeZoom: function timeZoom(a, b) {
      this.startTime = a;
      this.endTime = b;
    },
    minDuration: function minDuration() {
      var a = d.extractPeriod(this.minPeriod);
      return d.getPeriodDuration(a.period, a.count);
    },
    checkPeriodChange: function checkPeriodChange(a, b, c, e, h) {
      c = new Date(c);
      var f = new Date(e),
          g = this.firstDayOfWeek;
      e = b;
      'DD' == a && (b = 1);
      c = d.resetDateToMin(c, a, b, g).getTime();
      b = d.resetDateToMin(f, a, b, g).getTime();
      return 'DD' == a && 'hh' != h && c - b < d.getPeriodDuration(a, e) - d.getPeriodDuration('hh', 1) ? !1 : c != b ? !0 : !1;
    },
    generateDFObject: function generateDFObject() {
      this.dateFormatsObject = {};
      var a;
      for (a = 0; a < this.dateFormats.length; a++) {
        var b = this.dateFormats[a];
        this.dateFormatsObject[b.period] = b.format;
      }
    },
    hideBalloon: function hideBalloon() {
      this.balloon && this.balloon.hide && this.balloon.hide();
      this.prevBY = this.prevBX = NaN;
    },
    formatBalloonText: function formatBalloonText(a) {
      return a;
    },
    showBalloon: function showBalloon(a, b, c, e) {
      var d = this.offset;
      switch (this.position) {
        case 'bottom':
          b = this.height + d;
          break;
        case 'top':
          b = -d;
          break;
        case 'left':
          a = -d;
          break;
        case 'right':
          a = this.width + d;
      }
      c || (c = this.currentDateFormat);
      if ('V' == this.orientation) {
        if (0 > b || b > this.height) return;
        if (isNaN(b)) {
          this.hideBalloon();
          return;
        }
        b = this.adjustBalloonCoordinate(b, e);
        e = this.coordinateToValue(b);
      } else {
        if (0 > a || a > this.width) return;
        if (isNaN(a)) {
          this.hideBalloon();
          return;
        }
        a = this.adjustBalloonCoordinate(a, e);
        e = this.coordinateToValue(a);
      }
      var f;
      if (d = this.chart.chartCursor) f = d.index;
      if (this.balloon && void 0 !== e && this.balloon.enabled) {
        if (this.balloonTextFunction) {
          if ('date' == this.type || !0 === this.parseDates) e = new Date(e);
          e = this.balloonTextFunction(e);
        } else this.balloonText ? e = this.formatBalloonText(this.balloonText, f, c) : isNaN(e) || (e = this.formatValue(e, c));
        if (a != this.prevBX || b != this.prevBY) this.balloon.setPosition(a, b), this.prevBX = a, this.prevBY = b, e && this.balloon.showBalloon(e);
      }
    },
    adjustBalloonCoordinate: function adjustBalloonCoordinate(a) {
      return a;
    },
    createBalloon: function createBalloon() {
      var a = this.chart,
          b = a.chartCursor;
      b && (b = b.cursorPosition, 'mouse' != b && (this.stickBalloonToCategory = !0), 'start' == b && (this.stickBalloonToStart = !0), 'ValueAxis' == this.cname && (this.stickBalloonToCategory = !1));
      this.balloon && (this.balloon.destroy && this.balloon.destroy(), d.extend(this.balloon, a.balloon, !0));
    },
    setBalloonBounds: function setBalloonBounds() {
      var a = this.balloon;
      if (a) {
        var b = this.chart;
        a.cornerRadius = 0;
        a.shadowAlpha = 0;
        a.borderThickness = 1;
        a.borderAlpha = 1;
        a.adjustBorderColor = !1;
        a.showBullet = !1;
        this.balloon = a;
        a.chart = b;
        a.mainSet = b.plotBalloonsSet;
        a.pointerWidth = this.tickLength;
        if (this.parseDates || 'date' == this.type) a.pointerWidth = 0;
        a.className = this.id;
        b = 'V';
        'V' == this.orientation && (b = 'H');
        this.stickBalloonToCategory || (a.animationDuration = 0);
        var c,
            e,
            d,
            f,
            g = this.inside,
            k = this.width,
            l = this.height;
        switch (this.position) {
          case 'bottom':
            c = 0;
            e = k;
            g ? (d = 0, f = l) : (d = l, f = l + 1e3);
            break;
          case 'top':
            c = 0;
            e = k;
            g ? (d = 0, f = l) : (d = -1e3, f = 0);
            break;
          case 'left':
            d = 0;
            f = l;
            g ? (c = 0, e = k) : (c = -1e3, e = 0);
            break;
          case 'right':
            ;d = 0, f = l, g ? (c = 0, e = k) : (c = k, e = k + 1e3);
        }
        a.drop || (a.pointerOrientation = b);
        a.setBounds(c, d, e, f);
      }
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.ValueAxis = d.Class({
    inherits: d.AxisBase,
    construct: function construct(a) {
      this.cname = 'ValueAxis';
      this.createEvents('axisChanged', 'logarithmicAxisFailed', 'axisZoomed', 'axisIntZoomed');
      d.ValueAxis.base.construct.call(this, a);
      this.dataChanged = !0;
      this.stackType = 'none';
      this.position = 'left';
      this.unitPosition = 'right';
      this.includeAllValues = this.recalculateToPercents = this.includeHidden = this.includeGuidesInMinMax = this.integersOnly = !1;
      this.durationUnits = { DD: 'd. ', hh: ':', mm: ':', ss: '' };
      this.scrollbar = !1;
      this.baseValue = 0;
      this.radarCategoriesEnabled = !0;
      this.axisFrequency = 1;
      this.gridType = 'polygons';
      this.useScientificNotation = !1;
      this.axisTitleOffset = 10;
      this.pointPosition = 'axis';
      this.minMaxMultiplier = 1;
      this.logGridLimit = 2;
      this.totalTextOffset = this.treatZeroAs = 0;
      this.minPeriod = 'ss';
      this.relativeStart = 0;
      this.relativeEnd = 1;
      d.applyTheme(this, a, this.cname);
    },
    updateData: function updateData() {
      0 >= this.gridCountR && (this.gridCountR = 1);
      this.totals = [];
      this.data = this.chart.chartData;
      var a = this.chart;
      'xy' != a.type && (this.stackGraphs('smoothedLine'), this.stackGraphs('line'), this.stackGraphs('column'), this.stackGraphs('step'));
      this.recalculateToPercents && this.recalculate();
      this.synchronizationMultiplier && this.synchronizeWith ? (d.isString(this.synchronizeWith) && (this.synchronizeWith = a.getValueAxisById(this.synchronizeWith)), this.synchronizeWith && (this.synchronizeWithAxis(this.synchronizeWith), this.foundGraphs = !0)) : (this.foundGraphs = !1, this.getMinMax(), 0 === this.start && this.end == this.data.length - 1 && isNaN(this.minZoom) && isNaN(this.maxZoom) && (this.fullMin = this.min, this.fullMax = this.max, 'date' != this.type && (isNaN(this.minimum) || (this.fullMin = this.minimum), isNaN(this.maximum) || (this.fullMax = this.maximum)), this.logarithmic && (this.fullMin = this.logMin, 0 === this.fullMin && (this.fullMin = this.treatZeroAs)), 'date' == this.type && (this.minimumDate || (this.fullMin = this.minRR), this.maximumDate || (this.fullMax = this.maxRR))));
    },
    draw: function draw() {
      d.ValueAxis.base.draw.call(this);
      var a = this.chart,
          b = this.set;
      this.labelRotationR = this.labelRotation;
      d.setCN(a, this.set, 'value-axis value-axis-' + this.id);
      d.setCN(a, this.labelsSet, 'value-axis value-axis-' + this.id);
      d.setCN(a, this.axisLine.axisSet, 'value-axis value-axis-' + this.id);
      var c = this.type;
      'duration' == c && (this.duration = 'ss');
      !0 === this.dataChanged && (this.updateData(), this.dataChanged = !1);
      'date' == c && (this.logarithmic = !1, this.min = this.minRR, this.max = this.maxRR, this.reversed = !1, this.getDateMinMax());
      if (this.logarithmic) {
        var e = this.treatZeroAs,
            h = this.getExtremes(0, this.data.length - 1).min;
        !isNaN(this.minimum) && this.minimum < h && (h = this.minimum);
        this.logMin = h;
        this.minReal < h && (this.minReal = h);
        isNaN(this.minReal) && (this.minReal = h);
        0 < e && 0 === h && (this.minReal = h = e);
        if (0 >= h || 0 >= this.minimum) {
          this.fire({ type: 'logarithmicAxisFailed', chart: a });
          return;
        }
      }
      this.grid0 = null;
      var f,
          g,
          k = a.dx,
          l = a.dy,
          e = !1,
          h = this.logarithmic;
      if (isNaN(this.min) || isNaN(this.max) || !this.foundGraphs || Infinity == this.min || -Infinity == this.max) e = !0;else {
        'date' == this.type && this.min == this.max && (this.max += this.minDuration(), this.min -= this.minDuration());
        var m = this.labelFrequency,
            n = this.showFirstLabel,
            q = this.showLastLabel,
            p = 1,
            t = 0;
        this.minCalc = this.min;
        this.maxCalc = this.max;
        this.strictMinMax && (isNaN(this.minimum) || (this.min = this.minimum), isNaN(this.maximum) || (this.max = this.maximum));
        isNaN(this.minZoom) || (this.minReal = this.min = this.minZoom);
        isNaN(this.maxZoom) || (this.max = this.maxZoom);
        if (this.logarithmic) {
          g = Math.log(this.fullMax) * Math.LOG10E - Math.log(this.fullMin) * Math.LOG10E;
          var r = Math.log(this.max) / Math.LN10 - Math.log(this.fullMin) * Math.LOG10E;
          this.relativeStart = (Math.log(this.minReal) / Math.LN10 - Math.log(this.fullMin) * Math.LOG10E) / g;
          this.relativeEnd = r / g;
        } else this.relativeStart = d.fitToBounds((this.min - this.fullMin) / (this.fullMax - this.fullMin), 0, 1), this.relativeEnd = d.fitToBounds((this.max - this.fullMin) / (this.fullMax - this.fullMin), 0, 1);
        var r = Math.round((this.maxCalc - this.minCalc) / this.step) + 1,
            u;
        !0 === h ? (u = Math.log(this.max) * Math.LOG10E - Math.log(this.minReal) * Math.LOG10E, this.stepWidth = this.axisWidth / u, u > this.logGridLimit && (r = Math.ceil(Math.log(this.max) * Math.LOG10E) + 1, t = Math.round(Math.log(this.minReal) * Math.LOG10E), r > this.gridCountR && (p = Math.ceil(r / this.gridCountR)))) : this.stepWidth = this.axisWidth / (this.max - this.min);
        var x = 0;
        1 > this.step && -1 < this.step && (x = d.getDecimals(this.step));
        this.integersOnly && (x = 0);
        x > this.maxDecCount && (x = this.maxDecCount);
        var y = this.precision;
        isNaN(y) || (x = y);
        isNaN(this.maxZoom) && (this.max = d.roundTo(this.max, this.maxDecCount), this.min = d.roundTo(this.min, this.maxDecCount));
        g = {};
        g.precision = x;
        g.decimalSeparator = a.nf.decimalSeparator;
        g.thousandsSeparator = a.nf.thousandsSeparator;
        this.numberFormatter = g;
        this.exponential = !1;
        for (g = t; g < r; g += p) {
          var w = d.roundTo(this.step * g + this.min, x);-1 != String(w).indexOf('e') && (this.exponential = !0);
        }
        this.duration && (this.maxInterval = d.getMaxInterval(this.max, this.duration));
        var x = this.step,
            z,
            w = this.minorGridAlpha;
        this.minorGridEnabled && (z = this.getMinorGridStep(x, this.stepWidth * x));
        if (this.autoGridCount || 0 !== this.gridCount) if ('date' == c) this.generateDFObject(), this.timeDifference = this.max - this.min, this.maxTime = this.lastTime = this.max, this.startTime = this.firstTime = this.min, this.parseDatesDraw();else for (r >= this.autoRotateCount && !isNaN(this.autoRotateAngle) && (this.labelRotationR = this.autoRotateAngle), h && r++, g = t; g < r; g += p) {
          if (c = x * g + this.minCalc, c = d.roundTo(c, this.maxDecCount + 1), !this.integersOnly || Math.round(c) == c) if (isNaN(y) || Number(d.toFixed(c, y)) == c) {
            !0 === h && (0 === c && (c = this.minReal), u > this.logGridLimit && (c = Math.pow(10, g)));
            t = this.formatValue(c, !1, g);
            Math.round(g / m) != g / m && (t = void 0);
            if (0 === g && !n || g == r - 1 && !q) t = ' ';
            f = this.getCoordinate(c);
            var A;
            this.rotate && this.autoWrap && (A = this.stepWidth * x - 10);
            t = new this.axisItemRenderer(this, f, t, void 0, A, void 0, void 0, this.boldLabels);
            this.pushAxisItem(t);
            if (c == this.baseValue && 'radar' != a.type) {
              var B,
                  C,
                  t = this.width,
                  D = this.height;
              'H' == this.orientation ? 0 <= f && f <= t + 1 && (B = [f, f, f + k], C = [D, 0, l]) : 0 <= f && f <= D + 1 && (B = [0, t, t + k], C = [f, f, f + l]);
              B && (t = d.fitToBounds(2 * this.gridAlpha, 0, 1), isNaN(this.zeroGridAlpha) || (t = this.zeroGridAlpha), t = d.line(a.container, B, C, this.gridColor, t, 1, this.dashLength), t.translate(this.x, this.y), this.grid0 = t, a.axesSet.push(t), t.toBack(), d.setCN(a, t, this.bcn + 'zero-grid-' + this.id), d.setCN(a, t, this.bcn + 'zero-grid'));
            }
            if (!isNaN(z) && 0 < w && g < r - 1) {
              t = x / z;
              h && (z = x * (g + p) + this.minCalc, z = d.roundTo(z, this.maxDecCount + 1), u > this.logGridLimit && (z = Math.pow(10, g + p)), t = 9, z = (z - c) / t);
              f = this.gridAlpha;
              this.gridAlpha = this.minorGridAlpha;
              for (D = 1; D < t; D++) {
                var L = this.getCoordinate(c + z * D),
                    L = new this.axisItemRenderer(this, L, '', !1, 0, 0, !1, !1, 0, !0);
                this.pushAxisItem(L);
              }
              this.gridAlpha = f;
            }
          }
        }u = this.guides;
        A = u.length;
        if (0 < A) {
          B = this.fillAlpha;
          for (g = this.fillAlpha = 0; g < A; g++) {
            C = u[g], k = NaN, z = C.above, isNaN(C.toValue) || (k = this.getCoordinate(C.toValue), t = new this.axisItemRenderer(this, k, '', !0, NaN, NaN, C), this.pushAxisItem(t, z)), l = NaN, isNaN(C.value) || (l = this.getCoordinate(C.value), t = new this.axisItemRenderer(this, l, C.label, !0, NaN, (k - l) / 2, C), this.pushAxisItem(t, z)), isNaN(k) && (l -= 3, k = l + 3), isNaN(k - l) || 0 > l && 0 > k || (k = new this.guideFillRenderer(this, l, k, C), this.pushAxisItem(k, z), z = k.graphics(), C.graphics = z, C.balloonText && this.addEventListeners(z, C));
          }this.fillAlpha = B;
        }
        g = this.baseValue;
        this.min > this.baseValue && this.max > this.baseValue && (g = this.min);
        this.min < this.baseValue && this.max < this.baseValue && (g = this.max);
        h && g < this.minReal && (g = this.minReal);
        this.baseCoord = this.getCoordinate(g, !0);
        g = { type: 'axisChanged', target: this, chart: a };
        g.min = h ? this.minReal : this.min;
        g.max = this.max;
        this.fire(g);
        this.axisCreated = !0;
      }
      h = this.axisLine.set;
      g = this.labelsSet;
      b.translate(this.x, this.y);
      g.translate(this.x, this.y);
      this.positionTitle();
      'radar' != a.type && h.toFront();
      !this.visible || e ? (b.hide(), h.hide(), g.hide()) : (b.show(), h.show(), g.show());
      this.axisY = this.y;
      this.axisX = this.x;
    },
    getDateMinMax: function getDateMinMax() {
      this.minimumDate && (this.minimumDate instanceof Date || (this.minimumDate = d.getDate(this.minimumDate, this.chart.dataDateFormat, 'fff')), this.min = this.minimumDate.getTime());
      this.maximumDate && (this.maximumDate instanceof Date || (this.maximumDate = d.getDate(this.maximumDate, this.chart.dataDateFormat, 'fff')), this.max = this.maximumDate.getTime());
    },
    formatValue: function formatValue(a, b, c) {
      var e = this.exponential,
          h = this.logarithmic,
          f = this.numberFormatter,
          g = this.chart;
      if (f) return !0 === this.logarithmic && (e = -1 != String(a).indexOf('e') ? !0 : !1), this.useScientificNotation && (e = !0), this.usePrefixes && (e = !1), e ? (c = -1 == String(a).indexOf('e') ? a.toExponential(15) : String(a), e = c.split('e'), c = Number(e[0]), e = Number(e[1]), c = d.roundTo(c, 14), 10 == c && (c = 1, e += 1), c = c + 'e' + e, 0 === a && (c = '0'), 1 == a && (c = '1')) : (h && (e = String(a).split('.'), e[1] ? (f.precision = e[1].length, 0 > c && (f.precision = Math.abs(c)), b && 1 < a && (f.precision = 0)) : f.precision = -1), c = this.usePrefixes ? d.addPrefix(a, g.prefixesOfBigNumbers, g.prefixesOfSmallNumbers, f, !b) : d.formatNumber(a, f, f.precision)), this.duration && (b && (f.precision = 0), c = d.formatDuration(a, this.duration, '', this.durationUnits, this.maxInterval, f)), 'date' == this.type && (c = d.formatDate(new Date(a), this.currentDateFormat, g)), this.recalculateToPercents ? c += '%' : (b = this.unit) && (c = 'left' == this.unitPosition ? b + c : c + b), this.labelFunction && (c = 'date' == this.type ? this.labelFunction(c, new Date(a), this).toString() : this.labelFunction(a, c, this).toString()), c;
    },
    getMinorGridStep: function getMinorGridStep(a, b) {
      var c = [5, 4, 2];
      60 > b && c.shift();
      for (var e = Math.floor(Math.log(Math.abs(a)) * Math.LOG10E), d = 0; d < c.length; d++) {
        var f = a / c[d],
            g = Math.floor(Math.log(Math.abs(f)) * Math.LOG10E);
        if (!(1 < Math.abs(e - g))) if (1 > a) {
          if (g = Math.pow(10, -g) * f, g == Math.round(g)) return f;
        } else if (f == Math.round(f)) return f;
      }
    },
    stackGraphs: function stackGraphs(a) {
      var b = this.stackType;
      'stacked' == b && (b = 'regular');
      'line' == b && (b = 'none');
      '100% stacked' == b && (b = '100%');
      this.stackType = b;
      var c = [],
          e = [],
          h = [],
          f = [],
          g,
          k = this.chart.graphs,
          l,
          m,
          n,
          q,
          p,
          t = this.baseValue,
          r = !1;
      if ('line' == a || 'step' == a || 'smoothedLine' == a) r = !0;
      if (r && ('regular' == b || '100%' == b)) for (q = 0; q < k.length; q++) {
        n = k[q], n.stackGraph = null, n.hidden || (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable && (l && (n.stackGraph = l), l = n));
      }n = this.start - 10;
      l = this.end + 10;
      q = this.data.length - 1;
      n = d.fitToBounds(n, 0, q);
      l = d.fitToBounds(l, 0, q);
      for (p = n; p <= l; p++) {
        var u = 0;
        for (q = 0; q < k.length; q++) {
          if (n = k[q], n.hidden) n.newStack && (h[p] = NaN, e[p] = NaN);else if (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable) if (m = this.data[p].axes[this.id].graphs[n.id], g = m.values.value, isNaN(g)) n.newStack && (h[p] = NaN, e[p] = NaN);else {
            var x = d.getDecimals(g);
            u < x && (u = x);
            isNaN(f[p]) ? f[p] = Math.abs(g) : f[p] += Math.abs(g);
            f[p] = d.roundTo(f[p], u);
            x = n.fillToGraph;
            r && x && (x = this.data[p].axes[this.id].graphs[x.id]) && (m.values.open = x.values.value);
            'regular' == b && (r && (isNaN(c[p]) ? (c[p] = g, m.values.close = g, m.values.open = this.baseValue) : (isNaN(g) ? m.values.close = c[p] : m.values.close = g + c[p], m.values.open = c[p], c[p] = m.values.close)), 'column' == a && (n.newStack && (h[p] = NaN, e[p] = NaN), m.values.close = g, 0 > g ? (m.values.close = g, isNaN(e[p]) ? m.values.open = t : (m.values.close += e[p], m.values.open = e[p]), e[p] = m.values.close) : (m.values.close = g, isNaN(h[p]) ? m.values.open = t : (m.values.close += h[p], m.values.open = h[p]), h[p] = m.values.close)));
          }
        }
      }
      for (p = this.start; p <= this.end; p++) {
        for (q = 0; q < k.length; q++) {
          (n = k[q], n.hidden) ? n.newStack && (h[p] = NaN, e[p] = NaN) : (m = n.type, n.chart == this.chart && n.valueAxis == this && a == m && n.stackable && (m = this.data[p].axes[this.id].graphs[n.id], g = m.values.value, isNaN(g) || (c = g / f[p] * 100, m.values.percents = c, m.values.total = f[p], n.newStack && (h[p] = NaN, e[p] = NaN), '100%' == b && (isNaN(e[p]) && (e[p] = 0), isNaN(h[p]) && (h[p] = 0), 0 > c ? (m.values.close = d.fitToBounds(c + e[p], -100, 100), m.values.open = e[p], e[p] = m.values.close) : (m.values.close = d.fitToBounds(c + h[p], -100, 100), m.values.open = h[p], h[p] = m.values.close)))));
        }
      }
    },
    recalculate: function recalculate() {
      var a = this.chart,
          b = a.graphs,
          c;
      for (c = 0; c < b.length; c++) {
        var e = b[c];
        if (e.valueAxis == this) {
          var h = 'value';
          if ('candlestick' == e.type || 'ohlc' == e.type) h = 'open';
          var f,
              g,
              k = this.end + 2,
              k = d.fitToBounds(this.end + 1, 0, this.data.length - 1),
              l = this.start;
          0 < l && l--;
          var m;
          g = this.start;
          e.compareFromStart && (g = 0);
          if (!isNaN(a.startTime) && (m = a.categoryAxis)) {
            var n = m.minDuration(),
                n = new Date(a.startTime + n / 2),
                q = d.resetDateToMin(new Date(a.startTime), m.minPeriod).getTime();
            d.resetDateToMin(new Date(n), m.minPeriod).getTime() > q && g++;
          }
          if (m = a.recalculateFromDate) m = d.getDate(m, a.dataDateFormat, 'fff'), g = a.getClosestIndex(a.chartData, 'time', m.getTime(), !0, 0, a.chartData.length), k = a.chartData.length - 1;
          for (m = g; m <= k && (g = this.data[m].axes[this.id].graphs[e.id], f = g.values[h], e.recalculateValue && (f = g.dataContext[e.valueField + e.recalculateValue]), isNaN(f)); m++) {}
          this.recBaseValue = f;
          for (h = l; h <= k; h++) {
            g = this.data[h].axes[this.id].graphs[e.id];
            g.percents = {};
            var l = g.values,
                p;
            for (p in l) {
              g.percents[p] = 'percents' != p ? l[p] / f * 100 - 100 : l[p];
            }
          }
        }
      }
    },
    getMinMax: function getMinMax() {
      var a = !1,
          b = this.chart,
          c = b.graphs,
          e;
      for (e = 0; e < c.length; e++) {
        var h = c[e].type;('line' == h || 'step' == h || 'smoothedLine' == h) && this.expandMinMax && (a = !0);
      }
      a && (0 < this.start && this.start--, this.end < this.data.length - 1 && this.end++);
      'serial' == b.type && (!0 !== b.categoryAxis.parseDates || a || this.end < this.data.length - 1 && this.end++);
      this.includeAllValues && (this.start = 0, this.end = this.data.length - 1);
      a = this.minMaxMultiplier;
      b = this.getExtremes(this.start, this.end);
      this.min = b.min;
      this.max = b.max;
      this.minRR = this.min;
      this.maxRR = this.max;
      a = (this.max - this.min) * (a - 1);
      this.min -= a;
      this.max += a;
      a = this.guides.length;
      if (this.includeGuidesInMinMax && 0 < a) for (b = 0; b < a; b++) {
        c = this.guides[b], c.toValue < this.min && (this.min = c.toValue), c.value < this.min && (this.min = c.value), c.toValue > this.max && (this.max = c.toValue), c.value > this.max && (this.max = c.value);
      }isNaN(this.minimum) || (this.min = this.minimum);
      isNaN(this.maximum) || (this.max = this.maximum);
      'date' == this.type && this.getDateMinMax();
      this.min > this.max && (a = this.max, this.max = this.min, this.min = a);
      isNaN(this.minZoom) || (this.min = this.minZoom);
      isNaN(this.maxZoom) || (this.max = this.maxZoom);
      this.minCalc = this.min;
      this.maxCalc = this.max;
      this.minReal = this.min;
      this.maxReal = this.max;
      0 === this.min && 0 === this.max && (this.max = 9);
      this.min > this.max && (this.min = this.max - 1);
      a = this.min;
      b = this.max;
      c = this.max - this.min;
      e = 0 === c ? Math.pow(10, Math.floor(Math.log(Math.abs(this.max)) * Math.LOG10E)) / 10 : Math.pow(10, Math.floor(Math.log(Math.abs(c)) * Math.LOG10E)) / 10;
      isNaN(this.maximum) && (this.max = Math.ceil(this.max / e) * e + e);
      isNaN(this.minimum) && (this.min = Math.floor(this.min / e) * e - e);
      0 > this.min && 0 <= a && (this.min = 0);
      0 < this.max && 0 >= b && (this.max = 0);
      '100%' == this.stackType && (this.min = 0 > this.min ? -100 : 0, this.max = 0 > this.max ? 0 : 100);
      c = this.max - this.min;
      e = Math.pow(10, Math.floor(Math.log(Math.abs(c)) * Math.LOG10E)) / 10;
      this.step = Math.ceil(c / this.gridCountR / e) * e;
      c = Math.pow(10, Math.floor(Math.log(Math.abs(this.step)) * Math.LOG10E));
      c = d.fixStepE(c);
      e = Math.ceil(this.step / c);
      5 < e && (e = 10);
      5 >= e && 2 < e && (e = 5);
      this.step = Math.ceil(this.step / (c * e)) * c * e;
      1 > c ? (this.maxDecCount = Math.abs(Math.log(Math.abs(c)) * Math.LOG10E), this.maxDecCount = Math.round(this.maxDecCount), this.step = d.roundTo(this.step, this.maxDecCount + 1)) : this.maxDecCount = 0;
      this.min = this.step * Math.floor(this.min / this.step);
      this.max = this.step * Math.ceil(this.max / this.step);
      0 > this.min && 0 <= a && (this.min = 0);
      0 < this.max && 0 >= b && (this.max = 0);
      1 < this.minReal && 1 < this.max - this.minReal && (this.minReal = Math.floor(this.minReal));
      c = Math.pow(10, Math.floor(Math.log(Math.abs(this.minReal)) * Math.LOG10E));
      0 === this.min && (this.minReal = c);
      0 === this.min && 1 < this.minReal && (this.minReal = 1);
      0 < this.min && 0 < this.minReal - this.step && (this.minReal = this.min + this.step < this.minReal ? this.min + this.step : this.min);
      this.logarithmic && (2 < Math.log(b) * Math.LOG10E - Math.log(a) * Math.LOG10E ? (this.minReal = this.min = Math.pow(10, Math.floor(Math.log(Math.abs(a)) * Math.LOG10E)), this.max = Math.pow(10, Math.ceil(Math.log(Math.abs(b)) * Math.LOG10E))) : (a = Math.pow(10, Math.floor(Math.log(Math.abs(a)) * Math.LOG10E)) / 10, Math.pow(10, Math.floor(Math.log(Math.abs(this.min)) * Math.LOG10E)) / 10 < a && (this.minReal = this.min = 10 * a)));
    },
    getExtremes: function getExtremes(a, b) {
      var c, e, d;
      for (d = a; d <= b; d++) {
        var f = this.data[d].axes[this.id].graphs,
            g;
        for (g in f) {
          if (f.hasOwnProperty(g)) {
            var k = this.chart.graphsById[g];
            if (k.includeInMinMax && (!k.hidden || this.includeHidden)) {
              isNaN(c) && (c = Infinity);
              isNaN(e) && (e = -Infinity);
              this.foundGraphs = !0;
              k = f[g].values;
              this.recalculateToPercents && (k = f[g].percents);
              var l;
              if (this.minMaxField) l = k[this.minMaxField], l < c && (c = l), l > e && (e = l);else for (var m in k) {
                k.hasOwnProperty(m) && 'percents' != m && 'total' != m && (l = k[m], l < c && (c = l), l > e && (e = l));
              }
            }
          }
        }
      }
      return { min: c, max: e };
    },
    zoomOut: function zoomOut() {
      this.maxZoom = this.minZoom = NaN;
      this.zoomToRelativeValues(0, 1);
    },
    zoomToRelativeValues: function zoomToRelativeValues(a, b, c) {
      if (this.reversed) {
        var e = a;
        a = 1 - b;
        b = 1 - e;
      }
      var d = this.fullMax,
          e = this.fullMin,
          f = e + (d - e) * a,
          g = e + (d - e) * b;
      this.logarithmic && (d = Math.log(d) * Math.LOG10E - Math.log(e) * Math.LOG10E, f = Math.pow(10, d * a + Math.log(e) * Math.LOG10E), g = Math.pow(10, d * b + Math.log(e) * Math.LOG10E));
      return this.zoomToValues(f, g, c);
    },
    zoomToValues: function zoomToValues(a, b, c) {
      if (b < a) {
        var e = b;
        b = a;
        a = e;
      }
      var h = this.fullMax,
          e = this.fullMin;
      this.relativeStart = (a - e) / (h - e);
      this.relativeEnd = (b - e) / (h - e);
      if (this.logarithmic) {
        var h = Math.log(h) * Math.LOG10E - Math.log(e) * Math.LOG10E,
            f = Math.log(b) / Math.LN10 - Math.log(e) * Math.LOG10E;
        this.relativeStart = (Math.log(a) / Math.LN10 - Math.log(e) * Math.LOG10E) / h;
        this.relativeEnd = f / h;
      }
      if (this.minZoom != a || this.maxZoom != b) {
        if (0 !== this.relativeStart || 1 != this.relativeEnd) this.minZoom = a, this.maxZoom = b;
        e = { type: 'axisZoomed' };
        e.chart = this.chart;
        e.valueAxis = this;
        e.startValue = a;
        e.endValue = b;
        e.relativeStart = this.relativeStart;
        e.relativeEnd = this.relativeEnd;this.prevStartValue == a && this.prevEndValue == b || this.fire(e);
        this.prevStartValue = a;
        this.prevEndValue = b;
        c || (a = {}, d.copyProperties(e, a), a.type = 'axisIntZoomed', this.fire(a));
        return !0;
      }
    },
    coordinateToValue: function coordinateToValue(a) {
      if (isNaN(a)) return NaN;
      var b = this.axisWidth,
          c = this.stepWidth,
          e = this.reversed,
          d = this.rotate,
          f = this.min,
          g = this.minReal;
      return !0 === this.logarithmic ? Math.pow(10, (d ? !0 === e ? (b - a) / c : a / c : !0 === e ? a / c : (b - a) / c) + Math.log(g) * Math.LOG10E) : !0 === e ? d ? f - (a - b) / c : a / c + f : d ? a / c + f : f - (a - b) / c;
    },
    getCoordinate: function getCoordinate(a, b) {
      if (isNaN(a)) return NaN;
      var c = this.rotate,
          e = this.reversed,
          d = this.axisWidth,
          f = this.stepWidth,
          g = this.min,
          k = this.minReal;
      !0 === this.logarithmic ? (0 === a && (a = this.treatZeroAs), g = Math.log(a) * Math.LOG10E - Math.log(k) * Math.LOG10E, c = c ? !0 === e ? d - f * g : f * g : !0 === e ? f * g : d - f * g) : c = !0 === e ? c ? d - f * (a - g) : f * (a - g) : c ? f * (a - g) : d - f * (a - g);
      1e7 < Math.abs(c) && (c = c / Math.abs(c) * 1e7);
      b || (c = Math.round(c));
      return c;
    },
    synchronizeWithAxis: function synchronizeWithAxis(a) {
      this.synchronizeWith = a;
      this.listenTo(this.synchronizeWith, 'axisChanged', this.handleSynchronization);
    },
    handleSynchronization: function handleSynchronization() {
      if (this.synchronizeWith) {
        d.isString(this.synchronizeWith) && (this.synchronizeWith = this.chart.getValueAxisById(this.synchronizeWith));
        var a = this.synchronizeWith,
            b = a.min,
            c = a.max,
            a = a.step,
            e = this.synchronizationMultiplier;
        e && (this.min = b * e, this.max = c * e, this.step = a * e, b = Math.abs(Math.log(Math.abs(Math.pow(10, Math.floor(Math.log(Math.abs(this.step)) * Math.LOG10E)))) * Math.LOG10E), this.maxDecCount = b = Math.round(b), this.draw());
      }
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.RecAxis = d.Class({
    construct: function construct(a) {
      var b = a.chart,
          c = a.axisThickness,
          e = a.axisColor,
          h = a.axisAlpha,
          f = a.offset,
          g = a.dx,
          k = a.dy,
          l = a.x,
          m = a.y,
          n = a.height,
          q = a.width,
          p = b.container;
      'H' == a.orientation ? (e = d.line(p, [0, q], [0, 0], e, h, c), this.axisWidth = a.width, 'bottom' == a.position ? (k = c / 2 + f + n + m - 1, c = l) : (k = -c / 2 - f + m + k, c = g + l)) : (this.axisWidth = a.height, 'right' == a.position ? (e = d.line(p, [0, 0, -g], [0, n, n - k], e, h, c), k = m + k, c = c / 2 + f + g + q + l - 1) : (e = d.line(p, [0, 0], [0, n], e, h, c), k = m, c = -c / 2 - f + l));
      e.translate(c, k);
      c = b.container.set();
      c.push(e);
      b.axesSet.push(c);
      d.setCN(b, e, a.bcn + 'line');
      this.axisSet = c;
      this.set = e;
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.RecItem = d.Class({
    construct: function construct(a, b, c, e, h, f, g, k, l, m, n, q) {
      b = Math.round(b);
      var p = a.chart;
      this.value = c;
      void 0 == c && (c = '');
      l || (l = 0);
      void 0 == e && (e = !0);
      var t = p.fontFamily,
          r = a.fontSize;
      void 0 == r && (r = p.fontSize);
      var u = a.color;
      void 0 == u && (u = p.color);
      void 0 !== n && (u = n);
      var x = a.chart.container,
          y = x.set();
      this.set = y;
      var w = a.axisThickness,
          z = a.axisColor,
          A = a.axisAlpha,
          B = a.tickLength,
          C = a.gridAlpha,
          D = a.gridThickness,
          L = a.gridColor,
          I = a.dashLength,
          S = a.fillColor,
          O = a.fillAlpha,
          Q = a.labelsEnabled;
      n = a.labelRotationR;
      var ia = a.counter,
          H = a.inside,
          Z = a.labelOffset,
          va = a.dx,
          ma = a.dy,
          Oa = a.orientation,
          ea = a.position,
          ca = a.previousCoord,
          X = a.height,
          ya = a.width,
          da = a.offset,
          fa,
          za;
      g ? (void 0 !== g.id && (q = p.classNamePrefix + '-guide-' + g.id), Q = !0, isNaN(g.tickLength) || (B = g.tickLength), void 0 != g.lineColor && (L = g.lineColor), void 0 != g.color && (u = g.color), isNaN(g.lineAlpha) || (C = g.lineAlpha), isNaN(g.dashLength) || (I = g.dashLength), isNaN(g.lineThickness) || (D = g.lineThickness), !0 === g.inside && (H = !0, 0 < da && (da = 0)), isNaN(g.labelRotation) || (n = g.labelRotation), isNaN(g.fontSize) || (r = g.fontSize), g.position && (ea = g.position), void 0 !== g.boldLabel && (k = g.boldLabel), isNaN(g.labelOffset) || (Z = g.labelOffset)) : '' === c && (B = 0);
      m && !isNaN(a.minorTickLength) && (B = a.minorTickLength);
      var ga = 'start';
      0 < h && (ga = 'middle');
      a.centerLabels && (ga = 'middle');
      var T = n * Math.PI / 180,
          Y,
          Ca,
          G = 0,
          v = 0,
          na = 0,
          ha = Y = 0,
          Pa = 0;
      'V' == Oa && (n = 0);
      var ba;
      Q && '' !== c && (ba = a.autoWrap && 0 === n ? d.wrappedText(x, c, u, t, r, ga, k, Math.abs(h), 0) : d.text(x, c, u, t, r, ga, k), ga = ba.getBBox(), ha = ga.width, Pa = ga.height);
      if ('H' == Oa) {
        if (0 <= b && b <= ya + 1 && (0 < B && 0 < A && b + l <= ya + 1 && (fa = d.line(x, [b + l, b + l], [0, B], z, A, D), y.push(fa)), 0 < C && (za = d.line(x, [b, b + va, b + va], [X, X + ma, ma], L, C, D, I), y.push(za))), v = 0, G = b, g && 90 == n && H && (G -= r), !1 === e ? (ga = 'start', v = 'bottom' == ea ? H ? v + B : v - B : H ? v - B : v + B, G += 3, 0 < h && (G += h / 2 - 3, ga = 'middle'), 0 < n && (ga = 'middle')) : ga = 'middle', 1 == ia && 0 < O && !g && !m && ca < ya && (e = d.fitToBounds(b, 0, ya), ca = d.fitToBounds(ca, 0, ya), Y = e - ca, 0 < Y && (Ca = d.rect(x, Y, a.height, S, O), Ca.translate(e - Y + va, ma), y.push(Ca))), 'bottom' == ea ? (v += X + r / 2 + da, H ? (0 < n ? (v = X - ha / 2 * Math.sin(T) - B - 3, G += ha / 2 * Math.cos(T) - 4 + 2) : 0 > n ? (v = X + ha * Math.sin(T) - B - 3 + 2, G += -ha * Math.cos(T) - Pa * Math.sin(T) - 4) : v -= B + r + 3 + 3, v -= Z) : (0 < n ? (v = X + ha / 2 * Math.sin(T) + B + 3, G -= ha / 2 * Math.cos(T)) : 0 > n ? (v = X + B + 3 - ha / 2 * Math.sin(T) + 2, G += ha / 2 * Math.cos(T)) : v += B + w + 3 + 3, v += Z)) : (v += ma + r / 2 - da, G += va, H ? (0 < n ? (v = ha / 2 * Math.sin(T) + B + 3, G -= ha / 2 * Math.cos(T)) : v += B + 3, v += Z) : (0 < n ? (v = -(ha / 2) * Math.sin(T) - B - 6, G += ha / 2 * Math.cos(T)) : v -= B + r + 3 + w + 3, v -= Z)), 'bottom' == ea ? Y = (H ? X - B - 1 : X + w - 1) + da : (na = va, Y = (H ? ma : ma - B - w + 1) - da), f && (G += f), f = G, 0 < n && (f += ha / 2 * Math.cos(T)), ba && (r = 0, H && (r = ha / 2 * Math.cos(T)), f + r > ya + 2 || 0 > f)) ba.remove(), ba = null;
      } else {
        0 <= b && b <= X + 1 && (0 < B && 0 < A && b + l <= X + 1 && (fa = d.line(x, [0, B + 1], [b + l, b + l], z, A, D), y.push(fa)), 0 < C && (za = d.line(x, [0, va, ya + va], [b, b + ma, b + ma], L, C, D, I), y.push(za)));
        ga = 'end';
        if (!0 === H && 'left' == ea || !1 === H && 'right' == ea) ga = 'start';
        v = b - Pa / 2 + 2;
        1 == ia && 0 < O && !g && !m && (e = d.fitToBounds(b, 0, X), ca = d.fitToBounds(ca, 0, X), T = e - ca, Ca = d.polygon(x, [0, a.width, a.width, 0], [0, 0, T, T], S, O), Ca.translate(va, e - T + ma), y.push(Ca));
        v += r / 2;
        'right' == ea ? (G += va + ya + da, v += ma, H ? (f || (v -= r / 2 + 3), G = G - (B + 4) - Z) : (G += B + 4 + w, v -= 2, G += Z)) : H ? (G += B + 4 - da, f || (v -= r / 2 + 3), g && (G += va, v += ma), G += Z) : (G += -B - w - 4 - 2 - da, v -= 2, G -= Z);
        fa && ('right' == ea ? (na += va + da + ya - 1, Y += ma, na = H ? na - w : na + w) : (na -= da, H || (na -= B + w)));
        f && (v += f);
        H = -3;
        'right' == ea && (H += ma);
        ba && (v > X + 1 || v < H) && (ba.remove(), ba = null);
      }
      fa && (fa.translate(na, Y), d.setCN(p, fa, a.bcn + 'tick'), d.setCN(p, fa, q, !0), g && d.setCN(p, fa, 'guide'));
      !1 === a.visible && (fa && fa.remove(), ba && (ba.remove(), ba = null));
      ba && (ba.attr({ 'text-anchor': ga }), ba.translate(G, v, NaN, !0), 0 !== n && ba.rotate(-n, a.chart.backgroundColor), a.allLabels.push(ba), this.label = ba, d.setCN(p, ba, a.bcn + 'label'), d.setCN(p, ba, q, !0), g && d.setCN(p, ba, 'guide'));
      za && (d.setCN(p, za, a.bcn + 'grid'), d.setCN(p, za, q, !0), g && d.setCN(p, za, 'guide'));
      Ca && (d.setCN(p, Ca, a.bcn + 'fill'), d.setCN(p, Ca, q, !0));
      m ? za && d.setCN(p, za, a.bcn + 'grid-minor') : (a.counter = 0 === ia ? 1 : 0, a.previousCoord = b);
      0 === this.set.node.childNodes.length && this.set.remove();
    },
    graphics: function graphics() {
      return this.set;
    },
    getLabel: function getLabel() {
      return this.label;
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.RecFill = d.Class({
    construct: function construct(a, b, c, e) {
      var h = a.dx,
          f = a.dy,
          g = a.orientation,
          k = 0;
      if (c < b) {
        var l = b;
        b = c;
        c = l;
      }
      var m = e.fillAlpha;
      isNaN(m) && (m = 0);
      var l = a.chart.container,
          n = e.fillColor;
      'V' == g ? (b = d.fitToBounds(b, 0, a.height), c = d.fitToBounds(c, 0, a.height)) : (b = d.fitToBounds(b, 0, a.width), c = d.fitToBounds(c, 0, a.width));
      c -= b;
      isNaN(c) && (c = 4, k = 2, m = 0);
      0 > c && 'object' == (typeof n === 'undefined' ? 'undefined' : _typeof(n)) && (n = n.join(',').split(',').reverse());
      'V' == g ? (g = d.rect(l, a.width, c, n, m), g.translate(h, b - k + f)) : (g = d.rect(l, c, a.height, n, m), g.translate(b - k + h, f));
      d.setCN(a.chart, g, 'guide-fill');
      e.id && d.setCN(a.chart, g, 'guide-fill-' + e.id);
      this.set = l.set([g]);
    },
    graphics: function graphics() {
      return this.set;
    },
    getLabel: function getLabel() {}
  });
})();(function () {
  var d = window.AmCharts;
  d.AmChart = d.Class({
    construct: function construct(a) {
      this.svgIcons = this.tapToActivate = !0;
      this.theme = a;
      this.classNamePrefix = 'amcharts';
      this.addClassNames = !1;
      this.version = '3.20.0';
      d.addChart(this);
      this.createEvents('buildStarted', 'dataUpdated', 'init', 'rendered', 'drawn', 'failed', 'resized', 'animationFinished');
      this.height = this.width = '100%';
      this.dataChanged = !0;
      this.chartCreated = !1;
      this.previousWidth = this.previousHeight = 0;
      this.backgroundColor = '#FFFFFF';
      this.borderAlpha = this.backgroundAlpha = 0;
      this.color = this.borderColor = '#000000';
      this.fontFamily = 'Verdana';
      this.fontSize = 11;
      this.usePrefixes = !1;
      this.autoResize = !0;
      this.autoDisplay = !1;
      this.addCodeCredits = this.accessible = !0;
      this.touchStartTime = this.touchClickDuration = 0;
      this.precision = -1;
      this.percentPrecision = 2;
      this.decimalSeparator = '.';
      this.thousandsSeparator = ',';
      this.labels = [];
      this.allLabels = [];
      this.titles = [];
      this.marginRight = this.marginLeft = this.autoMarginOffset = 0;
      this.timeOuts = [];
      this.creditsPosition = 'top-left';
      var b = document.createElement('div'),
          c = b.style;
      c.overflow = 'hidden';
      c.position = 'relative';
      c.textAlign = 'left';
      this.chartDiv = b;
      b = document.createElement('div');
      c = b.style;
      c.overflow = 'hidden';
      c.position = 'relative';
      c.textAlign = 'left';
      this.legendDiv = b;
      this.titleHeight = 0;
      this.hideBalloonTime = 150;
      this.handDrawScatter = 2;
      this.handDrawThickness = 1;
      this.prefixesOfBigNumbers = [{ number: 1e3, prefix: 'k' }, { number: 1e6, prefix: 'M' }, { number: 1e9, prefix: 'G' }, { number: 1e12, prefix: 'T' }, { number: 1e15, prefix: 'P' }, { number: 1e18, prefix: 'E' }, { number: 1e21, prefix: 'Z' }, { number: 1e24, prefix: 'Y' }];
      this.prefixesOfSmallNumbers = [{ number: 1e-24, prefix: 'y' }, { number: 1e-21, prefix: 'z' }, { number: 1e-18, prefix: 'a' }, { number: 1e-15, prefix: 'f' }, { number: 1e-12, prefix: 'p' }, { number: 1e-9, prefix: 'n' }, { number: 1e-6, prefix: '\u03BC' }, { number: 0.001, prefix: 'm' }];
      this.panEventsEnabled = !0;
      this.product = 'amcharts';
      this.animations = [];
      this.balloon = new d.AmBalloon(this.theme);
      this.balloon.chart = this;
      this.processTimeout = 0;
      this.processCount = 1e3;
      this.animatable = [];
      d.applyTheme(this, a, 'AmChart');
    },
    drawChart: function drawChart() {
      0 < this.realWidth && 0 < this.realHeight && (this.drawBackground(), this.redrawLabels(), this.drawTitles(), this.brr(), this.renderFix(), this.chartDiv && (this.boundingRect = this.chartDiv.getBoundingClientRect()));
    },
    makeAccessible: function makeAccessible(a, b) {
      this.accessible && a && (a.setAttr('role', 'img'), a.setAttr('aria-label', b));
    },
    drawBackground: function drawBackground() {
      d.remove(this.background);
      var a = this.container,
          b = this.backgroundColor,
          c = this.backgroundAlpha,
          e = this.set;
      d.isModern || 0 !== c || (c = 0.001);
      var h = this.updateWidth();
      this.realWidth = h;
      var f = this.updateHeight();
      this.realHeight = f;
      b = d.polygon(a, [0, h - 1, h - 1, 0], [0, 0, f - 1, f - 1], b, c, 1, this.borderColor, this.borderAlpha);
      d.setCN(this, b, 'bg');
      this.background = b;
      e.push(b);
      if (b = this.backgroundImage) a = a.image(b, 0, 0, h, f), d.setCN(this, b, 'bg-image'), this.bgImg = a, e.push(a);
    },
    drawTitles: function drawTitles(a) {
      var b = this.titles;
      this.titleHeight = 0;
      if (d.ifArray(b)) {
        var c = 20,
            e;
        for (e = 0; e < b.length; e++) {
          var h = b[e],
              h = d.processObject(h, d.Title, this.theme);
          if (!1 !== h.enabled) {
            var f = h.color;
            void 0 === f && (f = this.color);
            var g = h.size;
            isNaN(g) && (g = this.fontSize + 2);
            isNaN(h.alpha);
            var k = this.marginLeft,
                l = !0;
            void 0 !== h.bold && (l = h.bold);
            f = d.wrappedText(this.container, h.text, f, this.fontFamily, g, 'middle', l, this.realWidth - 35);
            f.translate(k + (this.realWidth - this.marginRight - k) / 2, c);
            f.node.style.pointerEvents = 'none';
            h.sprite = f;
            d.setCN(this, f, 'title');
            h.id && d.setCN(this, f, 'title-' + h.id);
            f.attr({ opacity: h.alpha });
            c += f.getBBox().height + 5;
            a ? f.remove() : this.freeLabelsSet.push(f);
          }
        }
        this.titleHeight = c - 10;
      }
    },
    write: function write(a) {
      var b = this;
      if (b.listeners) for (var c = 0; c < b.listeners.length; c++) {
        var e = b.listeners[c];
        b.addListener(e.event, e.method);
      }
      b.fire({ type: 'buildStarted', chart: b });
      b.afterWriteTO && clearTimeout(b.afterWriteTO);
      0 < b.processTimeout ? b.afterWriteTO = setTimeout(function () {
        b.afterWrite.call(b, a);
      }, b.processTimeout) : b.afterWrite(a);
    },
    afterWrite: function afterWrite(a) {
      if (a = 'object' != (typeof a === 'undefined' ? 'undefined' : _typeof(a)) ? document.getElementById(a) : a) {
        for (; a.firstChild;) {
          a.removeChild(a.firstChild);
        }this.div = a;
        a.style.overflow = 'hidden';
        a.style.textAlign = 'left';
        var b = this.chartDiv,
            c = this.legendDiv,
            e = this.legend,
            h = c.style,
            f = b.style;
        this.measure();
        this.previousHeight = this.divRealHeight;
        this.previousWidth = this.divRealWidth;
        var g,
            k = document.createElement('div');
        g = k.style;
        g.position = 'relative';
        this.containerDiv = k;
        k.className = this.classNamePrefix + '-main-div';
        b.className = this.classNamePrefix + '-chart-div';
        a.appendChild(k);
        var l = this.exportConfig;
        l && d.AmExport && !this.AmExport && (this.AmExport = new d.AmExport(this, l));
        this.amExport && d.AmExport && (this.AmExport = d.extend(this.amExport, new d.AmExport(this), !0));
        this.AmExport && this.AmExport.init && this.AmExport.init();
        if (e) {
          e = this.addLegend(e, e.divId);
          if (e.enabled) switch (h.left = null, h.top = null, h.right = null, f.left = null, f.right = null, f.top = null, h.position = 'relative', f.position = 'relative', e.position) {
            case 'bottom':
              k.appendChild(b);
              k.appendChild(c);
              break;
            case 'top':
              k.appendChild(c);
              k.appendChild(b);
              break;
            case 'absolute':
              g.width = a.style.width;
              g.height = a.style.height;
              h.position = 'absolute';
              f.position = 'absolute';
              void 0 !== e.left && (h.left = e.left + 'px');
              void 0 !== e.right && (h.right = e.right + 'px');
              void 0 !== e.top && (h.top = e.top + 'px');
              void 0 !== e.bottom && (h.bottom = e.bottom + 'px');
              e.marginLeft = 0;
              e.marginRight = 0;
              k.appendChild(b);
              k.appendChild(c);
              break;
            case 'right':
              g.width = a.style.width;
              g.height = a.style.height;
              h.position = 'relative';
              f.position = 'absolute';
              k.appendChild(b);
              k.appendChild(c);
              break;
            case 'left':
              g.width = a.style.width;
              g.height = a.style.height;
              h.position = 'absolute';
              f.position = 'relative';
              k.appendChild(b);
              k.appendChild(c);
              break;
            case 'outside':
              k.appendChild(b);
          } else k.appendChild(b);
          this.prevLegendPosition = e.position;
        } else k.appendChild(b);
        this.listenersAdded || (this.addListeners(), this.listenersAdded = !0);
        this.initChart();
      }
    },
    createLabelsSet: function createLabelsSet() {
      d.remove(this.labelsSet);
      this.labelsSet = this.container.set();
      this.freeLabelsSet.push(this.labelsSet);
    },
    initChart: function initChart() {
      this.balloon = d.processObject(this.balloon, d.AmBalloon, this.theme);
      window.AmCharts_path && (this.path = window.AmCharts_path);
      void 0 === this.path && (this.path = d.getPath());
      void 0 === this.path && (this.path = 'amcharts/');
      this.path = d.normalizeUrl(this.path);
      void 0 === this.pathToImages && (this.pathToImages = '/Content/images/');
      this.initHC || (d.callInitHandler(this), this.initHC = !0);
      d.applyLang(this.language, this);
      var a = this.numberFormatter;
      a && (isNaN(a.precision) || (this.precision = a.precision), void 0 !== a.thousandsSeparator && (this.thousandsSeparator = a.thousandsSeparator), void 0 !== a.decimalSeparator && (this.decimalSeparator = a.decimalSeparator));(a = this.percentFormatter) && !isNaN(a.precision) && (this.percentPrecision = a.precision);
      this.nf = {
        precision: this.precision,
        thousandsSeparator: this.thousandsSeparator,
        decimalSeparator: this.decimalSeparator
      };
      this.pf = {
        precision: this.percentPrecision,
        thousandsSeparator: this.thousandsSeparator,
        decimalSeparator: this.decimalSeparator
      };
      this.destroy();(a = this.container) ? (a.container.innerHTML = '', a.width = this.realWidth, a.height = this.realHeight, a.addDefs(this), this.chartDiv.appendChild(a.container)) : a = new d.AmDraw(this.chartDiv, this.realWidth, this.realHeight, this);
      this.container = a;
      this.extension = '.png';
      this.svgIcons && d.SVG && (this.extension = '.svg');
      this.checkDisplay();
      a.chart = this;
      d.VML || d.SVG ? (a.handDrawn = this.handDrawn, a.handDrawScatter = this.handDrawScatter, a.handDrawThickness = this.handDrawThickness, d.remove(this.set), this.set = a.set(), d.remove(this.gridSet), this.gridSet = a.set(), d.remove(this.cursorLineSet), this.cursorLineSet = a.set(), d.remove(this.graphsBehindSet), this.graphsBehindSet = a.set(), d.remove(this.bulletBehindSet), this.bulletBehindSet = a.set(), d.remove(this.columnSet), this.columnSet = a.set(), d.remove(this.graphsSet), this.graphsSet = a.set(), d.remove(this.trendLinesSet), this.trendLinesSet = a.set(), d.remove(this.axesSet), this.axesSet = a.set(), d.remove(this.cursorSet), this.cursorSet = a.set(), d.remove(this.scrollbarsSet), this.scrollbarsSet = a.set(), d.remove(this.bulletSet), this.bulletSet = a.set(), d.remove(this.freeLabelsSet), this.freeLabelsSet = a.set(), d.remove(this.axesLabelsSet), this.axesLabelsSet = a.set(), d.remove(this.balloonsSet), this.balloonsSet = a.set(), d.remove(this.plotBalloonsSet), this.plotBalloonsSet = a.set(), d.remove(this.zoomButtonSet), this.zoomButtonSet = a.set(), d.remove(this.zbSet), this.zbSet = null, d.remove(this.linkSet), this.linkSet = a.set()) : this.fire({ type: 'failed', chart: this });
    },
    premeasure: function premeasure() {
      var a = this.div;
      if (a) {
        try {
          this.boundingRect = this.chartDiv.getBoundingClientRect();
        } catch (e) {}
        var b = a.offsetWidth,
            c = a.offsetHeight;
        a.clientHeight && (b = a.clientWidth, c = a.clientHeight);
        if (b != this.mw || c != this.mh) this.mw = b, this.mh = c, this.measure();
      }
    },
    measure: function measure() {
      var a = this.div;
      if (a) {
        var b = this.chartDiv,
            c = a.offsetWidth,
            e = a.offsetHeight,
            h = this.container;
        a.clientHeight && (c = a.clientWidth, e = a.clientHeight);
        var f = d.removePx(d.getStyle(a, 'padding-left')),
            g = d.removePx(d.getStyle(a, 'padding-right')),
            k = d.removePx(d.getStyle(a, 'padding-top')),
            l = d.removePx(d.getStyle(a, 'padding-bottom'));
        isNaN(f) || (c -= f);
        isNaN(g) || (c -= g);
        isNaN(k) || (e -= k);
        isNaN(l) || (e -= l);
        f = a.style;
        a = f.width;
        f = f.height;-1 != a.indexOf('px') && (c = d.removePx(a));-1 != f.indexOf('px') && (e = d.removePx(f));
        e = Math.round(e);
        c = Math.round(c);
        a = Math.round(d.toCoordinate(this.width, c));
        f = Math.round(d.toCoordinate(this.height, e));(c != this.previousWidth || e != this.previousHeight) && 0 < a && 0 < f && (b.style.width = a + 'px', b.style.height = f + 'px', b.style.padding = 0, h && h.setSize(a, f), this.balloon = d.processObject(this.balloon, d.AmBalloon, this.theme));
        this.balloon.setBounds && this.balloon.setBounds(2, 2, a - 2, f);
        this.balloon.chart = this;
        this.realWidth = a;
        this.realHeight = f;
        this.divRealWidth = c;
        this.divRealHeight = e;
      }
    },
    checkDisplay: function checkDisplay() {
      if (this.autoDisplay && this.container) {
        var a = d.rect(this.container, 10, 10),
            b = a.getBBox();
        0 === b.width && 0 === b.height && (this.divRealHeight = this.divRealWidth = this.realHeight = this.realWidth = 0, this.previousWidth = this.previousHeight = NaN);
        a.remove();
      }
    },
    destroy: function destroy() {
      this.chartDiv.innerHTML = '';
      this.clearTimeOuts();
      this.legend && this.legend.destroy();
    },
    clearTimeOuts: function clearTimeOuts() {
      var a = this.timeOuts;
      if (a) {
        var b;
        for (b = 0; b < a.length; b++) {
          clearTimeout(a[b]);
        }
      }
      this.timeOuts = [];
    },
    clear: function clear(a) {
      d.callMethod('clear', [this.chartScrollbar, this.scrollbarV, this.scrollbarH, this.chartCursor]);
      this.chartCursor = this.scrollbarH = this.scrollbarV = this.chartScrollbar = null;
      this.clearTimeOuts();
      this.container && (this.container.remove(this.chartDiv), this.container.remove(this.legendDiv));
      a || d.removeChart(this);
      if (a = this.div) for (; a.firstChild;) {
        a.removeChild(a.firstChild);
      }this.legend && this.legend.destroy();
    },
    setMouseCursor: function setMouseCursor(a) {
      'auto' == a && d.isNN && (a = 'default');
      this.chartDiv.style.cursor = a;
      this.legendDiv.style.cursor = a;
    },
    redrawLabels: function redrawLabels() {
      this.labels = [];
      var a = this.allLabels;
      this.createLabelsSet();
      var b;
      for (b = 0; b < a.length; b++) {
        this.drawLabel(a[b]);
      }
    },
    drawLabel: function drawLabel(a) {
      var b = this;
      if (b.container && !1 !== a.enabled) {
        a = d.processObject(a, d.Label, b.theme);
        var c = a.y,
            e = a.text,
            h = a.align,
            f = a.size,
            g = a.color,
            k = a.rotation,
            l = a.alpha,
            m = a.bold,
            n = d.toCoordinate(a.x, b.realWidth),
            c = d.toCoordinate(c, b.realHeight);
        n || (n = 0);
        c || (c = 0);
        void 0 === g && (g = b.color);
        isNaN(f) && (f = b.fontSize);
        h || (h = 'start');
        'left' == h && (h = 'start');
        'right' == h && (h = 'end');
        'center' == h && (h = 'middle', k ? c = b.realHeight - c + c / 2 : n = b.realWidth / 2 - n);
        void 0 === l && (l = 1);
        void 0 === k && (k = 0);
        c += f / 2;
        e = d.text(b.container, e, g, b.fontFamily, f, h, m, l);
        e.translate(n, c);
        d.setCN(b, e, 'label');
        a.id && d.setCN(b, e, 'label-' + a.id);
        0 !== k && e.rotate(k);
        a.url ? (e.setAttr('cursor', 'pointer'), e.click(function () {
          d.getURL(a.url, b.urlTarget);
        })) : e.node.style.pointerEvents = 'none';
        b.labelsSet.push(e);
        b.labels.push(e);
      }
    },
    addLabel: function addLabel(a, b, c, e, d, f, g, k, l, m) {
      a = {
        x: a,
        y: b,
        text: c,
        align: e,
        size: d,
        color: f,
        alpha: k,
        rotation: g,
        bold: l,
        url: m,
        enabled: !0
      };
      this.container && this.drawLabel(a);
      this.allLabels.push(a);
    },
    clearLabels: function clearLabels() {
      var a = this.labels,
          b;
      for (b = a.length - 1; 0 <= b; b--) {
        a[b].remove();
      }this.labels = [];
      this.allLabels = [];
    },
    updateHeight: function updateHeight() {
      var a = this.divRealHeight,
          b = this.legend;
      if (b) {
        var c = this.legendDiv.offsetHeight,
            b = b.position;
        if ('top' == b || 'bottom' == b) {
          a -= c;
          if (0 > a || isNaN(a)) a = 0;
          this.chartDiv.style.height = a + 'px';
        }
      }
      return a;
    },
    updateWidth: function updateWidth() {
      var a = this.divRealWidth,
          b = this.divRealHeight,
          c = this.legend;
      if (c) {
        var e = this.legendDiv,
            d = e.offsetWidth;
        isNaN(c.width) || (d = c.width);
        c.ieW && (d = c.ieW);
        var f = e.offsetHeight,
            e = e.style,
            g = this.chartDiv.style,
            c = c.position;
        if ('right' == c || 'left' == c) {
          a -= d;
          if (0 > a || isNaN(a)) a = 0;
          g.width = a + 'px';
          this.balloon.setBounds(2, 2, a - 2, this.realHeight);
          'left' == c ? (g.left = d + 'px', e.left = '0px') : (g.left = '0px', e.left = a + 'px');
          b > f && (e.top = (b - f) / 2 + 'px');
        }
      }
      return a;
    },
    getTitleHeight: function getTitleHeight() {
      this.drawTitles(!0);
      return this.titleHeight;
    },
    addTitle: function addTitle(a, b, c, e, d) {
      isNaN(b) && (b = this.fontSize + 2);
      a = { text: a, size: b, color: c, alpha: e, bold: d, enabled: !0 };
      this.titles.push(a);
      return a;
    },
    handleWheel: function handleWheel(a) {
      var b = 0;
      a || (a = window.event);
      a.wheelDelta ? b = a.wheelDelta / 120 : a.detail && (b = -a.detail / 3);
      b && this.handleWheelReal(b, a.shiftKey);
      a.preventDefault && a.preventDefault();
    },
    handleWheelReal: function handleWheelReal() {},
    handleDocTouchStart: function handleDocTouchStart() {
      this.hideBalloonReal();
      this.handleMouseMove();
      this.tmx = this.mouseX;
      this.tmy = this.mouseY;
      this.touchStartTime = new Date().getTime();
    },
    handleDocTouchEnd: function handleDocTouchEnd() {
      ;-0.5 < this.tmx && this.tmx < this.divRealWidth + 1 && 0 < this.tmy && this.tmy < this.divRealHeight ? (this.handleMouseMove(), 4 > Math.abs(this.mouseX - this.tmx) && 4 > Math.abs(this.mouseY - this.tmy) ? (this.tapped = !0, this.panRequired && this.panEventsEnabled && this.chartDiv && (this.chartDiv.style.msTouchAction = 'none', this.chartDiv.style.touchAction = 'none')) : this.mouseIsOver || this.resetTouchStyle()) : (this.tapped = !1, this.resetTouchStyle());
    },
    resetTouchStyle: function resetTouchStyle() {
      this.panEventsEnabled && this.chartDiv && (this.chartDiv.style.msTouchAction = 'auto', this.chartDiv.style.touchAction = 'auto');
    },
    checkTouchDuration: function checkTouchDuration(a) {
      var b = this,
          c = new Date().getTime();
      if (a) if (a.touches) b.isTouchEvent = !0;else if (!b.isTouchEvent) return !0;
      if (c - b.touchStartTime > b.touchClickDuration) return !0;
      setTimeout(function () {
        b.resetTouchDuration();
      }, 300);
    },
    resetTouchDuration: function resetTouchDuration() {
      this.isTouchEvent = !1;
    },
    checkTouchMoved: function checkTouchMoved() {
      if (4 < Math.abs(this.mouseX - this.tmx) || 4 < Math.abs(this.mouseY - this.tmy)) return !0;
    },
    addListeners: function addListeners() {
      var a = this,
          b = a.chartDiv;
      document.addEventListener ? ('ontouchstart' in document.documentElement && (b.addEventListener('touchstart', function (b) {
        a.handleTouchStart.call(a, b);
      }, !0), b.addEventListener('touchmove', function (b) {
        a.handleMouseMove.call(a, b);
      }, !0), b.addEventListener('touchend', function (b) {
        a.handleTouchEnd.call(a, b);
      }, !0), document.addEventListener('touchstart', function (b) {
        a.handleDocTouchStart.call(a, b);
      }), document.addEventListener('touchend', function (b) {
        a.handleDocTouchEnd.call(a, b);
      })), b.addEventListener('mousedown', function (b) {
        a.mouseIsOver = !0;
        a.handleMouseMove.call(a, b);
        a.handleMouseDown.call(a, b);
        a.handleDocTouchStart.call(a, b);
      }, !0), b.addEventListener('mouseover', function (b) {
        a.handleMouseOver.call(a, b);
      }, !0), b.addEventListener('mouseout', function (b) {
        a.handleMouseOut.call(a, b);
      }, !0), b.addEventListener('mouseup', function (b) {
        a.handleDocTouchEnd.call(a, b);
      }, !0)) : (b.attachEvent('onmousedown', function (b) {
        a.handleMouseDown.call(a, b);
      }), b.attachEvent('onmouseover', function (b) {
        a.handleMouseOver.call(a, b);
      }), b.attachEvent('onmouseout', function (b) {
        a.handleMouseOut.call(a, b);
      }));
    },
    dispDUpd: function dispDUpd() {
      this.skipEvents || (this.dispatchDataUpdated && (this.dispatchDataUpdated = !1, this.fire({ type: 'dataUpdated', chart: this })), this.chartCreated || (this.chartCreated = !0, this.fire({ type: 'init', chart: this })), this.chartRendered || (this.fire({ type: 'rendered', chart: this }), this.chartRendered = !0), this.fire({ type: 'drawn', chart: this }));
      this.skipEvents = !1;
    },
    validateSize: function validateSize() {
      var a = this;
      a.premeasure();
      a.checkDisplay();
      if (a.divRealWidth != a.previousWidth || a.divRealHeight != a.previousHeight) {
        var b = a.legend;
        if (0 < a.realWidth && 0 < a.realHeight) {
          a.sizeChanged = !0;
          if (b) {
            a.legendInitTO && clearTimeout(a.legendInitTO);
            var c = setTimeout(function () {
              b.invalidateSize();
            }, 10);
            a.timeOuts.push(c);
            a.legendInitTO = c;
          }
          a.marginsUpdated = !1;
          clearTimeout(a.initTO);
          c = setTimeout(function () {
            a.initChart();
          }, 10);
          a.timeOuts.push(c);
          a.initTO = c;
        }
        a.renderFix();
        b && b.renderFix && b.renderFix();
        clearTimeout(a.resizedTO);
        a.resizedTO = setTimeout(function () {
          a.fire({ type: 'resized', chart: a });
        }, 10);
        a.previousHeight = a.divRealHeight;
        a.previousWidth = a.divRealWidth;
      }
    },
    invalidateSize: function invalidateSize() {
      this.previousHeight = this.previousWidth = NaN;
      this.invalidateSizeReal();
    },
    invalidateSizeReal: function invalidateSizeReal() {
      var a = this;
      a.marginsUpdated = !1;
      clearTimeout(a.validateTO);
      var b = setTimeout(function () {
        a.validateSize();
      }, 5);
      a.timeOuts.push(b);
      a.validateTO = b;
    },
    validateData: function validateData(a) {
      this.chartCreated && (this.dataChanged = !0, this.marginsUpdated = !1, this.initChart(a));
    },
    validateNow: function validateNow(a, b) {
      this.initTO && clearTimeout(this.initTO);
      a && (this.dataChanged = !0, this.marginsUpdated = !1);
      this.skipEvents = b;
      this.chartRendered = !1;
      var c = this.legend;
      c && c.position != this.prevLegendPosition && (this.previousWidth = this.mw = 0, c.invalidateSize && (c.invalidateSize(), this.validateSize()));
      this.write(this.div);
    },
    showItem: function showItem(a) {
      a.hidden = !1;
      this.initChart();
    },
    hideItem: function hideItem(a) {
      a.hidden = !0;
      this.initChart();
    },
    hideBalloon: function hideBalloon() {
      var a = this;
      clearTimeout(a.hoverInt);
      clearTimeout(a.balloonTO);
      a.hoverInt = setTimeout(function () {
        a.hideBalloonReal.call(a);
      }, a.hideBalloonTime);
    },
    cleanChart: function cleanChart() {},
    hideBalloonReal: function hideBalloonReal() {
      var a = this.balloon;
      a && a.hide && a.hide();
    },
    showBalloon: function showBalloon(a, b, c, e, d) {
      var f = this;
      clearTimeout(f.balloonTO);
      clearTimeout(f.hoverInt);
      f.balloonTO = setTimeout(function () {
        f.showBalloonReal.call(f, a, b, c, e, d);
      }, 1);
    },
    showBalloonReal: function showBalloonReal(a, b, c, e, d) {
      this.handleMouseMove();
      var f = this.balloon;
      f.enabled && (f.followCursor(!1), f.changeColor(b), !c || f.fixedPosition ? (f.setPosition(e, d), isNaN(e) || isNaN(d) ? f.followCursor(!0) : f.followCursor(!1)) : f.followCursor(!0), a && f.showBalloon(a));
    },
    handleMouseOver: function handleMouseOver() {
      this.outTO && clearTimeout(this.outTO);
      d.resetMouseOver();
      this.mouseIsOver = !0;
    },
    handleMouseOut: function handleMouseOut() {
      var a = this;
      d.resetMouseOver();
      a.outTO && clearTimeout(a.outTO);
      a.outTO = setTimeout(function () {
        a.handleMouseOutReal();
      }, 10);
    },
    handleMouseOutReal: function handleMouseOutReal() {
      this.mouseIsOver = !1;
    },
    handleMouseMove: function handleMouseMove(a) {
      a || (a = window.event);
      this.mouse2Y = this.mouse2X = NaN;
      var b, c, e, d;
      if (a) {
        if (a.touches) {
          var f = a.touches.item(1);
          f && this.panEventsEnabled && this.boundingRect && (e = f.clientX - this.boundingRect.left, d = f.clientY - this.boundingRect.top);
          a = a.touches.item(0);
          if (!a) return;
        } else this.wasTouched = !1;
        this.boundingRect && a.clientX && (b = a.clientX - this.boundingRect.left, c = a.clientY - this.boundingRect.top);
        isNaN(e) ? this.mouseX = b : (this.mouseX = Math.min(b, e), this.mouse2X = Math.max(b, e));
        isNaN(d) ? this.mouseY = c : (this.mouseY = Math.min(c, d), this.mouse2Y = Math.max(c, d));
      }
    },
    handleTouchStart: function handleTouchStart(a) {
      this.hideBalloonReal();a && (a.touches && this.tapToActivate && !this.tapped || !this.panRequired) || (this.handleMouseMove(a), this.handleMouseDown(a));
    },
    handleTouchEnd: function handleTouchEnd(a) {
      this.wasTouched = !0;
      this.handleMouseMove(a);
      d.resetMouseOver();
      this.handleReleaseOutside(a);
    },
    handleReleaseOutside: function handleReleaseOutside() {
      this.handleDocTouchEnd.call(this);
    },
    handleMouseDown: function handleMouseDown(a) {
      d.resetMouseOver();
      this.mouseIsOver = !0;
      a && a.preventDefault && (this.panEventsEnabled ? a.preventDefault() : a.touches || a.preventDefault());
    },
    addLegend: function addLegend(a, b) {
      a = d.processObject(a, d.AmLegend, this.theme);
      a.divId = b;
      a.ieW = 0;
      var c;
      c = 'object' != (typeof b === 'undefined' ? 'undefined' : _typeof(b)) && b ? document.getElementById(b) : b;
      this.legend = a;
      a.chart = this;
      c ? (a.div = c, a.position = 'outside', a.autoMargins = !1) : a.div = this.legendDiv;
      return a;
    },
    removeLegend: function removeLegend() {
      this.legend = void 0;
      this.previousWidth = 0;
      this.legendDiv.innerHTML = '';
    },
    handleResize: function handleResize() {
      ;(d.isPercents(this.width) || d.isPercents(this.height)) && this.invalidateSizeReal();
      this.renderFix();
    },
    renderFix: function renderFix() {
      if (!d.VML) {
        var a = this.container;
        a && a.renderFix();
      }
    },
    getSVG: function getSVG() {
      if (d.hasSVG) return this.container;
    },
    animate: function animate(a, b, c, e, h, f, g) {
      a['an_' + b] && d.removeFromArray(this.animations, a['an_' + b]);
      c = {
        obj: a,
        frame: 0,
        attribute: b,
        from: c,
        to: e,
        time: h,
        effect: f,
        suffix: g
      };
      a['an_' + b] = c;
      this.animations.push(c);
      return c;
    },
    setLegendData: function setLegendData(a) {
      var b = this.legend;
      b && b.setData(a);
    },
    stopAnim: function stopAnim(a) {
      d.removeFromArray(this.animations, a);
    },
    updateAnimations: function updateAnimations() {
      var a;
      this.container && this.container.update();
      if (this.animations) for (a = this.animations.length - 1; 0 <= a; a--) {
        var b = this.animations[a],
            c = d.updateRate * b.time,
            e = b.frame + 1,
            h = b.obj,
            f = b.attribute;
        if (e <= c) {
          b.frame++;
          var g = Number(b.from),
              k = Number(b.to) - g,
              c = d[b.effect](0, e, g, k, c);
          0 === k ? (this.animations.splice(a, 1), h.node.style[f] = Number(b.to) + b.suffix) : h.node.style[f] = c + b.suffix;
        } else h.node.style[f] = Number(b.to) + b.suffix, h.animationFinished = !0, this.animations.splice(a, 1);
      }
    },
    update: function update() {
      this.updateAnimations();
      var a = this.animatable;
      if (0 < a.length) {
        for (var b = !0, c = a.length - 1; 0 <= c; c--) {
          var e = a[c];
          e && (e.animationFinished ? a.splice(c, 1) : b = !1);
        }
        b && (this.fire({ type: 'animationFinished', chart: this }), this.animatable = []);
      }
    },
    inIframe: function inIframe() {
      try {
        return window.self !== window.top;
      } catch (a) {
        return !0;
      }
    },
    brr: function brr() {}
  });
  d.Slice = d.Class({ construct: function construct() {} });
  d.SerialDataItem = d.Class({ construct: function construct() {} });
  d.GraphDataItem = d.Class({ construct: function construct() {} });
  d.Guide = d.Class({
    construct: function construct(a) {
      this.cname = 'Guide';
      d.applyTheme(this, a, this.cname);
    }
  });
  d.Title = d.Class({
    construct: function construct(a) {
      this.cname = 'Title';
      d.applyTheme(this, a, this.cname);
    }
  });
  d.Label = d.Class({
    construct: function construct(a) {
      this.cname = 'Label';
      d.applyTheme(this, a, this.cname);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.AmGraph = d.Class({
    construct: function construct(a) {
      this.cname = 'AmGraph';
      this.createEvents('rollOverGraphItem', 'rollOutGraphItem', 'clickGraphItem', 'doubleClickGraphItem', 'rightClickGraphItem', 'clickGraph', 'rollOverGraph', 'rollOutGraph');
      this.type = 'line';
      this.stackable = !0;
      this.columnCount = 1;
      this.columnIndex = 0;
      this.centerCustomBullets = this.showBalloon = !0;
      this.maxBulletSize = 50;
      this.minBulletSize = 4;
      this.balloonText = '[[value]]';
      this.hidden = this.scrollbar = this.animationPlayed = !1;
      this.pointPosition = 'middle';
      this.depthCount = 1;
      this.includeInMinMax = !0;
      this.negativeBase = 0;
      this.visibleInLegend = !0;
      this.showAllValueLabels = !1;
      this.showBulletsAt = this.showBalloonAt = 'close';
      this.lineThickness = 1;
      this.dashLength = 0;
      this.connect = !0;
      this.lineAlpha = 1;
      this.bullet = 'none';
      this.bulletBorderThickness = 2;
      this.bulletBorderAlpha = 0;
      this.bulletAlpha = 1;
      this.bulletSize = 8;
      this.cornerRadiusTop = this.hideBulletsCount = this.bulletOffset = 0;
      this.cursorBulletAlpha = 1;
      this.gradientOrientation = 'vertical';
      this.dy = this.dx = 0;
      this.periodValue = '';
      this.clustered = !0;
      this.periodSpan = 1;
      this.accessibleLabel = '[[title]] [[value]]';
      this.y = this.x = 0;
      this.switchable = !0;
      this.tcc = this.minDistance = 1;
      this.labelRotation = 0;
      this.labelAnchor = 'auto';
      this.labelOffset = 3;
      this.bcn = 'graph-';
      this.dateFormat = 'MMM DD, YYYY';
      this.noRounding = !0;
      d.applyTheme(this, a, this.cname);
    },
    init: function init() {
      this.createBalloon();
    },
    draw: function draw() {
      var a = this.chart;
      a.isRolledOverBullet = !1;
      var b = a.type;
      if (a.drawGraphs) {
        isNaN(this.precision) || (this.numberFormatter ? this.numberFormatter.precision = this.precision : this.numberFormatter = {
          precision: this.precision,
          decimalSeparator: a.decimalSeparator,
          thousandsSeparator: a.thousandsSeparator
        });
        var c = a.container;
        this.container = c;
        this.destroy();
        var e = c.set();
        this.set = e;
        e.translate(this.x, this.y);
        var h = c.set();
        this.bulletSet = h;
        h.translate(this.x, this.y);
        this.behindColumns ? (a.graphsBehindSet.push(e), a.bulletBehindSet.push(h)) : (a.graphsSet.push(e), a.bulletSet.push(h));
        var f = this.bulletAxis;
        d.isString(f) && (this.bulletAxis = a.getValueAxisById(f));
        c = c.set();
        d.remove(this.columnsSet);
        this.columnsSet = c;
        d.setCN(a, e, 'graph-' + this.type);
        d.setCN(a, e, 'graph-' + this.id);
        d.setCN(a, h, 'graph-' + this.type);
        d.setCN(a, h, 'graph-' + this.id);
        this.columnsArray = [];
        this.ownColumns = [];
        this.allBullets = [];
        this.animationArray = [];
        h = this.labelPosition;
        h || (f = this.valueAxis.stackType, h = 'top', 'column' == this.type && (a.rotate && (h = 'right'), '100%' == f || 'regular' == f) && (h = 'middle'), this.labelPosition = h);
        d.ifArray(this.data) && (a = !1, 'xy' == b ? this.xAxis.axisCreated && this.yAxis.axisCreated && (a = !0) : this.valueAxis.axisCreated && (a = !0), !this.hidden && a && this.createGraph());
        e.push(c);
      }
    },
    createGraph: function createGraph() {
      var a = this,
          b = a.chart;
      a.startAlpha = b.startAlpha;
      a.seqAn = b.sequencedAnimation;
      a.baseCoord = a.valueAxis.baseCoord;
      void 0 === a.fillAlphas && (a.fillAlphas = 0);
      a.bulletColorR = a.bulletColor;
      void 0 === a.bulletColorR && (a.bulletColorR = a.lineColorR, a.bulletColorNegative = a.negativeLineColor);
      void 0 === a.bulletAlpha && (a.bulletAlpha = a.lineAlpha);
      if ('step' == c || d.VML) a.noRounding = !1;
      var c = b.type;
      'gantt' == c && (c = 'serial');
      clearTimeout(a.playedTO);
      if (!isNaN(a.valueAxis.min) && !isNaN(a.valueAxis.max)) {
        switch (c) {
          case 'serial':
            a.categoryAxis && (a.createSerialGraph(), 'candlestick' == a.type && 1 > a.valueAxis.minMaxMultiplier && a.positiveClip(a.set));
            break;
          case 'radar':
            a.createRadarGraph();
            break;
          case 'xy':
            a.createXYGraph();
        }
        a.playedTO = setTimeout(function () {
          a.setAnimationPlayed.call(a);
        }, 500 * a.chart.startDuration);
      }
    },
    setAnimationPlayed: function setAnimationPlayed() {
      this.animationPlayed = !0;
    },
    createXYGraph: function createXYGraph() {
      var a = [],
          b = [],
          c = this.xAxis,
          e = this.yAxis;
      this.pmh = e.height;
      this.pmw = c.width;
      this.pmy = this.pmx = 0;
      var d;
      for (d = this.start; d <= this.end; d++) {
        var f = this.data[d].axes[c.id].graphs[this.id],
            g = f.values,
            k = g.x,
            l = g.y,
            g = c.getCoordinate(k, this.noRounding),
            m = e.getCoordinate(l, this.noRounding);
        if (!isNaN(k) && !isNaN(l) && (a.push(g), b.push(m), f.x = g, f.y = m, k = this.createBullet(f, g, m, d), l = this.labelText)) {
          var l = this.createLabel(f, l),
              n = 0;
          k && (n = k.size);
          this.positionLabel(f, g, m, l, n);
        }
      }
      this.drawLineGraph(a, b);
      this.launchAnimation();
    },
    createRadarGraph: function createRadarGraph() {
      var a = this.valueAxis.stackType,
          b = [],
          c = [],
          e = [],
          d = [],
          f,
          g,
          k,
          l,
          m;
      for (m = this.start; m <= this.end; m++) {
        var n = this.data[m].axes[this.valueAxis.id].graphs[this.id],
            q,
            p;
        'none' == a || '3d' == a ? q = n.values.value : (q = n.values.close, p = n.values.open);
        if (isNaN(q)) this.connect || (this.drawLineGraph(b, c, e, d), b = [], c = [], e = [], d = []);else {
          var t = this.valueAxis.getCoordinate(q, this.noRounding) - this.height,
              t = t * this.valueAxis.rMultiplier,
              r = -360 / (this.end - this.start + 1) * m;
          'middle' == this.valueAxis.pointPosition && (r -= 180 / (this.end - this.start + 1));
          q = t * Math.sin(r / 180 * Math.PI);
          t *= Math.cos(r / 180 * Math.PI);
          b.push(q);
          c.push(t);
          if (!isNaN(p)) {
            var u = this.valueAxis.getCoordinate(p, this.noRounding) - this.height,
                u = u * this.valueAxis.rMultiplier,
                x = u * Math.sin(r / 180 * Math.PI),
                r = u * Math.cos(r / 180 * Math.PI);
            e.push(x);
            d.push(r);
            isNaN(k) && (k = x);
            isNaN(l) && (l = r);
          }
          r = this.createBullet(n, q, t, m);
          n.x = q;
          n.y = t;
          if (x = this.labelText) x = this.createLabel(n, x), u = 0, r && (u = r.size), this.positionLabel(n, q, t, x, u);
          isNaN(f) && (f = q);
          isNaN(g) && (g = t);
        }
      }
      b.push(f);
      c.push(g);
      isNaN(k) || (e.push(k), d.push(l));
      this.drawLineGraph(b, c, e, d);
      this.launchAnimation();
    },
    positionLabel: function positionLabel(a, b, c, e, d) {
      if (e) {
        var f = this.chart,
            g = this.valueAxis,
            k = 'middle',
            l = !1,
            m = this.labelPosition,
            n = e.getBBox(),
            q = this.chart.rotate,
            p = a.isNegative;
        c -= n.height / 4 / 2;
        void 0 !== a.labelIsNegative && (p = a.labelIsNegative);
        switch (m) {
          case 'right':
            m = q ? p ? 'left' : 'right' : 'right';
            break;
          case 'top':
            m = q ? 'top' : p ? 'bottom' : 'top';
            break;
          case 'bottom':
            m = q ? 'bottom' : p ? 'top' : 'bottom';
            break;
          case 'left':
            m = q ? p ? 'right' : 'left' : 'left';
        }
        var t = a.columnGraphics,
            r = 0,
            u = 0;
        t && (r = t.x, u = t.y);
        var x = this.labelOffset;
        switch (m) {
          case 'right':
            k = 'start';
            b += d / 2 + x;
            break;
          case 'top':
            c = g.reversed ? c + (d / 2 + n.height / 2 + x) : c - (d / 2 + n.height / 2 + x);
            break;
          case 'bottom':
            c = g.reversed ? c - (d / 2 + n.height / 2 + x) : c + (d / 2 + n.height / 2 + x);
            break;
          case 'left':
            k = 'end';
            b -= d / 2 + x;
            break;
          case 'inside':
            'column' == this.type && (l = !0, q ? p ? (k = 'end', b = r - 3 - x) : (k = 'start', b = r + 3 + x) : c = p ? u + 7 + x : u - 10 - x);
            break;
          case 'middle':
            'column' == this.type && (l = !0, q ? b -= (b - r) / 2 + x - 3 : c -= (c - u) / 2 + x - 3);
        }
        'auto' != this.labelAnchor && (k = this.labelAnchor);
        e.attr({ 'text-anchor': k });
        this.labelRotation && e.rotate(this.labelRotation);
        e.translate(b, c);
        !this.showAllValueLabels && t && l && (n = e.getBBox(), n.height > a.columnHeight || n.width > a.columnWidth) && (e.remove(), e = null);
        e && 'radar' != f.type && (0 > b || b > this.width || 0 > c || c > this.height) && (e.remove(), e = null);
        if (e && ('serial' == f.type || 'gantt' == f.type)) if (q) {
          if (0 > c || c > this.height) e.remove(), e = null;
        } else if (0 > b || b > this.width) e.remove(), e = null;
        e && this.allBullets.push(e);
        return e;
      }
    },
    getGradRotation: function getGradRotation() {
      var a = 270;
      'horizontal' == this.gradientOrientation && (a = 0);
      return this.gradientRotation = a;
    },
    createSerialGraph: function createSerialGraph() {
      this.dashLengthSwitched = this.fillColorsSwitched = this.lineColorSwitched = void 0;
      var a = this.chart,
          b = this.id,
          c = this.index,
          e = this.data,
          h = this.chart.container,
          f = this.valueAxis,
          g = this.type,
          k = this.columnWidthReal,
          l = this.showBulletsAt;
      isNaN(this.columnWidth) || (k = this.columnWidth);
      isNaN(k) && (k = 0.8);
      var m = this.useNegativeColorIfDown,
          n = this.width,
          q = this.height,
          p = this.y,
          t = this.rotate,
          r = this.columnCount,
          u = d.toCoordinate(this.cornerRadiusTop, k / 2),
          x = this.connect,
          y = [],
          w = [],
          z,
          A,
          B,
          C,
          D = this.chart.graphs.length,
          L,
          I = this.dx / this.tcc,
          S = this.dy / this.tcc,
          O = f.stackType,
          Q = this.start,
          ia = this.end,
          H = this.scrollbar,
          Z = 'graph-column-';
      H && (Z = 'scrollbar-graph-column-');
      var va = this.categoryAxis,
          ma = this.baseCoord,
          Oa = this.negativeBase,
          ea = this.columnIndex,
          ca = this.lineThickness,
          X = this.lineAlpha,
          ya = this.lineColorR,
          da = this.dashLength,
          fa = this.set,
          za,
          ga = this.getGradRotation(),
          T = this.chart.columnSpacing,
          Y = va.cellWidth,
          Ca = (Y * k - r) / r;
      T > Ca && (T = Ca);
      var G,
          v,
          na,
          ha = q,
          Pa = n,
          ba = 0,
          tb = 0,
          ub,
          vb,
          gb,
          hb,
          wb = this.fillColorsR,
          Qa = this.negativeFillColors,
          Ja = this.negativeLineColor,
          Ya = this.fillAlphas,
          Za = this.negativeFillAlphas;
      'object' == (typeof Ya === 'undefined' ? 'undefined' : _typeof(Ya)) && (Ya = Ya[0]);
      'object' == (typeof Za === 'undefined' ? 'undefined' : _typeof(Za)) && (Za = Za[0]);
      var xb = this.noRounding;
      'step' == g && (xb = !1);
      var ib = f.getCoordinate(f.min);
      f.logarithmic && (ib = f.getCoordinate(f.minReal));
      this.minCoord = ib;
      this.resetBullet && (this.bullet = 'none');
      if (!(H || 'line' != g && 'smoothedLine' != g && 'step' != g || (1 == e.length && 'step' != g && 'none' == this.bullet && (this.bullet = 'round', this.resetBullet = !0), !Qa && void 0 == Ja || m))) {
        var Ua = Oa;
        Ua > f.max && (Ua = f.max);
        Ua < f.min && (Ua = f.min);
        f.logarithmic && (Ua = f.minReal);
        var Ka = f.getCoordinate(Ua),
            Lb = f.getCoordinate(f.max);
        t ? (ha = q, Pa = Math.abs(Lb - Ka), ub = q, vb = Math.abs(ib - Ka), hb = tb = 0, f.reversed ? (ba = 0, gb = Ka) : (ba = Ka, gb = 0)) : (Pa = n, ha = Math.abs(Lb - Ka), vb = n, ub = Math.abs(ib - Ka), gb = ba = 0, f.reversed ? (hb = p, tb = Ka) : hb = Ka);
      }
      var La = Math.round;
      this.pmx = La(ba);
      this.pmy = La(tb);
      this.pmh = La(ha);
      this.pmw = La(Pa);
      this.nmx = La(gb);
      this.nmy = La(hb);
      this.nmh = La(ub);
      this.nmw = La(vb);
      d.isModern || (this.nmy = this.nmx = 0, this.nmh = this.height);
      this.clustered || (r = 1);
      k = 'column' == g ? (Y * k - T * (r - 1)) / r : Y * k;
      1 > k && (k = 1);
      var Mb = this.fixedColumnWidth;
      isNaN(Mb) || (k = Mb);
      var K;
      if ('line' == g || 'step' == g || 'smoothedLine' == g) {
        if (0 < Q) {
          for (K = Q - 1; -1 < K; K--) {
            if (G = e[K], v = G.axes[f.id].graphs[b], na = v.values.value, !isNaN(na)) {
              Q = K;
              break;
            }
          }if (this.lineColorField) for (K = Q; -1 < K; K--) {
            if (G = e[K], v = G.axes[f.id].graphs[b], v.lineColor) {
              this.bulletColorSwitched = this.lineColorSwitched = v.lineColor;
              break;
            }
          }if (this.fillColorsField) for (K = Q; -1 < K; K--) {
            if (G = e[K], v = G.axes[f.id].graphs[b], v.fillColors) {
              this.fillColorsSwitched = v.fillColors;
              break;
            }
          }if (this.dashLengthField) for (K = Q; -1 < K; K--) {
            if (G = e[K], v = G.axes[f.id].graphs[b], !isNaN(v.dashLength)) {
              this.dashLengthSwitched = v.dashLength;
              break;
            }
          }
        }
        if (ia < e.length - 1) for (K = ia + 1; K < e.length; K++) {
          if (G = e[K], v = G.axes[f.id].graphs[b], na = v.values.value, !isNaN(na)) {
            ia = K;
            break;
          }
        }
      }
      ia < e.length - 1 && ia++;
      var U = [],
          V = [],
          Ra = !1;
      if ('line' == g || 'step' == g || 'smoothedLine' == g) if (this.stackable && 'regular' == O || '100%' == O || this.fillToGraph) Ra = !0;
      var Nb = this.noStepRisers,
          jb = -1e3,
          kb = -1e3,
          lb = this.minDistance,
          Sa = !0,
          $a = !1;
      for (K = Q; K <= ia; K++) {
        G = e[K];
        v = G.axes[f.id].graphs[b];
        v.index = K;
        var ab,
            Ta = NaN;
        if (m && void 0 == this.openField) for (var yb = K + 1; yb < e.length && (!e[yb] || !(ab = e[K + 1].axes[f.id].graphs[b]) || !ab.values || (Ta = ab.values.value, isNaN(Ta))); yb++) {}
        var R,
            P,
            J,
            aa,
            ja = NaN,
            E = NaN,
            F = NaN,
            N = NaN,
            M = NaN,
            pa = NaN,
            qa = NaN,
            ra = NaN,
            sa = NaN,
            wa = NaN,
            Da = NaN,
            ka = NaN,
            la = NaN,
            W = NaN,
            zb = NaN,
            Ab = NaN,
            ta = NaN,
            ua = void 0,
            Ma = wb,
            Va = Ya,
            Ha = ya,
            Aa,
            Ea,
            Bb = this.proCandlesticks,
            mb = this.topRadius,
            Fa = q - 1,
            oa = n - 1,
            bb = this.pattern;
        void 0 != v.pattern && (bb = v.pattern);
        isNaN(v.alpha) || (Va = v.alpha);
        isNaN(v.dashLength) || (da = v.dashLength);
        var Ia = v.values;
        f.recalculateToPercents && (Ia = v.percents);
        if (Ia) {
          W = this.stackable && 'none' != O && '3d' != O ? Ia.close : Ia.value;
          if ('candlestick' == g || 'ohlc' == g) W = Ia.close, Ab = Ia.low, qa = f.getCoordinate(Ab), zb = Ia.high, sa = f.getCoordinate(zb);
          ta = Ia.open;
          F = f.getCoordinate(W, xb);
          isNaN(ta) || (M = f.getCoordinate(ta, xb), m && 'regular' != O && '100%' != O && (Ta = ta, ta = M = NaN));
          m && (void 0 == this.openField ? ab && (ab.isNegative = Ta < W ? !0 : !1, isNaN(Ta) && (v.isNegative = !Sa)) : v.isNegative = Ta > W ? !0 : !1);
          if (!H) switch (this.showBalloonAt) {
            case 'close':
              v.y = F;
              break;
            case 'open':
              v.y = M;
              break;
            case 'high':
              v.y = sa;
              break;
            case 'low':
              v.y = qa;
          }
          var ja = G.x[va.id],
              Wa = this.periodSpan - 1;
          'step' != g || isNaN(G.cellWidth) || (Y = G.cellWidth);
          var xa = Math.floor(Y / 2) + Math.floor(Wa * Y / 2),
              Ga = xa,
              nb = 0;
          'left' == this.stepDirection && (nb = (2 * Y + Wa * Y) / 2, ja -= nb);
          'center' == this.stepDirection && (nb = Y / 2, ja -= nb);
          'start' == this.pointPosition && (ja -= Y / 2 + Math.floor(Wa * Y / 2), xa = 0, Ga = Math.floor(Y) + Math.floor(Wa * Y));
          'end' == this.pointPosition && (ja += Y / 2 + Math.floor(Wa * Y / 2), xa = Math.floor(Y) + Math.floor(Wa * Y), Ga = 0);
          if (Nb) {
            var Cb = this.columnWidth;
            isNaN(Cb) || (xa *= Cb, Ga *= Cb);
          }
          H || (v.x = ja);-1e5 > ja && (ja = -1e5);
          ja > n + 1e5 && (ja = n + 1e5);
          t ? (E = F, N = M, M = F = ja, isNaN(ta) && !this.fillToGraph && (N = ma), pa = qa, ra = sa) : (N = E = ja, isNaN(ta) && !this.fillToGraph && (M = ma));
          if (!Bb && W < ta || Bb && W < za) v.isNegative = !0, Qa && (Ma = Qa), Za && (Va = Za), void 0 != Ja && (Ha = Ja);
          $a = !1;
          isNaN(W) || (m ? W > Ta ? (Sa && ($a = !0), Sa = !1) : (Sa || ($a = !0), Sa = !0) : v.isNegative = W < Oa ? !0 : !1, za = W);
          var Ob = !1;
          H && a.chartScrollbar.ignoreCustomColors && (Ob = !0);
          Ob || (void 0 != v.color && (Ma = v.color), v.fillColors && (Ma = v.fillColors));
          switch (g) {
            case 'line':
              if (isNaN(W)) x || (this.drawLineGraph(y, w, U, V), y = [], w = [], U = [], V = []);else {
                if (Math.abs(E - jb) >= lb || Math.abs(F - kb) >= lb) y.push(E), w.push(F), jb = E, kb = F;
                wa = E;
                Da = F;
                ka = E;
                la = F;
                !Ra || isNaN(M) || isNaN(N) || (U.push(N), V.push(M));
                if ($a || void 0 != v.lineColor && v.lineColor != this.lineColorSwitched || void 0 != v.fillColors && v.fillColors != this.fillColorsSwitched || !isNaN(v.dashLength)) this.drawLineGraph(y, w, U, V), y = [E], w = [F], U = [], V = [], !Ra || isNaN(M) || isNaN(N) || (U.push(N), V.push(M)), m ? Sa ? (this.lineColorSwitched = ya, this.fillColorsSwitched = wb) : (this.lineColorSwitched = Ja, this.fillColorsSwitched = Qa) : (this.lineColorSwitched = v.lineColor, this.fillColorsSwitched = v.fillColors), this.dashLengthSwitched = v.dashLength;
                v.gap && (this.drawLineGraph(y, w, U, V), y = [], w = [], U = [], V = []);
              }
              break;
            case 'smoothedLine':
              if (isNaN(W)) x || (this.drawSmoothedGraph(y, w, U, V), y = [], w = [], U = [], V = []);else {
                if (Math.abs(E - jb) >= lb || Math.abs(F - kb) >= lb) y.push(E), w.push(F), jb = E, kb = F;
                wa = E;
                Da = F;
                ka = E;
                la = F;
                !Ra || isNaN(M) || isNaN(N) || (U.push(N), V.push(M));void 0 == v.lineColor && void 0 == v.fillColors && isNaN(v.dashLength) || (this.drawSmoothedGraph(y, w, U, V), y = [E], w = [F], U = [], V = [], !Ra || isNaN(M) || isNaN(N) || (U.push(N), V.push(M)), this.lineColorSwitched = v.lineColor, this.fillColorsSwitched = v.fillColors, this.dashLengthSwitched = v.dashLength);
                v.gap && (this.drawSmoothedGraph(y, w, U, V), y = [], w = [], U = [], V = []);
              }
              break;
            case 'step':
              if (!isNaN(W)) {
                t ? (isNaN(z) || (y.push(z), w.push(F - xa)), w.push(F - xa), y.push(E), w.push(F + Ga), y.push(E), !Ra || isNaN(M) || isNaN(N) || (isNaN(B) || (U.push(B), V.push(M - xa)), U.push(N), V.push(M - xa), U.push(N), V.push(M + Ga))) : (isNaN(A) || (w.push(A), y.push(E - xa)), y.push(E - xa), w.push(F), y.push(E + Ga), w.push(F), !Ra || isNaN(M) || isNaN(N) || (isNaN(C) || (U.push(N - xa), V.push(C)), U.push(N - xa), V.push(M), U.push(N + Ga), V.push(M)));
                z = E;
                A = F;
                B = N;
                C = M;
                wa = E;
                Da = F;
                ka = E;
                la = F;
                if ($a || void 0 != v.lineColor || void 0 != v.fillColors || !isNaN(v.dashLength)) {
                  var cc = y[y.length - 2],
                      dc = w[w.length - 2];
                  y.pop();
                  w.pop();
                  this.drawLineGraph(y, w, U, V);
                  y = [cc];
                  w = [dc];
                  t ? (w.push(F + Ga), y.push(E)) : (y.push(E + Ga), w.push(F));
                  U = [];
                  V = [];
                  this.lineColorSwitched = v.lineColor;
                  this.fillColorsSwitched = v.fillColors;
                  this.dashLengthSwitched = v.dashLength;
                  m && (Sa ? (this.lineColorSwitched = ya, this.fillColorsSwitched = wb) : (this.lineColorSwitched = Ja, this.fillColorsSwitched = Qa));
                }
                if (Nb || v.gap) z = A = NaN, this.drawLineGraph(y, w, U, V), y = [], w = [], U = [], V = [];
              } else if (!x) {
                if (1 >= this.periodSpan || 1 < this.periodSpan && E - z > xa + Ga) z = A = NaN;
                this.drawLineGraph(y, w, U, V);
                y = [];
                w = [];
                U = [];
                V = [];
              }
              break;
            case 'column':
              Aa = Ha;
              void 0 != v.lineColor && (Aa = v.lineColor);
              if (!isNaN(W)) {
                m || (v.isNegative = W < Oa ? !0 : !1);
                v.isNegative && (Qa && (Ma = Qa), void 0 != Ja && (Aa = Ja));
                var Pb = f.min,
                    Qb = f.max,
                    ob = ta;
                isNaN(ob) && (ob = Oa);
                if (!(W < Pb && ob < Pb || W > Qb && ob > Qb)) {
                  var Ba;
                  if (t) {
                    '3d' == O ? (P = F - (r / 2 - this.depthCount + 1) * (k + T) + T / 2 + S * ea, R = N + I * ea, Ba = ea) : (P = Math.floor(F - (r / 2 - ea) * (k + T) + T / 2), R = N, Ba = 0);
                    J = k;
                    wa = E;
                    Da = P + k / 2;
                    ka = E;
                    la = P + k / 2;
                    P + J > q + Ba * S && (J = q - P + Ba * S);
                    P < Ba * S && (J += P, P = Ba * S);
                    aa = E - N;
                    var ec = R;
                    R = d.fitToBounds(R, 0, n);
                    aa += ec - R;
                    aa = d.fitToBounds(aa, -R, n - R + I * ea);
                    v.labelIsNegative = 0 > aa ? !0 : !1;
                    0 === aa && 1 / W === 1 / -0 && (v.labelIsNegative = !0);
                    isNaN(G.percentWidthValue) || (J = this.height * G.percentWidthValue / 100, P = ja - J / 2, Da = P + J / 2);
                    J = d.roundTo(J, 2);
                    aa = d.roundTo(aa, 2);
                    P < q && 0 < J && (ua = new d.Cuboid(h, aa, J, I - a.d3x, S - a.d3y, Ma, Va, ca, Aa, X, ga, u, t, da, bb, mb, Z), v.columnWidth = Math.abs(aa), v.columnHeight = Math.abs(J));
                  } else {
                    '3d' == O ? (R = E - (r / 2 - this.depthCount + 1) * (k + T) + T / 2 + I * ea, P = M + S * ea, Ba = ea) : (R = E - (r / 2 - ea) * (k + T) + T / 2, P = M, Ba = 0);
                    J = k;
                    wa = R + k / 2;
                    Da = F;
                    ka = R + k / 2;
                    la = F;
                    R + J > n + Ba * I && (J = n - R + Ba * I);
                    R < Ba * I && (J += R - Ba * I, R = Ba * I);
                    aa = F - M;
                    v.labelIsNegative = 0 < aa ? !0 : !1;
                    0 === aa && -0 === W && (v.labelIsNegative = !0);
                    var fc = P;
                    P = d.fitToBounds(P, this.dy, q);
                    aa += fc - P;
                    aa = d.fitToBounds(aa, -P + S * ea, q - P);
                    isNaN(G.percentWidthValue) || (J = this.width * G.percentWidthValue / 100, R = ja - J / 2, wa = R + J / 2);
                    J = d.roundTo(J, 2);
                    aa = d.roundTo(aa, 2);
                    R < n + ea * I && 0 < J && (this.showOnAxis && (P -= S / 2), ua = new d.Cuboid(h, J, aa, I - a.d3x, S - a.d3y, Ma, Va, ca, Aa, this.lineAlpha, ga, u, t, da, bb, mb, Z), v.columnHeight = Math.abs(aa), v.columnWidth = Math.abs(J));
                  }
                }
                if (ua) {
                  Ea = ua.set;
                  d.setCN(a, ua.set, 'graph-' + this.type);
                  d.setCN(a, ua.set, 'graph-' + this.id);
                  v.className && d.setCN(a, ua.set, v.className, !0);
                  v.columnGraphics = Ea;
                  R = d.roundTo(R, 2);
                  P = d.roundTo(P, 2);
                  Ea.translate(R, P);(v.url || this.showHandOnHover) && Ea.setAttr('cursor', 'pointer');
                  if (!H) {
                    'none' == O && (L = t ? (this.end + 1 - K) * D - c : D * K + c);
                    '3d' == O && (t ? (L = (this.end + 1 - K) * D - c - 1e3 * this.depthCount, wa += I * this.columnIndex, ka += I * this.columnIndex, v.y += I * this.columnIndex) : (L = (D - c) * (K + 1) + 1e3 * this.depthCount, Da += S * this.columnIndex, la += S * this.columnIndex, v.y += S * this.columnIndex));
                    if ('regular' == O || '100%' == O) L = t ? 0 < Ia.value ? (this.end + 1 - K) * D + c : (this.end + 1 - K) * D - c : 0 < Ia.value ? D * K + c : D * K - c;
                    this.columnsArray.push({ column: ua, depth: L });
                    v.x = t ? P + J / 2 : R + J / 2;
                    this.ownColumns.push(ua);
                    this.animateColumns(ua, K, E, N, F, M);
                    this.addListeners(Ea, v);
                  }
                  this.columnsSet.push(Ea);
                }
              }
              break;
            case 'candlestick':
              if (!isNaN(ta) && !isNaN(W)) {
                var Xa, cb;
                Aa = Ha;
                void 0 != v.lineColor && (Aa = v.lineColor);
                wa = E;
                la = Da = F;
                ka = E;
                if (t) {
                  'open' == l && (ka = N);
                  'high' == l && (ka = ra);
                  'low' == l && (ka = pa);
                  E = d.fitToBounds(E, 0, oa);
                  N = d.fitToBounds(N, 0, oa);
                  pa = d.fitToBounds(pa, 0, oa);
                  ra = d.fitToBounds(ra, 0, oa);
                  if (0 === E && 0 === N && 0 === pa && 0 === ra) continue;
                  if (E == oa && N == oa && pa == oa && ra == oa) continue;
                  P = F - k / 2;
                  R = N;
                  J = k;
                  P + J > q && (J = q - P);
                  0 > P && (J += P, P = 0);
                  if (P < q && 0 < J) {
                    var Db, Eb;
                    W > ta ? (Db = [E, ra], Eb = [N, pa]) : (Db = [N, ra], Eb = [E, pa]);
                    !isNaN(ra) && !isNaN(pa) && F < q && 0 < F && (Xa = d.line(h, Db, [F, F], Aa, X, ca), cb = d.line(h, Eb, [F, F], Aa, X, ca));
                    aa = E - N;
                    ua = new d.Cuboid(h, aa, J, I, S, Ma, Ya, ca, Aa, X, ga, u, t, da, bb, mb, Z);
                  }
                } else {
                  'open' == l && (la = M);
                  'high' == l && (la = sa);
                  'low' == l && (la = qa);
                  F = d.fitToBounds(F, 0, Fa);
                  M = d.fitToBounds(M, 0, Fa);
                  qa = d.fitToBounds(qa, 0, Fa);
                  sa = d.fitToBounds(sa, 0, Fa);
                  if (0 === F && 0 === M && 0 === qa && 0 === sa) continue;
                  if (F == Fa && M == Fa && qa == Fa && sa == Fa) continue;
                  R = E - k / 2;
                  P = M + ca / 2;
                  J = k;
                  R + J > n && (J = n - R);
                  0 > R && (J += R, R = 0);
                  aa = F - M;
                  if (R < n && 0 < J) {
                    Bb && W >= ta && (Va = 0);
                    var ua = new d.Cuboid(h, J, aa, I, S, Ma, Va, ca, Aa, X, ga, u, t, da, bb, mb, Z),
                        Fb,
                        Gb;
                    W > ta ? (Fb = [F, sa], Gb = [M, qa]) : (Fb = [M, sa], Gb = [F, qa]);
                    !isNaN(sa) && !isNaN(qa) && E < n && 0 < E && (Xa = d.line(h, [E, E], Fb, Aa, X, ca), cb = d.line(h, [E, E], Gb, Aa, X, ca), d.setCN(a, Xa, this.bcn + 'line-high'), v.className && d.setCN(a, Xa, v.className, !0), d.setCN(a, cb, this.bcn + 'line-low'), v.className && d.setCN(a, cb, v.className, !0));
                  }
                }
                ua && (Ea = ua.set, v.columnGraphics = Ea, fa.push(Ea), Ea.translate(R, P - ca / 2), (v.url || this.showHandOnHover) && Ea.setAttr('cursor', 'pointer'), Xa && (fa.push(Xa), fa.push(cb)), H || (v.x = t ? P + J / 2 : R + J / 2, this.animateColumns(ua, K, E, N, F, M), this.addListeners(Ea, v)));
              }
              break;
            case 'ohlc':
              if (!(isNaN(ta) || isNaN(zb) || isNaN(Ab) || isNaN(W))) {
                var Rb = h.set();
                fa.push(Rb);
                W < ta && (v.isNegative = !0, void 0 != Ja && (Ha = Ja));
                var pb, qb, rb;
                if (t) {
                  la = F;
                  ka = E;
                  'open' == l && (ka = N);
                  'high' == l && (ka = ra);
                  'low' == l && (ka = pa);
                  pa = d.fitToBounds(pa, 0, oa);
                  ra = d.fitToBounds(ra, 0, oa);
                  if (0 === E && 0 === N && 0 === pa && 0 === ra) continue;
                  if (E == oa && N == oa && pa == oa && ra == oa) continue;
                  var Hb = F - k / 2,
                      Hb = d.fitToBounds(Hb, 0, q),
                      Sb = d.fitToBounds(F, 0, q),
                      Ib = F + k / 2,
                      Ib = d.fitToBounds(Ib, 0, q);
                  0 <= N && N <= oa && (qb = d.line(h, [N, N], [Hb, Sb], Ha, X, ca, da));
                  0 < F && F < q && (pb = d.line(h, [pa, ra], [F, F], Ha, X, ca, da));
                  0 <= E && E <= oa && (rb = d.line(h, [E, E], [Sb, Ib], Ha, X, ca, da));
                } else {
                  la = F;
                  'open' == l && (la = M);
                  'high' == l && (la = sa);
                  'low' == l && (la = qa);
                  var ka = E,
                      qa = d.fitToBounds(qa, 0, Fa),
                      sa = d.fitToBounds(sa, 0, Fa),
                      Jb = E - k / 2,
                      Jb = d.fitToBounds(Jb, 0, n),
                      Tb = d.fitToBounds(E, 0, n),
                      Kb = E + k / 2,
                      Kb = d.fitToBounds(Kb, 0, n);
                  0 <= M && M <= Fa && (qb = d.line(h, [Jb, Tb], [M, M], Ha, X, ca, da));
                  0 < E && E < n && (pb = d.line(h, [E, E], [qa, sa], Ha, X, ca, da));
                  0 <= F && F <= Fa && (rb = d.line(h, [Tb, Kb], [F, F], Ha, X, ca, da));
                }
                fa.push(qb);
                fa.push(pb);
                fa.push(rb);
                d.setCN(a, qb, this.bcn + 'stroke-open');
                d.setCN(a, rb, this.bcn + 'stroke-close');
                d.setCN(a, pb, this.bcn + 'stroke');
                v.className && d.setCN(a, Rb, v.className, !0);
                wa = E;
                Da = F;
              }
          }
          if (!H && !isNaN(W)) {
            var Ub = this.hideBulletsCount;
            if (this.end - this.start <= Ub || 0 === Ub) {
              var Vb = this.createBullet(v, ka, la, K),
                  Wb = this.labelText;
              if (Wb && !isNaN(wa) && !isNaN(wa)) {
                var gc = this.createLabel(v, Wb),
                    Xb = 0;
                Vb && (Xb = Vb.size);
                this.positionLabel(v, wa, Da, gc, Xb);
              }
              if ('regular' == O || '100%' == O) {
                var Yb = f.totalText;
                if (Yb) {
                  var Na = this.createLabel(v, Yb, f.totalTextColor);
                  d.setCN(a, Na, this.bcn + 'label-total');
                  this.allBullets.push(Na);
                  if (Na) {
                    var Zb = Na.getBBox(),
                        $b = Zb.width,
                        ac = Zb.height,
                        db,
                        eb,
                        sb = f.totalTextOffset,
                        bc = f.totals[K];
                    bc && bc.remove();
                    var fb = 0;
                    'column' != g && (fb = this.bulletSize);
                    t ? (eb = Da, db = 0 > W ? E - $b / 2 - 2 - fb - sb : E + $b / 2 + 3 + fb + sb) : (db = wa, eb = 0 > W ? F + ac / 2 + fb + sb : F - ac / 2 - 3 - fb - sb);
                    Na.translate(db, eb);
                    f.totals[K] = Na;
                    t ? (0 > eb || eb > q) && Na.remove() : (0 > db || db > n) && Na.remove();
                  }
                }
              }
            }
          }
        }
      }
      if ('line' == g || 'step' == g || 'smoothedLine' == g) 'smoothedLine' == g ? this.drawSmoothedGraph(y, w, U, V) : this.drawLineGraph(y, w, U, V), H || this.launchAnimation();
      this.bulletsHidden && this.hideBullets();
      this.customBulletsHidden && this.hideCustomBullets();
    },
    animateColumns: function animateColumns(a, b) {
      var c = this,
          e = c.chart.startDuration;
      0 < e && !c.animationPlayed && (c.seqAn ? (a.set.hide(), c.animationArray.push(a), e = setTimeout(function () {
        c.animate.call(c);
      }, e / (c.end - c.start + 1) * (b - c.start) * 1e3), c.timeOuts.push(e)) : c.animate(a), c.chart.animatable.push(a));
    },
    createLabel: function createLabel(a, b, c) {
      var e = this.chart,
          h = a.labelColor;
      h || (h = this.color);
      h || (h = e.color);
      c && (h = c);
      c = this.fontSize;
      void 0 === c && (this.fontSize = c = e.fontSize);
      var f = this.labelFunction;
      b = e.formatString(b, a);
      b = d.cleanFromEmpty(b);
      f && (b = f(a, b));
      if (void 0 !== b && '' !== b) return a = d.text(this.container, b, h, e.fontFamily, c), a.node.style.pointerEvents = 'none', d.setCN(e, a, this.bcn + 'label'), this.bulletSet.push(a), a;
    },
    positiveClip: function positiveClip(a) {
      a.clipRect(this.pmx, this.pmy, this.pmw, this.pmh);
    },
    negativeClip: function negativeClip(a) {
      a.clipRect(this.nmx, this.nmy, this.nmw, this.nmh);
    },
    drawLineGraph: function drawLineGraph(a, b, c, e) {
      var h = this;
      if (1 < a.length) {
        var f = h.noRounding,
            g = h.set,
            k = h.chart,
            l = h.container,
            m = l.set(),
            n = l.set();
        g.push(n);
        g.push(m);
        var q = h.lineAlpha,
            p = h.lineThickness,
            g = h.fillAlphas,
            t = h.lineColorR,
            r = h.negativeLineAlpha;
        isNaN(r) && (r = q);
        var u = h.lineColorSwitched;
        u && (t = u);
        var u = h.fillColorsR,
            x = h.fillColorsSwitched;
        x && (u = x);
        var y = h.dashLength;(x = h.dashLengthSwitched) && (y = x);
        var x = h.negativeLineColor,
            w = h.negativeFillColors,
            z = h.negativeFillAlphas,
            A = h.baseCoord;
        0 !== h.negativeBase && (A = h.valueAxis.getCoordinate(h.negativeBase, f), A > h.height && (A = h.height), 0 > A && (A = 0));
        q = d.line(l, a, b, t, q, p, y, !1, !0, f);
        d.setCN(k, q, h.bcn + 'stroke');
        m.push(q);
        m.click(function (a) {
          h.handleGraphEvent(a, 'clickGraph');
        }).mouseover(function (a) {
          h.handleGraphEvent(a, 'rollOverGraph');
        }).mouseout(function (a) {
          h.handleGraphEvent(a, 'rollOutGraph');
        }).touchmove(function (a) {
          h.chart.handleMouseMove(a);
        }).touchend(function (a) {
          h.chart.handleTouchEnd(a);
        });
        void 0 === x || h.useNegativeColorIfDown || (p = d.line(l, a, b, x, r, p, y, !1, !0, f), d.setCN(k, p, h.bcn + 'stroke'), d.setCN(k, p, h.bcn + 'stroke-negative'), n.push(p));
        if (0 < g || 0 < z) if (p = a.join(';').split(';'), r = b.join(';').split(';'), q = k.type, 'serial' == q || 'radar' == q ? 0 < c.length ? (c.reverse(), e.reverse(), p = a.concat(c), r = b.concat(e)) : 'radar' == q ? (r.push(0), p.push(0)) : h.rotate ? (r.push(r[r.length - 1]), p.push(A), r.push(r[0]), p.push(A), r.push(r[0]), p.push(p[0])) : (p.push(p[p.length - 1]), r.push(A), p.push(p[0]), r.push(A), p.push(a[0]), r.push(r[0])) : 'xy' == q && (b = h.fillToAxis) && (d.isString(b) && (b = k.getValueAxisById(b)), 'H' == b.orientation ? (A = 'top' == b.position ? 0 : b.height, p.push(p[p.length - 1]), r.push(A), p.push(p[0]), r.push(A), p.push(a[0]), r.push(r[0])) : (A = 'left' == b.position ? 0 : b.width, r.push(r[r.length - 1]), p.push(A), r.push(r[0]), p.push(A), r.push(r[0]), p.push(p[0]))), a = h.gradientRotation, 0 < g && (b = d.polygon(l, p, r, u, g, 1, '#000', 0, a, f), b.pattern(h.pattern, NaN, k.path), d.setCN(k, b, h.bcn + 'fill'), m.push(b)), w || void 0 !== x) isNaN(z) && (z = g), w || (w = x), f = d.polygon(l, p, r, w, z, 1, '#000', 0, a, f), d.setCN(k, f, h.bcn + 'fill'), d.setCN(k, f, h.bcn + 'fill-negative'), f.pattern(h.pattern, NaN, k.path), n.push(f), n.click(function (a) {
          h.handleGraphEvent(a, 'clickGraph');
        }).mouseover(function (a) {
          h.handleGraphEvent(a, 'rollOverGraph');
        }).mouseout(function (a) {
          h.handleGraphEvent(a, 'rollOutGraph');
        }).touchmove(function (a) {
          h.chart.handleMouseMove(a);
        }).touchend(function (a) {
          h.chart.handleTouchEnd(a);
        });
        h.applyMask(n, m);
      }
    },
    applyMask: function applyMask(a, b) {
      var c = a.length();
      'serial' != this.chart.type || this.scrollbar || (this.positiveClip(b), 0 < c && this.negativeClip(a));
    },
    drawSmoothedGraph: function drawSmoothedGraph(a, b, c, e) {
      if (1 < a.length) {
        var h = this.set,
            f = this.chart,
            g = this.container,
            k = g.set(),
            l = g.set();
        h.push(l);
        h.push(k);
        var m = this.lineAlpha,
            n = this.lineThickness,
            h = this.dashLength,
            q = this.fillAlphas,
            p = this.lineColorR,
            t = this.fillColorsR,
            r = this.negativeLineColor,
            u = this.negativeFillColors,
            x = this.negativeFillAlphas,
            y = this.baseCoord,
            w = this.lineColorSwitched;
        w && (p = w);(w = this.fillColorsSwitched) && (t = w);
        var z = this.negativeLineAlpha;
        isNaN(z) && (z = m);
        w = this.getGradRotation();
        m = new d.Bezier(g, a, b, p, m, n, t, 0, h, void 0, w);
        d.setCN(f, m, this.bcn + 'stroke');
        k.push(m.path);
        void 0 !== r && (n = new d.Bezier(g, a, b, r, z, n, t, 0, h, void 0, w), d.setCN(f, n, this.bcn + 'stroke'), d.setCN(f, n, this.bcn + 'stroke-negative'), l.push(n.path));
        0 < q && (m = a.join(';').split(';'), p = b.join(';').split(';'), n = '', 0 < c.length ? (c.push('M'), e.push('M'), c.reverse(), e.reverse(), m = a.concat(c), p = b.concat(e)) : (this.rotate ? (n += ' L' + y + ',' + b[b.length - 1], n += ' L' + y + ',' + b[0]) : (n += ' L' + a[a.length - 1] + ',' + y, n += ' L' + a[0] + ',' + y), n += ' L' + a[0] + ',' + b[0]), c = new d.Bezier(g, m, p, NaN, 0, 0, t, q, h, n, w), d.setCN(f, c, this.bcn + 'fill'), c.path.pattern(this.pattern, NaN, f.path), k.push(c.path), u || void 0 !== r) && (x || (x = q), u || (u = r), a = new d.Bezier(g, a, b, NaN, 0, 0, u, x, h, n, w), a.path.pattern(this.pattern, NaN, f.path), d.setCN(f, a, this.bcn + 'fill'), d.setCN(f, a, this.bcn + 'fill-negative'), l.push(a.path));
        this.applyMask(l, k);
      }
    },
    launchAnimation: function launchAnimation() {
      var a = this,
          b = a.chart.startDuration;
      if (0 < b && !a.animationPlayed) {
        var c = a.set,
            e = a.bulletSet;
        d.VML || (c.attr({ opacity: a.startAlpha }), e.attr({ opacity: a.startAlpha }));
        c.hide();
        e.hide();
        a.seqAn ? (b = setTimeout(function () {
          a.animateGraphs.call(a);
        }, a.index * b * 1e3), a.timeOuts.push(b)) : a.animateGraphs();
      }
    },
    animateGraphs: function animateGraphs() {
      var a = this.chart,
          b = this.set,
          c = this.bulletSet,
          e = this.x,
          d = this.y;
      b.show();
      c.show();
      var f = a.startDuration,
          g = a.startEffect;
      b && (this.rotate ? (b.translate(-1e3, d), c.translate(-1e3, d)) : (b.translate(e, -1e3), c.translate(e, -1e3)), b.animate({ opacity: 1, translate: e + ',' + d }, f, g), c.animate({ opacity: 1, translate: e + ',' + d }, f, g), a.animatable.push(b));
    },
    animate: function animate(a) {
      var b = this.chart,
          c = this.animationArray;
      !a && 0 < c.length && (a = c[0], c.shift());
      c = d[d.getEffect(b.startEffect)];
      b = b.startDuration;
      a && (this.rotate ? a.animateWidth(b, c) : a.animateHeight(b, c), a.set.show());
    },
    legendKeyColor: function legendKeyColor() {
      var a = this.legendColor,
          b = this.lineAlpha;
      void 0 === a && (a = this.lineColorR, 0 === b && (b = this.fillColorsR) && (a = 'object' == (typeof b === 'undefined' ? 'undefined' : _typeof(b)) ? b[0] : b));
      return a;
    },
    legendKeyAlpha: function legendKeyAlpha() {
      var a = this.legendAlpha;
      void 0 === a && (a = this.lineAlpha, this.fillAlphas > a && (a = this.fillAlphas), 0 === a && (a = this.bulletAlpha), 0 === a && (a = 1));
      return a;
    },
    createBullet: function createBullet(a, b, c) {
      if (!isNaN(b) && !isNaN(c) && ('none' != this.bullet || this.customBullet || a.bullet || a.customBullet)) {
        var e = this.chart,
            h = this.container,
            f = this.bulletOffset,
            g = this.bulletSize;
        isNaN(a.bulletSize) || (g = a.bulletSize);
        var k = a.values.value,
            l = this.maxValue,
            m = this.minValue,
            n = this.maxBulletSize,
            q = this.minBulletSize;
        isNaN(l) || (isNaN(k) || (g = (k - m) / (l - m) * (n - q) + q), m == l && (g = n));
        l = g;
        this.bulletAxis && (g = a.values.error, isNaN(g) || (k = g), g = this.bulletAxis.stepWidth * k);
        g < this.minBulletSize && (g = this.minBulletSize);
        this.rotate ? b = a.isNegative ? b - f : b + f : c = a.isNegative ? c + f : c - f;
        q = this.bulletColorR;
        a.lineColor && (this.bulletColorSwitched = a.lineColor);
        this.bulletColorSwitched && (q = this.bulletColorSwitched);
        a.isNegative && void 0 !== this.bulletColorNegative && (q = this.bulletColorNegative);
        void 0 !== a.color && (q = a.color);
        var p;
        'xy' == e.type && this.valueField && (p = this.pattern, a.pattern && (p = a.pattern));
        f = this.bullet;
        a.bullet && (f = a.bullet);
        var k = this.bulletBorderThickness,
            m = this.bulletBorderColorR,
            n = this.bulletBorderAlpha,
            t = this.bulletAlpha;
        m || (m = q);
        this.useLineColorForBulletBorder && (m = this.lineColorR, this.lineColorSwitched && (m = this.lineColorSwitched));
        var r = a.alpha;
        isNaN(r) || (t = r);
        p = d.bullet(h, f, g, q, t, k, m, n, l, 0, p, e.path);
        l = this.customBullet;
        a.customBullet && (l = a.customBullet);
        l && (p && p.remove(), 'function' == typeof l ? (l = new l(), l.chart = e, a.bulletConfig && (l.availableSpace = c, l.graph = this, l.graphDataItem = a, l.bulletY = c, a.bulletConfig.minCoord = this.minCoord - c, l.bulletConfig = a.bulletConfig), l.write(h), p && l.showBullet && l.set.push(p), a.customBulletGraphics = l.cset, p = l.set) : (p = h.set(), l = h.image(l, 0, 0, g, g), p.push(l), this.centerCustomBullets && l.translate(-g / 2, -g / 2)));
        if (p) {
          ;(a.url || this.showHandOnHover) && p.setAttr('cursor', 'pointer');
          if ('serial' == e.type || 'gantt' == e.type) if (-0.5 > b || b > this.width || c < -g / 2 || c > this.height) p.remove(), p = null;
          p && (this.bulletSet.push(p), p.translate(b, c), this.addListeners(p, a), this.allBullets.push(p));
          a.bx = b;
          a.by = c;
          d.setCN(e, p, this.bcn + 'bullet');
          a.className && d.setCN(e, p, a.className, !0);
        }
        if (p) {
          p.size = g || 0;
          if (e = this.bulletHitAreaSize) h = d.circle(h, e, '#FFFFFF', 0.001, 0), h.translate(b, c), a.hitBullet = h, this.bulletSet.push(h), this.addListeners(h, a);
          a.bulletGraphics = p;
        } else p = { size: 0 };
        p.graphDataItem = a;
        return p;
      }
    },
    showBullets: function showBullets() {
      var a = this.allBullets,
          b;
      this.bulletsHidden = !1;
      for (b = 0; b < a.length; b++) {
        a[b].show();
      }
    },
    hideBullets: function hideBullets() {
      var a = this.allBullets,
          b;
      this.bulletsHidden = !0;
      for (b = 0; b < a.length; b++) {
        a[b].hide();
      }
    },
    showCustomBullets: function showCustomBullets() {
      var a = this.allBullets,
          b;
      this.customBulletsHidden = !1;
      for (b = 0; b < a.length; b++) {
        var c = a[b].graphDataItem;
        c.customBulletGraphics && c.customBulletGraphics.show();
      }
    },
    hideCustomBullets: function hideCustomBullets() {
      var a = this.allBullets,
          b;
      this.customBulletsHidden = !0;
      for (b = 0; b < a.length; b++) {
        var c = a[b].graphDataItem;
        c.customBulletGraphics && c.customBulletGraphics.hide();
      }
    },
    addListeners: function addListeners(a, b) {
      var c = this;
      a.mouseover(function (a) {
        c.handleRollOver(b, a);
      }).mouseout(function (a) {
        c.handleRollOut(b, a);
      }).touchend(function (a) {
        c.handleRollOver(b, a);
        c.chart.panEventsEnabled && c.handleClick(b, a);
      }).touchstart(function (a) {
        c.handleRollOver(b, a);
      }).click(function (a) {
        c.handleClick(b, a);
      }).dblclick(function (a) {
        c.handleDoubleClick(b, a);
      }).contextmenu(function (a) {
        c.handleRightClick(b, a);
      });
      var e = c.chart;
      if (e.accessible && c.accessibleLabel) {
        var d = e.formatString(c.accessibleLabel, b);
        e.makeAccessible(a, d);
      }
    },
    handleRollOver: function handleRollOver(a, b) {
      this.handleGraphEvent(b, 'rollOverGraph');
      if (a) {
        var c = this.chart;
        a.bulletConfig && (c.isRolledOverBullet = !0);
        var e = {
          type: 'rollOverGraphItem',
          item: a,
          index: a.index,
          graph: this,
          target: this,
          chart: this.chart,
          event: b
        };
        this.fire(e);
        c.fire(e);
        clearTimeout(c.hoverInt);(c = c.chartCursor) && c.valueBalloonsEnabled || this.showGraphBalloon(a, 'V', !0);
      }
    },
    handleRollOut: function handleRollOut(a, b) {
      if (a) {
        var c = this.chart,
            e = {
          type: 'rollOutGraphItem',
          item: a,
          index: a.index,
          graph: this,
          target: this,
          chart: this.chart,
          event: b
        };
        this.fire(e);
        c.fire(e);
        c.isRolledOverBullet = !1;
      }
      this.handleGraphEvent(b, 'rollOutGraph');
      c = this.chart;(c = c.chartCursor) && c.valueBalloonsEnabled || this.hideBalloon();
    },
    handleClick: function handleClick(a, b) {
      if (!this.chart.checkTouchMoved() && this.chart.checkTouchDuration(b)) {
        if (a) {
          var c = {
            type: 'clickGraphItem',
            item: a,
            index: a.index,
            graph: this,
            target: this,
            chart: this.chart,
            event: b
          };
          this.fire(c);
          this.chart.fire(c);
          d.getURL(a.url, this.urlTarget);
        }
        this.handleGraphEvent(b, 'clickGraph');
      }
    },
    handleGraphEvent: function handleGraphEvent(a, b) {
      var c = {
        type: b,
        graph: this,
        target: this,
        chart: this.chart,
        event: a
      };
      this.fire(c);
      this.chart.fire(c);
    },
    handleRightClick: function handleRightClick(a, b) {
      if (a) {
        var c = {
          type: 'rightClickGraphItem',
          item: a,
          index: a.index,
          graph: this,
          target: this,
          chart: this.chart,
          event: b
        };
        this.fire(c);
        this.chart.fire(c);
      }
    },
    handleDoubleClick: function handleDoubleClick(a, b) {
      if (a) {
        var c = {
          type: 'doubleClickGraphItem',
          item: a,
          index: a.index,
          graph: this,
          target: this,
          chart: this.chart,
          event: b
        };
        this.fire(c);
        this.chart.fire(c);
      }
    },
    zoom: function zoom(a, b) {
      this.start = a;
      this.end = b;
      this.draw();
    },
    changeOpacity: function changeOpacity(a) {
      var b = this.set;
      b && b.setAttr('opacity', a);
      if (b = this.ownColumns) {
        var c;
        for (c = 0; c < b.length; c++) {
          var e = b[c].set;
          e && e.setAttr('opacity', a);
        }
      }
      ;(b = this.bulletSet) && b.setAttr('opacity', a);
    },
    destroy: function destroy() {
      d.remove(this.set);
      d.remove(this.bulletSet);
      var a = this.timeOuts;
      if (a) {
        var b;
        for (b = 0; b < a.length; b++) {
          clearTimeout(a[b]);
        }
      }
      this.timeOuts = [];
    },
    createBalloon: function createBalloon() {
      var a = this.chart;
      this.balloon ? this.balloon.destroy && this.balloon.destroy() : this.balloon = {};
      var b = this.balloon;
      d.extend(b, a.balloon, !0);
      b.chart = a;
      b.mainSet = a.plotBalloonsSet;
      b.className = this.id;
    },
    hideBalloon: function hideBalloon() {
      var a = this,
          b = a.chart;
      b.chartCursor ? b.chartCursor.valueBalloonsEnabled || b.hideBalloon() : b.hideBalloon();
      clearTimeout(a.hoverInt);
      a.hoverInt = setTimeout(function () {
        a.hideBalloonReal.call(a);
      }, b.hideBalloonTime);
    },
    hideBalloonReal: function hideBalloonReal() {
      this.balloon && this.balloon.hide();
      this.fixBulletSize();
    },
    fixBulletSize: function fixBulletSize() {
      if (d.isModern) {
        var a = this.resizedDItem;
        if (a) {
          var b = a.bulletGraphics;
          b && !b.doNotScale && (b.translate(a.bx, a.by, 1), b.setAttr('fill-opacity', this.bulletAlpha), b.setAttr('stroke-opacity', this.bulletBorderAlpha));
        }
        this.resizedDItem = null;
      }
    },
    showGraphBalloon: function showGraphBalloon(a, b, c, e, h) {
      var f = this.chart,
          g = this.balloon,
          k = 0,
          l = 0,
          m = f.chartCursor,
          n = !0;
      m ? m.valueBalloonsEnabled || (g = f.balloon, k = this.x, l = this.y, n = !1) : (g = f.balloon, k = this.x, l = this.y, n = !1);
      clearTimeout(this.hoverInt);
      if (f.chartCursor && (this.currentDataItem = a, 'serial' == f.type && f.isRolledOverBullet && f.chartCursor.valueBalloonsEnabled)) {
        this.hideBalloonReal();
        return;
      }
      this.resizeBullet(a, e, h);
      if (g && g.enabled && this.showBalloon && !this.hidden) {
        var m = f.formatString(this.balloonText, a, !0),
            q = this.balloonFunction;
        q && (m = q(a, a.graph));
        m && (m = d.cleanFromEmpty(m));
        m && '' !== m ? (e = f.getBalloonColor(this, a), g.drop || (g.pointerOrientation = b), b = a.x, h = a.y, f.rotate && (b = a.y, h = a.x), b += k, h += l, isNaN(b) || isNaN(h) ? this.hideBalloonReal() : (a = this.width, q = this.height, n && g.setBounds(k, l, a + k, q + l), g.changeColor(e), g.setPosition(b, h), g.fixPrevious(), g.fixedPosition && (c = !1), !c && 'radar' != f.type && (b < k || b > a + k || h < l || h > q + l) ? (g.showBalloon(m), g.hide(0)) : (g.followCursor(c), g.showBalloon(m)))) : (this.hideBalloonReal(), this.resizeBullet(a, e, h));
      } else this.hideBalloonReal();
    },
    resizeBullet: function resizeBullet(a, b, c) {
      this.fixBulletSize();
      if (a && d.isModern && (1 != b || !isNaN(c))) {
        var e = a.bulletGraphics;
        e && !e.doNotScale && (e.translate(a.bx, a.by, b), isNaN(c) || (e.setAttr('fill-opacity', c), e.setAttr('stroke-opacity', c)), this.resizedDItem = a);
      }
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.ChartCursor = d.Class({
    construct: function construct(a) {
      this.cname = 'ChartCursor';
      this.createEvents('changed', 'zoomed', 'onHideCursor', 'onShowCursor', 'draw', 'selected', 'moved', 'panning', 'zoomStarted');
      this.enabled = !0;
      this.cursorAlpha = 1;
      this.selectionAlpha = 0.2;
      this.cursorColor = '#CC0000';
      this.categoryBalloonAlpha = 1;
      this.color = '#FFFFFF';
      this.type = 'cursor';
      this.zoomed = !1;
      this.zoomable = !0;
      this.pan = !1;
      this.categoryBalloonDateFormat = 'MMM DD, YYYY';
      this.categoryBalloonText = '[[category]]';
      this.categoryBalloonEnabled = this.valueBalloonsEnabled = !0;
      this.rolledOver = !1;
      this.cursorPosition = 'middle';
      this.bulletsEnabled = this.skipZoomDispatch = !1;
      this.bulletSize = 8;
      this.selectWithoutZooming = this.oneBalloonOnly = !1;
      this.graphBulletSize = 1.7;
      this.animationDuration = 0.3;
      this.zooming = !1;
      this.adjustment = 0;
      this.avoidBalloonOverlapping = !0;
      this.leaveCursor = !1;
      this.leaveAfterTouch = !0;
      this.valueZoomable = !1;
      this.balloonPointerOrientation = 'horizontal';
      this.hLineEnabled = this.vLineEnabled = !0;
      this.vZoomEnabled = this.hZoomEnabled = !1;
      d.applyTheme(this, a, this.cname);
    },
    draw: function draw() {
      this.destroy();
      var a = this.chart;
      a.panRequired = !0;
      var b = a.container;
      this.rotate = a.rotate;
      this.container = b;
      this.prevLineHeight = this.prevLineWidth = NaN;
      b = b.set();
      b.translate(this.x, this.y);
      this.set = b;
      a.cursorSet.push(b);
      this.createElements();
      d.isString(this.limitToGraph) && (this.limitToGraph = d.getObjById(a.graphs, this.limitToGraph), this.fullWidth = !1, this.cursorPosition = 'middle');
      this.pointer = this.balloonPointerOrientation.substr(0, 1).toUpperCase();
      this.isHidden = !1;
      this.hideLines();
      this.valueLineAxis || (this.valueLineAxis = a.valueAxes[0]);
    },
    createElements: function createElements() {
      var a = this.chart,
          b = a.dx,
          c = a.dy,
          e = this.width,
          h = this.height,
          f,
          g,
          k = this.cursorAlpha,
          l = this.valueLineAlpha;
      this.rotate ? (f = l, g = k) : (g = l, f = k);
      'xy' == a.type && (g = k, void 0 !== l && (g = l), f = k);
      this.vvLine = d.line(this.container, [b, 0, 0], [c, 0, h], this.cursorColor, f, 1);
      d.setCN(a, this.vvLine, 'cursor-line');
      d.setCN(a, this.vvLine, 'cursor-line-vertical');
      this.hhLine = d.line(this.container, [0, e, e + b], [0, 0, c], this.cursorColor, g, 1);
      d.setCN(a, this.hhLine, 'cursor-line');
      d.setCN(a, this.hhLine, 'cursor-line-horizontal');
      this.vLine = this.rotate ? this.vvLine : this.hhLine;
      this.set.push(this.vvLine);
      this.set.push(this.hhLine);
      this.set.node.style.pointerEvents = 'none';
      this.fullLines = this.container.set();
      a = a.cursorLineSet;
      a.push(this.fullLines);
      a.translate(this.x, this.y);
      a.clipRect(0, 0, e, h);
      this.set.clipRect(0, 0, e, h);
    },
    update: function update() {
      var a = this.chart,
          b = a.mouseX - this.x,
          c = a.mouseY - this.y;
      this.mouseX = b;
      this.mouseY = c;
      this.mouse2X = a.mouse2X - this.x;
      this.mouse2Y = a.mouse2Y - this.y;
      var e;
      if (a.chartData && 0 < a.chartData.length) {
        this.mouseIsOver() ? (this.hideGraphBalloons = !1, this.rolledOver = e = !0, this.updateDrawing(), this.vvLine && isNaN(this.fx) && (a.rotate || !this.limitToGraph) && this.vvLine.translate(b, 0), !this.hhLine || !isNaN(this.fy) || a.rotate && this.limitToGraph || this.hhLine.translate(0, c), isNaN(this.mouse2X) ? this.dispatchMovedEvent(b, c) : e = !1) : this.forceShow || this.hideCursor();
        if (this.zooming) {
          if (!isNaN(this.mouse2X)) {
            isNaN(this.mouse2X0) || this.dispatchPanEvent();
            return;
          }
          if (this.pan) {
            this.dispatchPanEvent();
            return;
          }
          ;(this.hZoomEnabled || this.vZoomEnabled) && this.zooming && this.updateSelection();
        }
        e && this.showCursor();
      }
    },
    updateDrawing: function updateDrawing() {
      this.drawing && this.chart.setMouseCursor('crosshair');
      this.drawingNow && (d.remove(this.drawingLine), this.drawingLine = d.line(this.container, [this.drawStartX, this.mouseX], [this.drawStartY, this.mouseY], this.cursorColor, 1, 1));
    },
    fixWidth: function fixWidth(a) {
      if (this.fullWidth && this.prevLineWidth != a) {
        var b = this.vvLine,
            c = 0;
        b && (b.remove(), c = b.x);
        b = this.container.set();
        b.translate(c, 0);
        c = d.rect(this.container, a, this.height, this.cursorColor, this.cursorAlpha, 0);
        d.setCN(this.chart, c, 'cursor-fill');
        c.translate(-a / 2, 0);
        b.push(c);
        this.vvLine = b;
        this.fullLines.push(b);
        this.prevLineWidth = a;
      }
    },
    fixHeight: function fixHeight(a) {
      if (this.fullWidth && this.prevLineHeight != a) {
        var b = this.hhLine,
            c = 0;
        b && (b.remove(), c = b.y);
        b = this.container.set();
        b.translate(0, c);
        c = d.rect(this.container, this.width, a, this.cursorColor, this.cursorAlpha);
        c.translate(0, -a / 2);
        b.push(c);
        this.fullLines.push(b);
        this.hhLine = b;
        this.prevLineHeight = a;
      }
    },
    fixVLine: function fixVLine(a, b) {
      if (!isNaN(a)) {
        if (isNaN(this.prevLineX)) {
          var c = 0,
              e = this.mouseX;
          if (this.limitToGraph) {
            var d = this.chart.categoryAxis;
            d && (this.chart.rotate || (c = 'bottom' == d.position ? this.height : -this.height), e = a);
          }
          this.vvLine.translate(e, c);
        } else this.prevLineX != a && this.vvLine.translate(this.prevLineX, this.prevLineY);
        this.fx = a;
        this.prevLineX != a && (c = this.animationDuration, this.zooming && (c = 0), this.vvLine.stop(), this.vvLine.animate({ translate: a + ',' + b }, c, 'easeOutSine'), this.prevLineX = a, this.prevLineY = b);
      }
    },
    fixHLine: function fixHLine(a, b) {
      if (!isNaN(a)) {
        if (isNaN(this.prevLineY)) {
          var c = 0,
              e = this.mouseY;
          if (this.limitToGraph) {
            var d = this.chart.categoryAxis;
            d && (this.chart.rotate && (c = 'right' == d.position ? this.width : -this.width), e = a);
          }
          this.hhLine.translate(c, e);
        } else this.prevLineY != a && this.hhLine.translate(this.prevLineX, this.prevLineY);
        this.fy = a;
        this.prevLineY != a && (c = this.animationDuration, this.zooming && (c = 0), this.hhLine.stop(), this.hhLine.animate({ translate: b + ',' + a }, c, 'easeOutSine'), this.prevLineY = a, this.prevLineX = b);
      }
    },
    hideCursor: function hideCursor(a) {
      this.forceShow = !1;this.chart.wasTouched && this.leaveAfterTouch || this.isHidden || this.leaveCursor || (this.hideLines(), this.isHidden = !0, this.index = this.prevLineY = this.prevLineX = this.mouseY0 = this.mouseX0 = this.fy = this.fx = NaN, a ? this.chart.handleCursorHide() : this.fire({
        target: this,
        chart: this.chart,
        type: 'onHideCursor'
      }), this.chart.setMouseCursor('auto'));
    },
    hideLines: function hideLines() {
      this.vvLine && this.vvLine.hide();
      this.hhLine && this.hhLine.hide();
      this.fullLines && this.fullLines.hide();
      this.isHidden = !0;
      this.chart.handleCursorHide();
    },
    showCursor: function showCursor(a) {
      !this.drawing && this.enabled && (this.vLineEnabled && this.vvLine && this.vvLine.show(), this.hLineEnabled && this.hhLine && this.hhLine.show(), this.isHidden = !1, this.updateFullLine(), a || this.fire({ target: this, chart: this.chart, type: 'onShowCursor' }), this.pan && this.chart.setMouseCursor('move'));
    },
    updateFullLine: function updateFullLine() {
      this.zooming && this.fullWidth && this.selection && (this.rotate ? 0 < this.selection.height && this.hhLine.hide() : 0 < this.selection.width && this.vvLine.hide());
    },
    updateSelection: function updateSelection() {
      if (!this.pan && this.enabled) {
        var a = this.mouseX,
            b = this.mouseY;
        isNaN(this.fx) || (a = this.fx);
        isNaN(this.fy) || (b = this.fy);
        this.clearSelection();
        var c = this.mouseX0,
            e = this.mouseY0,
            h = this.width,
            f = this.height,
            a = d.fitToBounds(a, 0, h),
            b = d.fitToBounds(b, 0, f),
            g;
        a < c && (g = a, a = c, c = g);
        b < e && (g = b, b = e, e = g);
        this.hZoomEnabled ? h = a - c : c = 0;
        this.vZoomEnabled ? f = b - e : e = 0;
        isNaN(this.mouse2X) && 0 < Math.abs(h) && 0 < Math.abs(f) && (a = this.chart, b = d.rect(this.container, h, f, this.cursorColor, this.selectionAlpha), d.setCN(a, b, 'cursor-selection'), b.width = h, b.height = f, b.translate(c, e), this.set.push(b), this.selection = b);
        this.updateFullLine();
      }
    },
    mouseIsOver: function mouseIsOver() {
      var a = this.mouseX,
          b = this.mouseY;
      if (this.justReleased) return this.justReleased = !1, !0;
      if (this.mouseIsDown) return !0;
      if (!this.chart.mouseIsOver) return this.handleMouseOut(), !1;
      if (0 < a && a < this.width && 0 < b && b < this.height) return !0;
      this.handleMouseOut();
    },
    fixPosition: function fixPosition() {
      this.prevY = this.prevX = NaN;
    },
    handleMouseDown: function handleMouseDown() {
      this.update();
      if (this.mouseIsOver()) if (this.mouseIsDown = !0, this.mouseX0 = this.mouseX, this.mouseY0 = this.mouseY, this.mouse2X0 = this.mouse2X, this.mouse2Y0 = this.mouse2Y, this.drawing) this.drawStartY = this.mouseY, this.drawStartX = this.mouseX, this.drawingNow = !0;else if (this.dispatchMovedEvent(this.mouseX, this.mouseY), !this.pan && isNaN(this.mouse2X0) && (isNaN(this.fx) || (this.mouseX0 = this.fx), isNaN(this.fy) || (this.mouseY0 = this.fy)), this.hZoomEnabled || this.vZoomEnabled) {
        this.zooming = !0;
        var a = { chart: this.chart, target: this, type: 'zoomStarted' };
        a.x = this.mouseX / this.width;
        a.y = this.mouseY / this.height;
        this.index0 = a.index = this.index;
        this.timestamp0 = this.timestamp;
        this.fire(a);
      }
    },
    registerInitialMouse: function registerInitialMouse() {},
    handleReleaseOutside: function handleReleaseOutside() {
      this.mouseIsDown = !1;
      if (this.drawingNow) {
        this.drawingNow = !1;
        d.remove(this.drawingLine);
        var a = this.drawStartX,
            b = this.drawStartY,
            c = this.mouseX,
            e = this.mouseY,
            h = this.chart;(2 < Math.abs(a - c) || 2 < Math.abs(b - e)) && this.fire({
          type: 'draw',
          target: this,
          chart: h,
          initialX: a,
          initialY: b,
          finalX: c,
          finalY: e
        });
      }
      this.zooming && (this.zooming = !1, this.selectWithoutZooming ? this.dispatchZoomEvent('selected') : (this.hZoomEnabled || this.vZoomEnabled) && this.dispatchZoomEvent('zoomed'), this.rolledOver && this.dispatchMovedEvent(this.mouseX, this.mouseY));
      this.mouse2Y0 = this.mouse2X0 = this.mouseY0 = this.mouseX0 = NaN;
    },
    dispatchZoomEvent: function dispatchZoomEvent(a) {
      if (!this.pan) {
        var b = this.selection;
        if (b && 3 < Math.abs(b.width) && 3 < Math.abs(b.height)) {
          var c = Math.min(this.index, this.index0),
              e = Math.max(this.index, this.index0),
              d = c,
              f = e,
              g = this.chart,
              k = g.chartData,
              l = g.categoryAxis;
          l && l.parseDates && !l.equalSpacing && (d = k[c] ? k[c].time : Math.min(this.timestamp0, this.timestamp), f = k[e] ? g.getEndTime(k[e].time) : Math.max(this.timestamp0, this.timestamp));
          var b = {
            type: a,
            chart: this.chart,
            target: this,
            end: f,
            start: d,
            startIndex: c,
            endIndex: e,
            selectionHeight: b.height,
            selectionWidth: b.width,
            selectionY: b.y,
            selectionX: b.x
          },
              m;
          this.hZoomEnabled && 4 < Math.abs(this.mouseX0 - this.mouseX) && (b.startX = this.mouseX0 / this.width, b.endX = this.mouseX / this.width, m = !0);
          this.vZoomEnabled && 4 < Math.abs(this.mouseY0 - this.mouseY) && (b.startY = 1 - this.mouseY0 / this.height, b.endY = 1 - this.mouseY / this.height, m = !0);
          m && (this.prevY = this.prevX = NaN, this.fire(b), 'selected' != a && this.clearSelection());
          this.hideCursor();
        }
      }
    },
    dispatchMovedEvent: function dispatchMovedEvent(a, b, c, e) {
      a = Math.round(a);
      b = Math.round(b);
      if (!this.isHidden && (a != this.prevX || b != this.prevY || 'changed' == c)) {
        c || (c = 'moved');
        var d = this.fx,
            f = this.fy;
        isNaN(d) && (d = a);
        isNaN(f) && (f = b);
        var g = !1;
        this.zooming && this.pan && (g = !0);
        g = {
          hidden: this.isHidden,
          type: c,
          chart: this.chart,
          target: this,
          x: a,
          y: b,
          finalX: d,
          finalY: f,
          zooming: this.zooming,
          panning: g,
          mostCloseGraph: this.mostCloseGraph,
          index: this.index,
          skip: e,
          hideBalloons: this.hideGraphBalloons
        };
        this.rotate ? (g.position = b, g.finalPosition = f) : (g.position = a, g.finalPosition = d);
        this.prevX = a;
        this.prevY = b;
        e ? this.chart.handleCursorMove(g) : (this.fire(g), 'changed' == c && this.chart.fire(g));
      }
    },
    dispatchPanEvent: function dispatchPanEvent() {
      if (this.mouseIsDown) {
        var a = d.roundTo((this.mouseX - this.mouseX0) / this.width, 3),
            b = d.roundTo((this.mouseY - this.mouseY0) / this.height, 3),
            c = d.roundTo((this.mouse2X - this.mouse2X0) / this.width, 3),
            e = d.roundTo((this.mouse2Y - this.mouse2Y0) / this.height, 2),
            h = !1;
        0 !== Math.abs(a) && 0 !== Math.abs(b) && (h = !0);
        if (this.prevDeltaX == a || this.prevDeltaY == b) h = !1;
        isNaN(c) || isNaN(e) || (0 !== Math.abs(c) && 0 !== Math.abs(e) && (h = !0), this.prevDelta2X != c && this.prevDelta2Y != e) || (h = !1);
        h && (this.hideLines(), this.fire({
          type: 'panning',
          chart: this.chart,
          target: this,
          deltaX: a,
          deltaY: b,
          delta2X: c,
          delta2Y: e,
          index: this.index
        }), this.prevDeltaX = a, this.prevDeltaY = b, this.prevDelta2X = c, this.prevDelta2Y = e);
      }
    },
    clearSelection: function clearSelection() {
      var a = this.selection;
      a && (a.width = 0, a.height = 0, a.remove());
    },
    destroy: function destroy() {
      this.clear();
      d.remove(this.selection);
      this.selection = null;
      clearTimeout(this.syncTO);
      d.remove(this.set);
    },
    clear: function clear() {},
    setTimestamp: function setTimestamp(a) {
      this.timestamp = a;
    },
    setIndex: function setIndex(a, b) {
      a != this.index && (this.index = a, b || this.isHidden || this.dispatchMovedEvent(this.mouseX, this.mouseY, 'changed'));
    },
    handleMouseOut: function handleMouseOut() {
      this.enabled && this.rolledOver && (this.leaveCursor || this.setIndex(void 0), this.forceShow = !1, this.hideCursor(), this.rolledOver = !1);
    },
    showCursorAt: function showCursorAt(a) {
      var b = this.chart.categoryAxis;
      b && this.setPosition(b.categoryToCoordinate(a));
    },
    setPosition: function setPosition(a) {
      var b = this.chart,
          c = b.categoryAxis;
      if (c) {
        var e,
            d,
            f = c.coordinateToValue(a);
        c.showBalloonAt(f);
        this.forceShow = !0;
        c.stickBalloonToCategory ? b.rotate ? this.fixHLine(a, 0) : this.fixVLine(a, 0) : (this.showCursor(), b.rotate ? this.hhLine.translate(0, a) : this.vvLine.translate(a, 0));
        b.rotate ? e = a : d = a;
        this.dispatchMovedEvent(d, e);
        b.rotate ? (this.vvLine && this.vvLine.hide(), this.hhLine && this.hhLine.show()) : (this.hhLine && this.hhLine.hide(), this.vvLine && this.vvLine.show());
        this.updateFullLine();
        this.isHidden = !1;
        this.dispatchMovedEvent(d, e, 'moved', !0);
      }
    },
    enableDrawing: function enableDrawing(a) {
      this.enabled = !a;
      this.hideCursor();
      this.drawing = a;
    },
    syncWithCursor: function syncWithCursor(a, b) {
      clearTimeout(this.syncTO);
      a && (a.isHidden ? this.hideCursor(!0) : this.syncWithCursorReal(a, b));
    },
    isZooming: function isZooming(a) {
      this.zooming = a;
    },
    syncWithCursorReal: function syncWithCursorReal(a, b) {
      var c = a.vvLine,
          e = a.hhLine;
      this.index = a.index;
      this.forceShow = !0;this.zooming && this.pan || this.showCursor(!0);
      this.hideGraphBalloons = b;
      this.justReleased = a.justReleased;
      this.zooming = a.zooming;
      this.index0 = a.index0;
      this.mouseX0 = a.mouseX0;
      this.mouseY0 = a.mouseY0;
      this.mouse2X0 = a.mouse2X0;
      this.mouse2Y0 = a.mouse2Y0;
      this.timestamp0 = a.timestamp0;
      this.prevDeltaX = a.prevDeltaX;
      this.prevDeltaY = a.prevDeltaY;
      this.prevDelta2X = a.prevDelta2X;
      this.prevDelta2Y = a.prevDelta2Y;
      this.fx = a.fx;
      this.fy = a.fy;
      this.index = a.index;
      a.zooming && this.updateSelection();
      var d = a.mouseX,
          f = a.mouseY;
      this.rotate ? (d = NaN, this.vvLine && this.vvLine.hide(), this.hhLine && e && (isNaN(a.fy) ? this.hhLine.translate(0, a.mouseY) : this.fixHLine(a.fy, 0))) : (f = NaN, this.hhLine && this.hhLine.hide(), this.vvLine && c && (isNaN(a.fx) ? this.vvLine.translate(a.mouseX, 0) : this.fixVLine(a.fx, 0)));
      this.dispatchMovedEvent(d, f, 'moved', !0);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.SimpleChartScrollbar = d.Class({
    construct: function construct(a) {
      this.createEvents('zoomed', 'zoomStarted', 'zoomEnded');
      this.backgroundColor = '#D4D4D4';
      this.backgroundAlpha = 1;
      this.selectedBackgroundColor = '#EFEFEF';
      this.scrollDuration = this.selectedBackgroundAlpha = 1;
      this.resizeEnabled = !0;
      this.hideResizeGrips = !1;
      this.scrollbarHeight = 20;
      this.updateOnReleaseOnly = !1;
      9 > document.documentMode && (this.updateOnReleaseOnly = !0);
      this.dragIconHeight = this.dragIconWidth = 35;
      this.dragIcon = 'dragIconRoundBig';
      this.dragCursorHover = 'cursor: cursor: grab; cursor:-moz-grab; cursor:-webkit-grab;';
      this.dragCursorDown = 'cursor: cursor: grab; cursor:-moz-grabbing; cursor:-webkit-grabbing;';
      this.enabled = !0;
      this.percentStart = this.offset = 0;
      this.percentEnd = 1;
      d.applyTheme(this, a, 'SimpleChartScrollbar');
    },
    draw: function draw() {
      var a = this;
      a.destroy();
      if (a.enabled) {
        var b = a.chart.container,
            c = a.rotate,
            e = a.chart;
        e.panRequired = !0;
        var h = b.set();
        a.set = h;
        e.scrollbarsSet.push(h);
        var f, g;
        c ? (f = a.scrollbarHeight, g = e.plotAreaHeight) : (g = a.scrollbarHeight, f = e.plotAreaWidth);
        a.width = f;
        if ((a.height = g) && f) {
          var k = d.rect(b, f, g, a.backgroundColor, a.backgroundAlpha, 1, a.backgroundColor, a.backgroundAlpha);
          d.setCN(e, k, 'scrollbar-bg');
          a.bg = k;
          h.push(k);
          k = d.rect(b, f, g, '#000', 0.005);
          h.push(k);
          a.invisibleBg = k;
          k.click(function () {
            a.handleBgClick();
          }).mouseover(function () {
            a.handleMouseOver();
          }).mouseout(function () {
            a.handleMouseOut();
          }).touchend(function () {
            a.handleBgClick();
          });
          k = d.rect(b, f, g, a.selectedBackgroundColor, a.selectedBackgroundAlpha);
          d.setCN(e, k, 'scrollbar-bg-selected');
          a.selectedBG = k;
          h.push(k);
          f = d.rect(b, f, g, '#000', 0.005);
          a.dragger = f;
          h.push(f);
          f.mousedown(function (b) {
            a.handleDragStart(b);
          }).mouseup(function () {
            a.handleDragStop();
          }).mouseover(function () {
            a.handleDraggerOver();
          }).mouseout(function () {
            a.handleMouseOut();
          }).touchstart(function (b) {
            a.handleDragStart(b);
          }).touchend(function () {
            a.handleDragStop();
          });
          f = e.pathToImages;
          g = a.dragIcon.replace(/\.[a-z]*$/i, '');
          c ? (k = f + g + 'H' + e.extension, f = a.dragIconWidth, c = a.dragIconHeight) : (k = f + g + e.extension, c = a.dragIconWidth, f = a.dragIconHeight);
          g = b.image(k, 0, 0, c, f);
          d.setCN(e, g, 'scrollbar-grip-left');
          k = b.image(k, 0, 0, c, f);
          d.setCN(e, k, 'scrollbar-grip-right');
          var l = 10,
              m = 20;
          e.panEventsEnabled && (l = 25, m = a.scrollbarHeight);
          var n = d.rect(b, l, m, '#000', 0.005),
              q = d.rect(b, l, m, '#000', 0.005);
          q.translate(-(l - c) / 2, -(m - f) / 2);
          n.translate(-(l - c) / 2, -(m - f) / 2);
          c = b.set([g, q]);
          b = b.set([k, n]);
          a.iconLeft = c;
          h.push(a.iconLeft);
          a.iconRight = b;
          h.push(b);
          c.mousedown(function () {
            a.leftDragStart();
          }).mouseup(function () {
            a.leftDragStop();
          }).mouseover(function () {
            a.iconRollOver();
          }).mouseout(function () {
            a.iconRollOut();
          }).touchstart(function () {
            a.leftDragStart();
          }).touchend(function () {
            a.leftDragStop();
          });
          b.mousedown(function () {
            a.rightDragStart();
          }).mouseup(function () {
            a.rightDragStop();
          }).mouseover(function () {
            a.iconRollOver();
          }).mouseout(function () {
            a.iconRollOut();
          }).touchstart(function () {
            a.rightDragStart();
          }).touchend(function () {
            a.rightDragStop();
          });
          d.ifArray(e.chartData) ? h.show() : h.hide();
          a.hideDragIcons();
          a.clipDragger(!1);
        }
        h.translate(a.x, a.y);
        h.node.style.msTouchAction = 'none';
        h.node.style.touchAction = 'none';
      }
    },
    updateScrollbarSize: function updateScrollbarSize(a, b) {
      if (!isNaN(a) && !isNaN(b)) {
        a = Math.round(a);
        b = Math.round(b);
        var c = this.dragger,
            e,
            d,
            f,
            g,
            k;
        this.rotate ? (e = 0, d = a, f = this.width + 1, g = b - a, c.setAttr('height', b - a), c.setAttr('y', d)) : (e = a, d = 0, f = b - a, g = this.height + 1, k = b - a, c.setAttr('x', e), c.setAttr('width', k));
        this.clipAndUpdate(e, d, f, g);
      }
    },
    update: function update() {
      var a,
          b = !1,
          c,
          e,
          d = this.x,
          f = this.y,
          g = this.dragger,
          k = this.getDBox();
      if (k) {
        c = k.x + d;
        e = k.y + f;
        var l = k.width,
            k = k.height,
            m = this.rotate,
            n = this.chart,
            q = this.width,
            p = this.height,
            t = n.mouseX,
            r = n.mouseY;
        a = this.initialMouse;
        this.forceClip && this.clipDragger(!0);
        if (n.mouseIsOver) {
          this.dragging && (n = this.initialCoord, m ? (a = n + (r - a), 0 > a && (a = 0), n = p - k, a > n && (a = n), g.setAttr('y', a)) : (a = n + (t - a), 0 > a && (a = 0), n = q - l, a > n && (a = n), g.setAttr('x', a)), this.clipDragger(!0));
          if (this.resizingRight) {
            if (m) {
              if (a = r - e, a + e > p + f && (a = p - e + f), 0 > a) this.resizingRight = !1, b = this.resizingLeft = !0;else {
                if (0 === a || isNaN(a)) a = 0.1;
                g.setAttr('height', a);
              }
            } else if (a = t - c, a + c > q + d && (a = q - c + d), 0 > a) this.resizingRight = !1, b = this.resizingLeft = !0;else {
              if (0 === a || isNaN(a)) a = 0.1;
              g.setAttr('width', a);
            }
            this.clipDragger(!0);
          }
          if (this.resizingLeft) {
            if (m) {
              if (c = e, e = r, e < f && (e = f), isNaN(e) && (e = f), e > p + f && (e = p + f), a = !0 === b ? c - e : k + c - e, 0 > a) this.resizingRight = !0, this.resizingLeft = !1, g.setAttr('y', c + k - f);else {
                if (0 === a || isNaN(a)) a = 0.1;
                g.setAttr('y', e - f);
                g.setAttr('height', a);
              }
            } else if (e = t, e < d && (e = d), isNaN(e) && (e = d), e > q + d && (e = q + d), a = !0 === b ? c - e : l + c - e, 0 > a) this.resizingRight = !0, this.resizingLeft = !1, g.setAttr('x', c + l - d);else {
              if (0 === a || isNaN(a)) a = 0.1;
              g.setAttr('x', e - d);
              g.setAttr('width', a);
            }
            this.clipDragger(!0);
          }
        }
      }
    },
    stopForceClip: function stopForceClip() {
      this.animating = this.forceClip = !1;
    },
    clipDragger: function clipDragger(a) {
      var b = this.getDBox();
      if (b) {
        var c = b.x,
            e = b.y,
            d = b.width,
            b = b.height,
            f = !1;
        if (this.rotate) {
          if (c = 0, d = this.width + 1, this.clipY != e || this.clipH != b) f = !0;
        } else if (e = 0, b = this.height + 1, this.clipX != c || this.clipW != d) f = !0;
        f && (this.clipAndUpdate(c, e, d, b), a && (this.updateOnReleaseOnly || this.dispatchScrollbarEvent()));
      }
    },
    maskGraphs: function maskGraphs() {},
    clipAndUpdate: function clipAndUpdate(a, b, c, e) {
      this.clipX = a;
      this.clipY = b;
      this.clipW = c;
      this.clipH = e;
      this.selectedBG.setAttr('width', c);
      this.selectedBG.setAttr('height', e);
      this.selectedBG.translate(a, b);
      this.updateDragIconPositions();
      this.maskGraphs(a, b, c, e);
    },
    dispatchScrollbarEvent: function dispatchScrollbarEvent() {
      if (this.skipEvent) this.skipEvent = !1;else {
        var a = this.chart;
        a.hideBalloon();
        var b = this.getDBox(),
            c = b.x,
            e = b.y,
            d = b.width,
            f = b.height,
            g,
            k;
        this.rotate ? (b = e, g = this.height / f, k = 1 - e / this.height, c = 1 - (e + f) / this.height) : (b = c, g = this.width / d, k = c / this.width, c = (c + d) / this.width);
        this.fire({
          type: 'zoomed',
          position: b,
          chart: a,
          target: this,
          multiplier: g,
          relativeStart: c,
          relativeEnd: k
        });
      }
    },
    updateDragIconPositions: function updateDragIconPositions() {
      var a = this.getDBox(),
          b = a.x,
          c = a.y,
          e = this.iconLeft,
          d = this.iconRight,
          f,
          g,
          k = this.scrollbarHeight;
      this.rotate ? (f = this.dragIconWidth, g = this.dragIconHeight, e.translate((k - g) / 2, c - f / 2), d.translate((k - g) / 2, c + a.height - f / 2)) : (f = this.dragIconHeight, g = this.dragIconWidth, e.translate(b - g / 2, (k - f) / 2), d.translate(b - g / 2 + a.width, (k - f) / 2));
    },
    showDragIcons: function showDragIcons() {
      this.resizeEnabled && (this.iconLeft.show(), this.iconRight.show());
    },
    hideDragIcons: function hideDragIcons() {
      if (!this.resizingLeft && !this.resizingRight && !this.dragging) {
        if (this.hideResizeGrips || !this.resizeEnabled) this.iconLeft.hide(), this.iconRight.hide();
        this.removeCursors();
      }
    },
    removeCursors: function removeCursors() {
      this.chart.setMouseCursor('auto');
    },
    fireZoomEvent: function fireZoomEvent(a) {
      this.fire({ type: a, chart: this.chart, target: this });
    },
    percentZoom: function percentZoom(a, b) {
      if (this.dragger && this.enabled) {
        this.dragger.stop();
        isNaN(a) && (a = 0);
        isNaN(b) && (b = 1);
        var c, e, d;
        this.rotate ? (c = this.height, e = c - c * b, d = c - c * a) : (c = this.width, d = c * b, e = c * a);
        this.updateScrollbarSize(e, d);
        this.clipDragger(!1);
        this.percentStart = a;
        this.percentEnd = b;
      }
    },
    destroy: function destroy() {
      this.clear();
      d.remove(this.set);
      d.remove(this.iconRight);
      d.remove(this.iconLeft);
    },
    clear: function clear() {},
    handleDragStart: function handleDragStart() {
      if (this.enabled) {
        this.fireZoomEvent('zoomStarted');
        var a = this.chart;
        this.dragger.stop();
        this.removeCursors();
        d.isModern && this.dragger.node.setAttribute('style', this.dragCursorDown);
        this.dragging = !0;
        var b = this.getDBox();
        this.rotate ? (this.initialCoord = b.y, this.initialMouse = a.mouseY) : (this.initialCoord = b.x, this.initialMouse = a.mouseX);
      }
    },
    handleDragStop: function handleDragStop() {
      this.updateOnReleaseOnly && (this.update(), this.skipEvent = !1, this.dispatchScrollbarEvent());
      this.dragging = !1;
      this.mouseIsOver && this.removeCursors();
      d.isModern && this.dragger.node.setAttribute('style', this.dragCursorHover);
      this.update();
      this.fireZoomEvent('zoomEnded');
    },
    handleDraggerOver: function handleDraggerOver() {
      this.handleMouseOver();
      d.isModern && this.dragger.node.setAttribute('style', this.dragCursorHover);
    },
    leftDragStart: function leftDragStart() {
      this.fireZoomEvent('zoomStarted');
      this.dragger.stop();
      this.resizingLeft = !0;
    },
    leftDragStop: function leftDragStop() {
      this.resizingLeft = !1;
      this.mouseIsOver || this.removeCursors();
      this.updateOnRelease();
      this.fireZoomEvent('zoomEnded');
    },
    rightDragStart: function rightDragStart() {
      this.fireZoomEvent('zoomStarted');
      this.dragger.stop();
      this.resizingRight = !0;
    },
    rightDragStop: function rightDragStop() {
      this.resizingRight = !1;
      this.mouseIsOver || this.removeCursors();
      this.updateOnRelease();
      this.fireZoomEvent('zoomEnded');
    },
    iconRollOut: function iconRollOut() {
      this.removeCursors();
    },
    iconRollOver: function iconRollOver() {
      this.rotate ? this.chart.setMouseCursor('ns-resize') : this.chart.setMouseCursor('ew-resize');
      this.handleMouseOver();
    },
    getDBox: function getDBox() {
      if (this.dragger) return this.dragger.getBBox();
    },
    handleBgClick: function handleBgClick() {
      var a = this;
      if (!a.resizingRight && !a.resizingLeft) {
        a.zooming = !0;
        var b,
            c,
            e = a.scrollDuration,
            h = a.dragger;
        b = a.getDBox();
        var f = b.height,
            g = b.width;
        c = a.chart;
        var k = a.y,
            l = a.x,
            m = a.rotate;
        m ? (b = 'y', c = c.mouseY - f / 2 - k, c = d.fitToBounds(c, 0, a.height - f)) : (b = 'x', c = c.mouseX - g / 2 - l, c = d.fitToBounds(c, 0, a.width - g));
        a.updateOnReleaseOnly ? (a.skipEvent = !1, h.setAttr(b, c), a.dispatchScrollbarEvent(), a.clipDragger()) : (a.animating = !0, c = Math.round(c), m ? h.animate({ y: c }, e, '>') : h.animate({ x: c }, e, '>'), a.forceClip = !0, clearTimeout(a.forceTO), a.forceTO = setTimeout(function () {
          a.stopForceClip.call(a);
        }, 5e3 * e));
      }
    },
    updateOnRelease: function updateOnRelease() {
      this.updateOnReleaseOnly && (this.update(), this.skipEvent = !1, this.dispatchScrollbarEvent());
    },
    handleReleaseOutside: function handleReleaseOutside() {
      if (this.set) {
        if (this.resizingLeft || this.resizingRight || this.dragging) this.updateOnRelease(), this.removeCursors();
        this.animating = this.mouseIsOver = this.dragging = this.resizingRight = this.resizingLeft = !1;
        this.hideDragIcons();
        this.update();
      }
    },
    handleMouseOver: function handleMouseOver() {
      this.mouseIsOver = !0;
      this.showDragIcons();
    },
    handleMouseOut: function handleMouseOut() {
      this.mouseIsOver = !1;
      this.hideDragIcons();
      this.removeCursors();
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.ChartScrollbar = d.Class({
    inherits: d.SimpleChartScrollbar,
    construct: function construct(a) {
      this.cname = 'ChartScrollbar';
      d.ChartScrollbar.base.construct.call(this, a);
      this.graphLineColor = '#BBBBBB';
      this.graphLineAlpha = 0;
      this.graphFillColor = '#BBBBBB';
      this.graphFillAlpha = 1;
      this.selectedGraphLineColor = '#888888';
      this.selectedGraphLineAlpha = 0;
      this.selectedGraphFillColor = '#888888';
      this.selectedGraphFillAlpha = 1;
      this.gridCount = 0;
      this.gridColor = '#FFFFFF';
      this.gridAlpha = 0.7;
      this.skipEvent = this.autoGridCount = !1;
      this.color = '#FFFFFF';
      this.scrollbarCreated = !1;
      this.oppositeAxis = !0;
      d.applyTheme(this, a, this.cname);
    },
    init: function init() {
      var a = this.categoryAxis,
          b = this.chart,
          c = this.gridAxis;
      a || ('CategoryAxis' == this.gridAxis.cname ? (this.catScrollbar = !0, a = new d.CategoryAxis(), a.id = 'scrollbar') : (a = new d.ValueAxis(), a.data = b.chartData, a.id = c.id, a.type = c.type, a.maximumDate = c.maximumDate, a.minimumDate = c.minimumDate, a.minPeriod = c.minPeriod), this.categoryAxis = a);
      a.chart = b;
      a.dateFormats = c.dateFormats;
      a.markPeriodChange = c.markPeriodChange;
      a.boldPeriodBeginning = c.boldPeriodBeginning;
      a.labelFunction = c.labelFunction;
      a.axisItemRenderer = d.RecItem;
      a.axisRenderer = d.RecAxis;
      a.guideFillRenderer = d.RecFill;
      a.inside = !0;
      a.fontSize = this.fontSize;
      a.tickLength = 0;
      a.axisAlpha = 0;
      d.isString(this.graph) && (this.graph = d.getObjById(b.graphs, this.graph));(a = this.graph) && this.catScrollbar && (c = this.valueAxis, c || (this.valueAxis = c = new d.ValueAxis(), c.visible = !1, c.scrollbar = !0, c.axisItemRenderer = d.RecItem, c.axisRenderer = d.RecAxis, c.guideFillRenderer = d.RecFill, c.labelsEnabled = !1, c.chart = b), b = this.unselectedGraph, b || (b = new d.AmGraph(), b.scrollbar = !0, this.unselectedGraph = b, b.negativeBase = a.negativeBase, b.noStepRisers = a.noStepRisers), b = this.selectedGraph, b || (b = new d.AmGraph(), b.scrollbar = !0, this.selectedGraph = b, b.negativeBase = a.negativeBase, b.noStepRisers = a.noStepRisers));
      this.scrollbarCreated = !0;
    },
    draw: function draw() {
      var a = this;
      d.ChartScrollbar.base.draw.call(a);
      if (a.enabled) {
        a.scrollbarCreated || a.init();
        var b = a.chart,
            c = b.chartData,
            e = a.categoryAxis,
            h = a.rotate,
            f = a.x,
            g = a.y,
            k = a.width,
            l = a.height,
            m = a.gridAxis,
            n = a.set;
        e.setOrientation(!h);
        e.parseDates = m.parseDates;
        'ValueAxis' == a.categoryAxis.cname && (e.rotate = !h);
        e.equalSpacing = m.equalSpacing;
        e.minPeriod = m.minPeriod;
        e.startOnAxis = m.startOnAxis;
        e.width = k - 1;
        e.height = l;
        e.gridCount = a.gridCount;
        e.gridColor = a.gridColor;
        e.gridAlpha = a.gridAlpha;
        e.color = a.color;
        e.tickLength = 0;
        e.axisAlpha = 0;
        e.autoGridCount = a.autoGridCount;
        e.parseDates && !e.equalSpacing && e.timeZoom(b.firstTime, b.lastTime);
        e.minimum = a.gridAxis.fullMin;
        e.maximum = a.gridAxis.fullMax;
        e.strictMinMax = !0;
        e.zoom(0, c.length - 1);
        if ((m = a.graph) && a.catScrollbar) {
          var q = a.valueAxis,
              p = m.valueAxis;
          q.id = p.id;
          q.rotate = h;
          q.setOrientation(h);
          q.width = k;
          q.height = l;
          q.dataProvider = c;
          q.reversed = p.reversed;
          q.logarithmic = p.logarithmic;
          q.gridAlpha = 0;
          q.axisAlpha = 0;
          n.push(q.set);
          h ? (q.y = g, q.x = 0) : (q.x = f, q.y = 0);
          var f = Infinity,
              g = -Infinity,
              t;
          for (t = 0; t < c.length; t++) {
            var r = c[t].axes[p.id].graphs[m.id].values,
                u;
            for (u in r) {
              if (r.hasOwnProperty(u) && 'percents' != u && 'total' != u) {
                var x = r[u];
                x < f && (f = x);
                x > g && (g = x);
              }
            }
          }
          Infinity != f && (q.minimum = f);-Infinity != g && (q.maximum = g + 0.1 * (g - f));
          f == g && (--q.minimum, q.maximum += 1);
          void 0 !== a.minimum && (q.minimum = a.minimum);
          void 0 !== a.maximum && (q.maximum = a.maximum);
          q.zoom(0, c.length - 1);
          u = a.unselectedGraph;
          u.id = m.id;
          u.bcn = 'scrollbar-graph-';
          u.rotate = h;
          u.chart = b;
          u.data = c;
          u.valueAxis = q;
          u.chart = m.chart;
          u.categoryAxis = a.categoryAxis;
          u.periodSpan = m.periodSpan;
          u.valueField = m.valueField;
          u.openField = m.openField;
          u.closeField = m.closeField;
          u.highField = m.highField;
          u.lowField = m.lowField;
          u.lineAlpha = a.graphLineAlpha;
          u.lineColorR = a.graphLineColor;
          u.fillAlphas = a.graphFillAlpha;
          u.fillColorsR = a.graphFillColor;
          u.connect = m.connect;
          u.hidden = m.hidden;
          u.width = k;
          u.height = l;
          u.pointPosition = m.pointPosition;
          u.stepDirection = m.stepDirection;
          u.periodSpan = m.periodSpan;
          p = a.selectedGraph;
          p.id = m.id;
          p.bcn = u.bcn + 'selected-';
          p.rotate = h;
          p.chart = b;
          p.data = c;
          p.valueAxis = q;
          p.chart = m.chart;
          p.categoryAxis = e;
          p.periodSpan = m.periodSpan;
          p.valueField = m.valueField;
          p.openField = m.openField;
          p.closeField = m.closeField;
          p.highField = m.highField;
          p.lowField = m.lowField;
          p.lineAlpha = a.selectedGraphLineAlpha;
          p.lineColorR = a.selectedGraphLineColor;
          p.fillAlphas = a.selectedGraphFillAlpha;
          p.fillColorsR = a.selectedGraphFillColor;
          p.connect = m.connect;
          p.hidden = m.hidden;
          p.width = k;
          p.height = l;
          p.pointPosition = m.pointPosition;
          p.stepDirection = m.stepDirection;
          p.periodSpan = m.periodSpan;
          b = a.graphType;
          b || (b = m.type);
          u.type = b;
          p.type = b;
          c = c.length - 1;
          u.zoom(0, c);
          p.zoom(0, c);
          p.set.click(function () {
            a.handleBackgroundClick();
          }).mouseover(function () {
            a.handleMouseOver();
          }).mouseout(function () {
            a.handleMouseOut();
          });
          u.set.click(function () {
            a.handleBackgroundClick();
          }).mouseover(function () {
            a.handleMouseOver();
          }).mouseout(function () {
            a.handleMouseOut();
          });
          n.push(u.set);
          n.push(p.set);
        }
        n.push(e.set);
        n.push(e.labelsSet);
        a.bg.toBack();
        a.invisibleBg.toFront();
        a.dragger.toFront();
        a.iconLeft.toFront();
        a.iconRight.toFront();
      }
    },
    timeZoom: function timeZoom(a, b, c) {
      this.startTime = a;
      this.endTime = b;
      this.timeDifference = b - a;
      this.skipEvent = !d.toBoolean(c);
      this.zoomScrollbar();
      this.dispatchScrollbarEvent();
    },
    zoom: function zoom(a, b) {
      this.start = a;
      this.end = b;
      this.skipEvent = !0;
      this.zoomScrollbar();
    },
    dispatchScrollbarEvent: function dispatchScrollbarEvent() {
      if (this.categoryAxis && 'ValueAxis' == this.categoryAxis.cname) d.ChartScrollbar.base.dispatchScrollbarEvent.call(this);else if (this.skipEvent) this.skipEvent = !1;else {
        var a = this.chart.chartData,
            b,
            c,
            e = this.dragger.getBBox();
        b = e.x;
        var h = e.y,
            f = e.width,
            e = e.height,
            g = this.chart;
        this.rotate ? (b = h, c = e) : c = f;
        f = { type: 'zoomed', target: this };
        f.chart = g;
        var k = this.categoryAxis,
            l = this.stepWidth,
            h = g.minSelectedTime,
            e = g.maxSelectedTime,
            m = !1;
        if (k.parseDates && !k.equalSpacing) {
          if (a = g.lastTime, g = g.firstTime, k = Math.round(b / l) + g, b = this.dragging ? k + this.timeDifference : Math.round((b + c) / l) + g, k > b && (k = b), 0 < h && b - k < h && (b = Math.round(k + (b - k) / 2), m = Math.round(h / 2), k = b - m, b += m, m = !0), 0 < e && b - k > e && (b = Math.round(k + (b - k) / 2), m = Math.round(e / 2), k = b - m, b += m, m = !0), b > a && (b = a), b - h < k && (k = b - h), k < g && (k = g), k + h > b && (b = k + h), k != this.startTime || b != this.endTime) this.startTime = k, this.endTime = b, f.start = k, f.end = b, f.startDate = new Date(k), f.endDate = new Date(b), this.fire(f);
        } else if (k.startOnAxis || (b += l / 2), c -= this.stepWidth / 2, h = k.xToIndex(b), b = k.xToIndex(b + c), h != this.start || this.end != b) k.startOnAxis && (this.resizingRight && h == b && b++, this.resizingLeft && h == b && (0 < h ? h-- : b = 1)), this.start = h, this.end = this.dragging ? this.start + this.difference : b, f.start = this.start, f.end = this.end, k.parseDates && (a[this.start] && (f.startDate = new Date(a[this.start].time)), a[this.end] && (f.endDate = new Date(a[this.end].time))), this.fire(f);
        m && this.zoomScrollbar(!0);
      }
    },
    zoomScrollbar: function zoomScrollbar(a) {
      if ((!(this.dragging || this.resizingLeft || this.resizingRight || this.animating) || a) && this.dragger && this.enabled) {
        var b;
        a = this.chart;
        var c = a.chartData,
            e = this.categoryAxis;
        e.parseDates && !e.equalSpacing ? (c = e.stepWidth, e = a.firstTime, a = c * (this.startTime - e), b = c * (this.endTime - e)) : (a = c[this.start].x[e.id], b = c[this.end].x[e.id], c = e.stepWidth, e.startOnAxis || (e = c / 2, a -= e, b += e));
        this.stepWidth = c;
        this.updateScrollbarSize(a, b);
      }
    },
    maskGraphs: function maskGraphs(a, b, c, e) {
      var d = this.selectedGraph;
      d && d.set.clipRect(a, b, c, e);
    },
    handleDragStart: function handleDragStart() {
      d.ChartScrollbar.base.handleDragStart.call(this);
      this.difference = this.end - this.start;
      this.timeDifference = this.endTime - this.startTime;
      0 > this.timeDifference && (this.timeDifference = 0);
    },
    handleBackgroundClick: function handleBackgroundClick() {
      d.ChartScrollbar.base.handleBackgroundClick.call(this);
      this.dragging || (this.difference = this.end - this.start, this.timeDifference = this.endTime - this.startTime, 0 > this.timeDifference && (this.timeDifference = 0));
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.AmBalloon = d.Class({
    construct: function construct(a) {
      this.cname = 'AmBalloon';
      this.enabled = !0;
      this.fillColor = '#FFFFFF';
      this.fillAlpha = 0.8;
      this.borderThickness = 2;
      this.borderColor = '#FFFFFF';
      this.borderAlpha = 1;
      this.cornerRadius = 0;
      this.maxWidth = 220;
      this.horizontalPadding = 8;
      this.verticalPadding = 4;
      this.pointerWidth = 6;
      this.pointerOrientation = 'V';
      this.color = '#000000';
      this.adjustBorderColor = !0;
      this.show = this.follow = this.showBullet = !1;
      this.bulletSize = 3;
      this.shadowAlpha = 0.4;
      this.shadowColor = '#000000';
      this.fadeOutDuration = this.animationDuration = 0.3;
      this.fixedPosition = !0;
      this.offsetY = 6;
      this.offsetX = 1;
      this.textAlign = 'center';
      this.disableMouseEvents = !0;
      this.deltaSignX = this.deltaSignY = 1;
      d.isModern || (this.offsetY *= 1.5);
      this.sdy = this.sdx = 0;
      d.applyTheme(this, a, this.cname);
    },
    draw: function draw() {
      var a = this.pointToX,
          b = this.pointToY;
      d.isModern || (this.drop = !1);
      var c = this.chart;
      d.VML && (this.fadeOutDuration = 0);
      this.xAnim && c.stopAnim(this.xAnim);
      this.yAnim && c.stopAnim(this.yAnim);
      this.sdy = this.sdx = 0;
      if (!isNaN(a)) {
        var e = this.follow,
            h = c.container,
            f = this.set;
        d.remove(f);
        this.removeDiv();
        f = h.set();
        f.node.style.pointerEvents = 'none';
        this.set = f;
        this.mainSet ? (this.mainSet.push(this.set), this.sdx = this.mainSet.x, this.sdy = this.mainSet.y) : c.balloonsSet.push(f);
        if (this.show) {
          var g = this.l,
              k = this.t,
              l = this.r,
              m = this.b,
              n = this.balloonColor,
              q = this.fillColor,
              p = this.borderColor,
              t = q;
          void 0 != n && (this.adjustBorderColor ? t = p = n : q = n);
          var r = this.horizontalPadding,
              u = this.verticalPadding,
              x = this.pointerWidth,
              y = this.pointerOrientation,
              w = this.cornerRadius,
              z = c.fontFamily,
              A = this.fontSize;
          void 0 == A && (A = c.fontSize);
          var n = document.createElement('div'),
              B = c.classNamePrefix;
          n.className = B + '-balloon-div';
          this.className && (n.className = n.className + ' ' + B + '-balloon-div-' + this.className);
          B = n.style;
          this.disableMouseEvents && (B.pointerEvents = 'none');
          B.position = 'absolute';
          var C = this.minWidth,
              D = '';
          isNaN(C) || (D = 'min-width:' + (C - 2 * r) + 'px; ');
          n.innerHTML = '<div style="text-align:' + this.textAlign + '; ' + D + 'max-width:' + this.maxWidth + 'px; font-size:' + A + 'px; color:' + this.color + '; font-family:' + z + '">' + this.text + '</div>';
          c.chartDiv.appendChild(n);
          this.textDiv = n;
          var L = n.offsetWidth,
              I = n.offsetHeight;
          n.clientHeight && (L = n.clientWidth, I = n.clientHeight);
          z = I + 2 * u;
          D = L + 2 * r;
          !isNaN(C) && D < C && (D = C);
          window.opera && (z += 2);
          var S = !1,
              A = this.offsetY;
          c.handDrawn && (A += c.handDrawScatter + 2);
          'H' != y ? (C = a - D / 2, b < k + z + 10 && 'down' != y ? (S = !0, e && (b += A), A = b + x, this.deltaSignY = -1) : (e && (b -= A), A = b - z - x, this.deltaSignY = 1)) : (2 * x > z && (x = z / 2), A = b - z / 2, a < g + (l - g) / 2 ? (C = a + x, this.deltaSignX = -1) : (C = a - D - x, this.deltaSignX = 1));
          A + z >= m && (A = m - z);
          A < k && (A = k);
          C < g && (C = g);
          C + D > l && (C = l - D);
          var k = A + u,
              m = C + r,
              O = this.shadowAlpha,
              Q = this.shadowColor,
              r = this.borderThickness,
              ia = this.bulletSize,
              H,
              u = this.fillAlpha,
              Z = this.borderAlpha;
          this.showBullet && (H = d.circle(h, ia, t, u), f.push(H));
          this.drop ? (g = D / 1.6, l = 0, 'V' == y && (y = 'down'), 'H' == y && (y = 'left'), 'down' == y && (C = a + 1, A = b - g - g / 3), 'up' == y && (l = 180, C = a + 1, A = b + g + g / 3), 'left' == y && (l = 270, C = a + g + g / 3 + 2, A = b), 'right' == y && (l = 90, C = a - g - g / 3 + 2, A = b), k = A - I / 2 + 1, m = C - L / 2 - 1, q = d.drop(h, g, l, q, u, r, p, Z)) : 0 < w || 0 === x ? (0 < O && (a = d.rect(h, D, z, q, 0, r + 1, Q, O, w), d.isModern ? a.translate(1, 1) : a.translate(4, 4), f.push(a)), q = d.rect(h, D, z, q, u, r, p, Z, w)) : (t = [], w = [], 'H' != y ? (g = a - C, g > D - x && (g = D - x), g < x && (g = x), t = [0, g - x, a - C, g + x, D, D, 0, 0], w = S ? [0, 0, b - A, 0, 0, z, z, 0] : [z, z, b - A, z, z, 0, 0, z]) : (y = b - A, y > z - x && (y = z - x), y < x && (y = x), w = [0, y - x, b - A, y + x, z, z, 0, 0], t = a < g + (l - g) / 2 ? [0, 0, C < a ? 0 : a - C, 0, 0, D, D, 0] : [D, D, C + D > a ? D : a - C, D, D, 0, 0, D]), 0 < O && (a = d.polygon(h, t, w, q, 0, r, Q, O), a.translate(1, 1), f.push(a)), q = d.polygon(h, t, w, q, u, r, p, Z));
          this.bg = q;
          f.push(q);
          q.toFront();
          d.setCN(c, q, 'balloon-bg');
          this.className && d.setCN(c, q, 'balloon-bg-' + this.className);
          h = 1 * this.deltaSignX;
          m += this.sdx;
          k += this.sdy;
          B.left = m + 'px';
          B.top = k + 'px';
          f.translate(C - h, A, 1, !0);
          q = q.getBBox();
          this.bottom = A + z + 1;
          this.yPos = q.y + A;
          H && H.translate(this.pointToX - C + h, b - A);
          b = this.animationDuration;
          0 < this.animationDuration && !e && !isNaN(this.prevX) && (f.translate(this.prevX, this.prevY, NaN, !0), f.animate({ translate: C - h + ',' + A }, b, 'easeOutSine'), n && (B.left = this.prevTX + 'px', B.top = this.prevTY + 'px', this.xAnim = c.animate({ node: n }, 'left', this.prevTX, m, b, 'easeOutSine', 'px'), this.yAnim = c.animate({ node: n }, 'top', this.prevTY, k, b, 'easeOutSine', 'px')));
          this.prevX = C - h;
          this.prevY = A;
          this.prevTX = m;
          this.prevTY = k;
        }
      }
    },
    fixPrevious: function fixPrevious() {
      this.rPrevX = this.prevX;
      this.rPrevY = this.prevY;
      this.rPrevTX = this.prevTX;
      this.rPrevTY = this.prevTY;
    },
    restorePrevious: function restorePrevious() {
      this.prevX = this.rPrevX;
      this.prevY = this.rPrevY;
      this.prevTX = this.rPrevTX;
      this.prevTY = this.rPrevTY;
    },
    followMouse: function followMouse() {
      if (this.follow && this.show) {
        var a = this.chart.mouseX - this.offsetX * this.deltaSignX - this.sdx,
            b = this.chart.mouseY - this.sdy;
        this.pointToX = a;
        this.pointToY = b;
        if (a != this.previousX || b != this.previousY) if (this.previousX = a, this.previousY = b, 0 === this.cornerRadius) this.draw();else {
          var c = this.set;
          if (c) {
            var e = c.getBBox(),
                a = a - e.width / 2,
                d = b - e.height - 10;
            a < this.l && (a = this.l);
            a > this.r - e.width && (a = this.r - e.width);
            d < this.t && (d = b + 10);
            c.translate(a, d);
            b = this.textDiv.style;
            b.left = a + this.horizontalPadding + 'px';
            b.top = d + this.verticalPadding + 'px';
          }
        }
      }
    },
    changeColor: function changeColor(a) {
      this.balloonColor = a;
    },
    setBounds: function setBounds(a, b, c, d) {
      this.l = a;
      this.t = b;
      this.r = c;
      this.b = d;
      this.destroyTO && clearTimeout(this.destroyTO);
    },
    showBalloon: function showBalloon(a) {
      if (this.text != a || this.positionChanged) this.text = a, this.isHiding = !1, this.show = !0, this.destroyTO && clearTimeout(this.destroyTO), a = this.chart, this.fadeAnim1 && a.stopAnim(this.fadeAnim1), this.fadeAnim2 && a.stopAnim(this.fadeAnim2), this.draw(), this.positionChanged = !1;
    },
    hide: function hide(a) {
      var b = this;
      b.text = void 0;
      isNaN(a) && (a = b.fadeOutDuration);
      var c = b.chart;
      if (0 < a && !b.isHiding) {
        b.isHiding = !0;
        b.destroyTO && clearTimeout(b.destroyTO);
        b.destroyTO = setTimeout(function () {
          b.destroy.call(b);
        }, 1e3 * a);
        b.follow = !1;
        b.show = !1;
        var d = b.set;
        d && (d.setAttr('opacity', b.fillAlpha), b.fadeAnim1 = d.animate({ opacity: 0 }, a, 'easeInSine'));
        b.textDiv && (b.fadeAnim2 = c.animate({ node: b.textDiv }, 'opacity', 1, 0, a, 'easeInSine', ''));
      } else b.show = !1, b.follow = !1, b.destroy();
    },
    setPosition: function setPosition(a, b) {
      if (a != this.pointToX || b != this.pointToY) this.previousX = this.pointToX, this.previousY = this.pointToY, this.pointToX = a, this.pointToY = b, this.positionChanged = !0;
    },
    followCursor: function followCursor(a) {
      var b = this;
      b.follow = a;
      clearInterval(b.interval);
      var c = b.chart.mouseX - b.sdx,
          d = b.chart.mouseY - b.sdy;
      !isNaN(c) && a && (b.pointToX = c - b.offsetX * b.deltaSignX, b.pointToY = d, b.followMouse(), b.interval = setInterval(function () {
        b.followMouse.call(b);
      }, 40));
    },
    removeDiv: function removeDiv() {
      if (this.textDiv) {
        var a = this.textDiv.parentNode;
        a && a.removeChild(this.textDiv);
      }
    },
    destroy: function destroy() {
      clearInterval(this.interval);
      d.remove(this.set);
      this.removeDiv();
      this.set = null;
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.AmCoordinateChart = d.Class({
    inherits: d.AmChart,
    construct: function construct(a) {
      d.AmCoordinateChart.base.construct.call(this, a);
      this.theme = a;
      this.createEvents('rollOverGraphItem', 'rollOutGraphItem', 'clickGraphItem', 'doubleClickGraphItem', 'rightClickGraphItem', 'clickGraph', 'rollOverGraph', 'rollOutGraph');
      this.startAlpha = 1;
      this.startDuration = 0;
      this.startEffect = 'elastic';
      this.sequencedAnimation = !0;
      this.colors = '#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000'.split(' ');
      this.balloonDateFormat = 'MMM DD, YYYY';
      this.valueAxes = [];
      this.graphs = [];
      this.guides = [];
      this.gridAboveGraphs = !1;
      d.applyTheme(this, a, 'AmCoordinateChart');
    },
    initChart: function initChart() {
      d.AmCoordinateChart.base.initChart.call(this);
      this.drawGraphs = !0;
      var a = this.categoryAxis;
      a && (this.categoryAxis = d.processObject(a, d.CategoryAxis, this.theme));
      this.processValueAxes();
      this.createValueAxes();
      this.processGraphs();
      this.processGuides();
      d.VML && (this.startAlpha = 1);
      this.setLegendData(this.graphs);
      this.gridAboveGraphs && (this.gridSet.toFront(), this.bulletSet.toFront(), this.balloonsSet.toFront());
    },
    createValueAxes: function createValueAxes() {
      if (0 === this.valueAxes.length) {
        var a = new d.ValueAxis();
        this.addValueAxis(a);
      }
    },
    parseData: function parseData() {
      this.processValueAxes();
      this.processGraphs();
    },
    parseSerialData: function parseSerialData(a) {
      this.chartData = [];
      if (a) {
        if (0 < this.processTimeout) {
          1 > this.processCount && (this.processCount = 1);
          var b = a.length / this.processCount;
          this.parseCount = Math.ceil(b) - 1;
          for (var c = 0; c < b; c++) {
            this.delayParseSerialData(a, c);
          }
        } else this.parseCount = 0, this.parsePartSerialData(a, 0, a.length, 0);
      } else this.onDataUpdated();
    },
    delayParseSerialData: function delayParseSerialData(a, b) {
      var c = this,
          d = c.processCount;
      setTimeout(function () {
        c.parsePartSerialData.call(c, a, b * d, (b + 1) * d, b);
      }, c.processTimeout);
    },
    parsePartSerialData: function parsePartSerialData(a, b, c, e) {
      c > a.length && (c = a.length);
      var h = this.graphs,
          f = {},
          g = this.seriesIdField;
      g || (g = this.categoryField);
      var k = !1,
          l,
          m = this.categoryAxis,
          n,
          q,
          p;
      m && (k = m.parseDates, n = m.forceShowField, p = m.classNameField, q = m.labelColorField, l = m.categoryFunction);
      var t,
          r,
          u = {},
          x;
      k && (t = d.extractPeriod(m.minPeriod), r = t.period, t = t.count, x = d.getPeriodDuration(r, t));
      var y = {};
      this.lookupTable = y;
      var w,
          z = this.dataDateFormat,
          A = {};
      for (w = b; w < c; w++) {
        var B = {},
            C = a[w];
        b = C[this.categoryField];
        B.dataContext = C;
        B.category = l ? l(b, C, m) : String(b);
        n && (B.forceShow = C[n]);
        p && (B.className = C[p]);
        q && (B.labelColor = C[q]);
        y[C[g]] = B;
        if (k && (m.categoryFunction ? b = m.categoryFunction(b, C, m) : (!z || b instanceof Date || (b = b.toString() + ' |'), b = d.getDate(b, z, m.minPeriod)), b = d.resetDateToMin(b, r, t, m.firstDayOfWeek), B.category = b, B.time = b.getTime(), isNaN(B.time))) continue;
        var D = this.valueAxes;
        B.axes = {};
        B.x = {};
        var L;
        for (L = 0; L < D.length; L++) {
          var I = D[L].id;
          B.axes[I] = {};
          B.axes[I].graphs = {};
          var S;
          for (S = 0; S < h.length; S++) {
            b = h[S];
            var O = b.id,
                Q = 1.1;
            isNaN(b.gapPeriod) || (Q = b.gapPeriod);
            var ia = b.periodValue;
            if (b.valueAxis.id == I) {
              B.axes[I].graphs[O] = {};
              var H = {};
              H.index = w;
              var Z = C;
              b.dataProvider && (Z = f);
              H.values = this.processValues(Z, b, ia);
              !b.connect && A && A[O] && 0 < Q && B.time - u[O] >= x * Q && (A[O].gap = !0);
              this.processFields(b, H, Z);
              H.category = B.category;
              H.serialDataItem = B;
              H.graph = b;
              B.axes[I].graphs[O] = H;
              u[O] = B.time;
              A[O] = H;
            }
          }
        }
        this.chartData[w] = B;
      }
      if (this.parseCount == e) {
        for (a = 0; a < h.length; a++) {
          b = h[a], b.dataProvider && this.parseGraphData(b);
        }this.dataChanged = !1;
        this.dispatchDataUpdated = !0;
        this.onDataUpdated();
      }
    },
    processValues: function processValues(a, b, c) {
      var e = {},
          h,
          f = !1;'candlestick' != b.type && 'ohlc' != b.type || '' === c || (f = !0);
      for (var g = 'value error open close low high'.split(' '), k = 0; k < g.length; k++) {
        var l = g[k];
        'value' != l && 'error' != l && f && (c = l.charAt(0).toUpperCase() + l.slice(1));
        var m = a[b[l + 'Field'] + c];
        null !== m && (h = Number(m), isNaN(h) || (e[l] = h), 'date' == b.valueAxis.type && void 0 !== m && (h = d.getDate(m, b.chart.dataDateFormat), e[l] = h.getTime()));
      }
      return e;
    },
    parseGraphData: function parseGraphData(a) {
      var b = a.dataProvider,
          c = a.seriesIdField;
      c || (c = this.seriesIdField);
      c || (c = this.categoryField);
      var d;
      for (d = 0; d < b.length; d++) {
        var h = b[d],
            f = this.lookupTable[String(h[c])],
            g = a.valueAxis.id;
        f && (g = f.axes[g].graphs[a.id], g.serialDataItem = f, g.values = this.processValues(h, a, a.periodValue), this.processFields(a, g, h));
      }
    },
    addValueAxis: function addValueAxis(a) {
      a.chart = this;
      this.valueAxes.push(a);
      this.validateData();
    },
    removeValueAxesAndGraphs: function removeValueAxesAndGraphs() {
      var a = this.valueAxes,
          b;
      for (b = a.length - 1; -1 < b; b--) {
        this.removeValueAxis(a[b]);
      }
    },
    removeValueAxis: function removeValueAxis(a) {
      var b = this.graphs,
          c;
      for (c = b.length - 1; 0 <= c; c--) {
        var d = b[c];
        d && d.valueAxis == a && this.removeGraph(d);
      }
      b = this.valueAxes;
      for (c = b.length - 1; 0 <= c; c--) {
        b[c] == a && b.splice(c, 1);
      }this.validateData();
    },
    addGraph: function addGraph(a) {
      this.graphs.push(a);
      this.chooseGraphColor(a, this.graphs.length - 1);
      this.validateData();
    },
    removeGraph: function removeGraph(a) {
      var b = this.graphs,
          c;
      for (c = b.length - 1; 0 <= c; c--) {
        b[c] == a && (b.splice(c, 1), a.destroy());
      }this.validateData();
    },
    handleValueAxisZoom: function handleValueAxisZoom() {},
    processValueAxes: function processValueAxes() {
      var a = this.valueAxes,
          b;
      for (b = 0; b < a.length; b++) {
        var c = a[b],
            c = d.processObject(c, d.ValueAxis, this.theme);
        a[b] = c;
        c.chart = this;
        c.init();
        this.listenTo(c, 'axisIntZoomed', this.handleValueAxisZoom);
        c.id || (c.id = 'valueAxisAuto' + b + '_' + new Date().getTime());
        void 0 === c.usePrefixes && (c.usePrefixes = this.usePrefixes);
      }
    },
    processGuides: function processGuides() {
      var a = this.guides,
          b = this.categoryAxis;
      if (a) for (var c = 0; c < a.length; c++) {
        var e = a[c];(void 0 !== e.category || void 0 !== e.date) && b && b.addGuide(e);
        e.id || (e.id = 'guideAuto' + c + '_' + new Date().getTime());
        var h = e.valueAxis;
        h ? (d.isString(h) && (h = this.getValueAxisById(h)), h ? h.addGuide(e) : this.valueAxes[0].addGuide(e)) : isNaN(e.value) || this.valueAxes[0].addGuide(e);
      }
    },
    processGraphs: function processGraphs() {
      var a = this.graphs,
          b;
      this.graphsById = {};
      for (b = 0; b < a.length; b++) {
        var c = a[b],
            c = d.processObject(c, d.AmGraph, this.theme);
        a[b] = c;
        this.chooseGraphColor(c, b);
        c.chart = this;
        c.init();
        d.isString(c.valueAxis) && (c.valueAxis = this.getValueAxisById(c.valueAxis));
        c.valueAxis || (c.valueAxis = this.valueAxes[0]);
        c.id || (c.id = 'graphAuto' + b + '_' + new Date().getTime());
        this.graphsById[c.id] = c;
      }
    },
    formatString: function formatString(a, b, c) {
      var e = b.graph,
          h = e.valueAxis;
      h.duration && b.values.value && (h = d.formatDuration(b.values.value, h.duration, '', h.durationUnits, h.maxInterval, h.numberFormatter), a = a.split('[[value]]').join(h));
      a = d.massReplace(a, {
        '[[title]]': e.title,
        '[[description]]': b.description
      });
      a = c ? d.fixNewLines(a) : d.fixBrakes(a);
      return a = d.cleanFromEmpty(a);
    },
    getBalloonColor: function getBalloonColor(a, b, c) {
      var e = a.lineColor,
          h = a.balloonColor;
      c && (h = e);
      c = a.fillColorsR;
      'object' == (typeof c === 'undefined' ? 'undefined' : _typeof(c)) ? e = c[0] : void 0 !== c && (e = c);
      b.isNegative && (c = a.negativeLineColor, a = a.negativeFillColors, 'object' == (typeof a === 'undefined' ? 'undefined' : _typeof(a)) ? c = a[0] : void 0 !== a && (c = a), void 0 !== c && (e = c));
      void 0 !== b.color && (e = b.color);
      void 0 !== b.lineColor && (e = b.lineColor);
      b = b.fillColors;
      void 0 !== b && (e = b, d.ifArray(b) && (e = b[0]));
      void 0 === h && (h = e);
      return h;
    },
    getGraphById: function getGraphById(a) {
      return d.getObjById(this.graphs, a);
    },
    getValueAxisById: function getValueAxisById(a) {
      return d.getObjById(this.valueAxes, a);
    },
    processFields: function processFields(a, b, c) {
      if (a.itemColors) {
        var e = a.itemColors,
            h = b.index;
        b.color = h < e.length ? e[h] : d.randomColor();
      }
      e = 'lineColor color alpha fillColors description bullet customBullet bulletSize bulletConfig url labelColor dashLength pattern gap className'.split(' ');
      for (h = 0; h < e.length; h++) {
        var f = e[h],
            g = a[f + 'Field'];
        g && (g = c[g], d.isDefined(g) && (b[f] = g));
      }
      b.dataContext = c;
    },
    chooseGraphColor: function chooseGraphColor(a, b) {
      if (a.lineColor) a.lineColorR = a.lineColor;else {
        var c;
        c = this.colors.length > b ? this.colors[b] : a.lineColorR ? a.lineColorR : d.randomColor();
        a.lineColorR = c;
      }
      a.fillColorsR = a.fillColors ? a.fillColors : a.lineColorR;
      a.bulletBorderColorR = a.bulletBorderColor ? a.bulletBorderColor : a.useLineColorForBulletBorder ? a.lineColorR : a.bulletColor;
      a.bulletColorR = a.bulletColor ? a.bulletColor : a.lineColorR;
      if (c = this.patterns) a.pattern = c[b];
    },
    handleLegendEvent: function handleLegendEvent(a) {
      var b = a.type;
      a = a.dataItem;
      if (!this.legend.data && a) {
        var c = a.hidden,
            d = a.showBalloon;
        switch (b) {
          case 'clickMarker':
            this.textClickEnabled && (d ? this.hideGraphsBalloon(a) : this.showGraphsBalloon(a));
            break;
          case 'clickLabel':
            d ? this.hideGraphsBalloon(a) : this.showGraphsBalloon(a);
            break;
          case 'rollOverItem':
            c || this.highlightGraph(a);
            break;
          case 'rollOutItem':
            c || this.unhighlightGraph();
            break;
          case 'hideItem':
            this.hideGraph(a);
            break;
          case 'showItem':
            this.showGraph(a);
        }
      }
    },
    highlightGraph: function highlightGraph(a) {
      var b = this.graphs,
          c,
          d = 0.2;
      this.legend && (d = this.legend.rollOverGraphAlpha);
      if (1 != d) for (c = 0; c < b.length; c++) {
        var h = b[c];
        h != a && h.changeOpacity(d);
      }
    },
    unhighlightGraph: function unhighlightGraph() {
      var a;
      this.legend && (a = this.legend.rollOverGraphAlpha);
      if (1 != a) {
        a = this.graphs;
        var b;
        for (b = 0; b < a.length; b++) {
          a[b].changeOpacity(1);
        }
      }
    },
    showGraph: function showGraph(a) {
      a.switchable && (a.hidden = !1, this.dataChanged = !0, 'xy' != this.type && (this.marginsUpdated = !1), this.chartCreated && this.initChart());
    },
    hideGraph: function hideGraph(a) {
      a.switchable && (this.dataChanged = !0, 'xy' != this.type && (this.marginsUpdated = !1), a.hidden = !0, this.chartCreated && this.initChart());
    },
    hideGraphsBalloon: function hideGraphsBalloon(a) {
      a.showBalloon = !1;
      this.updateLegend();
    },
    showGraphsBalloon: function showGraphsBalloon(a) {
      a.showBalloon = !0;
      this.updateLegend();
    },
    updateLegend: function updateLegend() {
      this.legend && this.legend.invalidateSize();
    },
    resetAnimation: function resetAnimation() {
      var a = this.graphs;
      if (a) {
        var b;
        for (b = 0; b < a.length; b++) {
          a[b].animationPlayed = !1;
        }
      }
    },
    animateAgain: function animateAgain() {
      this.resetAnimation();
      this.validateNow();
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.TrendLine = d.Class({
    construct: function construct(a) {
      this.cname = 'TrendLine';
      this.createEvents('click');
      this.isProtected = !1;
      this.dashLength = 0;
      this.lineColor = '#00CC00';
      this.lineThickness = this.lineAlpha = 1;
      d.applyTheme(this, a, this.cname);
    },
    draw: function draw() {
      var a = this;
      a.destroy();
      var b = a.chart,
          c = b.container,
          e,
          h,
          f,
          g,
          k = a.categoryAxis,
          l = a.initialDate,
          m = a.initialCategory,
          n = a.finalDate,
          q = a.finalCategory,
          p = a.valueAxis,
          t = a.valueAxisX,
          r = a.initialXValue,
          u = a.finalXValue,
          x = a.initialValue,
          y = a.finalValue,
          w = p.recalculateToPercents,
          z = b.dataDateFormat;
      k && (l && (l = d.getDate(l, z, 'fff'), a.initialDate = l, e = k.dateToCoordinate(l)), m && (e = k.categoryToCoordinate(m)), n && (n = d.getDate(n, z, 'fff'), a.finalDate = n, h = k.dateToCoordinate(n)), q && (h = k.categoryToCoordinate(q)));
      t && !w && (isNaN(r) || (e = t.getCoordinate(r)), isNaN(u) || (h = t.getCoordinate(u)));
      p && !w && (isNaN(x) || (f = p.getCoordinate(x)), isNaN(y) || (g = p.getCoordinate(y)));
      if (!(isNaN(e) || isNaN(h) || isNaN(f) || isNaN(f))) {
        b.rotate ? (k = [f, g], g = [e, h]) : (k = [e, h], g = [f, g]);
        l = a.lineColor;
        f = d.line(c, k, g, l, a.lineAlpha, a.lineThickness, a.dashLength);
        e = k;
        h = g;
        q = k[1] - k[0];
        p = g[1] - g[0];
        0 === q && (q = 0.01);
        0 === p && (p = 0.01);
        m = q / Math.abs(q);
        n = p / Math.abs(p);
        p = 90 * Math.PI / 180 - Math.asin(q / (q * p / Math.abs(q * p) * Math.sqrt(Math.pow(q, 2) + Math.pow(p, 2))));
        q = Math.abs(5 * Math.cos(p));
        p = Math.abs(5 * Math.sin(p));
        e.push(k[1] - m * p, k[0] - m * p);
        h.push(g[1] + n * q, g[0] + n * q);
        g = d.polygon(c, e, h, l, 0.005, 0);
        c = c.set([g, f]);
        c.translate(b.marginLeftReal, b.marginTopReal);
        b.trendLinesSet.push(c);
        d.setCN(b, f, 'trend-line');
        d.setCN(b, f, 'trend-line-' + a.id);
        a.line = f;
        a.set = c;
        if (f = a.initialImage) f = d.processObject(f, d.Image, a.theme), f.chart = b, f.draw(), f.translate(e[0] + f.offsetX, h[0] + f.offsetY), c.push(f.set);
        if (f = a.finalImage) f = d.processObject(f, d.Image, a.theme), f.chart = b, f.draw(), f.translate(e[1] + f.offsetX, h[1] + f.offsetY), c.push(f.set);
        g.mouseup(function () {
          a.handleLineClick();
        }).mouseover(function () {
          a.handleLineOver();
        }).mouseout(function () {
          a.handleLineOut();
        });
        g.touchend && g.touchend(function () {
          a.handleLineClick();
        });
        c.clipRect(0, 0, b.plotAreaWidth, b.plotAreaHeight);
      }
    },
    handleLineClick: function handleLineClick() {
      this.fire({ type: 'click', trendLine: this, chart: this.chart });
    },
    handleLineOver: function handleLineOver() {
      var a = this.rollOverColor;
      void 0 !== a && this.line.attr({ stroke: a });
      this.balloonText && (clearTimeout(this.chart.hoverInt), a = this.line.getBBox(), this.chart.showBalloon(this.balloonText, this.lineColor, !0, this.x + a.x + a.width / 2, this.y + a.y + a.height / 2));
    },
    handleLineOut: function handleLineOut() {
      this.line.attr({ stroke: this.lineColor });
      this.balloonText && this.chart.hideBalloon();
    },
    destroy: function destroy() {
      d.remove(this.set);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.Image = d.Class({
    construct: function construct(a) {
      this.cname = 'Image';
      this.height = this.width = 20;
      this.rotation = this.offsetY = this.offsetX = 0;
      this.balloonColor = this.color = '#000000';
      this.opacity = 1;
      d.applyTheme(this, a, this.cname);
    },
    draw: function draw() {
      var a = this;
      a.set && a.set.remove();
      var b = a.chart.container;
      a.set = b.set();
      var c, d;
      a.url ? (c = b.image(a.url, 0, 0, a.width, a.height), d = 1) : a.svgPath && (c = b.path(a.svgPath), c.setAttr('fill', a.color), c.setAttr('stroke', a.outlineColor), b = c.getBBox(), d = Math.min(a.width / b.width, a.height / b.height));
      c && (c.setAttr('opacity', a.opacity), a.set.rotate(a.rotation), c.translate(-a.width / 2, -a.height / 2, d), a.balloonText && c.mouseover(function () {
        a.chart.showBalloon(a.balloonText, a.balloonColor, !0);
      }).mouseout(function () {
        a.chart.hideBalloon();
      }).touchend(function () {
        a.chart.hideBalloon();
      }).touchstart(function () {
        a.chart.showBalloon(a.balloonText, a.balloonColor, !0);
      }), a.set.push(c));
    },
    translate: function translate(a, b) {
      this.set && this.set.translate(a, b);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.circle = function (a, b, c, e, h, f, g, k, l) {
    0 >= b && (b = 0.001);
    if (void 0 == h || 0 === h) h = 0.01;
    void 0 === f && (f = '#000000');
    void 0 === g && (g = 0);
    e = {
      fill: c,
      stroke: f,
      'fill-opacity': e,
      'stroke-width': h,
      'stroke-opacity': g
    };
    a = isNaN(l) ? a.circle(0, 0, b).attr(e) : a.ellipse(0, 0, b, l).attr(e);
    k && a.gradient('radialGradient', [c, d.adjustLuminosity(c, -0.6)]);
    return a;
  };
  d.text = function (a, b, c, e, h, f, g, k) {
    f || (f = 'middle');
    'right' == f && (f = 'end');
    'left' == f && (f = 'start');
    isNaN(k) && (k = 1);
    void 0 !== b && (b = String(b), d.isIE && !d.isModern && (b = b.replace('&amp;', '&'), b = b.replace('&', '&amp;')));
    c = { fill: c, 'font-family': e, 'font-size': h + 'px', opacity: k };
    !0 === g && (c['font-weight'] = 'bold');
    c['text-anchor'] = f;
    return a.text(b, c);
  };
  d.polygon = function (a, b, c, e, h, f, g, k, l, m, n) {
    isNaN(f) && (f = 0.01);
    isNaN(k) && (k = h);
    var q = e,
        p = !1;
    'object' == (typeof q === 'undefined' ? 'undefined' : _typeof(q)) && 1 < q.length && (p = !0, q = q[0]);
    void 0 === g && (g = q);
    h = {
      fill: q,
      stroke: g,
      'fill-opacity': h,
      'stroke-width': f,
      'stroke-opacity': k
    };
    void 0 !== n && 0 < n && (h['stroke-dasharray'] = n);
    n = d.dx;
    f = d.dy;
    a.handDrawn && (c = d.makeHD(b, c, a.handDrawScatter), b = c[0], c = c[1]);
    g = Math.round;
    m && (b[t] = d.roundTo(b[t], 5), c[t] = d.roundTo(c[t], 5), g = Number);
    k = 'M' + (g(b[0]) + n) + ',' + (g(c[0]) + f);
    for (var t = 1; t < b.length; t++) {
      m && (b[t] = d.roundTo(b[t], 5), c[t] = d.roundTo(c[t], 5)), k += ' L' + (g(b[t]) + n) + ',' + (g(c[t]) + f);
    }a = a.path(k + ' Z').attr(h);
    p && a.gradient('linearGradient', e, l);
    return a;
  };
  d.rect = function (a, b, c, e, h, f, g, k, l, m, n) {
    if (isNaN(b) || isNaN(c)) return a.set();
    isNaN(f) && (f = 0);
    void 0 === l && (l = 0);
    void 0 === m && (m = 270);
    isNaN(h) && (h = 0);
    var q = e,
        p = !1;
    'object' == (typeof q === 'undefined' ? 'undefined' : _typeof(q)) && (q = q[0], p = !0);
    void 0 === g && (g = q);
    void 0 === k && (k = h);
    b = Math.round(b);
    c = Math.round(c);
    var t = 0,
        r = 0;
    0 > b && (b = Math.abs(b), t = -b);
    0 > c && (c = Math.abs(c), r = -c);
    t += d.dx;
    r += d.dy;
    h = { fill: q, stroke: g, 'fill-opacity': h, 'stroke-opacity': k };
    void 0 !== n && 0 < n && (h['stroke-dasharray'] = n);
    a = a.rect(t, r, b, c, l, f).attr(h);
    p && a.gradient('linearGradient', e, m);
    return a;
  };
  d.bullet = function (a, b, c, e, h, f, g, k, l, m, n, q, p) {
    var t;
    'circle' == b && (b = 'round');
    switch (b) {
      case 'round':
        t = d.circle(a, c / 2, e, h, f, g, k);
        break;
      case 'square':
        t = d.polygon(a, [-c / 2, c / 2, c / 2, -c / 2], [c / 2, c / 2, -c / 2, -c / 2], e, h, f, g, k, m - 180, void 0, p);
        break;
      case 'rectangle':
        t = d.polygon(a, [-c, c, c, -c], [c / 2, c / 2, -c / 2, -c / 2], e, h, f, g, k, m - 180, void 0, p);
        break;
      case 'diamond':
        t = d.polygon(a, [-c / 2, 0, c / 2, 0], [0, -c / 2, 0, c / 2], e, h, f, g, k);
        break;
      case 'triangleUp':
        t = d.triangle(a, c, 0, e, h, f, g, k);
        break;
      case 'triangleDown':
        t = d.triangle(a, c, 180, e, h, f, g, k);
        break;
      case 'triangleLeft':
        t = d.triangle(a, c, 270, e, h, f, g, k);
        break;
      case 'triangleRight':
        t = d.triangle(a, c, 90, e, h, f, g, k);
        break;
      case 'bubble':
        t = d.circle(a, c / 2, e, h, f, g, k, !0);
        break;
      case 'line':
        t = d.line(a, [-c / 2, c / 2], [0, 0], e, h, f, g, k);
        break;
      case 'yError':
        t = a.set();
        t.push(d.line(a, [0, 0], [-c / 2, c / 2], e, h, f));
        t.push(d.line(a, [-l, l], [-c / 2, -c / 2], e, h, f));
        t.push(d.line(a, [-l, l], [c / 2, c / 2], e, h, f));
        break;
      case 'xError':
        ;t = a.set(), t.push(d.line(a, [-c / 2, c / 2], [0, 0], e, h, f)), t.push(d.line(a, [-c / 2, -c / 2], [-l, l], e, h, f)), t.push(d.line(a, [c / 2, c / 2], [-l, l], e, h, f));
    }
    t && t.pattern(n, NaN, q);
    return t;
  };
  d.triangle = function (a, b, c, d, h, f, g, k) {
    if (void 0 === f || 0 === f) f = 1;
    void 0 === g && (g = '#000');
    void 0 === k && (k = 0);
    d = {
      fill: d,
      stroke: g,
      'fill-opacity': h,
      'stroke-width': f,
      'stroke-opacity': k
    };
    b /= 2;
    var l;
    0 === c && (l = ' M' + -b + ',' + b + ' L0,' + -b + ' L' + b + ',' + b + ' Z');
    180 == c && (l = ' M' + -b + ',' + -b + ' L0,' + b + ' L' + b + ',' + -b + ' Z');
    90 == c && (l = ' M' + -b + ',' + -b + ' L' + b + ',0 L' + -b + ',' + b + ' Z');
    270 == c && (l = ' M' + -b + ',0 L' + b + ',' + b + ' L' + b + ',' + -b + ' Z');
    return a.path(l).attr(d);
  };
  d.line = function (a, b, c, e, h, f, g, k, l, m, n) {
    if (a.handDrawn && !n) return d.handDrawnLine(a, b, c, e, h, f, g, k, l, m, n);
    f = { fill: 'none', 'stroke-width': f };
    void 0 !== g && 0 < g && (f['stroke-dasharray'] = g);
    isNaN(h) || (f['stroke-opacity'] = h);
    e && (f.stroke = e);
    e = Math.round;
    m && (e = Number, b[0] = d.roundTo(b[0], 5), c[0] = d.roundTo(c[0], 5));
    m = d.dx;
    h = d.dy;
    g = 'M' + (e(b[0]) + m) + ',' + (e(c[0]) + h);
    for (k = 1; k < b.length; k++) {
      b[k] = d.roundTo(b[k], 5), c[k] = d.roundTo(c[k], 5), g += ' L' + (e(b[k]) + m) + ',' + (e(c[k]) + h);
    }if (d.VML) return a.path(g, void 0, !0).attr(f);
    l && (g += ' M0,0 L0,0');
    return a.path(g).attr(f);
  };
  d.makeHD = function (a, b, c) {
    for (var d = [], h = [], f = 1; f < a.length; f++) {
      for (var g = Number(a[f - 1]), k = Number(b[f - 1]), l = Number(a[f]), m = Number(b[f]), n = Math.round(Math.sqrt(Math.pow(l - g, 2) + Math.pow(m - k, 2)) / 50) + 1, l = (l - g) / n, m = (m - k) / n, q = 0; q <= n; q++) {
        var p = k + q * m + Math.random() * c;
        d.push(g + q * l + Math.random() * c);
        h.push(p);
      }
    }return [d, h];
  };
  d.handDrawnLine = function (a, b, c, e, h, f, g, k, l, m) {
    var n,
        q = a.set();
    for (n = 1; n < b.length; n++) {
      for (var p = [b[n - 1], b[n]], t = [c[n - 1], c[n]], t = d.makeHD(p, t, a.handDrawScatter), p = t[0], t = t[1], r = 1; r < p.length; r++) {
        q.push(d.line(a, [p[r - 1], p[r]], [t[r - 1], t[r]], e, h, f + Math.random() * a.handDrawThickness - a.handDrawThickness / 2, g, k, l, m, !0));
      }
    }return q;
  };
  d.doNothing = function (a) {
    return a;
  };
  d.drop = function (a, b, c, d, h, f, g, k) {
    var l = 1 / 180 * Math.PI,
        m = c - 20,
        n = Math.sin(m * l) * b,
        q = Math.cos(m * l) * b,
        p = Math.sin((m + 40) * l) * b,
        t = Math.cos((m + 40) * l) * b,
        r = 0.8 * b,
        u = -b / 3,
        x = b / 3;
    0 === c && (u = -u, x = 0);
    180 == c && (x = 0);
    90 == c && (u = 0);
    270 == c && (u = 0, x = -x);
    c = {
      fill: d,
      stroke: g,
      'stroke-width': f,
      'stroke-opacity': k,
      'fill-opacity': h
    };
    b = 'M' + n + ',' + q + ' A' + b + ',' + b + ',0,1,1,' + p + ',' + t + (' A' + r + ',' + r + ',0,0,0,' + (Math.sin((m + 20) * l) * b + x) + ',' + (Math.cos((m + 20) * l) * b + u));
    b += ' A' + r + ',' + r + ',0,0,0,' + n + ',' + q;
    return a.path(b, void 0, void 0, '1000,1000').attr(c);
  };
  d.wedge = function (a, b, c, e, h, f, g, k, l, m, n, q, p, t) {
    var r = Math.round;
    f = r(f);
    g = r(g);
    k = r(k);
    var u = r(g / f * k),
        x = d.VML,
        y = 359.5 + f / 100;
    359.94 < y && (y = 359.94);
    h >= y && (h = y);
    var w = 1 / 180 * Math.PI,
        y = b + Math.sin(e * w) * k,
        z = c - Math.cos(e * w) * u,
        A = b + Math.sin(e * w) * f,
        B = c - Math.cos(e * w) * g,
        C = b + Math.sin((e + h) * w) * f,
        D = c - Math.cos((e + h) * w) * g,
        L = b + Math.sin((e + h) * w) * k,
        w = c - Math.cos((e + h) * w) * u,
        I = {
      fill: d.adjustLuminosity(m.fill, -0.2),
      'stroke-opacity': 0,
      'fill-opacity': m['fill-opacity']
    },
        S = 0;
    180 < Math.abs(h) && (S = 1);
    e = a.set();
    var O;
    x && (y = r(10 * y), A = r(10 * A), C = r(10 * C), L = r(10 * L), z = r(10 * z), B = r(10 * B), D = r(10 * D), w = r(10 * w), b = r(10 * b), l = r(10 * l), c = r(10 * c), f *= 10, g *= 10, k *= 10, u *= 10, 1 > Math.abs(h) && 1 >= Math.abs(C - A) && 1 >= Math.abs(D - B) && (O = !0));
    h = '';
    var Q;
    q && (I['fill-opacity'] = 0, I['stroke-opacity'] = m['stroke-opacity'] / 2, I.stroke = m.stroke);
    if (0 < l) {
      Q = ' M' + y + ',' + (z + l) + ' L' + A + ',' + (B + l);
      x ? (O || (Q += ' A' + (b - f) + ',' + (l + c - g) + ',' + (b + f) + ',' + (l + c + g) + ',' + A + ',' + (B + l) + ',' + C + ',' + (D + l)), Q += ' L' + L + ',' + (w + l), 0 < k && (O || (Q += ' B' + (b - k) + ',' + (l + c - u) + ',' + (b + k) + ',' + (l + c + u) + ',' + L + ',' + (l + w) + ',' + y + ',' + (l + z)))) : (Q += ' A' + f + ',' + g + ',0,' + S + ',1,' + C + ',' + (D + l) + ' L' + L + ',' + (w + l), 0 < k && (Q += ' A' + k + ',' + u + ',0,' + S + ',0,' + y + ',' + (z + l)));
      Q += ' Z';
      var ia = l;
      x && (ia /= 10);
      for (var H = 0; H < ia; H += 10) {
        var Z = a.path(Q, void 0, void 0, '1000,1000').attr(I);
        e.push(Z);
        Z.translate(0, -H);
      }
      Q = a.path(' M' + y + ',' + z + ' L' + y + ',' + (z + l) + ' L' + A + ',' + (B + l) + ' L' + A + ',' + B + ' L' + y + ',' + z + ' Z', void 0, void 0, '1000,1000').attr(I);
      l = a.path(' M' + C + ',' + D + ' L' + C + ',' + (D + l) + ' L' + L + ',' + (w + l) + ' L' + L + ',' + w + ' L' + C + ',' + D + ' Z', void 0, void 0, '1000,1000').attr(I);
      e.push(Q);
      e.push(l);
    }
    x ? (O || (h = ' A' + r(b - f) + ',' + r(c - g) + ',' + r(b + f) + ',' + r(c + g) + ',' + r(A) + ',' + r(B) + ',' + r(C) + ',' + r(D)), g = ' M' + r(y) + ',' + r(z) + ' L' + r(A) + ',' + r(B) + h + ' L' + r(L) + ',' + r(w)) : g = ' M' + y + ',' + z + ' L' + A + ',' + B + (' A' + f + ',' + g + ',0,' + S + ',1,' + C + ',' + D) + ' L' + L + ',' + w;
    0 < k && (x ? O || (g += ' B' + (b - k) + ',' + (c - u) + ',' + (b + k) + ',' + (c + u) + ',' + L + ',' + w + ',' + y + ',' + z) : g += ' A' + k + ',' + u + ',0,' + S + ',0,' + y + ',' + z);
    a.handDrawn && (k = d.line(a, [y, A], [z, B], m.stroke, m.thickness * Math.random() * a.handDrawThickness, m['stroke-opacity']), e.push(k));
    a = a.path(g + ' Z', void 0, void 0, '1000,1000').attr(m);
    if (n) {
      k = [];
      for (u = 0; u < n.length; u++) {
        k.push(d.adjustLuminosity(m.fill, n[u]));
      }'radial' != t || d.isModern || (k = []);
      0 < k.length && a.gradient(t + 'Gradient', k);
    }
    d.isModern && 'radial' == t && a.grad && (a.grad.setAttribute('gradientUnits', 'userSpaceOnUse'), a.grad.setAttribute('r', f), a.grad.setAttribute('cx', b), a.grad.setAttribute('cy', c));
    a.pattern(q, NaN, p);
    e.wedge = a;
    e.push(a);
    return e;
  };
  d.rgb2hex = function (a) {
    return (a = a.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i)) && 4 === a.length ? '#' + ('0' + parseInt(a[1], 10).toString(16)).slice(-2) + ('0' + parseInt(a[2], 10).toString(16)).slice(-2) + ('0' + parseInt(a[3], 10).toString(16)).slice(-2) : '';
  };
  d.adjustLuminosity = function (a, b) {
    a && -1 != a.indexOf('rgb') && (a = d.rgb2hex(a));
    a = String(a).replace(/[^0-9a-f]/gi, '');
    6 > a.length && (a = String(a[0]) + String(a[0]) + String(a[1]) + String(a[1]) + String(a[2]) + String(a[2]));
    b = b || 0;
    var c = '#',
        e,
        h;
    for (h = 0; 3 > h; h++) {
      e = parseInt(a.substr(2 * h, 2), 16), e = Math.round(Math.min(Math.max(0, e + e * b), 255)).toString(16), c += ('00' + e).substr(e.length);
    }return c;
  };
})();(function () {
  var d = window.AmCharts;
  d.Bezier = d.Class({
    construct: function construct(a, b, c, e, h, f, g, k, l, m, n) {
      var q, p;
      'object' == (typeof g === 'undefined' ? 'undefined' : _typeof(g)) && 1 < g.length && (p = !0, q = g, g = g[0]);
      'object' == (typeof k === 'undefined' ? 'undefined' : _typeof(k)) && (k = k[0]);
      0 === k && (g = 'none');
      f = { fill: g, 'fill-opacity': k, 'stroke-width': f };
      void 0 !== l && 0 < l && (f['stroke-dasharray'] = l);
      isNaN(h) || (f['stroke-opacity'] = h);
      e && (f.stroke = e);
      e = 'M' + Math.round(b[0]) + ',' + Math.round(c[0]);
      h = [];
      for (l = 0; l < b.length; l++) {
        h.push({ x: Number(b[l]), y: Number(c[l]) });
      }1 < h.length && (b = this.interpolate(h), e += this.drawBeziers(b));
      m ? e += m : d.VML || (e += 'M0,0 L0,0');
      this.path = a.path(e).attr(f);
      this.node = this.path.node;
      p && this.path.gradient('linearGradient', q, n);
    },
    interpolate: function interpolate(a) {
      var b = [];
      b.push({ x: a[0].x, y: a[0].y });
      var c = a[1].x - a[0].x,
          e = a[1].y - a[0].y,
          h = d.bezierX,
          f = d.bezierY;
      b.push({ x: a[0].x + c / h, y: a[0].y + e / f });
      var g;
      for (g = 1; g < a.length - 1; g++) {
        var k = a[g - 1],
            l = a[g],
            e = a[g + 1];
        isNaN(e.x) && (e = l);
        isNaN(l.x) && (l = k);
        isNaN(k.x) && (k = l);
        c = e.x - l.x;
        e = e.y - k.y;
        k = l.x - k.x;
        k > c && (k = c);
        b.push({ x: l.x - k / h, y: l.y - e / f });
        b.push({ x: l.x, y: l.y });
        b.push({ x: l.x + k / h, y: l.y + e / f });
      }
      e = a[a.length - 1].y - a[a.length - 2].y;
      c = a[a.length - 1].x - a[a.length - 2].x;
      b.push({ x: a[a.length - 1].x - c / h, y: a[a.length - 1].y - e / f });
      b.push({ x: a[a.length - 1].x, y: a[a.length - 1].y });
      return b;
    },
    drawBeziers: function drawBeziers(a) {
      var b = '',
          c;
      for (c = 0; c < (a.length - 1) / 3; c++) {
        b += this.drawBezierMidpoint(a[3 * c], a[3 * c + 1], a[3 * c + 2], a[3 * c + 3]);
      }return b;
    },
    drawBezierMidpoint: function drawBezierMidpoint(a, b, c, d) {
      var h = Math.round,
          f = this.getPointOnSegment(a, b, 0.75),
          g = this.getPointOnSegment(d, c, 0.75),
          k = (d.x - a.x) / 16,
          l = (d.y - a.y) / 16,
          m = this.getPointOnSegment(a, b, 0.375);
      a = this.getPointOnSegment(f, g, 0.375);
      a.x -= k;
      a.y -= l;
      b = this.getPointOnSegment(g, f, 0.375);
      b.x += k;
      b.y += l;
      c = this.getPointOnSegment(d, c, 0.375);
      k = this.getMiddle(m, a);
      f = this.getMiddle(f, g);
      g = this.getMiddle(b, c);
      m = ' Q' + h(m.x) + ',' + h(m.y) + ',' + h(k.x) + ',' + h(k.y);
      m += ' Q' + h(a.x) + ',' + h(a.y) + ',' + h(f.x) + ',' + h(f.y);
      m += ' Q' + h(b.x) + ',' + h(b.y) + ',' + h(g.x) + ',' + h(g.y);
      return m += ' Q' + h(c.x) + ',' + h(c.y) + ',' + h(d.x) + ',' + h(d.y);
    },
    getMiddle: function getMiddle(a, b) {
      return { x: (a.x + b.x) / 2, y: (a.y + b.y) / 2 };
    },
    getPointOnSegment: function getPointOnSegment(a, b, c) {
      return { x: a.x + (b.x - a.x) * c, y: a.y + (b.y - a.y) * c };
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.AmDraw = d.Class({
    construct: function construct(a, b, c, e) {
      d.SVG_NS = 'http://www.w3.org/2000/svg';
      d.SVG_XLINK = 'http://www.w3.org/1999/xlink';
      d.hasSVG = !!document.createElementNS && !!document.createElementNS(d.SVG_NS, 'svg').createSVGRect;
      1 > b && (b = 10);
      1 > c && (c = 10);
      this.div = a;
      this.width = b;
      this.height = c;
      this.rBin = document.createElement('div');
      d.hasSVG ? (d.SVG = !0, b = this.createSvgElement('svg'), a.appendChild(b), this.container = b, this.addDefs(e), this.R = new d.SVGRenderer(this)) : d.isIE && d.VMLRenderer && (d.VML = !0, d.vmlStyleSheet || (document.namespaces.add('amvml', 'urn:schemas-microsoft-com:vml'), 31 > document.styleSheets.length ? (b = document.createStyleSheet(), b.addRule('.amvml', 'behavior:url(#default#VML); display:inline-block; antialias:true'), d.vmlStyleSheet = b) : document.styleSheets[0].addRule('.amvml', 'behavior:url(#default#VML); display:inline-block; antialias:true')), this.container = a, this.R = new d.VMLRenderer(this, e), this.R.disableSelection(a));
    },
    createSvgElement: function createSvgElement(a) {
      return document.createElementNS(d.SVG_NS, a);
    },
    circle: function circle(a, b, c, e) {
      var h = new d.AmDObject('circle', this);
      h.attr({ r: c, cx: a, cy: b });
      this.addToContainer(h.node, e);
      return h;
    },
    ellipse: function ellipse(a, b, c, e, h) {
      var f = new d.AmDObject('ellipse', this);
      f.attr({ rx: c, ry: e, cx: a, cy: b });
      this.addToContainer(f.node, h);
      return f;
    },
    setSize: function setSize(a, b) {
      0 < a && 0 < b && (this.container.style.width = a + 'px', this.container.style.height = b + 'px');
    },
    rect: function rect(a, b, c, e, h, f, g) {
      var k = new d.AmDObject('rect', this);
      d.VML && (h = Math.round(100 * h / Math.min(c, e)), c += 2 * f, e += 2 * f, k.bw = f, k.node.style.marginLeft = -f, k.node.style.marginTop = -f);
      1 > c && (c = 1);
      1 > e && (e = 1);
      k.attr({
        x: a,
        y: b,
        width: c,
        height: e,
        rx: h,
        ry: h,
        'stroke-width': f
      });
      this.addToContainer(k.node, g);
      return k;
    },
    image: function image(a, b, c, e, h, f) {
      var g = new d.AmDObject('image', this);
      g.attr({ x: b, y: c, width: e, height: h });
      this.R.path(g, a);
      this.addToContainer(g.node, f);
      return g;
    },
    addToContainer: function addToContainer(a, b) {
      b || (b = this.container);
      b.appendChild(a);
    },
    text: function text(a, b, c) {
      return this.R.text(a, b, c);
    },
    path: function path(a, b, c, e) {
      var h = new d.AmDObject('path', this);
      e || (e = '100,100');
      h.attr({ cs: e });
      c ? h.attr({ dd: a }) : h.attr({ d: a });
      this.addToContainer(h.node, b);
      return h;
    },
    set: function set(a) {
      return this.R.set(a);
    },
    remove: function remove(a) {
      if (a) {
        var b = this.rBin;
        b.appendChild(a);
        b.innerHTML = '';
      }
    },
    renderFix: function renderFix() {
      var a = this.container,
          b = a.style;
      b.top = '0px';
      b.left = '0px';
      try {
        var c = a.getBoundingClientRect(),
            d = c.left - Math.round(c.left),
            h = c.top - Math.round(c.top);
        d && (b.left = d + 'px');
        h && (b.top = h + 'px');
      } catch (f) {}
    },
    update: function update() {
      this.R.update();
    },
    addDefs: function addDefs(a) {
      if (d.hasSVG) {
        var b = this.createSvgElement('desc'),
            c = this.container;
        c.setAttribute('version', '1.1');
        c.style.position = 'absolute';
        this.setSize(this.width, this.height);
        if (a.accessibleTitle) {
          var e = this.createSvgElement('title');
          e.appendChild(document.createTextNode(a.accessibleTitle));
          c.appendChild(e);
        }
        d.rtl && (c.setAttribute('direction', 'rtl'), c.style.left = 'auto', c.style.right = '0px');
        a && (a.addCodeCredits && b.appendChild(document.createTextNode('JavaScript chart by amCharts ' + a.version)), c.appendChild(b), a.defs && (b = this.createSvgElement('defs'), c.appendChild(b), d.parseDefs(a.defs, b), this.defs = b));
      }
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.AmDObject = d.Class({
    construct: function construct(a, b) {
      this.D = b;
      this.R = b.R;
      this.node = this.R.create(this, a);
      this.y = this.x = 0;
      this.scale = 1;
    },
    attr: function attr(a) {
      this.R.attr(this, a);
      return this;
    },
    getAttr: function getAttr(a) {
      return this.node.getAttribute(a);
    },
    setAttr: function setAttr(a, b) {
      this.R.setAttr(this, a, b);
      return this;
    },
    clipRect: function clipRect(a, b, c, d) {
      this.R.clipRect(this, a, b, c, d);
    },
    translate: function translate(a, b, c, d) {
      d || (a = Math.round(a), b = Math.round(b));
      this.R.move(this, a, b, c);
      this.x = a;
      this.y = b;
      this.scale = c;
      this.angle && this.rotate(this.angle);
    },
    rotate: function rotate(a, b) {
      this.R.rotate(this, a, b);
      this.angle = a;
    },
    animate: function animate(a, b, c) {
      for (var e in a) {
        if (a.hasOwnProperty(e)) {
          var h = e,
              f = a[e];
          c = d.getEffect(c);
          this.R.animate(this, h, f, b, c);
        }
      }
    },
    push: function push(a) {
      if (a) {
        var b = this.node;
        b.appendChild(a.node);
        var c = a.clipPath;
        c && b.appendChild(c);(a = a.grad) && b.appendChild(a);
      }
    },
    text: function text(a) {
      this.R.setText(this, a);
    },
    remove: function remove() {
      this.stop();
      this.R.remove(this);
    },
    clear: function clear() {
      var a = this.node;
      if (a.hasChildNodes()) for (; 1 <= a.childNodes.length;) {
        a.removeChild(a.firstChild);
      }
    },
    hide: function hide() {
      this.setAttr('visibility', 'hidden');
    },
    show: function show() {
      this.setAttr('visibility', 'visible');
    },
    getBBox: function getBBox() {
      return this.R.getBBox(this);
    },
    toFront: function toFront() {
      var a = this.node;
      if (a) {
        this.prevNextNode = a.nextSibling;
        var b = a.parentNode;
        b && b.appendChild(a);
      }
    },
    toPrevious: function toPrevious() {
      var a = this.node;
      a && this.prevNextNode && (a = a.parentNode) && a.insertBefore(this.prevNextNode, null);
    },
    toBack: function toBack() {
      var a = this.node;
      if (a) {
        this.prevNextNode = a.nextSibling;
        var b = a.parentNode;
        if (b) {
          var c = b.firstChild;
          c && b.insertBefore(a, c);
        }
      }
    },
    mouseover: function mouseover(a) {
      this.R.addListener(this, 'mouseover', a);
      return this;
    },
    mouseout: function mouseout(a) {
      this.R.addListener(this, 'mouseout', a);
      return this;
    },
    click: function click(a) {
      this.R.addListener(this, 'click', a);
      return this;
    },
    dblclick: function dblclick(a) {
      this.R.addListener(this, 'dblclick', a);
      return this;
    },
    mousedown: function mousedown(a) {
      this.R.addListener(this, 'mousedown', a);
      return this;
    },
    mouseup: function mouseup(a) {
      this.R.addListener(this, 'mouseup', a);
      return this;
    },
    touchmove: function touchmove(a) {
      this.R.addListener(this, 'touchmove', a);
      return this;
    },
    touchstart: function touchstart(a) {
      this.R.addListener(this, 'touchstart', a);
      return this;
    },
    touchend: function touchend(a) {
      this.R.addListener(this, 'touchend', a);
      return this;
    },
    contextmenu: function contextmenu(a) {
      this.node.addEventListener ? this.node.addEventListener('contextmenu', a, !0) : this.R.addListener(this, 'contextmenu', a);
      return this;
    },
    stop: function stop() {
      d.removeFromArray(this.R.animations, this.an_translate);
      d.removeFromArray(this.R.animations, this.an_y);
      d.removeFromArray(this.R.animations, this.an_x);
    },
    length: function length() {
      return this.node.childNodes.length;
    },
    gradient: function gradient(a, b, c) {
      this.R.gradient(this, a, b, c);
    },
    pattern: function pattern(a, b, c) {
      a && this.R.pattern(this, a, b, c);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.VMLRenderer = d.Class({
    construct: function construct(a, b) {
      this.chart = b;
      this.D = a;
      this.cNames = {
        circle: 'oval',
        ellipse: 'oval',
        rect: 'roundrect',
        path: 'shape'
      };
      this.styleMap = {
        x: 'left',
        y: 'top',
        width: 'width',
        height: 'height',
        'font-family': 'fontFamily',
        'font-size': 'fontSize',
        visibility: 'visibility'
      };
    },
    create: function create(a, b) {
      var c;
      if ('group' == b) c = document.createElement('div'), a.type = 'div';else if ('text' == b) c = document.createElement('div'), a.type = 'text';else if ('image' == b) c = document.createElement('img'), a.type = 'image';else {
        a.type = 'shape';
        a.shapeType = this.cNames[b];
        c = document.createElement('amvml:' + this.cNames[b]);
        var d = document.createElement('amvml:stroke');
        c.appendChild(d);
        a.stroke = d;
        var h = document.createElement('amvml:fill');
        c.appendChild(h);
        a.fill = h;
        h.className = 'amvml';
        d.className = 'amvml';
        c.className = 'amvml';
      }
      c.style.position = 'absolute';
      c.style.top = 0;
      c.style.left = 0;
      return c;
    },
    path: function path(a, b) {
      a.node.setAttribute('src', b);
    },
    setAttr: function setAttr(a, b, c) {
      if (void 0 !== c) {
        var e;
        8 === document.documentMode && (e = !0);
        var h = a.node,
            f = a.type,
            g = h.style;
        'r' == b && (g.width = 2 * c, g.height = 2 * c);
        'oval' == a.shapeType && ('rx' == b && (g.width = 2 * c), 'ry' == b && (g.height = 2 * c));
        'roundrect' == a.shapeType && ('width' != b && 'height' != b || --c);
        'cursor' == b && (g.cursor = c);
        'cx' == b && (g.left = c - d.removePx(g.width) / 2);
        'cy' == b && (g.top = c - d.removePx(g.height) / 2);
        var k = this.styleMap[b];
        'width' == k && 0 > c && (c = 0);
        void 0 !== k && (g[k] = c);
        'text' == f && ('text-anchor' == b && (a.anchor = c, k = h.clientWidth, 'end' == c && (g.marginLeft = -k + 'px'), 'middle' == c && (g.marginLeft = -(k / 2) + 'px', g.textAlign = 'center'), 'start' == c && (g.marginLeft = '0px')), 'fill' == b && (g.color = c), 'font-weight' == b && (g.fontWeight = c));
        if (g = a.children) for (k = 0; k < g.length; k++) {
          g[k].setAttr(b, c);
        }if ('shape' == f) {
          'cs' == b && (h.style.width = '100px', h.style.height = '100px', h.setAttribute('coordsize', c));
          'd' == b && h.setAttribute('path', this.svgPathToVml(c));
          'dd' == b && h.setAttribute('path', c);
          f = a.stroke;
          a = a.fill;
          'stroke' == b && (e ? f.color = c : f.setAttribute('color', c));
          'stroke-width' == b && (e ? f.weight = c : f.setAttribute('weight', c));
          'stroke-opacity' == b && (e ? f.opacity = c : f.setAttribute('opacity', c));
          'stroke-dasharray' == b && (g = 'solid', 0 < c && 3 > c && (g = 'dot'), 3 <= c && 6 >= c && (g = 'dash'), 6 < c && (g = 'longdash'), e ? f.dashstyle = g : f.setAttribute('dashstyle', g));
          if ('fill-opacity' == b || 'opacity' == b) 0 === c ? e ? a.on = !1 : a.setAttribute('on', !1) : e ? a.opacity = c : a.setAttribute('opacity', c);
          'fill' == b && (e ? a.color = c : a.setAttribute('color', c));
          'rx' == b && (e ? h.arcSize = c + '%' : h.setAttribute('arcsize', c + '%'));
        }
      }
    },
    attr: function attr(a, b) {
      for (var c in b) {
        b.hasOwnProperty(c) && this.setAttr(a, c, b[c]);
      }
    },
    text: function text(a, b, c) {
      var e = new d.AmDObject('text', this.D),
          h = e.node;
      h.style.whiteSpace = 'pre';
      h.innerHTML = a;
      this.D.addToContainer(h, c);
      this.attr(e, b);
      return e;
    },
    getBBox: function getBBox(a) {
      return this.getBox(a.node);
    },
    getBox: function getBox(a) {
      var b = a.offsetLeft,
          c = a.offsetTop,
          d = a.offsetWidth,
          h = a.offsetHeight,
          f;
      if (a.hasChildNodes()) {
        var g, k, l;
        for (l = 0; l < a.childNodes.length; l++) {
          f = this.getBox(a.childNodes[l]);
          var m = f.x;
          isNaN(m) || (isNaN(g) ? g = m : m < g && (g = m));
          var n = f.y;
          isNaN(n) || (isNaN(k) ? k = n : n < k && (k = n));
          m = f.width + m;
          isNaN(m) || (d = Math.max(d, m));
          f = f.height + n;
          isNaN(f) || (h = Math.max(h, f));
        }
        0 > g && (b += g);
        0 > k && (c += k);
      }
      return { x: b, y: c, width: d, height: h };
    },
    setText: function setText(a, b) {
      var c = a.node;
      c && (c.innerHTML = b);
      this.setAttr(a, 'text-anchor', a.anchor);
    },
    addListener: function addListener(a, b, c) {
      a.node['on' + b] = c;
    },
    move: function move(a, b, c) {
      var e = a.node,
          h = e.style;
      'text' == a.type && (c -= d.removePx(h.fontSize) / 2 - 1);
      'oval' == a.shapeType && (b -= d.removePx(h.width) / 2, c -= d.removePx(h.height) / 2);
      a = a.bw;
      isNaN(a) || (b -= a, c -= a);
      isNaN(b) || isNaN(c) || (e.style.left = b + 'px', e.style.top = c + 'px');
    },
    svgPathToVml: function svgPathToVml(a) {
      var b = a.split(' ');
      a = '';
      var c,
          d = Math.round,
          h;
      for (h = 0; h < b.length; h++) {
        var f = b[h],
            g = f.substring(0, 1),
            f = f.substring(1),
            k = f.split(','),
            l = d(k[0]) + ',' + d(k[1]);
        'M' == g && (a += ' m ' + l);
        'L' == g && (a += ' l ' + l);
        'Z' == g && (a += ' x e');
        if ('Q' == g) {
          var m = c.length,
              n = c[m - 1],
              q = k[0],
              p = k[1],
              l = k[2],
              t = k[3];
          c = d(c[m - 2] / 3 + 2 / 3 * q);
          n = d(n / 3 + 2 / 3 * p);
          q = d(2 / 3 * q + l / 3);
          p = d(2 / 3 * p + t / 3);
          a += ' c ' + c + ',' + n + ',' + q + ',' + p + ',' + l + ',' + t;
        }
        'A' == g && (a += ' wa ' + f);
        'B' == g && (a += ' at ' + f);
        c = k;
      }
      return a;
    },
    animate: function animate(a, b, c, d, h) {
      var f = a.node,
          g = this.chart;
      a.animationFinished = !1;
      if ('translate' == b) {
        b = c.split(',');
        c = b[1];
        var k = f.offsetTop;
        g.animate(a, 'left', f.offsetLeft, b[0], d, h, 'px');
        g.animate(a, 'top', k, c, d, h, 'px');
      }
    },
    clipRect: function clipRect(a, b, c, d, h) {
      a = a.node;
      0 === b && 0 === c ? (a.style.width = d + 'px', a.style.height = h + 'px', a.style.overflow = 'hidden') : a.style.clip = 'rect(' + c + 'px ' + (b + d) + 'px ' + (c + h) + 'px ' + b + 'px)';
    },
    rotate: function rotate(a, b, c) {
      if (0 !== Number(b)) {
        var e = a.node;
        a = e.style;
        c || (c = this.getBGColor(e.parentNode));
        a.backgroundColor = c;
        a.paddingLeft = 1;
        c = b * Math.PI / 180;
        var h = Math.cos(c),
            f = Math.sin(c),
            g = d.removePx(a.left),
            k = d.removePx(a.top),
            l = e.offsetWidth,
            e = e.offsetHeight;
        b /= Math.abs(b);
        a.left = g + l / 2 - l / 2 * Math.cos(c) - b * e / 2 * Math.sin(c) + 3;
        a.top = k - b * l / 2 * Math.sin(c) + b * e / 2 * Math.sin(c);
        a.cssText = a.cssText + "; filter:progid:DXImageTransform.Microsoft.Matrix(M11='" + h + "', M12='" + -f + "', M21='" + f + "', M22='" + h + "', sizingmethod='auto expand');";
      }
    },
    getBGColor: function getBGColor(a) {
      var b = '#FFFFFF';
      if (a.style) {
        var c = a.style.backgroundColor;
        '' !== c ? b = c : a.parentNode && (b = this.getBGColor(a.parentNode));
      }
      return b;
    },
    set: function set(a) {
      var b = new d.AmDObject('group', this.D);
      this.D.container.appendChild(b.node);
      if (a) {
        var c;
        for (c = 0; c < a.length; c++) {
          b.push(a[c]);
        }
      }
      return b;
    },
    gradient: function gradient(a, b, c, d) {
      var h = '';
      'radialGradient' == b && (b = 'gradientradial', c.reverse());
      'linearGradient' == b && (b = 'gradient');
      var f;
      for (f = 0; f < c.length; f++) {
        h += Math.round(100 * f / (c.length - 1)) + '% ' + c[f], f < c.length - 1 && (h += ',');
      }a = a.fill;
      90 == d ? d = 0 : 270 == d ? d = 180 : 180 == d ? d = 90 : 0 === d && (d = 270);
      8 === document.documentMode ? (a.type = b, a.angle = d) : (a.setAttribute('type', b), a.setAttribute('angle', d));
      h && (a.colors.value = h);
    },
    remove: function remove(a) {
      a.clipPath && this.D.remove(a.clipPath);
      this.D.remove(a.node);
    },
    disableSelection: function disableSelection(a) {
      a.onselectstart = function () {
        return !1;
      };
      a.style.cursor = 'default';
    },
    pattern: function pattern(a, b, c, e) {
      c = a.node;
      a = a.fill;
      var h = 'none';
      b.color && (h = b.color);
      c.fillColor = h;
      b = b.url;
      d.isAbsolute(b) || (b = e + b);
      8 === document.documentMode ? (a.type = 'tile', a.src = b) : (a.setAttribute('type', 'tile'), a.setAttribute('src', b));
    },
    update: function update() {}
  });
})();(function () {
  var d = window.AmCharts;
  d.SVGRenderer = d.Class({
    construct: function construct(a) {
      this.D = a;
      this.animations = [];
    },
    create: function create(a, b) {
      return document.createElementNS(d.SVG_NS, b);
    },
    attr: function attr(a, b) {
      for (var c in b) {
        b.hasOwnProperty(c) && this.setAttr(a, c, b[c]);
      }
    },
    setAttr: function setAttr(a, b, c) {
      void 0 !== c && a.node.setAttribute(b, c);
    },
    animate: function animate(a, b, c, e, h) {
      a.animationFinished = !1;
      var f = a.node;
      a['an_' + b] && d.removeFromArray(this.animations, a['an_' + b]);
      'translate' == b ? (f = (f = f.getAttribute('transform')) ? String(f).substring(10, f.length - 1) : '0,0', f = f.split(', ').join(' '), f = f.split(' ').join(','), 0 === f && (f = '0,0')) : f = Number(f.getAttribute(b));
      c = { obj: a, frame: 0, attribute: b, from: f, to: c, time: e, effect: h };
      this.animations.push(c);
      a['an_' + b] = c;
    },
    update: function update() {
      var a,
          b = this.animations;
      for (a = b.length - 1; 0 <= a; a--) {
        var c = b[a],
            e = c.time * d.updateRate,
            h = c.frame + 1,
            f = c.obj,
            g = c.attribute,
            k,
            l,
            m;
        h <= e ? (c.frame++, 'translate' == g ? (k = c.from.split(','), g = Number(k[0]), k = Number(k[1]), isNaN(k) && (k = 0), l = c.to.split(','), m = Number(l[0]), l = Number(l[1]), m = 0 === m - g ? m : Math.round(d[c.effect](0, h, g, m - g, e)), c = 0 === l - k ? l : Math.round(d[c.effect](0, h, k, l - k, e)), g = 'transform', c = 'translate(' + m + ',' + c + ')') : (l = Number(c.from), k = Number(c.to), m = k - l, c = d[c.effect](0, h, l, m, e), isNaN(c) && (c = k), 0 === m && this.animations.splice(a, 1)), this.setAttr(f, g, c)) : ('translate' == g ? (l = c.to.split(','), m = Number(l[0]), l = Number(l[1]), f.translate(m, l)) : (k = Number(c.to), this.setAttr(f, g, k)), f.animationFinished = !0, this.animations.splice(a, 1));
      }
    },
    getBBox: function getBBox(a) {
      if (a = a.node) try {
        return a.getBBox();
      } catch (b) {}
      return { width: 0, height: 0, x: 0, y: 0 };
    },
    path: function path(a, b) {
      a.node.setAttributeNS(d.SVG_XLINK, 'xlink:href', b);
    },
    clipRect: function clipRect(a, b, c, e, h) {
      var f = a.node,
          g = a.clipPath;
      g && this.D.remove(g);
      var k = f.parentNode;
      k && (f = document.createElementNS(d.SVG_NS, 'clipPath'), g = d.getUniqueId(), f.setAttribute('id', g), this.D.rect(b, c, e, h, 0, 0, f), k.appendChild(f), b = '#', d.baseHref && !d.isIE && (b = this.removeTarget(window.location.href) + b), this.setAttr(a, 'clip-path', 'url(' + b + g + ')'), this.clipPathC++, a.clipPath = f);
    },
    text: function text(a, b, c) {
      var e = new d.AmDObject('text', this.D);
      a = String(a).split('\n');
      var h = d.removePx(b['font-size']),
          f;
      for (f = 0; f < a.length; f++) {
        var g = this.create(null, 'tspan');
        g.appendChild(document.createTextNode(a[f]));
        g.setAttribute('y', (h + 2) * f + Math.round(h / 2));
        g.setAttribute('x', 0);
        e.node.appendChild(g);
      }
      e.node.setAttribute('y', Math.round(h / 2));
      this.attr(e, b);
      this.D.addToContainer(e.node, c);
      return e;
    },
    setText: function setText(a, b) {
      var c = a.node;
      c && (c.removeChild(c.firstChild), c.appendChild(document.createTextNode(b)));
    },
    move: function move(a, b, c, d) {
      isNaN(b) && (b = 0);
      isNaN(c) && (c = 0);
      b = 'translate(' + b + ',' + c + ')';
      d && (b = b + ' scale(' + d + ')');
      this.setAttr(a, 'transform', b);
    },
    rotate: function rotate(a, b) {
      var c = a.node.getAttribute('transform'),
          d = 'rotate(' + b + ')';
      c && (d = c + ' ' + d);
      this.setAttr(a, 'transform', d);
    },
    set: function set(a) {
      var b = new d.AmDObject('g', this.D);
      this.D.container.appendChild(b.node);
      if (a) {
        var c;
        for (c = 0; c < a.length; c++) {
          b.push(a[c]);
        }
      }
      return b;
    },
    addListener: function addListener(a, b, c) {
      a.node['on' + b] = c;
    },
    gradient: function gradient(a, b, c, e) {
      var h = a.node,
          f = a.grad;
      f && this.D.remove(f);
      b = document.createElementNS(d.SVG_NS, b);
      f = d.getUniqueId();
      b.setAttribute('id', f);
      if (!isNaN(e)) {
        var g = 0,
            k = 0,
            l = 0,
            m = 0;
        90 == e ? l = 100 : 270 == e ? m = 100 : 180 == e ? g = 100 : 0 === e && (k = 100);
        b.setAttribute('x1', g + '%');
        b.setAttribute('x2', k + '%');
        b.setAttribute('y1', l + '%');
        b.setAttribute('y2', m + '%');
      }
      for (e = 0; e < c.length; e++) {
        g = document.createElementNS(d.SVG_NS, 'stop'), k = 100 * e / (c.length - 1), 0 === e && (k = 0), g.setAttribute('offset', k + '%'), g.setAttribute('stop-color', c[e]), b.appendChild(g);
      }h.parentNode.appendChild(b);
      c = '#';
      d.baseHref && !d.isIE && (c = this.removeTarget(window.location.href) + c);
      h.setAttribute('fill', 'url(' + c + f + ')');
      a.grad = b;
    },
    removeTarget: function removeTarget(a) {
      return a.split('#')[0];
    },
    pattern: function pattern(a, b, c, e) {
      var h = a.node;
      isNaN(c) && (c = 1);
      var f = a.patternNode;
      f && this.D.remove(f);
      var f = document.createElementNS(d.SVG_NS, 'pattern'),
          g = d.getUniqueId(),
          k = b;
      b.url && (k = b.url);
      d.isAbsolute(k) || -1 != k.indexOf('data:image') || (k = e + k);
      e = Number(b.width);
      isNaN(e) && (e = 4);
      var l = Number(b.height);
      isNaN(l) && (l = 4);
      e /= c;
      l /= c;
      c = b.x;
      isNaN(c) && (c = 0);
      var m = -Math.random() * Number(b.randomX);
      isNaN(m) || (c = m);
      m = b.y;
      isNaN(m) && (m = 0);
      var n = -Math.random() * Number(b.randomY);
      isNaN(n) || (m = n);
      f.setAttribute('id', g);
      f.setAttribute('width', e);
      f.setAttribute('height', l);
      f.setAttribute('patternUnits', 'userSpaceOnUse');
      f.setAttribute('xlink:href', k);
      b.color && (n = document.createElementNS(d.SVG_NS, 'rect'), n.setAttributeNS(null, 'height', e), n.setAttributeNS(null, 'width', l), n.setAttributeNS(null, 'fill', b.color), f.appendChild(n));
      this.D.image(k, 0, 0, e, l, f).translate(c, m);
      k = '#';
      d.baseHref && !d.isIE && (k = this.removeTarget(window.location.href) + k);
      h.setAttribute('fill', 'url(' + k + g + ')');
      a.patternNode = f;
      h.parentNode.appendChild(f);
    },
    remove: function remove(a) {
      a.clipPath && this.D.remove(a.clipPath);
      a.grad && this.D.remove(a.grad);
      a.patternNode && this.D.remove(a.patternNode);
      this.D.remove(a.node);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.AmLegend = d.Class({
    construct: function construct(a) {
      this.enabled = !0;
      this.cname = 'AmLegend';
      this.createEvents('rollOverMarker', 'rollOverItem', 'rollOutMarker', 'rollOutItem', 'showItem', 'hideItem', 'clickMarker', 'rollOverItem', 'rollOutItem', 'clickLabel');
      this.position = 'bottom';
      this.borderColor = this.color = '#000000';
      this.borderAlpha = 0;
      this.markerLabelGap = 5;
      this.verticalGap = 10;
      this.align = 'left';
      this.horizontalGap = 0;
      this.spacing = 10;
      this.markerDisabledColor = '#AAB3B3';
      this.markerType = 'square';
      this.markerSize = 16;
      this.markerBorderThickness = this.markerBorderAlpha = 1;
      this.marginBottom = this.marginTop = 0;
      this.marginLeft = this.marginRight = 20;
      this.autoMargins = !0;
      this.valueWidth = 50;
      this.switchable = !0;
      this.switchType = 'x';
      this.switchColor = '#FFFFFF';
      this.rollOverColor = '#CC0000';
      this.reversedOrder = !1;
      this.labelText = '[[title]]';
      this.valueText = '[[value]]';
      this.useMarkerColorForLabels = !1;
      this.rollOverGraphAlpha = 1;
      this.textClickEnabled = !1;
      this.equalWidths = !0;
      this.backgroundColor = '#FFFFFF';
      this.backgroundAlpha = 0;
      this.useGraphSettings = !1;
      this.showEntries = !0;
      d.applyTheme(this, a, this.cname);
    },
    setData: function setData(a) {
      this.legendData = a;
      this.invalidateSize();
    },
    invalidateSize: function invalidateSize() {
      this.destroy();
      this.entries = [];
      this.valueLabels = [];
      var a = this.legendData;
      this.enabled && (d.ifArray(a) || d.ifArray(this.data)) && this.drawLegend();
    },
    drawLegend: function drawLegend() {
      var a = this.chart,
          b = this.position,
          c = this.width,
          e = a.divRealWidth,
          h = a.divRealHeight,
          f = this.div,
          g = this.legendData;
      this.data && (g = this.data);
      isNaN(this.fontSize) && (this.fontSize = a.fontSize);
      this.maxColumnsReal = this.maxColumns;
      if ('right' == b || 'left' == b) this.maxColumnsReal = 1, this.autoMargins && (this.marginLeft = this.marginRight = 10);else if (this.autoMargins) {
        this.marginRight = a.marginRight;
        this.marginLeft = a.marginLeft;
        var k = a.autoMarginOffset;
        'bottom' == b ? (this.marginBottom = k, this.marginTop = 0) : (this.marginTop = k, this.marginBottom = 0);
      }
      c = void 0 !== c ? d.toCoordinate(c, e) : 'right' != b && 'left' != b ? a.realWidth : 0 < this.ieW ? this.ieW : a.realWidth;
      'outside' == b ? (c = f.offsetWidth, h = f.offsetHeight, f.clientHeight && (c = f.clientWidth, h = f.clientHeight)) : (isNaN(c) || (f.style.width = c + 'px'), f.className = 'amChartsLegend ' + a.classNamePrefix + '-legend-div');
      this.divWidth = c;(b = this.container) ? (b.container.innerHTML = '', f.appendChild(b.container), b.width = c, b.height = h, b.setSize(c, h), b.addDefs(a)) : b = new d.AmDraw(f, c, h, a);
      this.container = b;
      this.lx = 0;
      this.ly = 8;
      h = this.markerSize;
      h > this.fontSize && (this.ly = h / 2 - 1);
      0 < h && (this.lx += h + this.markerLabelGap);
      this.titleWidth = 0;
      if (h = this.title) h = d.text(this.container, h, this.color, a.fontFamily, this.fontSize, 'start', !0), d.setCN(a, h, 'legend-title'), h.translate(this.marginLeft, this.marginTop + this.verticalGap + this.ly + 1), a = h.getBBox(), this.titleWidth = a.width + 15, this.titleHeight = a.height + 6;
      this.index = this.maxLabelWidth = 0;
      if (this.showEntries) {
        for (a = 0; a < g.length; a++) {
          this.createEntry(g[a]);
        }for (a = this.index = 0; a < g.length; a++) {
          this.createValue(g[a]);
        }
      }
      this.arrangeEntries();
      this.updateValues();
    },
    arrangeEntries: function arrangeEntries() {
      var a = this.position,
          b = this.marginLeft + this.titleWidth,
          c = this.marginRight,
          e = this.marginTop,
          h = this.marginBottom,
          f = this.horizontalGap,
          g = this.div,
          k = this.divWidth,
          l = this.maxColumnsReal,
          m = this.verticalGap,
          n = this.spacing,
          q = k - c - b,
          p = 0,
          t = 0,
          r = this.container;
      this.set && this.set.remove();
      var u = r.set();
      this.set = u;
      var x = r.set();
      u.push(x);
      var y = this.entries,
          w,
          z;
      for (z = 0; z < y.length; z++) {
        w = y[z].getBBox();
        var A = w.width;
        A > p && (p = A);
        w = w.height;
        w > t && (t = w);
      }
      var A = t = 0,
          B = f,
          C = 0,
          D = 0;
      for (z = 0; z < y.length; z++) {
        var L = y[z];
        this.reversedOrder && (L = y[y.length - z - 1]);
        w = L.getBBox();
        var I;
        this.equalWidths ? I = A * (p + n + this.markerLabelGap) : (I = B, B = B + w.width + f + n);
        w.height > D && (D = w.height);
        I + w.width > q && 0 < z && 0 !== A && (t++, I = A = 0, B = I + w.width + f + n, C = C + D + m, D = 0);
        L.translate(I, C);
        A++;
        !isNaN(l) && A >= l && (A = 0, t++, C = C + D + m, B = f, D = 0);
        x.push(L);
      }
      w = x.getBBox();
      l = w.height + 2 * m - 1;
      'left' == a || 'right' == a ? (n = w.width + 2 * f, k = n + b + c, g.style.width = k + 'px', this.ieW = k) : n = k - b - c - 1;
      c = d.polygon(this.container, [0, n, n, 0], [0, 0, l, l], this.backgroundColor, this.backgroundAlpha, 1, this.borderColor, this.borderAlpha);
      d.setCN(this.chart, c, 'legend-bg');
      u.push(c);
      u.translate(b, e);
      c.toBack();
      b = f;
      if ('top' == a || 'bottom' == a || 'absolute' == a || 'outside' == a) 'center' == this.align ? b = f + (n - w.width) / 2 : 'right' == this.align && (b = f + n - w.width);
      x.translate(b, m + 1);
      this.titleHeight > l && (l = this.titleHeight);
      a = l + e + h + 1;
      0 > a && (a = 0);
      a > this.chart.divRealHeight && (g.style.top = '0px');
      g.style.height = Math.round(a) + 'px';
      r.setSize(this.divWidth, a);
    },
    createEntry: function createEntry(a) {
      if (!1 !== a.visibleInLegend && !a.hideFromLegend) {
        var b = this.chart,
            c = a.markerType;
        a.legendEntryWidth = this.markerSize;
        c || (c = this.markerType);
        var e = a.color,
            h = a.alpha;
        a.legendKeyColor && (e = a.legendKeyColor());
        a.legendKeyAlpha && (h = a.legendKeyAlpha());
        var f;
        !0 === a.hidden && (f = e = this.markerDisabledColor);
        var g = a.pattern,
            k = a.customMarker;
        k || (k = this.customMarker);
        var l = this.container,
            m = this.markerSize,
            n = 0,
            q = 0,
            p = m / 2;
        if (this.useGraphSettings) {
          c = a.type;
          this.switchType = void 0;
          if ('line' == c || 'step' == c || 'smoothedLine' == c || 'ohlc' == c) g = l.set(), a.hidden || (e = a.lineColorR, f = a.bulletBorderColorR), n = d.line(l, [0, 2 * m], [m / 2, m / 2], e, a.lineAlpha, a.lineThickness, a.dashLength), d.setCN(b, n, 'graph-stroke'), g.push(n), a.bullet && (a.hidden || (e = a.bulletColorR), n = d.bullet(l, a.bullet, a.bulletSize, e, a.bulletAlpha, a.bulletBorderThickness, f, a.bulletBorderAlpha)) && (d.setCN(b, n, 'graph-bullet'), n.translate(m + 1, m / 2), g.push(n)), p = 0, n = m, q = m / 3;else {
            var t;
            a.getGradRotation && (t = a.getGradRotation(), 0 === t && (t = 180));
            n = a.fillColorsR;
            !0 === a.hidden && (n = e);
            if (g = this.createMarker('rectangle', n, a.fillAlphas, a.lineThickness, e, a.lineAlpha, t, g, a.dashLength)) p = m, g.translate(p, m / 2);
            n = m;
          }
          d.setCN(b, g, 'graph-' + c);
          d.setCN(b, g, 'graph-' + a.id);
        } else if (k) g = l.image(k, 0, 0, m, m);else {
          var r;
          isNaN(this.gradientRotation) || (r = 180 + this.gradientRotation);(g = this.createMarker(c, e, h, void 0, void 0, void 0, r, g)) && g.translate(m / 2, m / 2);
        }
        d.setCN(b, g, 'legend-marker');
        this.addListeners(g, a);
        l = l.set([g]);
        this.switchable && a.switchable && l.setAttr('cursor', 'pointer');
        void 0 !== a.id && d.setCN(b, l, 'legend-item-' + a.id);
        d.setCN(b, l, a.className, !0);
        f = this.switchType;
        var u;
        f && 'none' != f && 0 < m && ('x' == f ? (u = this.createX(), u.translate(m / 2, m / 2)) : u = this.createV(), u.dItem = a, !0 !== a.hidden ? 'x' == f ? u.hide() : u.show() : 'x' != f && u.hide(), this.switchable || u.hide(), this.addListeners(u, a), a.legendSwitch = u, l.push(u), d.setCN(b, u, 'legend-switch'));
        f = this.color;
        a.showBalloon && this.textClickEnabled && void 0 !== this.selectedColor && (f = this.selectedColor);
        this.useMarkerColorForLabels && (f = e);
        !0 === a.hidden && (f = this.markerDisabledColor);
        e = d.massReplace(this.labelText, { '[[title]]': a.title });
        t = this.fontSize;
        g && (m <= t && (m = m / 2 + this.ly - t / 2 + (t + 2 - m) / 2 - q, g.translate(p, m), u && u.translate(u.x, m)), a.legendEntryWidth = g.getBBox().width);
        var x;
        e && (e = d.fixBrakes(e), a.legendTextReal = e, x = this.labelWidth, x = isNaN(x) ? d.text(this.container, e, f, b.fontFamily, t, 'start') : d.wrappedText(this.container, e, f, b.fontFamily, t, 'start', !1, x, 0), d.setCN(b, x, 'legend-label'), x.translate(this.lx + n, this.ly), l.push(x), b = x.getBBox().width, this.maxLabelWidth < b && (this.maxLabelWidth = b));
        this.entries[this.index] = l;
        a.legendEntry = this.entries[this.index];
        a.legendLabel = x;
        this.index++;
      }
    },
    addListeners: function addListeners(a, b) {
      var c = this;
      a && a.mouseover(function (a) {
        c.rollOverMarker(b, a);
      }).mouseout(function (a) {
        c.rollOutMarker(b, a);
      }).click(function (a) {
        c.clickMarker(b, a);
      });
    },
    rollOverMarker: function rollOverMarker(a, b) {
      this.switchable && this.dispatch('rollOverMarker', a, b);
      this.dispatch('rollOverItem', a, b);
    },
    rollOutMarker: function rollOutMarker(a, b) {
      this.switchable && this.dispatch('rollOutMarker', a, b);
      this.dispatch('rollOutItem', a, b);
    },
    clickMarker: function clickMarker(a, b) {
      this.switchable && (!0 === a.hidden ? this.dispatch('showItem', a, b) : this.dispatch('hideItem', a, b));
      this.dispatch('clickMarker', a, b);
    },
    rollOverLabel: function rollOverLabel(a, b) {
      a.hidden || (this.textClickEnabled && a.legendLabel && a.legendLabel.attr({ fill: this.rollOverColor }), this.dispatch('rollOverItem', a, b));
    },
    rollOutLabel: function rollOutLabel(a, b) {
      if (!a.hidden) {
        if (this.textClickEnabled && a.legendLabel) {
          var c = this.color;
          void 0 !== this.selectedColor && a.showBalloon && (c = this.selectedColor);
          this.useMarkerColorForLabels && (c = a.lineColor, void 0 === c && (c = a.color));
          a.legendLabel.attr({ fill: c });
        }
        this.dispatch('rollOutItem', a, b);
      }
    },
    clickLabel: function clickLabel(a, b) {
      this.textClickEnabled ? a.hidden || this.dispatch('clickLabel', a, b) : this.switchable && (!0 === a.hidden ? this.dispatch('showItem', a, b) : this.dispatch('hideItem', a, b));
    },
    dispatch: function dispatch(a, b, c) {
      a = { type: a, dataItem: b, target: this, event: c, chart: this.chart };
      this.chart && this.chart.handleLegendEvent(a);
      this.fire(a);
    },
    createValue: function createValue(a) {
      var b = this,
          c = b.fontSize,
          e = b.chart;
      if (!1 !== a.visibleInLegend && !a.hideFromLegend) {
        var h = b.maxLabelWidth;
        b.forceWidth && (h = b.labelWidth);
        b.equalWidths || (b.valueAlign = 'left');
        'left' == b.valueAlign && (h = a.legendEntry.getBBox().width);
        var f = h;
        if (b.valueText && 0 < b.valueWidth) {
          var g = b.color;
          b.useMarkerColorForValues && (g = a.color, a.legendKeyColor && (g = a.legendKeyColor()));
          !0 === a.hidden && (g = b.markerDisabledColor);
          var k = b.valueText,
              h = h + b.lx + b.markerLabelGap + b.valueWidth,
              l = 'end';
          'left' == b.valueAlign && (h -= b.valueWidth, l = 'start');
          g = d.text(b.container, k, g, b.chart.fontFamily, c, l);
          d.setCN(e, g, 'legend-value');
          g.translate(h, b.ly);
          b.entries[b.index].push(g);
          f += b.valueWidth + 2 * b.markerLabelGap;
          g.dItem = a;
          b.valueLabels.push(g);
        }
        b.index++;
        e = b.markerSize;
        e < c + 7 && (e = c + 7, d.VML && (e += 3));
        c = b.container.rect(a.legendEntryWidth, 0, f, e, 0, 0).attr({ stroke: 'none', fill: '#fff', 'fill-opacity': 0.005 });
        c.dItem = a;
        b.entries[b.index - 1].push(c);
        c.mouseover(function (c) {
          b.rollOverLabel(a, c);
        }).mouseout(function (c) {
          b.rollOutLabel(a, c);
        }).click(function (c) {
          b.clickLabel(a, c);
        });
      }
    },
    createV: function createV() {
      var a = this.markerSize;
      return d.polygon(this.container, [a / 5, a / 2, a - a / 5, a / 2], [a / 3, a - a / 5, a / 5, a / 1.7], this.switchColor);
    },
    createX: function createX() {
      var a = (this.markerSize - 4) / 2,
          b = { stroke: this.switchColor, 'stroke-width': 3 },
          c = this.container,
          e = d.line(c, [-a, a], [-a, a]).attr(b),
          a = d.line(c, [-a, a], [a, -a]).attr(b);
      return this.container.set([e, a]);
    },
    createMarker: function createMarker(a, b, c, e, h, f, g, k, l) {
      var m = this.markerSize,
          n = this.container;
      h || (h = this.markerBorderColor);
      h || (h = b);
      isNaN(e) && (e = this.markerBorderThickness);
      isNaN(f) && (f = this.markerBorderAlpha);
      return d.bullet(n, a, m, b, c, e, h, f, m, g, k, this.chart.path, l);
    },
    validateNow: function validateNow() {
      this.invalidateSize();
    },
    updateValues: function updateValues() {
      var a = this.valueLabels,
          b = this.chart,
          c,
          e = this.data;
      if (a) for (c = 0; c < a.length; c++) {
        var h = a[c],
            f = h.dItem,
            g = ' ';
        if (e) f.value ? h.text(f.value) : h.text('');else {
          var k;
          if (void 0 !== f.type) {
            k = f.currentDataItem;
            var l = this.periodValueText;
            f.legendPeriodValueText && (l = f.legendPeriodValueText);
            k ? (g = this.valueText, f.legendValueText && (g = f.legendValueText), g = b.formatString(g, k)) : l && b.formatPeriodString && (l = d.massReplace(l, { '[[title]]': f.title }), g = b.formatPeriodString(l, f));
          } else g = b.formatString(this.valueText, f);
          if (l = this.valueFunction) k && (f = k), g = l(f, g);
          h.text(g);
        }
      }
    },
    renderFix: function renderFix() {
      if (!d.VML && this.enabled) {
        var a = this.container;
        a && a.renderFix();
      }
    },
    destroy: function destroy() {
      this.div.innerHTML = '';
      d.remove(this.set);
    }
  });
})();(function () {
  var d = window.AmCharts;
  d.formatMilliseconds = function (a, b) {
    if (-1 != a.indexOf('fff')) {
      var c = b.getMilliseconds(),
          d = String(c);
      10 > c && (d = '00' + c);
      10 <= c && 100 > c && (d = '0' + c);
      a = a.replace(/fff/g, d);
    }
    return a;
  };
  d.extractPeriod = function (a) {
    var b = d.stripNumbers(a),
        c = 1;
    b != a && (c = Number(a.slice(0, a.indexOf(b))));
    return { period: b, count: c };
  };
  d.getDate = function (a, b, c) {
    return a instanceof Date ? d.newDate(a, c) : b && isNaN(a) ? d.stringToDate(a, b) : new Date(a);
  };
  d.daysInMonth = function (a) {
    return new Date(a.getYear(), a.getMonth() + 1, 0).getDate();
  };
  d.newDate = function (a, b) {
    return b && -1 == b.indexOf('fff') ? new Date(a) : new Date(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds());
  };
  d.resetDateToMin = function (a, b, c, e) {
    void 0 === e && (e = 1);
    var h, f, g, k, l, m, n;
    d.useUTC ? (h = a.getUTCFullYear(), f = a.getUTCMonth(), g = a.getUTCDate(), k = a.getUTCHours(), l = a.getUTCMinutes(), m = a.getUTCSeconds(), n = a.getUTCMilliseconds(), a = a.getUTCDay()) : (h = a.getFullYear(), f = a.getMonth(), g = a.getDate(), k = a.getHours(), l = a.getMinutes(), m = a.getSeconds(), n = a.getMilliseconds(), a = a.getDay());
    switch (b) {
      case 'YYYY':
        h = Math.floor(h / c) * c;
        f = 0;
        g = 1;
        n = m = l = k = 0;
        break;
      case 'MM':
        f = Math.floor(f / c) * c;
        g = 1;
        n = m = l = k = 0;
        break;
      case 'WW':
        g = a >= e ? g - a + e : g - (7 + a) + e;
        n = m = l = k = 0;
        break;
      case 'DD':
        n = m = l = k = 0;
        break;
      case 'hh':
        k = Math.floor(k / c) * c;
        n = m = l = 0;
        break;
      case 'mm':
        l = Math.floor(l / c) * c;
        n = m = 0;
        break;
      case 'ss':
        m = Math.floor(m / c) * c;
        n = 0;
        break;
      case 'fff':
        n = Math.floor(n / c) * c;
    }
    d.useUTC ? (a = new Date(), a.setUTCFullYear(h, f, g), a.setUTCHours(k, l, m, n)) : a = new Date(h, f, g, k, l, m, n);
    return a;
  };
  d.getPeriodDuration = function (a, b) {
    void 0 === b && (b = 1);
    var c;
    switch (a) {
      case 'YYYY':
        c = 316224e5;
        break;
      case 'MM':
        c = 26784e5;
        break;
      case 'WW':
        c = 6048e5;
        break;
      case 'DD':
        c = 864e5;
        break;
      case 'hh':
        c = 36e5;
        break;
      case 'mm':
        c = 6e4;
        break;
      case 'ss':
        c = 1e3;
        break;
      case 'fff':
        c = 1;
    }
    return c * b;
  };
  d.intervals = {
    s: { nextInterval: 'ss', contains: 1e3 },
    ss: { nextInterval: 'mm', contains: 60, count: 0 },
    mm: { nextInterval: 'hh', contains: 60, count: 1 },
    hh: { nextInterval: 'DD', contains: 24, count: 2 },
    DD: { nextInterval: '', contains: Infinity, count: 3 }
  };
  d.getMaxInterval = function (a, b) {
    var c = d.intervals;
    return a >= c[b].contains ? (a = Math.round(a / c[b].contains), b = c[b].nextInterval, d.getMaxInterval(a, b)) : 'ss' == b ? c[b].nextInterval : b;
  };
  d.dayNames = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' ');
  d.shortDayNames = 'Sun Mon Tue Wed Thu Fri Sat'.split(' ');
  d.monthNames = 'January February March April May June July August September October November December'.split(' ');
  d.shortMonthNames = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ');
  d.getWeekNumber = function (a) {
    a = new Date(a);
    a.setHours(0, 0, 0);
    a.setDate(a.getDate() + 4 - (a.getDay() || 7));
    var b = new Date(a.getFullYear(), 0, 1);
    return Math.ceil(((a - b) / 864e5 + 1) / 7);
  };
  d.stringToDate = function (a, b) {
    var c = {},
        e = [{ pattern: 'YYYY', period: 'year' }, { pattern: 'YY', period: 'year' }, { pattern: 'MM', period: 'month' }, { pattern: 'M', period: 'month' }, { pattern: 'DD', period: 'date' }, { pattern: 'D', period: 'date' }, { pattern: 'JJ', period: 'hours' }, { pattern: 'J', period: 'hours' }, { pattern: 'HH', period: 'hours' }, { pattern: 'H', period: 'hours' }, { pattern: 'KK', period: 'hours' }, { pattern: 'K', period: 'hours' }, { pattern: 'LL', period: 'hours' }, { pattern: 'L', period: 'hours' }, { pattern: 'NN', period: 'minutes' }, { pattern: 'N', period: 'minutes' }, { pattern: 'SS', period: 'seconds' }, { pattern: 'S', period: 'seconds' }, { pattern: 'QQQ', period: 'milliseconds' }, { pattern: 'QQ', period: 'milliseconds' }, { pattern: 'Q', period: 'milliseconds' }],
        h = !0,
        f = b.indexOf('AA');-1 != f && (a.substr(f, 2), 'pm' == a.toLowerCase && (h = !1));
    var f = b,
        g,
        k,
        l;
    for (l = 0; l < e.length; l++) {
      k = e[l].period, c[k] = 0, 'date' == k && (c[k] = 1);
    }for (l = 0; l < e.length; l++) {
      if (g = e[l].pattern, k = e[l].period, -1 != b.indexOf(g)) {
        var m = d.getFromDateString(g, a, f);
        b = b.replace(g, '');
        if ('KK' == g || 'K' == g || 'LL' == g || 'L' == g) h || (m += 12);
        c[k] = m;
      }
    }d.useUTC ? (e = new Date(), e.setUTCFullYear(c.year, c.month, c.date), e.setUTCHours(c.hours, c.minutes, c.seconds, c.milliseconds)) : e = new Date(c.year, c.month, c.date, c.hours, c.minutes, c.seconds, c.milliseconds);
    return e;
  };
  d.getFromDateString = function (a, b, c) {
    if (void 0 !== b) return c = c.indexOf(a), b = String(b), b = b.substr(c, a.length), '0' == b.charAt(0) && (b = b.substr(1, b.length - 1)), b = Number(b), isNaN(b) && (b = 0), -1 != a.indexOf('M') && b--, b;
  };
  d.formatDate = function (a, b, c) {
    c || (c = d);
    var e,
        h,
        f,
        g,
        k,
        l,
        m,
        n,
        q = d.getWeekNumber(a);
    d.useUTC ? (e = a.getUTCFullYear(), h = a.getUTCMonth(), f = a.getUTCDate(), g = a.getUTCDay(), k = a.getUTCHours(), l = a.getUTCMinutes(), m = a.getUTCSeconds(), n = a.getUTCMilliseconds()) : (e = a.getFullYear(), h = a.getMonth(), f = a.getDate(), g = a.getDay(), k = a.getHours(), l = a.getMinutes(), m = a.getSeconds(), n = a.getMilliseconds());
    var p = String(e).substr(2, 2),
        t = '0' + g;
    b = b.replace(/W/g, q);
    q = k;
    24 == q && (q = 0);
    var r = q;
    10 > r && (r = '0' + r);
    b = b.replace(/JJ/g, r);
    b = b.replace(/J/g, q);
    r = k;
    0 === r && (r = 24, -1 != b.indexOf('H') && (f--, 0 === f && (e = new Date(a), e.setDate(e.getDate() - 1), h = e.getMonth(), f = e.getDate(), e = e.getFullYear())));
    a = h + 1;
    9 > h && (a = '0' + a);
    q = f;
    10 > f && (q = '0' + f);
    var u = r;
    10 > u && (u = '0' + u);
    b = b.replace(/HH/g, u);
    b = b.replace(/H/g, r);
    r = k;
    11 < r && (r -= 12);
    u = r;
    10 > u && (u = '0' + u);
    b = b.replace(/KK/g, u);
    b = b.replace(/K/g, r);
    r = k;
    0 === r && (r = 12);
    12 < r && (r -= 12);
    u = r;
    10 > u && (u = '0' + u);
    b = b.replace(/LL/g, u);
    b = b.replace(/L/g, r);
    r = l;
    10 > r && (r = '0' + r);
    b = b.replace(/NN/g, r);
    b = b.replace(/N/g, l);
    l = m;
    10 > l && (l = '0' + l);
    b = b.replace(/SS/g, l);
    b = b.replace(/S/g, m);
    m = n;
    10 > m && (m = '00' + m);
    100 > m && (m = '0' + m);
    l = n;
    10 > l && (l = '00' + l);
    b = b.replace(/QQQ/g, m);
    b = b.replace(/QQ/g, l);
    b = b.replace(/Q/g, n);
    b = 12 > k ? b.replace(/A/g, c.amString) : b.replace(/A/g, c.pmString);
    b = b.replace(/YYYY/g, '@IIII@');
    b = b.replace(/YY/g, '@II@');
    b = b.replace(/MMMM/g, '@XXXX@');
    b = b.replace(/MMM/g, '@XXX@');
    b = b.replace(/MM/g, '@XX@');
    b = b.replace(/M/g, '@X@');
    b = b.replace(/DD/g, '@RR@');
    b = b.replace(/D/g, '@R@');
    b = b.replace(/EEEE/g, '@PPPP@');
    b = b.replace(/EEE/g, '@PPP@');
    b = b.replace(/EE/g, '@PP@');
    b = b.replace(/E/g, '@P@');
    b = b.replace(/@IIII@/g, e);
    b = b.replace(/@II@/g, p);
    b = b.replace(/@XXXX@/g, c.monthNames[h]);
    b = b.replace(/@XXX@/g, c.shortMonthNames[h]);
    b = b.replace(/@XX@/g, a);
    b = b.replace(/@X@/g, h + 1);
    b = b.replace(/@RR@/g, q);
    b = b.replace(/@R@/g, f);
    b = b.replace(/@PPPP@/g, c.dayNames[g]);
    b = b.replace(/@PPP@/g, c.shortDayNames[g]);
    b = b.replace(/@PP@/g, t);
    return b = b.replace(/@P@/g, g);
  };
  d.changeDate = function (a, b, c, e, h) {
    if (d.useUTC) return d.changeUTCDate(a, b, c, e, h);
    var f = -1;
    void 0 === e && (e = !0);
    void 0 === h && (h = !1);
    !0 === e && (f = 1);
    switch (b) {
      case 'YYYY':
        a.setFullYear(a.getFullYear() + c * f);
        e || h || a.setDate(a.getDate() + 1);
        break;
      case 'MM':
        b = a.getMonth();
        a.setMonth(a.getMonth() + c * f);
        a.getMonth() > b + c * f && a.setDate(a.getDate() - 1);
        e || h || a.setDate(a.getDate() + 1);
        break;
      case 'DD':
        a.setDate(a.getDate() + c * f);
        break;
      case 'WW':
        a.setDate(a.getDate() + c * f * 7);
        break;
      case 'hh':
        a.setHours(a.getHours() + c * f);
        break;
      case 'mm':
        a.setMinutes(a.getMinutes() + c * f);
        break;
      case 'ss':
        a.setSeconds(a.getSeconds() + c * f);
        break;
      case 'fff':
        a.setMilliseconds(a.getMilliseconds() + c * f);
    }
    return a;
  };
  d.changeUTCDate = function (a, b, c, d, h) {
    var f = -1;
    void 0 === d && (d = !0);
    void 0 === h && (h = !1);
    !0 === d && (f = 1);
    switch (b) {
      case 'YYYY':
        a.setUTCFullYear(a.getUTCFullYear() + c * f);
        d || h || a.setUTCDate(a.getUTCDate() + 1);
        break;
      case 'MM':
        b = a.getUTCMonth();
        a.setUTCMonth(a.getUTCMonth() + c * f);
        a.getUTCMonth() > b + c * f && a.setUTCDate(a.getUTCDate() - 1);
        d || h || a.setUTCDate(a.getUTCDate() + 1);
        break;
      case 'DD':
        a.setUTCDate(a.getUTCDate() + c * f);
        break;
      case 'WW':
        a.setUTCDate(a.getUTCDate() + c * f * 7);
        break;
      case 'hh':
        a.setUTCHours(a.getUTCHours() + c * f);
        break;
      case 'mm':
        a.setUTCMinutes(a.getUTCMinutes() + c * f);
        break;
      case 'ss':
        a.setUTCSeconds(a.getUTCSeconds() + c * f);
        break;
      case 'fff':
        a.setUTCMilliseconds(a.getUTCMilliseconds() + c * f);
    }
    return a;
  };
})();
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 443 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var AmCharts = __webpack_require__(442);
var xy = __webpack_require__(444);

module.exports = function () {
  console.log('AmCharts Loaded');
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 444 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

module.exports = function () {
  var e = window.AmCharts;e.AmRectangularChart = e.Class({ inherits: e.AmCoordinateChart, construct: function construct(a) {
      e.AmRectangularChart.base.construct.call(this, a);this.theme = a;this.createEvents("zoomed", "changed");this.marginRight = this.marginBottom = this.marginTop = this.marginLeft = 20;this.depth3D = this.angle = 0;this.plotAreaFillColors = "#FFFFFF";this.plotAreaFillAlphas = 0;this.plotAreaBorderColor = "#000000";this.plotAreaBorderAlpha = 0;this.maxZoomFactor = 20;this.zoomOutButtonImageSize = 19;this.zoomOutButtonImage = "lens";this.zoomOutText = "Show all";this.zoomOutButtonColor = "#e5e5e5";this.zoomOutButtonAlpha = 0;this.zoomOutButtonRollOverAlpha = 1;this.zoomOutButtonPadding = 8;this.trendLines = [];this.autoMargins = !0;this.marginsUpdated = !1;this.autoMarginOffset = 10;e.applyTheme(this, a, "AmRectangularChart");
    }, initChart: function initChart() {
      e.AmRectangularChart.base.initChart.call(this);this.updateDxy();!this.marginsUpdated && this.autoMargins && (this.resetMargins(), this.drawGraphs = !1);this.processScrollbars();this.updateMargins();this.updatePlotArea();
      this.updateScrollbars();this.updateTrendLines();this.updateChartCursor();this.updateValueAxes();this.scrollbarOnly || this.updateGraphs();
    }, drawChart: function drawChart() {
      e.AmRectangularChart.base.drawChart.call(this);this.drawPlotArea();if (e.ifArray(this.chartData)) {
        var a = this.chartCursor;a && a.draw();
      }
    }, resetMargins: function resetMargins() {
      var a = {},
          b;if ("xy" == this.type) {
        var c = this.xAxes,
            d = this.yAxes;for (b = 0; b < c.length; b++) {
          var g = c[b];g.ignoreAxisWidth || (g.setOrientation(!0), g.fixAxisPosition(), a[g.position] = !0);
        }for (b = 0; b < d.length; b++) {
          c = d[b], c.ignoreAxisWidth || (c.setOrientation(!1), c.fixAxisPosition(), a[c.position] = !0);
        }
      } else {
        d = this.valueAxes;for (b = 0; b < d.length; b++) {
          c = d[b], c.ignoreAxisWidth || (c.setOrientation(this.rotate), c.fixAxisPosition(), a[c.position] = !0);
        }(b = this.categoryAxis) && !b.ignoreAxisWidth && (b.setOrientation(!this.rotate), b.fixAxisPosition(), b.fixAxisPosition(), a[b.position] = !0);
      }a.left && (this.marginLeft = 0);a.right && (this.marginRight = 0);a.top && (this.marginTop = 0);a.bottom && (this.marginBottom = 0);this.fixMargins = a;
    }, measureMargins: function measureMargins() {
      var a = this.valueAxes,
          b,
          c = this.autoMarginOffset,
          d = this.fixMargins,
          g = this.realWidth,
          e = this.realHeight,
          f = c,
          k = c,
          m = g;b = e;var l;for (l = 0; l < a.length; l++) {
        a[l].handleSynchronization(), b = this.getAxisBounds(a[l], f, m, k, b), f = Math.round(b.l), m = Math.round(b.r), k = Math.round(b.t), b = Math.round(b.b);
      }if (a = this.categoryAxis) b = this.getAxisBounds(a, f, m, k, b), f = Math.round(b.l), m = Math.round(b.r), k = Math.round(b.t), b = Math.round(b.b);d.left && f < c && (this.marginLeft = Math.round(-f + c), !isNaN(this.minMarginLeft) && this.marginLeft < this.minMarginLeft && (this.marginLeft = this.minMarginLeft));d.right && m >= g - c && (this.marginRight = Math.round(m - g + c), !isNaN(this.minMarginRight) && this.marginRight < this.minMarginRight && (this.marginRight = this.minMarginRight));d.top && k < c + this.titleHeight && (this.marginTop = Math.round(this.marginTop - k + c + this.titleHeight), !isNaN(this.minMarginTop) && this.marginTop < this.minMarginTop && (this.marginTop = this.minMarginTop));d.bottom && b > e - c && (this.marginBottom = Math.round(this.marginBottom + b - e + c), !isNaN(this.minMarginBottom) && this.marginBottom < this.minMarginBottom && (this.marginBottom = this.minMarginBottom));this.initChart();
    }, getAxisBounds: function getAxisBounds(a, b, c, d, e) {
      if (!a.ignoreAxisWidth) {
        var h = a.labelsSet,
            f = a.tickLength;a.inside && (f = 0);if (h) switch (h = a.getBBox(), a.position) {case "top":
            a = h.y;d > a && (d = a);break;case "bottom":
            a = h.y + h.height;e < a && (e = a);break;case "right":
            a = h.x + h.width + f + 3;c < a && (c = a);break;case "left":
            a = h.x - f, b > a && (b = a);}
      }return { l: b, t: d, r: c, b: e };
    }, drawZoomOutButton: function drawZoomOutButton() {
      var a = this;if (!a.zbSet) {
        var b = a.container.set();
        a.zoomButtonSet.push(b);var c = a.color,
            d = a.fontSize,
            g = a.zoomOutButtonImageSize,
            h = a.zoomOutButtonImage.replace(/\.[a-z]*$/i, ""),
            f = e.lang.zoomOutText || a.zoomOutText,
            k = a.zoomOutButtonColor,
            m = a.zoomOutButtonAlpha,
            l = a.zoomOutButtonFontSize,
            p = a.zoomOutButtonPadding;isNaN(l) || (d = l);(l = a.zoomOutButtonFontColor) && (c = l);var l = a.zoomOutButton,
            q;l && (l.fontSize && (d = l.fontSize), l.color && (c = l.color), l.backgroundColor && (k = l.backgroundColor), isNaN(l.backgroundAlpha) || (a.zoomOutButtonRollOverAlpha = l.backgroundAlpha));
        var r = l = 0;void 0 !== a.pathToImages && h && (q = a.container.image(a.pathToImages + h + a.extension, 0, 0, g, g), e.setCN(a, q, "zoom-out-image"), b.push(q), q = q.getBBox(), l = q.width + 5);void 0 !== f && (c = e.text(a.container, f, c, a.fontFamily, d, "start"), e.setCN(a, c, "zoom-out-label"), d = c.getBBox(), r = q ? q.height / 2 - 3 : d.height / 2, c.translate(l, r), b.push(c));q = b.getBBox();c = 1;e.isModern || (c = 0);k = e.rect(a.container, q.width + 2 * p + 5, q.height + 2 * p - 2, k, 1, 1, k, c);k.setAttr("opacity", m);k.translate(-p, -p);e.setCN(a, k, "zoom-out-bg");b.push(k);
        k.toBack();a.zbBG = k;q = k.getBBox();b.translate(a.marginLeftReal + a.plotAreaWidth - q.width + p, a.marginTopReal + p);b.hide();b.mouseover(function () {
          a.rollOverZB();
        }).mouseout(function () {
          a.rollOutZB();
        }).click(function () {
          a.clickZB();
        }).touchstart(function () {
          a.rollOverZB();
        }).touchend(function () {
          a.rollOutZB();a.clickZB();
        });for (m = 0; m < b.length; m++) {
          b[m].attr({ cursor: "pointer" });
        }a.zbSet = b;
      }
    }, rollOverZB: function rollOverZB() {
      this.rolledOverZB = !0;this.zbBG.setAttr("opacity", this.zoomOutButtonRollOverAlpha);
    }, rollOutZB: function rollOutZB() {
      this.rolledOverZB = !1;this.zbBG.setAttr("opacity", this.zoomOutButtonAlpha);
    }, clickZB: function clickZB() {
      this.rolledOverZB = !1;this.zoomOut();
    }, zoomOut: function zoomOut() {
      this.zoomOutValueAxes();
    }, drawPlotArea: function drawPlotArea() {
      var a = this.dx,
          b = this.dy,
          c = this.marginLeftReal,
          d = this.marginTopReal,
          g = this.plotAreaWidth - 1,
          h = this.plotAreaHeight - 1,
          f = this.plotAreaFillColors,
          k = this.plotAreaFillAlphas,
          m = this.plotAreaBorderColor,
          l = this.plotAreaBorderAlpha;"object" == (typeof k === "undefined" ? "undefined" : _typeof(k)) && (k = k[0]);f = e.polygon(this.container, [0, g, g, 0, 0], [0, 0, h, h, 0], f, k, 1, m, l, this.plotAreaGradientAngle);
      e.setCN(this, f, "plot-area");f.translate(c + a, d + b);this.set.push(f);0 !== a && 0 !== b && (f = this.plotAreaFillColors, "object" == (typeof f === "undefined" ? "undefined" : _typeof(f)) && (f = f[0]), f = e.adjustLuminosity(f, -.15), g = e.polygon(this.container, [0, a, g + a, g, 0], [0, b, b, 0, 0], f, k, 1, m, l), e.setCN(this, g, "plot-area-bottom"), g.translate(c, d + h), this.set.push(g), a = e.polygon(this.container, [0, 0, a, a, 0], [0, h, h + b, b, 0], f, k, 1, m, l), e.setCN(this, a, "plot-area-left"), a.translate(c, d), this.set.push(a));(c = this.bbset) && this.scrollbarOnly && c.remove();
    }, updatePlotArea: function updatePlotArea() {
      var a = this.updateWidth(),
          b = this.updateHeight(),
          c = this.container;this.realWidth = a;this.realWidth = b;c && this.container.setSize(a, b);var c = this.marginLeftReal,
          d = this.marginTopReal,
          a = a - c - this.marginRightReal - this.dx,
          b = b - d - this.marginBottomReal;1 > a && (a = 1);1 > b && (b = 1);this.plotAreaWidth = Math.round(a);this.plotAreaHeight = Math.round(b);this.plotBalloonsSet.translate(c, d);
    }, updateDxy: function updateDxy() {
      this.dx = Math.round(this.depth3D * Math.cos(this.angle * Math.PI / 180));this.dy = Math.round(-this.depth3D * Math.sin(this.angle * Math.PI / 180));this.d3x = Math.round(this.columnSpacing3D * Math.cos(this.angle * Math.PI / 180));this.d3y = Math.round(-this.columnSpacing3D * Math.sin(this.angle * Math.PI / 180));
    }, updateMargins: function updateMargins() {
      var a = this.getTitleHeight();this.titleHeight = a;this.marginTopReal = this.marginTop - this.dy;this.fixMargins && !this.fixMargins.top && (this.marginTopReal += a);this.marginBottomReal = this.marginBottom;this.marginLeftReal = this.marginLeft;this.marginRightReal = this.marginRight;
    }, updateValueAxes: function updateValueAxes() {
      var a = this.valueAxes,
          b;for (b = 0; b < a.length; b++) {
        var c = a[b];this.setAxisRenderers(c);this.updateObjectSize(c);
      }
    }, setAxisRenderers: function setAxisRenderers(a) {
      a.axisRenderer = e.RecAxis;a.guideFillRenderer = e.RecFill;a.axisItemRenderer = e.RecItem;a.marginsChanged = !0;
    }, updateGraphs: function updateGraphs() {
      var a = this.graphs,
          b;for (b = 0; b < a.length; b++) {
        var c = a[b];c.index = b;c.rotate = this.rotate;this.updateObjectSize(c);
      }
    }, updateObjectSize: function updateObjectSize(a) {
      a.width = this.plotAreaWidth - 1;a.height = this.plotAreaHeight - 1;a.x = this.marginLeftReal;a.y = this.marginTopReal;a.dx = this.dx;
      a.dy = this.dy;
    }, updateChartCursor: function updateChartCursor() {
      var a = this.chartCursor;a && (a = e.processObject(a, e.ChartCursor, this.theme), this.updateObjectSize(a), this.addChartCursor(a), a.chart = this);
    }, processScrollbars: function processScrollbars() {
      var a = this.chartScrollbar;a && (a = e.processObject(a, e.ChartScrollbar, this.theme), this.addChartScrollbar(a));
    }, updateScrollbars: function updateScrollbars() {}, removeChartCursor: function removeChartCursor() {
      e.callMethod("destroy", [this.chartCursor]);this.chartCursor = null;
    }, zoomTrendLines: function zoomTrendLines() {
      var a = this.trendLines,
          b;for (b = 0; b < a.length; b++) {
        var c = a[b];c.valueAxis.recalculateToPercents ? c.set && c.set.hide() : (c.x = this.marginLeftReal, c.y = this.marginTopReal, c.draw());
      }
    }, handleCursorValueZoom: function handleCursorValueZoom() {}, addTrendLine: function addTrendLine(a) {
      this.trendLines.push(a);
    }, zoomOutValueAxes: function zoomOutValueAxes() {
      for (var a = this.valueAxes, b = 0; b < a.length; b++) {
        a[b].zoomOut();
      }
    }, removeTrendLine: function removeTrendLine(a) {
      var b = this.trendLines,
          c;for (c = b.length - 1; 0 <= c; c--) {
        b[c] == a && b.splice(c, 1);
      }
    }, adjustMargins: function adjustMargins(a, b) {
      var c = a.position,
          d = a.scrollbarHeight + a.offset;a.enabled && ("top" == c ? b ? this.marginLeftReal += d : this.marginTopReal += d : b ? this.marginRightReal += d : this.marginBottomReal += d);
    }, getScrollbarPosition: function getScrollbarPosition(a, b, c) {
      var d = "bottom",
          e = "top";a.oppositeAxis || (e = d, d = "top");a.position = b ? "bottom" == c || "left" == c ? d : e : "top" == c || "right" == c ? d : e;
    }, updateChartScrollbar: function updateChartScrollbar(a, b) {
      if (a) {
        a.rotate = b;var c = this.marginTopReal,
            d = this.marginLeftReal,
            e = a.scrollbarHeight,
            h = this.dx,
            f = this.dy,
            k = a.offset;"top" == a.position ? b ? (a.y = c, a.x = d - e - k) : (a.y = c - e + f - k, a.x = d + h) : b ? (a.y = c + f, a.x = d + this.plotAreaWidth + h + k) : (a.y = c + this.plotAreaHeight + k, a.x = this.marginLeftReal);
      }
    }, showZB: function showZB(a) {
      var b = this.zbSet;a && (b = this.zoomOutText, "" !== b && b && this.drawZoomOutButton());if (b = this.zbSet) this.zoomButtonSet.push(b), a ? b.show() : b.hide(), this.rollOutZB();
    }, handleReleaseOutside: function handleReleaseOutside(a) {
      e.AmRectangularChart.base.handleReleaseOutside.call(this, a);(a = this.chartCursor) && a.handleReleaseOutside && a.handleReleaseOutside();
    }, handleMouseDown: function handleMouseDown(a) {
      e.AmRectangularChart.base.handleMouseDown.call(this, a);var b = this.chartCursor;b && b.handleMouseDown && !this.rolledOverZB && b.handleMouseDown(a);
    }, update: function update() {
      e.AmRectangularChart.base.update.call(this);this.chartCursor && this.chartCursor.update && this.chartCursor.update();
    }, handleScrollbarValueZoom: function handleScrollbarValueZoom(a) {
      this.relativeZoomValueAxes(a.target.valueAxes, a.relativeStart, a.relativeEnd);this.zoomAxesAndGraphs();
    }, zoomValueScrollbar: function zoomValueScrollbar(a) {
      if (a && a.enabled) {
        var b = a.valueAxes[0],
            c = b.relativeStart,
            d = b.relativeEnd;b.reversed && (d = 1 - c, c = 1 - b.relativeEnd);a.percentZoom(c, d);
      }
    }, zoomAxesAndGraphs: function zoomAxesAndGraphs() {
      if (!this.scrollbarOnly) {
        var a = this.valueAxes,
            b;for (b = 0; b < a.length; b++) {
          a[b].zoom(this.start, this.end);
        }a = this.graphs;for (b = 0; b < a.length; b++) {
          a[b].zoom(this.start, this.end);
        }(b = this.chartCursor) && b.clearSelection();this.zoomTrendLines();
      }
    }, handleValueAxisZoomReal: function handleValueAxisZoomReal(a, b) {
      var c = a.relativeStart,
          d = a.relativeEnd;if (c > d) var e = c,
          c = d,
          d = e;this.relativeZoomValueAxes(b, c, d);this.updateAfterValueZoom();
    }, updateAfterValueZoom: function updateAfterValueZoom() {
      this.zoomAxesAndGraphs();this.zoomScrollbar();
    }, relativeZoomValueAxes: function relativeZoomValueAxes(a, b, c) {
      b = e.fitToBounds(b, 0, 1);c = e.fitToBounds(c, 0, 1);if (b > c) {
        var d = b;b = c;c = d;
      }var d = 1 / this.maxZoomFactor,
          g = e.getDecimals(d) + 4;c - b < d && (c = b + (c - b) / 2, b = c - d / 2, c += d / 2);b = e.roundTo(b, g);c = e.roundTo(c, g);d = !1;if (a) {
        for (g = 0; g < a.length; g++) {
          var h = a[g].zoomToRelativeValues(b, c, !0);h && (d = h);
        }this.showZB();
      }return d;
    }, addChartCursor: function addChartCursor(a) {
      e.callMethod("destroy", [this.chartCursor]);a && (this.listenTo(a, "moved", this.handleCursorMove), this.listenTo(a, "zoomed", this.handleCursorZoom), this.listenTo(a, "zoomStarted", this.handleCursorZoomStarted), this.listenTo(a, "panning", this.handleCursorPanning), this.listenTo(a, "onHideCursor", this.handleCursorHide));this.chartCursor = a;
    }, handleCursorChange: function handleCursorChange() {}, handleCursorMove: function handleCursorMove(a) {
      var b,
          c = this.valueAxes;for (b = 0; b < c.length; b++) {
        a.panning || c[b].showBalloon(a.x, a.y);
      }
    }, handleCursorZoom: function handleCursorZoom(a) {
      if (this.skipZoomed) this.skipZoomed = !1;else {
        var b = this.startX0,
            c = this.endX0,
            d = this.endY0,
            e = this.startY0,
            h = a.startX,
            f = a.endX,
            k = a.startY,
            m = a.endY;this.startX0 = this.endX0 = this.startY0 = this.endY0 = NaN;this.handleCursorZoomReal(b + h * (c - b), b + f * (c - b), e + k * (d - e), e + m * (d - e), a);
      }
    }, handleCursorHide: function handleCursorHide() {
      var a,
          b = this.valueAxes;for (a = 0; a < b.length; a++) {
        b[a].hideBalloon();
      }b = this.graphs;for (a = 0; a < b.length; a++) {
        b[a].hideBalloonReal();
      }
    } });
}();(function () {
  var e = window.AmCharts;e.AmXYChart = e.Class({ inherits: e.AmRectangularChart, construct: function construct(a) {
      this.type = "xy";e.AmXYChart.base.construct.call(this, a);this.cname = "AmXYChart";this.theme = a;this.createEvents("zoomed");e.applyTheme(this, a, this.cname);
    }, initChart: function initChart() {
      e.AmXYChart.base.initChart.call(this);this.dataChanged && this.updateData();this.drawChart();!this.marginsUpdated && this.autoMargins && (this.marginsUpdated = !0, this.measureMargins());var a = this.marginLeftReal,
          b = this.marginTopReal,
          c = this.plotAreaWidth,
          d = this.plotAreaHeight;this.graphsSet.clipRect(a, b, c, d);this.bulletSet.clipRect(a, b, c, d);this.trendLinesSet.clipRect(a, b, c, d);this.drawGraphs = !0;this.showZB();
    }, prepareForExport: function prepareForExport() {
      var a = this.bulletSet;a.clipPath && this.container.remove(a.clipPath);
    }, createValueAxes: function createValueAxes() {
      var a = [],
          b = [];this.xAxes = a;this.yAxes = b;var c = this.valueAxes,
          d,
          g;for (g = 0; g < c.length; g++) {
        d = c[g];var h = d.position;if ("top" == h || "bottom" == h) d.rotate = !0;d.setOrientation(d.rotate);h = d.orientation;"V" == h && b.push(d);"H" == h && a.push(d);
      }0 === b.length && (d = new e.ValueAxis(this.theme), d.rotate = !1, d.setOrientation(!1), c.push(d), b.push(d));0 === a.length && (d = new e.ValueAxis(this.theme), d.rotate = !0, d.setOrientation(!0), c.push(d), a.push(d));for (g = 0; g < c.length; g++) {
        this.processValueAxis(c[g], g);
      }a = this.graphs;for (g = 0; g < a.length; g++) {
        this.processGraph(a[g], g);
      }
    }, drawChart: function drawChart() {
      e.AmXYChart.base.drawChart.call(this);var a = this.chartData;if (0 < this.realWidth && 0 < this.realHeight) {
        e.ifArray(a) ? (this.chartScrollbar && this.updateScrollbars(), this.zoomChart()) : this.cleanChart();if (a = this.scrollbarH) this.hideXScrollbar ? (a && a.destroy(), this.scrollbarH = null) : a.draw();if (a = this.scrollbarV) this.hideYScrollbar ? (a.destroy(), this.scrollbarV = null) : a.draw();this.zoomScrollbar();if (!this.autoMargins || this.marginsUpdated) this.dispDUpd(), this.chartCreated = !0;
      }
    }, cleanChart: function cleanChart() {
      e.callMethod("destroy", [this.valueAxes, this.graphs, this.scrollbarV, this.scrollbarH, this.chartCursor]);
    }, zoomChart: function zoomChart() {
      this.zoomObjects(this.valueAxes);
      this.zoomObjects(this.graphs);this.zoomTrendLines();this.prevPlotAreaWidth = this.plotAreaWidth;this.prevPlotAreaHeight = this.plotAreaHeight;
    }, zoomObjects: function zoomObjects(a) {
      var b = a.length,
          c,
          d;for (c = 0; c < b; c++) {
        d = a[c], d.zoom(0, this.chartData.length - 1);
      }
    }, updateData: function updateData() {
      this.parseData();var a = this.chartData,
          b = a.length - 1,
          c = this.graphs,
          d = this.dataProvider,
          e = -Infinity,
          h = Infinity,
          f,
          k;if (d) {
        for (f = 0; f < c.length; f++) {
          if (k = c[f], k.data = a, k.zoom(0, b), k = k.valueField) {
            var m;for (m = 0; m < d.length; m++) {
              if (null !== l) {
                var l = Number(d[m][k]);
                l > e && (e = l);l < h && (h = l);
              }
            }
          }
        }isNaN(this.minValue) || (h = this.minValue);isNaN(this.maxValue) || (e = this.maxValue);for (f = 0; f < c.length; f++) {
          k = c[f], k.maxValue = e, k.minValue = h;
        }if (a = this.chartCursor) a.type = "crosshair", a.valueBalloonsEnabled = !1;this.dataChanged = !1;this.dispatchDataUpdated = !0;
      }
    }, processValueAxis: function processValueAxis(a) {
      a.chart = this;a.minMaxField = "H" == a.orientation ? "x" : "y";a.min = NaN;a.max = NaN;
    }, processGraph: function processGraph(a) {
      e.isString(a.xAxis) && (a.xAxis = this.getValueAxisById(a.xAxis));e.isString(a.yAxis) && (a.yAxis = this.getValueAxisById(a.yAxis));
      a.xAxis || (a.xAxis = this.xAxes[0]);a.yAxis || (a.yAxis = this.yAxes[0]);a.valueAxis = a.yAxis;
    }, parseData: function parseData() {
      e.AmXYChart.base.parseData.call(this);this.chartData = [];var a = this.dataProvider,
          b = this.valueAxes,
          c = this.graphs,
          d;if (a) for (d = 0; d < a.length; d++) {
        var g = { axes: {}, x: {}, y: {} },
            h = this.dataDateFormat,
            f = a[d],
            k;for (k = 0; k < b.length; k++) {
          var m = b[k].id;g.axes[m] = {};g.axes[m].graphs = {};var l;for (l = 0; l < c.length; l++) {
            var p = c[l],
                q = p.id;if (p.xAxis.id == m || p.yAxis.id == m) {
              var r = {};r.serialDataItem = g;r.index = d;var t = {},
                  n = f[p.valueField];null !== n && (n = Number(n), isNaN(n) || (t.value = n));n = f[p.xField];null !== n && ("date" == p.xAxis.type && (n = e.getDate(f[p.xField], h).getTime()), n = Number(n), isNaN(n) || (t.x = n));n = f[p.yField];null !== n && ("date" == p.yAxis.type && (n = e.getDate(f[p.yField], h).getTime()), n = Number(n), isNaN(n) || (t.y = n));n = f[p.errorField];null !== n && (n = Number(n), isNaN(n) || (t.error = n));r.values = t;this.processFields(p, r, f);r.serialDataItem = g;r.graph = p;g.axes[m].graphs[q] = r;
            }
          }
        }this.chartData[d] = g;
      }this.start = 0;this.end = this.chartData.length - 1;
    }, formatString: function formatString(a, b, c) {
      var d = b.graph,
          g = d.numberFormatter;g || (g = this.nf);var h, f;"date" == b.graph.xAxis.type && (h = e.formatDate(new Date(b.values.x), d.dateFormat, this), f = RegExp("\\[\\[x\\]\\]", "g"), a = a.replace(f, h));"date" == b.graph.yAxis.type && (h = e.formatDate(new Date(b.values.y), d.dateFormat, this), f = RegExp("\\[\\[y\\]\\]", "g"), a = a.replace(f, h));a = e.formatValue(a, b.values, ["value", "x", "y"], g);-1 != a.indexOf("[[") && (a = e.formatDataContextValue(a, b.dataContext));return a = e.AmXYChart.base.formatString.call(this, a, b, c);
    }, addChartScrollbar: function addChartScrollbar(a) {
      e.callMethod("destroy", [this.chartScrollbar, this.scrollbarH, this.scrollbarV]);if (a) {
        this.chartScrollbar = a;this.scrollbarHeight = a.scrollbarHeight;var b = "backgroundColor backgroundAlpha selectedBackgroundColor selectedBackgroundAlpha scrollDuration resizeEnabled hideResizeGrips scrollbarHeight updateOnReleaseOnly".split(" ");if (!this.hideYScrollbar) {
          var c = new e.ChartScrollbar(this.theme);c.skipEvent = !0;c.chart = this;this.listenTo(c, "zoomed", this.handleScrollbarValueZoom);
          e.copyProperties(a, c, b);c.rotate = !0;this.scrollbarV = c;
        }this.hideXScrollbar || (c = new e.ChartScrollbar(this.theme), c.skipEvent = !0, c.chart = this, this.listenTo(c, "zoomed", this.handleScrollbarValueZoom), e.copyProperties(a, c, b), c.rotate = !1, this.scrollbarH = c);
      }
    }, updateTrendLines: function updateTrendLines() {
      var a = this.trendLines,
          b;for (b = 0; b < a.length; b++) {
        var c = a[b],
            c = e.processObject(c, e.TrendLine, this.theme);a[b] = c;c.chart = this;var d = c.valueAxis;e.isString(d) && (c.valueAxis = this.getValueAxisById(d));d = c.valueAxisX;e.isString(d) && (c.valueAxisX = this.getValueAxisById(d));c.id || (c.id = "trendLineAuto" + b + "_" + new Date().getTime());c.valueAxis || (c.valueAxis = this.yAxes[0]);c.valueAxisX || (c.valueAxisX = this.xAxes[0]);
      }
    }, updateMargins: function updateMargins() {
      e.AmXYChart.base.updateMargins.call(this);var a = this.scrollbarV;a && (this.getScrollbarPosition(a, !0, this.yAxes[0].position), this.adjustMargins(a, !0));if (a = this.scrollbarH) this.getScrollbarPosition(a, !1, this.xAxes[0].position), this.adjustMargins(a, !1);
    }, updateScrollbars: function updateScrollbars() {
      e.AmXYChart.base.updateScrollbars.call(this);
      var a = this.scrollbarV;a && (this.updateChartScrollbar(a, !0), a.valueAxes = this.yAxes, a.gridAxis || (a.gridAxis = this.yAxes[0]));if (a = this.scrollbarH) this.updateChartScrollbar(a, !1), a.valueAxes = this.xAxes, a.gridAxis || (a.gridAxis = this.xAxes[0]);
    }, removeChartScrollbar: function removeChartScrollbar() {
      e.callMethod("destroy", [this.scrollbarH, this.scrollbarV]);this.scrollbarV = this.scrollbarH = null;
    }, handleReleaseOutside: function handleReleaseOutside(a) {
      e.AmXYChart.base.handleReleaseOutside.call(this, a);e.callMethod("handleReleaseOutside", [this.scrollbarH, this.scrollbarV]);
    }, update: function update() {
      e.AmXYChart.base.update.call(this);this.scrollbarH && this.scrollbarH.update && this.scrollbarH.update();this.scrollbarV && this.scrollbarV.update && this.scrollbarV.update();
    }, zoomScrollbar: function zoomScrollbar() {
      this.zoomValueScrollbar(this.scrollbarV);this.zoomValueScrollbar(this.scrollbarH);
    }, handleCursorZoomReal: function handleCursorZoomReal(a, b, c, d) {
      isNaN(a) || isNaN(b) || this.relativeZoomValueAxes(this.xAxes, a, b);isNaN(c) || isNaN(d) || this.relativeZoomValueAxes(this.yAxes, c, d);this.updateAfterValueZoom();
    },
    handleCursorZoomStarted: function handleCursorZoomStarted() {
      if (this.xAxes) {
        var a = this.xAxes[0];this.startX0 = a.relativeStart;this.endX0 = a.relativeEnd;a.reversed && (this.startX0 = 1 - a.relativeEnd, this.endX0 = 1 - a.relativeStart);
      }this.yAxes && (a = this.yAxes[0], this.startY0 = a.relativeStart, this.endY0 = a.relativeEnd, a.reversed && (this.startY0 = 1 - a.relativeEnd, this.endY0 = 1 - a.relativeStart));
    }, updateChartCursor: function updateChartCursor() {
      e.AmXYChart.base.updateChartCursor.call(this);var a = this.chartCursor;if (a) {
        a.valueLineEnabled = !0;a.categoryLineAxis || (a.categoryLineAxis = this.xAxes[0]);var b = this.valueAxis;if (a.valueLineBalloonEnabled) {
          var c = a.categoryBalloonAlpha,
              d = a.categoryBalloonColor,
              g = a.color;void 0 === d && (d = a.cursorColor);for (var h = 0; h < this.valueAxes.length; h++) {
            var b = this.valueAxes[h],
                f = b.balloon;f || (f = {});f = e.extend(f, this.balloon, !0);f.fillColor = d;f.balloonColor = d;f.fillAlpha = c;f.borderColor = d;f.color = g;b.balloon = f;
          }
        } else for (c = 0; c < this.valueAxes.length; c++) {
          b = this.valueAxes[c], b.balloon && (b.balloon = null);
        }a.zoomable && (this.hideYScrollbar || (a.vZoomEnabled = !0), this.hideXScrollbar || (a.hZoomEnabled = !0));
      }
    }, handleCursorPanning: function handleCursorPanning(a) {
      var b = a.deltaX,
          c = a.delta2X,
          d;isNaN(c) && (c = b, d = !0);var g = this.endX0,
          h = this.startX0,
          f = g - h,
          c = g - f * c,
          g = f;d || (g = 0);b = e.fitToBounds(h - f * b, 0, 1 - g);c = e.fitToBounds(c, g, 1);this.relativeZoomValueAxes(this.xAxes, b, c);f = a.deltaY;a = a.delta2Y;isNaN(a) && (a = f, d = !0);c = this.endY0;b = this.startY0;h = c - b;f = c + h * f;c = h;d || (c = 0);d = e.fitToBounds(b + h * a, 0, 1 - c);f = e.fitToBounds(f, c, 1);this.relativeZoomValueAxes(this.yAxes, d, f);this.updateAfterValueZoom();
    },
    handleValueAxisZoom: function handleValueAxisZoom(a) {
      this.handleValueAxisZoomReal(a, "V" == a.valueAxis.orientation ? this.yAxes : this.xAxes);
    }, showZB: function showZB() {
      var a,
          b = this.valueAxes;if (b) for (var c = 0; c < b.length; c++) {
        var d = b[c];0 !== d.relativeStart && (a = !0);1 != d.relativeEnd && (a = !0);
      }e.AmXYChart.base.showZB.call(this, a);
    } });
})();
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 445 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __activeTabRef = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.store = {
      activePhysicalTab: 'land',
      activeFinancialTab: 'income'
    };
    this.listenToMany(_Actions2.default);
  },
  onUPDATE_PHYSICAL_TAB: function onUPDATE_PHYSICAL_TAB(tab) {
    this.store.activePhysicalTab = tab;
    this.trigger(this.store);
  },
  onUPDATE_FINANCIAL_TAB: function onUPDATE_FINANCIAL_TAB(tab) {
    this.store.activeFinancialTab = tab;
    this.trigger(this.store);
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__activeTabRef, '__activeTabRef', 'C:/_repos_windows/dairybase/Frontend/app/stores/__activeTabRef/index.js');
}();

;

/***/ }),
/* 446 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

module.exports = function runCalculations(scenario, Source) {
  var o = _extends({}, scenario);

  o.CashFlowLivestockNet = o.IncomeLivestock - o.CashFlowLivestockPurchase;

  o.LivestockInventoryChange = Source.IncomeLivestockTrading - Source.CashFlowLivestockNet;

  o.IncomeLivestockTrading = o.CashFlowLivestockNet + o.LivestockInventoryChange;

  o.FertiliserTonnesAppliedTotal = o.CompCalculatorFertilisers.reduce(function (__num, f) {
    return __num + f.TonnesApplied;
  }, 0);

  o.ExpenseIrrigation = o.ExpenseWaterPurchase + o.ExpenseIrrigationOther;
  o.ExpenseIrrigationPerMlApplied = o.ExpenseIrrigation / o.WaterIrrigationTotalML;

  o.ExpenseFodderPhysicalPurchase = o.CompCalculatorFeeds.reduce(function (__num, f) {
    if (f.FeedCostGroupKey !== 'Fodder') return __num;
    var FeedPurchaseCost = f.PricePerTonne * f.QuantityPurchased;
    return __num + FeedPurchaseCost;
  }, 0);

  o.ExpenseConcentratesPhysicalPurchase = o.CompCalculatorFeeds.reduce(function (__num, f) {
    if (f.FeedCostGroupKey !== 'Concentrate') return __num;
    var FeedPurchaseCost = f.PricePerTonne * f.QuantityPurchased;
    return __num + FeedPurchaseCost;
  }, 0);

  o.ExpenseOtherFeedPhysicalPurchase = o.CompCalculatorFeeds.reduce(function (__num, f) {
    if (f.FeedCostGroupKey !== 'Other') return __num;
    var FeedPurchaseCost = f.PricePerTonne * f.QuantityPurchased;
    return __num + FeedPurchaseCost;
  }, 0);

  var _ExpenseFodderPurchase = o.ExpenseFodderPurchase;
  var _ExpenseConcentratesPurchase = o.ExpenseConcentratesPurchase;
  var _ExpenseOtherFeedPurchase = o.ExpenseOtherFeedPurchase;

  if (o.CcModelSwitchId === 1) {
    _ExpenseFodderPurchase = o.ExpenseFodderPhysicalPurchase;
    _ExpenseConcentratesPurchase = o.ExpenseConcentratesPhysicalPurchase;
    _ExpenseOtherFeedPurchase = o.ExpenseOtherFeedPhysicalPurchase;
  }

  o.ExpenseFeedPurchaseTotal = _ExpenseFodderPurchase + _ExpenseConcentratesPurchase + _ExpenseOtherFeedPurchase;

  o.ExpenseFeedPhysicalPurchaseTotal = o.ExpenseFodderPhysicalPurchase + o.ExpenseConcentratesPhysicalPurchase + o.ExpenseOtherFeedPhysicalPurchase;

  o.FeedPurchasedFodderTDM = o.CompCalculatorFeeds.reduce(function (__num, f) {
    if (f.FeedCostGroupKey !== 'Fodder') return __num;
    return __num + f.QuantityPurchasedTDM;
  }, 0);

  o.FeedPurchasedConcTDM = o.CompCalculatorFeeds.reduce(function (__num, f) {
    if (f.FeedCostGroupKey !== 'Concentrate') return __num;
    return __num + f.QuantityPurchasedTDM;
  }, 0);

  o.FeedPurchasedOtherTDM = o.CompCalculatorFeeds.reduce(function (__num, f) {
    if (f.FeedCostGroupKey !== 'Other') return __num;
    return __num + f.QuantityPurchasedTDM;
  }, 0);

  o.FeedPurchasedTotalTDM = o.FeedPurchasedFodderTDM + o.FeedPurchasedConcTDM + o.FeedPurchasedOtherTDM;

  o.FeedFodderCostPerTDM = _ExpenseFodderPurchase / o.FeedPurchasedFodderTDM;

  o.FeedConcCostPerTDM = _ExpenseConcentratesPurchase / o.FeedPurchasedConcTDM;
  o.FeedOtherCostPerTDM = _ExpenseOtherFeedPurchase / o.FeedPurchasedOtherTDM;
  o.FeedTotalCostPerTDM = o.ExpenseFeedPurchaseTotal / o.FeedPurchasedTotalTDM;

  o.FeedFodderPhysicalCostPerTDM = o.ExpenseFodderPhysicalPurchase / o.FeedPurchasedFodderTDM;

  o.FeedConcPhysicalPurchaseCostPerTDM = o.ExpenseConcentratesPhysicalPurchase / o.FeedPurchasedConcTDM;

  o.FeedOtherPhysicalPurchaseCostPerTDM = o.ExpenseOtherFeedPhysicalPurchase / o.FeedPurchasedOtherTDM;

  o.FeedTotalPhysicalCostPerTDM = o.ExpenseFeedPhysicalPurchaseTotal / o.FeedPurchasedTotalTDM;

  o.IncomeFarmCashTotalAdjustment = Source.IncomeFarmCashTotal - Source.IncomeMilkTotal - Source.CashFlowLivestockNet;

  o.IncomeFarmCashTotal = o.IncomeFarmCashTotalAdjustment + o.IncomeMilkTotal + o.CashFlowLivestockNet;

  o.ExpenseFarmWorkingAdjustment = Source.ExpenseFarmWorking - Source.ExpenseFertiliser - Source.ExpenseIrrigation - Source.ExpenseFeedPurchaseTotal;

  o.ExpenseFarmWorking = o.ExpenseFarmWorkingAdjustment + o.ExpenseFertiliser + o.ExpenseIrrigation + o.ExpenseFeedPurchaseTotal;

  o.CashFlowFarmOperatingSurplus = o.IncomeFarmCashTotal - o.ExpenseFarmWorking;

  return o;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 447 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var __help = module.exports = _reflux2.default.createStore({
  init: function init() {
    this.store = {};
    this.listenToMany(_Actions2.default);
  },
  NEW_USER_SESSION: function NEW_USER_SESSION(blob) {
    this.store = blob.DataLabels;
    this.trigger();
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(__help, '__help', 'C:/_repos_windows/dairybase/Frontend/app/stores/__help/index.js');
}();

;

/***/ }),
/* 448 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (list) {
  var date = new Date();
  var year = date.getFullYear().toString().substr(2, 2);
  var month = date.getMonth();
  var financialYear;
  if (month >= 6) {
    financialYear = _.findIndex(list, function (item) {
      return item.Title.substr(0, 2) === year;
    });
  } else {
    financialYear = _.findIndex(list, function (item) {
      return item.Title.substr(3, 2) === year;
    });
  }
  return financialYear;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 449 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = checkDairyBaseGroups;

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function checkDairyBaseGroups(groups) {
  var matchList = groups.filter(function (group) {
    return _.contains(_user2.default.dairyBaseGroups, group);
  });
  return matchList.length > 0;
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(checkDairyBaseGroups, 'checkDairyBaseGroups', 'C:/_repos_windows/dairybase/Frontend/app/utils/_checkDairyBaseGroups/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 450 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (id) {
  if (_datasetList2.default.store.length < 1) return false;
  if (typeof id === "undefined") id = _activeDataset2.default.id;
  var dataset = _.find(_datasetList2.default.store, { Id: id });
  return dataset.EditAuthority && !dataset.IsCcModel;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 451 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function () {

  var _localToken = localStorage.getItem('accessToken');
  var _windowToken = window.dbtoken;

  // check for window object
  if (typeof _windowToken === "string") {
    localStorage.setItem('accessToken', _windowToken);
    return _windowToken;
  }

  // check for localStorage token
  if (typeof _localToken === "string") {
    return _localToken;
  }

  return undefined;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 452 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.default = getUrlParameterByName;
function getUrlParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results === null ? undefined : decodeURIComponent(results[1].replace(/\+/g, " "));
}
;

var _temp = function () {
    if (typeof __REACT_HOT_LOADER__ === 'undefined') {
        return;
    }

    __REACT_HOT_LOADER__.register(getUrlParameterByName, "getUrlParameterByName", "C:/_repos_windows/dairybase/Frontend/app/utils/_getUrlParameterByName/index.js");
}();

;
module.exports = exports["default"];

/***/ }),
/* 453 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (item) {

  var _options = _dataDefinition2.default.selectOptions[item.SelectList] || _dataDefinition2.default.selectOptions[item.FieldId];

  if (typeof _options !== "undefined") {
    item.Options = _options;
  }

  return item;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 454 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = function (item) {

  switch (item.Type) {
    case "Number":
      if (typeof item.Value === "number") item.Value = item.Value.toFixed(item.Decimal);
      break;
    case "Percent":
      if (typeof item.Value === "number") item.Value = (item.Value * 100).toFixed(item.Decimal);
      break;
  }

  return item;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 455 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (item) {

  // wow.
  switch (item.Type) {
    case "MultiSelect":

      var list = _dataDefinition2.default.selectOptions[item.SelectList] || [];
      var valueArr = item.Value.split('');

      var newValue = list.reduce(function (__arr, item, i) {
        if (typeof valueArr[i] === 'undefined') {
          __arr.push(0);
        } else {
          __arr.push(+valueArr[i]);
        }
        return __arr;
      }, []);
      return _extends({}, item, {
        Value: newValue
      });
    default:
      return item;
  }
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 456 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = function (chartObj, chartDatasets) {

  var counter = 0;

  chartObj.graphs = chartObj.graphs.map(function (item, index) {
    if (/Dataset/i.test(item.id) && counter + 1 <= chartDatasets.length) {
      var dataset = _.find(_datasetList2.default.store, { Id: chartDatasets[counter] });
      counter++;
      item.balloonText = dataset.Name + ' <br/> ' + dataset.DairyBaseId + ' \u2014 ' + dataset.FinancialYear + ' <br/> x: [[x]] y: [[y]]';
    }
    return item;
  });
  return chartObj;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 457 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var idCounter = 0;

module.exports = function () {
  idCounter++;
  return idCounter;
};
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(idCounter, "idCounter", "C:/_repos_windows/dairybase/Frontend/app/utils/_uniqueIdGenerator/index.js");
}();

;

/***/ }),
/* 458 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1015);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _velocityAnimate = __webpack_require__(186);

var _velocityAnimate2 = _interopRequireDefault(_velocityAnimate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Popup = module.exports = __webpack_require__(1)({
  componentDidMount: function componentDidMount() {
    (0, _velocityAnimate2.default)(this.popup, {
      translateY: ['-100%', '-60%'],
      scale: [1.0, 0.4]
    }, {
      easing: [0.42, 0.23, 0.03, 1.35],
      duration: 250
    });
  },
  createMarkup: function createMarkup() {
    return { __html: this.props.text };
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      {
        ref: function ref(_ref2) {
          return _this.popup = _ref2;
        },
        className: '_CCpopup',
        style: {
          top: this.props.coords.top,
          left: this.props.coords.left
        } },
      _react2.default.createElement(
        'div',
        { ref: function ref(_ref) {
            return _this.content = _ref;
          }, className: '_content' },
        _react2.default.createElement('p', {
          className: 'CCDescriptionLabel__text',
          dangerouslySetInnerHTML: this.createMarkup()
        })
      ),
      _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'curvedtriangledown' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Popup, 'Popup', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CCPopup/_DescriptionLabel/_Popup/index.jsx');
}();

;

/***/ }),
/* 459 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1016);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _Popup = __webpack_require__(458);

var _Popup2 = _interopRequireDefault(_Popup);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DescriptionLabel = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      popupIsActive: false
    };
  },
  _hasDescription: function _hasDescription() {
    return typeof this.props.description === 'string' && this.props.description !== '';
  },
  _togglePopup: function _togglePopup() {
    var _this = this;

    if (this._hasDescription()) {
      this.setState({
        popupIsActive: !this.state.popupIsActive,
        coords: (0, _getDomCoords3.default)(this.label)
      }, function () {
        _this.state.popupIsActive ? document.addEventListener('click', _this._togglePopup) : document.removeEventListener('click', _this._togglePopup);
      });
    }
  },
  render: function render() {
    var _this2 = this;

    var labelClasses = (0, _classnames2.default)({
      DescriptionLabel: true,
      'has-description': this._hasDescription()
    });

    return _react2.default.createElement(
      'div',
      {
        ref: function ref(_ref) {
          _this2.label = _ref;
        },
        onClick: this._togglePopup },
      this.props.children,
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.popupIsActive,
          className: 'Popup' },
        _react2.default.createElement(_Popup2.default, { coords: this.state.coords, text: this.props.description })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DescriptionLabel, 'DescriptionLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CCPopup/_DescriptionLabel/index.jsx');
}();

;

/***/ }),
/* 460 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1017);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _style = __webpack_require__(461);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      options: this.sortOptions(this.props)
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.setState({
      value: newProps.value,
      options: this.sortOptions(newProps)
    });
  },
  sortOptions: function sortOptions(props) {
    var options = props.options,
        value = props.value;


    if (!options) return options;
    if (options.length === 0) return options;

    var hasOrder = typeof options[0].Order === 'number';
    var orderKey = hasOrder ? 'Order' : 'Id';
    var filteredList = !hasOrder ? options : options.filter(function (item) {
      return item.Id === value || item.Order > 0;
    });

    return _.sortBy(filteredList, orderKey);
  },
  _handleSelect: function _handleSelect(evt) {
    if (!this.props.disabled) {
      this._handleSubmitData(evt.target.value);
    }
  },
  _handleSubmitData: function _handleSubmitData(newValue) {
    this.props.onSubmit(+newValue, this.props.id);
  },
  render: function render() {
    var CC_YearSelectInput__dropdown = (0, _classnames2.default)({
      CC_YearSelectInput__dropdown: true,
      'is-error': this.props.error
    });
    return _react2.default.createElement(
      _style.YearDropdown,
      null,
      this._renderSelectElement(),
      _react2.default.createElement(_style.DownIcon, null)
    );
  },
  _renderSelectElement: function _renderSelectElement() {
    var selectElement;

    var classList = (0, _classnames2.default)({
      CC_YearSelectInput__field: true,
      'is-error': this.props.error,
      'is-disabled': this.props.disabled
    });

    if (typeof this.state.value !== 'undefined' && this.state.options.length !== 0) {
      selectElement = _react2.default.createElement(
        _style.YearInput,
        {
          disabled: this.props.disabled,
          value: this.state.value,
          onChange: this._handleSelect },
        this.state.options.map(function (option, index) {
          return _react2.default.createElement(
            'option',
            { key: index, value: option.Id },
            option.Title
          );
        })
      );
    } else {
      selectElement = _react2.default.createElement(
        _style.YearInput,
        {
          className: 'CC_YearSelectInput__field',
          disabled: true,
          value: '1' },
        _react2.default.createElement(
          'option',
          { value: '1' },
          'waiting for data...'
        )
      );
    }
    return selectElement;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 461 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.YearInput = exports.YearDropdown = exports.DownIcon = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DownIcon = exports.DownIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_arrow_down' }).withConfig({
  displayName: 'SelectInput__DownIcon'
})(['', ';position:absolute;z-index:1;right:5px;top:50%;margin-top:-8px;path{fill:', ';}'], _css.mixins.icon('18px', '18px'), _css.vars.a(_css.vars.DA_Dairy_blue, 50));

var YearDropdown = exports.YearDropdown = _styledComponents2.default.div.withConfig({
  displayName: 'SelectInput__YearDropdown'
})(['font-family:', ';letter-spacing:0.8px;width:110px;height:50px;background:white;border:1px solid ', ';font-size:14px;color:', ';display:flex;align-items:center;text-align:center;justify-content:center;letter-spacing:0.8px;position:relative;z-index:1;&:hover{border-color:', ';', '{path{fill:', ';}}}'], _css.vars.Gilroy, _css.vars.a(_css.vars.DA_accent_blue, 30), _css.vars.DA_Dairy_blue, _css.vars.DA_accent_blue, DownIcon, _css.vars.DA_accent_blue);

var YearInput = exports.YearInput = _styledComponents2.default.select.withConfig({
  displayName: 'SelectInput__YearInput'
})(['position:absolute;z-index:2;top:0;left:0;right:0;bottom:0;text-align:right;line-height:1.2;background:none;border:none;color:', ';cursor:pointer;font-size:14px;padding:8px;padding-bottom:7px;padding-left:12px;width:100%;-webkit-appearance:none;-moz-appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;&:hover{color:', ';', '{path{fill:', ';}}}&:focus{color:', ';', '{path{fill:', ';}}}&.is-disabled{cursor:not-allowed;opacity:0.6;}&:focus{outline:none;}&.is-error{color:', ';}'], _css.vars.DA_Dairy_blue, _css.vars.DA_accent_blue, DownIcon, _css.vars.DA_accent_blue, _css.vars.DA_accent_blue, DownIcon, _css.vars.DA_accent_blue, _css.vars.DA_red);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DownIcon, 'DownIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/SelectInput/style.js');

  __REACT_HOT_LOADER__.register(YearDropdown, 'YearDropdown', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/SelectInput/style.js');

  __REACT_HOT_LOADER__.register(YearInput, 'YearInput', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/SelectInput/style.js');
}();

;

/***/ }),
/* 462 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SubmitButton = exports.Submit = exports.CalculatorIcon = exports.CreateButton = exports.YearTitle = exports.YearLabel = exports.Inputs = exports.SourceText = exports.BackIcon = exports.BackButtonContent = exports.BackButton = exports.SubHeaderLeft = exports.SubHeader = exports.Text = exports.Content = exports.InputTextArea = exports.Title = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var lightblue = _css.mixins.opacity('#b8dde1', 50);

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__Root'
})(['width:', ';margin:0 auto;padding-top:150px;padding-bottom:20px;'], function (props) {
  return props.small ? '600px' : '1000px';
});

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__Title'
})(['font-family:', ';font-size:30px;font-weight:bold;text-align:center;padding-bottom:20px;color:#0c2340;'], _css.vars.Gilroy);

var InputTextArea = exports.InputTextArea = _styledComponents2.default.textarea.withConfig({
  displayName: 'CreateBudgetButton__InputTextArea'
})(['font-family:', ';color:', ';font-size:14px;border:1px solid ', ';padding:16px;border-radius:2px;height:auto;font-weight:$light;letter-spacing:0.8px;width:400px;&:hover{border-color:', ';}&:focus{border-color:', ';outline:none;}'], _css.vars.Gilroy, _css.vars.DA_Dairy_blue, _css.vars.a(_css.vars.DA_accent_blue, 30), _css.vars.a(_css.vars.DA_accent_blue, 80), _css.vars.DA_accent_blue);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__Content'
})(['padding:20px;background:white;']);

var Text = exports.Text = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__Text'
})(['font-family:', ';letter-spacing:0.8px;color:#0c2340;padding-top:5px;padding-bottom:20px;border-bottom:1px solid #eeeeed;margin-bottom:20px;text-align:center;'], _css.vars.Gilroy);

var SubHeader = exports.SubHeader = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__SubHeader'
})(['']);

var SubHeaderLeft = exports.SubHeaderLeft = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__SubHeaderLeft'
})(['display:flex;align-items:center;']);

var BackButton = exports.BackButton = _styledComponents2.default.button.withConfig({
  displayName: 'CreateBudgetButton__BackButton'
})(['cursor:pointer;background:white;padding:5px 12px;color:', ';font-weight:500;border:1px solid white;border-radius:22px;font-size:14px;&:hover{border:1px solid ', ';}&:active{background:', ';}'], _css.vars.DA_text, _css.vars.a(_css.vars.DA_text, 20), _css.vars.a(_css.vars.DA_text, 10));
var BackButtonContent = exports.BackButtonContent = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__BackButtonContent'
})(['display:flex;align-items:center;']);

var BackIcon = exports.BackIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_arrow_left' }).withConfig({
  displayName: 'CreateBudgetButton__BackIcon'
})(['', ';margin-right:10px;path{fill:', ';}'], _css.mixins.icon('14px', '14px'), _css.vars.DA_text);

var SourceText = exports.SourceText = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__SourceText'
})(['color:', ';font-size:14px;letter-spacing:0.8px;padding-left:20px;'], _css.vars.DA_text);

var Inputs = exports.Inputs = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__Inputs'
})(['width:400px;margin-top:-20px;']);

var YearLabel = exports.YearLabel = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__YearLabel'
})(['font-weight:700;font-size:12px;letter-spacing:1.1px;text-transform:uppercase;color:', ';padding-top:25px;padding-bottom:5px;'], _css.vars.DA_Dairy_blue);

var YearTitle = exports.YearTitle = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__YearTitle'
})(['width:84px;height:50px;background:white;border:1px solid ', ';font-size:14px;color:', ';display:flex;align-items:center;text-align:center;justify-content:center;letter-spacing:0.8px;'], _css.vars.a(_css.vars.DA_accent_blue, 30), _css.vars.DA_Dairy_blue);

var CreateButton = exports.CreateButton = _styledComponents2.default.button.withConfig({
  displayName: 'CreateBudgetButton__CreateButton'
})(['', ' position:relative;z-index:1;display:flex;align-items:center;padding:10px 20px;padding-left:40px;padding-top:11px;padding-bottom:9px;background:', ';color:#407ec9;border:1px solid #407ec9;border-radius:3px;font-weight:bold;font-size:14px;&:hover{color:#407ec9;}&:active{color:#407ec9;}'], function (props) {
  return props.useFont && '\n    font-family: ' + _css.vars.Gilroy + ';\n  ';
}, lightblue);

var CalculatorIcon = exports.CalculatorIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_calculator' }).withConfig({
  displayName: 'CreateBudgetButton__CalculatorIcon'
})(['', ';margin-right:4px;margin-left:-4px;position:absolute;z-index:1;top:6px;left:10px;'], _css.mixins.icon('30px', '30px'));

var Submit = exports.Submit = _styledComponents2.default.div.withConfig({
  displayName: 'CreateBudgetButton__Submit'
})(['padding-top:20px;display:flex;justify-content:flex-end;']);

var SubmitButton = exports.SubmitButton = _styledComponents2.default.button.withConfig({
  displayName: 'CreateBudgetButton__SubmitButton'
})(['font-family:', ';cursor:pointer;background:', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;border:none;&:hover{background:', ';}&:active{color:white;}'], _css.vars.Gilroy, _css.vars.a(_css.vars.DA_pasture_green, 75), _css.vars.DA_Dairy_blue, _css.vars.DA_accent_green);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(lightblue, 'lightblue', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(InputTextArea, 'InputTextArea', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(Text, 'Text', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(SubHeader, 'SubHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(SubHeaderLeft, 'SubHeaderLeft', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(BackButton, 'BackButton', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(BackButtonContent, 'BackButtonContent', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(BackIcon, 'BackIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(SourceText, 'SourceText', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(Inputs, 'Inputs', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(YearLabel, 'YearLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(YearTitle, 'YearTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(CreateButton, 'CreateButton', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(CalculatorIcon, 'CalculatorIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(Submit, 'Submit', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');

  __REACT_HOT_LOADER__.register(SubmitButton, 'SubmitButton', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/CreateBudgetButton/style.js');
}();

;

/***/ }),
/* 463 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _style = __webpack_require__(964);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _FilterHeader = __webpack_require__(154);

var _FilterHeader2 = _interopRequireDefault(_FilterHeader);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _LoadDetailModal = __webpack_require__(206);

var _LoadDetailModal2 = _interopRequireDefault(_LoadDetailModal);

var _reactRouterDom = __webpack_require__(12);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter__FilteredList = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_activeDataset2.default, 'handleDatasetUpdate')],

  getInitialState: function getInitialState() {
    return {
      loadDatasetPortalOpen: false,
      activeDatasetId: undefined
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleDatasetUpdate();
  },
  handleDatasetUpdate: function handleDatasetUpdate() {
    this.setState({
      activeDatasetId: _activeDataset2.default.id
    });
  },
  toggleLoadDataset: function toggleLoadDataset() {
    this.setState({
      loadDatasetPortalOpen: !this.state.loadDatasetPortalOpen
    });
  },
  render: function render() {
    if (typeof this.state.activeDatasetId === 'undefined' || this.state.activeDatasetId === 1 || this.props.list.length < 1) return null;

    var DatasetList = this.props.listComponent;
    var dataset = _.find(this.props.list, { Id: this.state.activeDatasetId });

    if (typeof dataset === 'undefined') return null;
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.title },
        _react2.default.createElement(
          'h3',
          { className: _style2.default.text },
          'Last Opened:'
        )
      ),
      _react2.default.createElement(
        'button',
        { className: _style2.default.item, onClick: this.toggleLoadDataset },
        dataset.Name,
        _react2.default.createElement(
          _Portal2.default,
          {
            forceZ: true,
            context: document.body,
            isOpen: this.state.loadDatasetPortalOpen,
            className: 'Overlay' },
          _react2.default.createElement(_LoadDetailModal2.default, {
            history: this.props.history,
            toggleMethod: this.toggleLoadDataset,
            dataset: dataset
          })
        )
      )
    );
  }
});

module.exports = (0, _reactRouterDom.withRouter)(Filter__FilteredList);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter__FilteredList, 'Filter__FilteredList', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/components/RecentlyOpen/index.jsx');
}();

;

/***/ }),
/* 464 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = getYearId;
function getYearId(date) {
  var _date = date || new Date();

  var month = _date.getMonth() + 1;
  var year = _date.getFullYear();
  var financialYear = month <= 6 ? year - 1 : year;

  var yearRef = 52; // 2020
  var yearDiff = financialYear - 2020;
  var YearId = yearRef + yearDiff;

  return YearId;
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(getYearId, "getYearId", "C:/_repos_windows/dairybase/Frontend/app/views/_shared/utils/getYearId/index.js");
}();

;
module.exports = exports["default"];

/***/ }),
/* 465 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(966);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getClass: function getClass(className) {
    if (typeof this.props.classes === 'undefined' || typeof this.props.classes[className] === 'undefined') {
      return _style2.default[className];
    }

    return this.props.classes[className];
  },
  render: function render() {
    return _react2.default.createElement(
      'button',
      { className: this.getClass('root'), onClick: this.props.onClick },
      _react2.default.createElement(
        'div',
        { className: this.getClass('content') },
        _react2.default.createElement(_xchIcon2.default, {
          id: 'close',
          classes: {
            icon: this.getClass('icon')
          } }),
        _react2.default.createElement(
          'span',
          { className: this.getClass('text') },
          'close'
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/xch-GenericCloseBtn/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 466 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(968);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (!this.state.isFocused) {
      this.setState({
        value: newProps.value
      });
    }
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.setState({
        isFocused: true,
        value: this.state.value
      }, function () {
        setTimeout(function () {
          var input = _this.my_input;
          input.select();
          input.addEventListener('mousewheel', function (event) {
            event.preventDefault();
          });
        }, 30);
      });
    }
  },
  _handleBlur: function _handleBlur() {
    this.setState({
      isFocused: false
    }, function () {
      this._handleSubmitData();
    });
  },
  _handleChange: function _handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    this.setState({
      isFocused: false,
      value: this.props.value
    });
  },
  _handleSubmitData: function _handleSubmitData() {
    var newValue = this.state.value;

    // validate all the things
    if (typeof newValue === 'undefined' || newValue === null || +newValue === +this.props.value || this.props.disabled) {
      if (!this.state.isFocused) {
        this.setState({
          value: this.props.value
        });
      }
      return;
    }

    // Passed validation? Send data out to smart handler
    this.props.onSubmit(this.props.id, newValue);
  },
  render: function render() {
    var _classnames,
        _this2 = this;

    var classList = (0, _classnames3.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['InputTextArea'], true), _defineProperty(_classnames, _style2.default['not-editable'], this.props.disabled), _defineProperty(_classnames, _style2.default['is-focused'], this.state.isFocused), _classnames));

    return _react2.default.createElement(
      'div',
      { ref: 'my_input_wrapper', className: classList },
      _react2.default.createElement('textarea', {
        ref: function ref(_ref) {
          return _this2.my_input = _ref;
        },
        rows: this.props.rows,
        className: _style2.default['_input'],
        value: this.state.value,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown,
        wrap: 'off'
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/_shared/xch-TextArea/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 467 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _FilterControls = __webpack_require__(107);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterController = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleFilterUpdate')],

  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    this.setState({
      filter: _datasetListFilter2.default.store
    });
  },
  _updateColumnFilter: function _updateColumnFilter(column) {
    var isReversed = column === this.state.filter.orderBy ? !this.state.filter.reversed : false;

    _Actions2.default.UPDATE_FILTERED_LIST({
      searchTerm: null,
      orderBy: column,
      reversed: isReversed,
      group: null
    });
  },


  renderChildren: function renderChildren() {
    var _this = this;

    return _react2.default.Children.map(this.props.children, function (child) {
      return _react2.default.cloneElement(child, {
        filter: _this.state.filter,
        updateColumnFilter: _this._updateColumnFilter
      });
    });
  },

  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'filterController' },
      this.renderChildren()
    );
  }

});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterController, 'FilterController', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_FilterController/index.jsx');
}();

;

/***/ }),
/* 468 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1025);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TableColSelect = module.exports = __webpack_require__(1)({
  _handleSubmitData: function _handleSubmitData(newValue) {
    // passed validation? Set the new data in store:
    _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      "Table": this.props.data.Table,
      "Element": this.props.data.FieldId,
      "Value": newValue
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'TableColSelect' },
      _react2.default.createElement(_InputSelect2.default, {
        id: this.props.data.FieldId,
        value: this.props.data.Value,
        options: this.props.data.Options,
        onSubmit: this._handleSubmitData,
        disabled: false })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TableColSelect, 'TableColSelect', 'C:/_repos_windows/dairybase/Frontend/app/views/atomWrappers/_TableColSelect/index.jsx');
}();

;

/***/ }),
/* 469 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _style = __webpack_require__(969);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ActualIcon = __webpack_require__(271);

var _ActualIcon2 = _interopRequireDefault(_ActualIcon);

var _EditableIcon = __webpack_require__(272);

var _EditableIcon2 = _interopRequireDefault(_EditableIcon);

var _xchCheckBox = __webpack_require__(125);

var _xchCheckBox2 = _interopRequireDefault(_xchCheckBox);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var DatasetList__Item = module.exports = __webpack_require__(1)({
  _onClick: function _onClick(dataset) {
    this.props.emitItemClick(dataset);
  },
  render: function render() {
    var _this = this;

    var _dataset = this.props.dataset;

    var _props = this.props,
        Budgets = _props.Budgets,
        showBudgets = _props.showBudgets;


    if (_dataset._isOrphan && !showBudgets) return null;

    return _react2.default.createElement(
      'div',
      null,
      this.renderItem(_dataset),
      showBudgets && Budgets && Budgets.map(function (budget) {
        return _this.renderItem(budget);
      })
    );
  },
  renderItem: function renderItem(dataset) {
    var _classnames,
        _this2 = this;

    var selected = this.props.checkIfSelected(dataset);

    var DatasetList__item = (0, _classnames3.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['DatasetList__item'], true), _defineProperty(_classnames, _style2.default['is-selected'], selected), _defineProperty(_classnames, _style2.default['is-budget'], dataset.IsCcModel), _defineProperty(_classnames, _style2.default['is-orphan'], dataset._isOrphan), _classnames));

    var LabelStyle = {
      width: dataset.IsCcModel && !dataset._isOrphan ? '440px' : '460px'
    };

    return _react2.default.createElement(
      'div',
      { className: DatasetList__item, key: dataset.Id },
      _react2.default.createElement(
        _react2.default.Fragment,
        null,
        dataset.IsCcModel && !dataset._isOrphan && _react2.default.createElement('div', { className: _style2.default['budget-border-box'] }),
        _react2.default.createElement(
          'button',
          {
            className: _style2.default['_button'],
            onClick: function onClick() {
              return _this2._onClick(dataset);
            } },
          _react2.default.createElement(
            'div',
            { className: _style2.default['_content'] },
            !this.props.hasCheckbox ? null : _react2.default.createElement(
              'div',
              { className: _style2.default['DatasetList__checkbox'] },
              _react2.default.createElement(_xchCheckBox2.default, { value: selected, onSubmit: function onSubmit() {} })
            ),
            _react2.default.createElement(
              'div',
              {
                style: LabelStyle,
                className: _style2.default['DatasetList__column'] + ' ' + _style2.default['first_child'] },
              dataset.Name
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default['DatasetList__column'] },
              dataset.DairyBaseId
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default['DatasetList__column'] },
              dataset.FinancialYear
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default['DatasetList__column'] },
              _react2.default.createElement(_ActualIcon2.default, {
                value: dataset.IsActual,
                classes: {
                  icon: _style2.default['_icon']
                }
              })
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default['DatasetList__column'] },
              _react2.default.createElement(_EditableIcon2.default, {
                value: dataset.EditAuthority,
                classes: {
                  icon: _style2.default['_icon']
                }
              })
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default['DatasetList__column'] },
              _react2.default.createElement(
                'span',
                { title: dataset.OwnerName, className: '_owner' },
                dataset.OwnerName
              )
            )
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DatasetList__Item, 'DatasetList__Item', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_DatasetList/_Item/index.js');
}();

;

/***/ }),
/* 470 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1034);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var RadioList = module.exports = __webpack_require__(1)({
  _handleSubmitData: function _handleSubmitData(evt) {
    if (this.props.disabled) return;

    var newValue = +evt.currentTarget.id;
    if (newValue !== this.props.value) {
      this.props.onSubmit(newValue, this.props.id);
    }
  },
  _renderOptions: function _renderOptions() {
    var _this = this;

    var list = _.sortBy(this.props.options, 'Id');
    var options = list.map(function (option, index) {

      var optionClasses = (0, _classnames2.default)({
        "RadioList__item": true,
        "is-selected": _this.props.value === option.Id
      });

      return _react2.default.createElement(
        'button',
        {
          key: index,
          id: option.Id,
          className: optionClasses,
          onClick: _this._handleSubmitData },
        _react2.default.createElement(
          'div',
          { className: '_box' },
          _react2.default.createElement('div', { className: '_check' })
        ),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          option.Title
        )
      );
    });

    return options;
  },
  render: function render() {

    var classList = (0, _classnames2.default)({
      "RadioList": true,
      "is-disabled": this.props.disabled
    });

    return _react2.default.createElement(
      'div',
      { className: classList },
      this._renderOptions()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RadioList, 'RadioList', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_RadioList/index.jsx');
}();

;

/***/ }),
/* 471 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1035);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var RadioSwitch = module.exports = __webpack_require__(1)({
  _handleSubmitData: function _handleSubmitData(evt) {
    if (this.props.disabled) return;

    var newValue = +evt.currentTarget.id;
    if (newValue !== this.props.value) {
      this.props.onSubmit(newValue, this.props.id);
    }
  },
  _renderOptions: function _renderOptions() {
    var _this = this;

    var list = _.sortBy(this.props.options, 'Id');
    var options = list.map(function (option, index) {

      var optionClasses = (0, _classnames2.default)({
        "_option": true,
        "is-selected": _this.props.value === option.Id
      });

      return _react2.default.createElement(
        'button',
        {
          key: index,
          id: option.Id,
          className: optionClasses,
          onClick: _this._handleSubmitData },
        _react2.default.createElement(
          'span',
          { className: '_text' },
          option.Title
        )
      );
    });

    return options;
  },
  render: function render() {

    var classList = (0, _classnames2.default)({
      "RadioSwitch": true,
      "is-disabled": this.props.disabled
    });

    return _react2.default.createElement(
      'div',
      { className: classList },
      _react2.default.createElement(
        'div',
        { className: '_field' },
        this._renderOptions()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RadioSwitch, 'RadioSwitch', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_RadioSwitch/index.jsx');
}();

;

/***/ }),
/* 472 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1037);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _TextInput = __webpack_require__(152);

var _TextInput2 = _interopRequireDefault(_TextInput);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SwitchableTextInput = module.exports = __webpack_require__(1)({
  render: function render() {
    return this.props.editable ? _react2.default.createElement(_TextInput2.default, {
      id: this.props.id,
      value: this.props.value,
      onSubmit: this.props.onSubmit,
      disabled: this.props.disabled }) : _react2.default.createElement(
      'span',
      null,
      this.props.value
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SwitchableTextInput, 'SwitchableTextInput', 'C:/_repos_windows/dairybase/Frontend/app/views/atoms/_SwitchableTextInput/index.jsx');
}();

;

/***/ }),
/* 473 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(971);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchGenericCloseBtn = __webpack_require__(465);

var _xchGenericCloseBtn2 = _interopRequireDefault(_xchGenericCloseBtn);

var _NotesEditor = __webpack_require__(270);

var _NotesEditor2 = _interopRequireDefault(_NotesEditor);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _GET__logout = __webpack_require__(410);

var _GET__logout2 = _interopRequireDefault(_GET__logout);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _RequestPortal = __webpack_require__(156);

var _RequestPortal2 = _interopRequireDefault(_RequestPortal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'UserPreference',
    fields: {
      'UserNotes': {
        Value: ''
      }
    }
  }])],

  getInitialState: function getInitialState() {
    return {
      editing: false,
      notesRequestOpen: false,
      newNotes: '',
      logoutError: false,
      logoutPending: false
    };
  },
  _handleLogout: function _handleLogout() {
    var _this = this;

    this.setState({
      logoutError: false,
      logoutPending: true
    }, function () {
      return (0, _GET__logout2.default)(function () {
        _this.setState({
          logoutError: true,
          logoutPending: false
        });
      });
    });
  },
  handleSaveChanges: function handleSaveChanges(value) {
    this.setState({
      newNotes: value
    }, this.toggleNotesRequest);
  },
  handleEditSuccess: function handleEditSuccess() {
    _Actions2.default.UPDATE_USER_PREFERENCE('UserNotes', this.state.newNotes);
    this.toggleNotesRequest();
    this.handleEditingToggle();
  },
  toggleNotesRequest: function toggleNotesRequest() {
    this.setState({
      notesRequestOpen: !this.state.notesRequestOpen
    });
  },
  handleEditingToggle: function handleEditingToggle() {
    this.setState({
      editing: !this.state.editing
    });
  },
  handleCloseModal: function handleCloseModal() {
    // if(this.state.editing) return; // some signal that the user needs to save...
    this.props.onToggle();
  },
  renderLoginText: function renderLoginText() {
    if (this.state.logoutError) return 'Try again';
    if (this.state.logoutPending) return 'Logging out...';
    return 'Logout of DairyBase';
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement('div', { className: _style2.default.background, onClick: this.handleCloseModal }),
      _react2.default.createElement(
        'div',
        { className: _style2.default.container },
        _react2.default.createElement(
          'div',
          { className: _style2.default.mainCol },
          _react2.default.createElement(_xchGenericCloseBtn2.default, { onClick: this.handleCloseModal }),
          _react2.default.createElement(
            'h2',
            { className: _style2.default.subtitle },
            'User Account Area'
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.heading },
            _react2.default.createElement(
              'h3',
              { className: _style2.default.title },
              this.props.userName
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default.logout },
              _react2.default.createElement(
                'span',
                { className: _style2.default.logoutError },
                this.state.logoutError ? 'Error logging out' : null
              ),
              _react2.default.createElement(
                'button',
                {
                  className: _style2.default.logout_button,
                  onClick: this._handleLogout },
                this.renderLoginText()
              )
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.notesCol },
          _react2.default.createElement(
            'h2',
            { className: _style2.default.subtitle },
            'General Notes'
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.notesContent },
            _react2.default.createElement(_NotesEditor2.default, {
              onSaveChanges: this.handleSaveChanges,
              onToggleEditing: this.handleEditingToggle,
              editAuthority: true,
              editing: this.state.editing,
              notes: this.state.UserNotes.Value }),
            _react2.default.createElement(_RequestPortal2.default, {
              isOpen: this.state.notesRequestOpen,
              successHandler: this.handleEditSuccess,
              failHandler: this.toggleNotesRequest,
              request: _POST__editData2.default,
              data: {
                Table: 'UserPreference',
                Data: [{
                  Fields: {
                    UserNotes: this.state.newNotes
                  }
                }]
              },
              pendingText: {
                title: 'Please wait',
                text: 'Saving changes to your notes...'
              },
              successText: {
                title: 'Success!',
                text: 'Your notes were updated.'
              },
              failText: {
                title: 'Oops, something went wrong.',
                text: 'Your notes could not be edited'
              } })
          )
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Banner/UserSettings/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 474 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1041);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _DatasetDetail = __webpack_require__(278);

var _DatasetDetail2 = _interopRequireDefault(_DatasetDetail);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {

    return _react2.default.createElement(
      'div',
      { className: 'DetailModal' },
      _react2.default.createElement('div', { className: '_background', onClick: this.props.toggle }),
      _react2.default.createElement(
        'div',
        { className: 'DetailModal__content' },
        _react2.default.createElement(
          'div',
          { className: '_arrow' },
          _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'curvedtriangle' })
        ),
        _react2.default.createElement(_DatasetDetail2.default, { dataset: this.props.dataset })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 475 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1042);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _velocityAnimate = __webpack_require__(186);

var _velocityAnimate2 = _interopRequireDefault(_velocityAnimate);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _POST__saveActiveDataset = __webpack_require__(121);

var _POST__saveActiveDataset2 = _interopRequireDefault(_POST__saveActiveDataset);

var _ModalBoxTemplate = __webpack_require__(699);

var _ModalBoxTemplate2 = _interopRequireDefault(_ModalBoxTemplate);

var _AlertModal = __webpack_require__(504);

var _AlertModal2 = _interopRequireDefault(_AlertModal);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _UserSettings = __webpack_require__(473);

var _UserSettings2 = _interopRequireDefault(_UserSettings);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _DetailModal = __webpack_require__(474);

var _DetailModal2 = _interopRequireDefault(_DetailModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  mixins: [_reflux2.default.listenTo(_activeDataset2.default, '_handleDatasetUpdate'), _reflux2.default.listenTo(_datasetList2.default, '_handleDatasetUpdate'), _reflux2.default.listenTo(_user2.default, '_handleUserSessionUpdate')],

  isActive: function isActive(path, index) {
    var pathArr = this.props.location.pathname.split('/');
    return pathArr[index] === path;
  },
  getInitialState: function getInitialState() {
    return {
      backToBudgetId: undefined,
      dataset: undefined,
      dataSetSaved: true,
      datasetEditable: true,
      datasetCopyable: true,
      title: 'Fetching Dataset...',
      userName: '...',
      farm: '...',
      year: '...',
      physical: true,
      financial: false,
      userPortalOpen: false,
      datasetDetailOpen: false,
      saveRequestPortalOpen: false,
      exitModalOpen: false,
      createPortalOpen: false,
      helpPortalOpen: false,
      emailPortalOpen: false
    };
  },
  componentDidMount: function componentDidMount() {
    this.handleBackState(this.props);
    this._handleUserSessionUpdate();
  },
  componentDidUpdate: function componentDidUpdate(yourdog) {
    this.handleBackState(this.props);
  },
  handleBackState: function handleBackState(newProps) {
    var _routeState = newProps.location.state || {};
    if (_routeState.backToBudgetId && !this.state.backToBudgetId) {
      this.setState({
        backToBudgetId: _routeState.backToBudgetId
      });
    }
  },
  _handleDatasetUpdate: function _handleDatasetUpdate() {
    if (_datasetList2.default.store.length >= 1) {
      var activeDatasetDetail = _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id }) || {};
      this.setState({
        title: activeDatasetDetail.Name,
        farm: activeDatasetDetail.DairyBaseId,
        year: activeDatasetDetail.FinancialYear,
        datasetStatus: _activeDataset2.default.store.status,
        dataSetSaved: _activeDataset2.default.DataSetSaved,
        dataset: activeDatasetDetail,
        id: activeDatasetDetail.Id,
        datasetEditable: activeDatasetDetail.EditAuthority,
        datasetCopyable: activeDatasetDetail.CopyAuthority
      });
    }
  },


  // TODO: Should this info really be updated on session... or dataset load?
  _handleUserSessionUpdate: function _handleUserSessionUpdate() {
    this.setState({
      userName: _user2.default.name
    });
  },
  _handleSaveDatasetSuccess: function _handleSaveDatasetSuccess() {
    this._toggleSaveRequestPortal();
    this._toggleExitModal();
    this.props.history.push('/');
  },
  _handleContinue: function _handleContinue() {
    var _this = this;

    _Actions2.default.DISCARD_DATASET_CHANGES(function () {
      _this._toggleExitModal();
      _this.props.history.push('/');
    });
  },
  _handleCopyDataset: function _handleCopyDataset() {
    this._toggleCreatePortal();
  },
  _handleDatasetCopySuccess: function _handleDatasetCopySuccess() {
    this._toggleCreatePortal();
    this._toggleExitModal();
  },
  _handleBack: function _handleBack() {
    if (this.isActive('comparison', 2) || this.isActive('bulk-comparison', 2) || this.isActive('single', 2) || this.isActive('farm-size', 2) || this.isActive('dfmp-farm-client-report', 2) || this.isActive('farm-history', 2)) return this.props.history.push('/reports');
    if (this.isActive('reports', 1)) return this._handleExitReports();
    this.props.history.push('/');
  },
  _handleExitReports: function _handleExitReports() {
    if (!this.state.dataSetSaved) {
      this.props.history.push('/editor');
    } else {
      this.props.history.push('/');
    }
  },
  handleUserToggle: function handleUserToggle() {
    this.setState({
      userPortalOpen: !this.state.userPortalOpen
    });
  },
  _handleEmailToggle: function _handleEmailToggle() {
    this.setState({
      emailPortalOpen: !this.state.emailPortalOpen
    });
  },
  _handleHelpToggle: function _handleHelpToggle() {
    this.setState({
      helpPortalOpen: !this.state.helpPortalOpen
    });
  },
  _handleToggleDetail: function _handleToggleDetail() {
    this.setState({
      datasetDetailOpen: !this.state.datasetDetailOpen
    });
  },
  _toggleSaveRequestPortal: function _toggleSaveRequestPortal() {
    this.setState({
      saveRequestPortalOpen: !this.state.saveRequestPortalOpen
    });
  },
  _toggleCreatePortal: function _toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  _toggleExitModal: function _toggleExitModal() {
    this.setState({
      exitModalOpen: !this.state.exitModalOpen
    });
  },
  render: function render() {
    var isHidden = this.props.location.pathname.split('/')[1] === 'budget';
    if (isHidden) return null;
    return _react2.default.createElement(
      'div',
      { className: 'Banner', style: { paddingRight: (0, _getScrollbarWidth2.default)() } },
      _react2.default.createElement(
        'div',
        { className: '_innerContainer' },
        this._renderBackButton(),
        _react2.default.createElement(
          'div',
          { className: 'Banner__menu' },
          _react2.default.createElement(
            'a',
            {
              className: 'Banner__webBtn',
              target: '_blank',
              href: 'http://www.dairybase.com.au' },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'globe' }),
              _react2.default.createElement(
                'span',
                { className: '_text' },
                'dairybase.com.au'
              )
            )
          ),
          _react2.default.createElement('span', { className: '_divider' }),
          _react2.default.createElement(
            'button',
            {
              ref: 'btn',
              className: 'Banner__helpBtn',
              onClick: this._handleHelpToggle },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'help' })
            )
          ),
          _react2.default.createElement('span', { className: '_divider' }),
          _react2.default.createElement(
            'button',
            {
              ref: 'btn',
              className: 'Banner__feedbackBtn',
              onClick: this._handleEmailToggle },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'mail' })
            )
          ),
          _react2.default.createElement('span', { className: '_divider' }),
          _react2.default.createElement(
            'button',
            {
              ref: 'btn',
              className: 'Banner__userBtn',
              onClick: this.handleUserToggle },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'user' }),
              _react2.default.createElement(
                'span',
                { className: '_text' },
                this.state.userName
              )
            )
          )
        ),
        this._renderTitle(),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.userPortalOpen,
            className: 'UserSettingsPortal' },
          _react2.default.createElement(_UserSettings2.default, {
            userName: this.state.userName,
            onToggle: this.handleUserToggle
          })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.helpPortalOpen,
            className: 'Overlay--help' },
          _react2.default.createElement(
            _HelpModal2.default,
            { closePortal: this._handleHelpToggle },
            _react2.default.createElement(_HelpText2.default, { id: 'BannerHelp', className: 'HelpModal__text' })
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.emailPortalOpen,
            className: 'Overlay--help' },
          _react2.default.createElement(
            _HelpModal2.default,
            { closePortal: this._handleEmailToggle },
            _react2.default.createElement(
              'div',
              {
                style: { padding: '60px', width: '500px', margin: '0 auto' } },
              _react2.default.createElement(
                'h2',
                { style: { fontWeight: 'bold', paddingBottom: '10px' } },
                'Contact the DairyBase team'
              ),
              _react2.default.createElement(
                'p',
                { style: { fontSize: '14px' } },
                'For all enquiries about DairyBase, ',
                _react2.default.createElement('br', null),
                'please call',
                ' ',
                _react2.default.createElement(
                  'span',
                  {
                    style: {
                      backgroundColor: 'rgba(0,103,184,0.2)',
                      display: 'inline-block',
                      padding: '2px 6px',
                      borderRadius: '3px'
                    } },
                  '1800 548 073'
                ),
                ' ',
                _react2.default.createElement('br', null),
                'during business hours, or email us at',
                ' ',
                _react2.default.createElement(
                  'a',
                  {
                    target: '_blank',
                    href: 'mailto:dairybasesupport@dairyaustralia.com.au?subject=DairyBase email enquiry' },
                  'dairybasesupport@dairyaustralia.com.au'
                )
              )
            )
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.datasetDetailOpen,
            className: 'Overlay' },
          _react2.default.createElement(_DetailModal2.default, {
            dataset: this.state.dataset,
            toggle: this._handleToggleDetail
          })
        ),
        _react2.default.createElement(
          _Portal2.default,
          { context: document.body, isOpen: this.state.exitModalOpen },
          _react2.default.createElement(
            _ModalBoxTemplate2.default,
            { toggleModal: this._toggleExitModal },
            _react2.default.createElement(_AlertModal2.default, {
              emitSaveDataset: this._toggleSaveRequestPortal,
              emitSaveCopy: this._handleCopyDataset,
              emitExitWithoutSave: this._handleContinue
            })
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.saveRequestPortalOpen },
          _react2.default.createElement(_RequestModal2.default, {
            successHandler: this._handleSaveDatasetSuccess,
            failHandler: this._toggleSaveRequestPortal,
            request: _POST__saveActiveDataset2.default,
            data: {
              Overwrite: false
            },
            pendingText: {
              title: 'Please wait',
              text: 'Saving dataset...'
            },
            successText: {
              title: 'Success!',
              text: 'Dataset was saved.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'The dataset could not be saved.'
            }
          })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.createPortalOpen,
            className: 'Overlay' },
          _react2.default.createElement(
            'div',
            { className: '_modalBox' },
            _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleCreatePortal }),
            _react2.default.createElement(_CreateDatasetModal2.default, {
              callback: this._handleDatasetCopySuccess,
              useActive: true,
              prefillDataset: this.state.Id,
              prefillFarm: this.state.farm,
              prefillYear: this.state.year
            })
          )
        )
      )
    );
  },
  _renderTitle: function _renderTitle() {
    if (this.isActive('editor', 1)) {
      return _react2.default.createElement(
        'h1',
        {
          ref: 'title',
          className: 'Banner__title',
          onClick: this._handleToggleDetail },
        _react2.default.createElement(
          'span',
          { className: '_text' },
          this.state.title,
          this.state.datasetEditable ? _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'edit' }) : _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'lock' })
        )
      );
    }
  },
  _renderBackButton: function _renderBackButton() {
    // TODO: maybe a better flow for this (more give less if)


    if (this.isActive('comparison', 2) || this.isActive('bulk-comparison', 2) || this.isActive('single', 2) || this.isActive('farm-size', 2) || this.isActive('dfmp-farm-client-report', 2) || this.isActive('farm-history', 2)) {
      return _react2.default.createElement(
        'button',
        { className: 'Banner__backBtn', onClick: this._handleBack },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'back' }),
          _react2.default.createElement(
            'span',
            { className: '_text' },
            'Select Report'
          )
        )
      );
    }

    if (this.isActive('reports', 1)) {

      if (this.state.backToBudgetId) {
        return this.renderBudgetBack();
      }

      if (!this.state.dataSetSaved) {
        return _react2.default.createElement(
          'button',
          { className: 'Banner__backBtn', onClick: this._handleBack },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'back' }),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Editor'
            )
          )
        );
      } else {
        return this.renderListBack();
      }
    }

    if (this.isActive('editor', 1)) {
      if (this.state.backToBudgetId) {
        return this.renderBudgetBack();
      }

      return this.renderListBack();
    }

    if (this.isActive('industry-authority', 1)) {
      return this.renderListBack();
    }
  },
  renderListBack: function renderListBack() {
    return _react2.default.createElement(
      'button',
      { className: 'Banner__backBtn', onClick: this._handleBack },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'back' }),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Dataset list'
        )
      )
    );
  },
  renderBudgetBack: function renderBudgetBack() {
    var _this2 = this;

    return _react2.default.createElement(
      'button',
      { className: 'Banner__backBtn', onClick: function onClick() {
          _this2.setState({ backToBudgetId: undefined });
          _this2.props.history.push('/budget/' + _this2.state.backToBudgetId);
        } },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'back' }),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Budget'
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 476 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _style = __webpack_require__(972);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _NotesEditor = __webpack_require__(270);

var _NotesEditor2 = _interopRequireDefault(_NotesEditor);

var _POST__editDataSetDetail = __webpack_require__(191);

var _POST__editDataSetDetail2 = _interopRequireDefault(_POST__editDataSetDetail);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DatasetDetail = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      editing: false,
      requestPortalOpen: false,
      newNotes: ''
    };
  },
  handleSaveChanges: function handleSaveChanges(value) {
    this.setState({
      newNotes: value
    }, this._toggleEditRequest);
  },
  _toggleEditRequest: function _toggleEditRequest() {
    this.setState({
      requestPortalOpen: !this.state.requestPortalOpen
    });
  },
  _handleEditSuccess: function _handleEditSuccess() {
    this._toggleEditRequest();
    this.handleEditingToggle();
  },
  handleEditingToggle: function handleEditingToggle() {
    this.setState({
      editing: !this.state.editing
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'h2',
        { className: _style2.default.title },
        'Notes for ',
        this.props.Name
      ),
      _react2.default.createElement(_NotesEditor2.default, {
        onSaveChanges: this.handleSaveChanges,
        onToggleEditing: this.handleEditingToggle,
        editAuthority: this.props.editDetailAuthority,
        editing: this.state.editing,
        notes: this.props.notes }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.requestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleEditSuccess,
          failHandler: this._toggleEditRequest,
          request: _POST__editDataSetDetail2.default,
          data: {
            DataSetNotes: this.state.newNotes,
            FarmDataSetId: this.props.FarmDataSetId,
            Name: this.props.Name,
            Description: this.props.Description,
            DairyBaseId: this.props.DairyBaseId,
            FinancialYearId: this.props.FinancialYearId,
            IsActual: this.props.IsActual,
            PrivacySettingId: this.props.PrivacySettingId
          },
          pendingText: {
            title: 'Please wait',
            text: 'Saving new dataset notes.'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset notes were updated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Your notes could not be saved.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DatasetDetail, 'DatasetDetail', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_DatasetDetail/Notes/index.js');
}();

;

/***/ }),
/* 477 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _TextArea = __webpack_require__(277);

var _TextArea2 = _interopRequireDefault(_TextArea);

var _TextInput = __webpack_require__(152);

var _TextInput2 = _interopRequireDefault(_TextInput);

var _Boolean = __webpack_require__(274);

var _Boolean2 = _interopRequireDefault(_Boolean);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _checkFarmAuth2 = __webpack_require__(148);

var _checkFarmAuth3 = _interopRequireDefault(_checkFarmAuth2);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var EditForm = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DatasetDetail__editForm' },
      _react2.default.createElement(
        'div',
        { className: 'DatasetDetail__field' },
        _react2.default.createElement(
          'h3',
          { className: '_label' },
          'Dataset Name'
        ),
        _react2.default.createElement(_TextInput2.default, {
          id: 'Name',
          value: this.props.Name,
          onSubmit: this.props.updateField })
      ),
      _react2.default.createElement(
        'div',
        { className: 'DatasetDetail__field' },
        _react2.default.createElement(
          'h3',
          { className: '_label' },
          'Description'
        ),
        _react2.default.createElement(_TextArea2.default, {
          id: 'Description',
          value: this.props.Description,
          onSubmit: this.props.updateField
        })
      ),
      _react2.default.createElement(
        'div',
        { className: 'DatasetDetail__fieldRow' },
        _react2.default.createElement(
          'div',
          { style: { paddingRight: '20px', width: '295px' } },
          this._renderDairyBaseId()
        ),
        _react2.default.createElement(
          'div',
          { className: 'DatasetDetail__field', style: { paddingRight: '10px' } },
          _react2.default.createElement(
            'h3',
            { className: '_label' },
            'Financial Year'
          ),
          _react2.default.createElement(_InputSelect2.default, {
            id: 'FinancialYearId',
            value: this.props.FinancialYearId,
            onSubmit: this.props.updateField,
            disabled: !this.props.editAuthority,
            options: _dataDefinition2.default.selectOptions.FinancialYearId })
        ),
        _react2.default.createElement(
          'div',
          { className: 'DatasetDetail__field is-switch' },
          _react2.default.createElement(_Boolean2.default, {
            id: 'IsActual',
            label: 'Actual Data?',
            value: this.props.IsActual,
            onSubmit: this.props.updateField })
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'DatasetDetail__fieldRow' },
        _react2.default.createElement(
          'div',
          { style: { paddingRight: '5px', width: '220px' } },
          _react2.default.createElement(
            'div',
            { className: 'DatasetDetail__field' },
            _react2.default.createElement(
              'h3',
              { className: '_label', style: { paddingBottom: '7px' } },
              'Region'
            ),
            _react2.default.createElement(_InputSelect2.default, {
              id: 'RegionId',
              value: this.props.RegionId,
              onSubmit: this.props.updateField,
              options: this.props.regionList })
          )
        ),
        _react2.default.createElement(
          'div',
          { style: { paddingLeft: '12px', width: '200px' } },
          _react2.default.createElement(
            'div',
            { className: 'DatasetDetail__field' },
            _react2.default.createElement(
              'h3',
              { className: '_label' },
              'Privacy Setting',
              _react2.default.createElement(_GenericHelpBtn2.default, { offsetLeft: -80, offsetTop: -4, onClick: this._toggleHelpPortal.bind(this, 'PrivacyHelp') })
            ),
            _react2.default.createElement(
              _Portal2.default,
              {
                context: document.body,
                isOpen: this.state.helpPortalsOpen['PrivacyHelp'],
                className: 'Overlay--help' },
              _react2.default.createElement(
                _HelpModal2.default,
                {
                  closePortal: this._toggleHelpPortal.bind(this, 'PrivacyHelp') },
                _react2.default.createElement(_HelpText2.default, { id: 'PrivacyHelp', className: 'HelpModal__text' })
              )
            ),
            _react2.default.createElement(_InputSelect2.default, {
              id: 'PrivacySettingId',
              value: this.props.PrivacySettingId,
              onSubmit: this.props.updateField,
              options: _dataDefinition2.default.selectOptions.PrivacySettingId })
          )
        )
      ),
      _react2.default.createElement(
        'button',
        {
          className: 'DatasetDetail__submitBtn',
          onClick: this.props.submitDetails },
        'Save Detail'
      )
    );
  },
  _renderDairyBaseId: function _renderDairyBaseId() {
    var FarmId = _.find(_dataDefinition2.default.selectOptions.FarmId, { Title: this.props.DairyBaseId });
    var FarmAuthObject = _.find(_dataDefinition2.default.farmList, { DairyBaseId: this.props.DairyBaseId }).CreateAuthority;

    if (typeof FarmId === 'undefined' || !FarmAuthObject) {
      return _react2.default.createElement(
        'div',
        { className: 'DatasetDetail__field' },
        _react2.default.createElement(
          'h3',
          { className: '_label' },
          'Farm Id'
        ),
        _react2.default.createElement(
          'span',
          { className: '_farmId' },
          this.props.DairyBaseId
        )
      );
    }

    var options = _dataDefinition2.default.selectOptions.FarmId.filter(function (item, index) {

      return _.find(_dataDefinition2.default.farmList, { DairyBaseId: item.Title }).CreateAuthority;
    });

    var da0001 = _.find(options, { Title: 'DA0001' });

    if (da0001) {
      options = options.filter(function (farm) {
        return farm.Title !== 'DA0001';
      }).concat([da0001]);
    }

    var sortedOptions = options.map(function (option, index) {
      return _extends({}, option, {
        Order: index + 1
      });
    });

    return _react2.default.createElement(
      'div',
      { className: 'DatasetDetail__field' },
      _react2.default.createElement(
        'h3',
        { className: '_label' },
        'Farm Id'
      ),
      _react2.default.createElement(_InputSelect2.default, {
        id: 'DairyBaseId',
        value: FarmId.Id,
        onSubmit: this.props.updateField,
        options: sortedOptions })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(EditForm, 'EditForm', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_DatasetDetail/_editForm/index.jsx');
}();

;

/***/ }),
/* 478 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GroupModal = __webpack_require__(284);

var _GroupModal2 = _interopRequireDefault(_GroupModal);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Col = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      groupPortalOpen: false
    };
  },
  _openGroupPortal: function _openGroupPortal() {
    this.setState({
      groupPortalOpen: true,
      coords: (0, _getDomCoords3.default)(this.myBtn, true)
    });
  },
  _toggleGroupPortal: function _toggleGroupPortal() {
    this.setState({
      groupPortalOpen: !this.state.groupPortalOpen
    });
  },
  render: function render() {
    var _this = this;

    var ModalHandler = this.props.colData.handler;
    return _react2.default.createElement(
      'button',
      {
        ref: function ref(_ref) {
          return _this.myBtn = _ref;
        },
        onClick: this._openGroupPortal,
        className: 'DatasetList__column' },
      this.props.colData.title,
      _react2.default.createElement(
        _Portal2.default,
        { context: document.body, isOpen: this.state.groupPortalOpen },
        _react2.default.createElement(
          _GroupModal2.default,
          {
            coords: this.state.coords,
            closePortal: this._toggleGroupPortal,
            arrowRight: this.props.colData.id === 'OwnerName',
            leftOffset: this.props.colData.id === 'OwnerName' ? 130 : 0 },
          _react2.default.createElement(ModalHandler, null)
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Col, 'Col', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilterControls/_Col/index.jsx');
}();

;

/***/ }),
/* 479 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = [{
  title: "Farm ID",
  id: "DairyBaseId",
  handler: __webpack_require__(281)
}, {
  title: "Year",
  id: "FinancialYear",
  handler: __webpack_require__(283)
}, {
  title: "Actual",
  id: "IsActual",
  handler: __webpack_require__(279)
}, {
  title: "Editable",
  id: "EditAuthority",
  handler: __webpack_require__(280)
}, {
  title: "User",
  id: "OwnerName",
  handler: __webpack_require__(282)
}];
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 480 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _Item = __webpack_require__(1)({
  _onClick: function _onClick() {
    _Actions2.default.UPDATE_DATASETLIST_FILTER(this.props.filter, this.props.id);
  },
  render: function render() {
    return _react2.default.createElement(
      'button',
      { className: 'FilterHeader__Item', onClick: this._onClick },
      this.props.title
    );
  }
});

module.exports = _Item;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_Item, '_Item', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilterHeader/_Item/index.jsx');
}();

;

/***/ }),
/* 481 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1047);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _ConfirmationModal = __webpack_require__(109);

var _ConfirmationModal2 = _interopRequireDefault(_ConfirmationModal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__deleteGroup = __webpack_require__(260);

var _POST__deleteGroup2 = _interopRequireDefault(_POST__deleteGroup);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterList__Item = module.exports = __webpack_require__(1)({
  _onClick: function _onClick() {
    this.props.emitItemClicked(this.props.item.id);
  },
  render: function render() {
    var FilterList__Item = (0, _classnames2.default)({
      'FilterList__Item': true,
      'is-active': this.props.item.active
    });
    return _react2.default.createElement(
      'div',
      { className: '_item' },
      _react2.default.createElement(
        'div',
        { className: FilterList__Item },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._onClick },
          _react2.default.createElement(
            'span',
            { className: '_text' },
            this.props.item.title
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterList__Item, 'FilterList__Item', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilterList/_Item/index.jsx');
}();

;

/***/ }),
/* 482 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1049);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _FilterHeader = __webpack_require__(154);

var _FilterHeader2 = _interopRequireDefault(_FilterHeader);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter__FilteredList = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, "_handleNewFilter"), _reflux2.default.listenTo(_datasetGroups2.default, "_handleNewFilter")],

  getInitialState: function getInitialState() {
    return {
      filter: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      filter: _datasetListFilter2.default.store,
      filtering: _datasetListFilter2.default.filtering
    });
  },
  _getFilteredList: function _getFilteredList() {
    var _this = this;

    // nothing filtered so return an empty list
    if (!this.state.filtering) return [];
    return this.props.list.filter(function (item, index) {
      // includes anything from the filter
      return _.includes((0, _checkItemInFilter2.default)(item, _this.state.filter), true);
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Filter__FilteredList is-in-filter' },
      _react2.default.createElement(_FilterHeader2.default, null),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(_DatasetList2.default, {
          list: this._getFilteredList(),
          emitItemClick: this.props.emitItemClick,
          selectedList: this.props.selectedList,
          hasCheckbox: this.props.hasCheckbox })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter__FilteredList, 'Filter__FilteredList', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilteringDatasetList/_FilteredList/index.jsx');
}();

;

/***/ }),
/* 483 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1050);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _FilterHeader = __webpack_require__(154);

var _FilterHeader2 = _interopRequireDefault(_FilterHeader);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter__FilteredList = module.exports = __webpack_require__(1)({
  _getFilteredList: function _getFilteredList() {
    var _this = this;

    return this.props.list.filter(function (item, index) {
      return item.Id === _this.props.activeDatasetId;
    });
  },
  render: function render() {
    return typeof this.props.activeDatasetId === 'undefined' || this.props.activeDatasetId === 1 || this.props.list.length < 1 ? null : _react2.default.createElement(
      'div',
      { className: 'RecentlyOpened' },
      _react2.default.createElement(
        'h3',
        { className: '_text' },
        'Last Opened:'
      ),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(_DatasetList2.default, {
          list: this._getFilteredList(),
          emitItemClick: this.props.emitItemClick,
          selectedList: this.props.selectedList,
          hasCheckbox: this.props.hasCheckbox
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter__FilteredList, 'Filter__FilteredList', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_FilteringDatasetList/_RecentlyOpen/index.jsx');
}();

;

/***/ }),
/* 484 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1053);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Groups__Header = module.exports = __webpack_require__(1)({
  _renderEditButton: function _renderEditButton() {
    return this.props.editing ? _react2.default.createElement(
      'button',
      { className: '_editBtn', onClick: this.props.emitEditToggle },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' }),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Done editing'
        )
      )
    ) : _react2.default.createElement(
      'button',
      { className: '_editBtn', onClick: this.props.emitEditToggle },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_Icon2.default, { id: 'edit', className: '_icon' }),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Edit Groups'
        )
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Groups__Header' },
      _react2.default.createElement(
        'button',
        { className: '_createBtn', onClick: this.props.emitCreateNewGroup },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { id: 'plus', className: '_icon' }),
          _react2.default.createElement(
            'span',
            { className: '_text' },
            'New Group'
          )
        )
      ),
      this._renderEditButton()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Groups__Header, 'Groups__Header', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Groups/_Header/index.jsx');
}();

;

/***/ }),
/* 485 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1054);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _ConfirmationModal = __webpack_require__(109);

var _ConfirmationModal2 = _interopRequireDefault(_ConfirmationModal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__deleteGroup = __webpack_require__(260);

var _POST__deleteGroup2 = _interopRequireDefault(_POST__deleteGroup);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Groups__Item = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      deleteConfirmationPortalOpen: false,
      deleteRequestPortalOpen: false
    };
  },
  _toggleDeleteConfirmationPortal: function _toggleDeleteConfirmationPortal() {
    this.setState({
      deleteConfirmationPortalOpen: !this.state.deleteConfirmationPortalOpen
    });
  },
  _toggleDeleteRequestPortal: function _toggleDeleteRequestPortal() {
    this.setState({
      deleteRequestPortalOpen: !this.state.deleteRequestPortalOpen
    });
  },
  _handleDeleteConfirm: function _handleDeleteConfirm() {
    _Actions2.default.CLEAR_DATASETLIST_FILTER();
    this._toggleDeleteConfirmationPortal();
    this._toggleDeleteRequestPortal();
  },
  _onClick: function _onClick() {
    this.props.emitItemClicked(this.props.group.id);
  },
  _renderDeleteBtn: function _renderDeleteBtn() {
    return !this.props.editing ? null : _react2.default.createElement(
      'button',
      { className: '_deleteBtn', onClick: this._toggleDeleteConfirmationPortal },
      _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
    );
  },
  _renderEditIcon: function _renderEditIcon() {
    return !this.props.editing ? null : _react2.default.createElement(_Icon2.default, { id: 'edit', className: '_icon' });
  },
  render: function render() {
    var Groups__Item = (0, _classnames2.default)({
      'Groups__Item': true,
      'is-active': this.props.group.active,
      'is-editing': this.props.editing
    });
    return _react2.default.createElement(
      'div',
      { className: '_item' },
      this._renderDeleteBtn(),
      _react2.default.createElement(
        'div',
        { className: Groups__Item },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._onClick },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            this._renderEditIcon(),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              this.props.group.title
            )
          )
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.deleteConfirmationPortalOpen },
        _react2.default.createElement(_ConfirmationModal2.default, {
          confirmHandler: this._handleDeleteConfirm,
          cancelHandler: this._toggleDeleteConfirmationPortal,
          content: {
            title: 'Are you sure?',
            text: 'You will not lose any datasets, but this group will be destroyed.',
            btns: {
              confirm: 'Delete Group',
              cancel: 'Cancel'
            }
          } })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.deleteRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleDeleteRequestPortal,
          failHandler: this._toggleDeleteRequestPortal,
          request: _POST__deleteGroup2.default,
          data: {
            Id: this.props.group.id
          },
          pendingText: {
            title: 'Please wait',
            text: 'Deleting Group...'
          },
          successText: {
            title: 'Success!',
            text: 'The group has been deleted'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The group could not be deleted.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Groups__Item, 'Groups__Item', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Groups/_List/_Item/index.jsx');
}();

;

/***/ }),
/* 486 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1055);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Item = __webpack_require__(485);

var _Item2 = _interopRequireDefault(_Item);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var nameSortFunction = function nameSortFunction(item) {
  return item.title.toLowerCase();
};

var Groups__List = module.exports = __webpack_require__(1)({
  _renderList: function _renderList() {
    var _this = this;

    var sortedList = _.sortBy(this.props.list, nameSortFunction);
    return sortedList.map(function (group, index) {
      return _react2.default.createElement(_Item2.default, {
        key: index,
        group: group,
        editing: _this.props.editing,
        emitItemClicked: _this.props.emitListItemClicked });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Groups__List' },
      this._renderList()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(nameSortFunction, 'nameSortFunction', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Groups/_List/index.jsx');

  __REACT_HOT_LOADER__.register(Groups__List, 'Groups__List', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_Groups/_List/index.jsx');
}();

;

/***/ }),
/* 487 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SubActionBtn = module.exports = __webpack_require__(1)({
  render: function render() {
    return this.props.render ? this.renderButton() : null;
  },
  renderButton: function renderButton() {
    return this.props.link ? _react2.default.createElement(
      'a',
      { className: "SubActionBtn " + this.props.id, href: this.props.url },
      _react2.default.createElement(
        'div',
        { className: '_circle' },
        _react2.default.createElement(_Icon2.default, { id: this.props.icon, className: '_icon' })
      ),
      _react2.default.createElement('span', { className: '_label', dangerouslySetInnerHTML: { __html: this.props.label } })
    ) : _react2.default.createElement(
      'button',
      { className: "SubActionBtn " + this.props.id, onClick: this.props.onClick },
      _react2.default.createElement(
        'div',
        { className: '_circle' },
        _react2.default.createElement(_Icon2.default, { id: this.props.icon, className: '_icon' })
      ),
      _react2.default.createElement('span', { className: '_label', dangerouslySetInnerHTML: { __html: this.props.label } })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SubActionBtn, 'SubActionBtn', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_SubActionBtn/index.jsx');
}();

;

/***/ }),
/* 488 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _fieldGroupErrorMixin = __webpack_require__(263);

var _fieldGroupErrorMixin2 = _interopRequireDefault(_fieldGroupErrorMixin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TabRoute = module.exports = __webpack_require__(1)({

  mixins: [(0, _fieldGroupErrorMixin2.default)(undefined)],

  render: function render() {
    var _text = (0, _classnames2.default)({
      '_text': true,
      'is-error': this.state.requestError
    });
    return _react2.default.createElement(
      'button',
      {
        key: this.props.index,
        onClick: this.props.onClick,
        className: this.props.className },
      _react2.default.createElement(
        'span',
        { className: _text },
        this.props.title
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TabRoute, 'TabRoute', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabCategories/_tab.jsx');
}();

;

/***/ }),
/* 489 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1059);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _tabManifest = __webpack_require__(38);

var _tabManifest2 = _interopRequireDefault(_tabManifest);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _activeTabRef = __webpack_require__(445);

var _activeTabRef2 = _interopRequireDefault(_activeTabRef);

var _tab = __webpack_require__(488);

var _tab2 = _interopRequireDefault(_tab);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var allTabFields = {
  physical: [],
  financial: []
};

_tabManifest2.default.forEach(function (tab) {
  _.forOwn(tab.fields, function (value, key) {
    allTabFields[tab.category].push(key);
  });
});

var TabCategories = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  componentWillMount: function componentWillMount() {
    var RouteArr = this.props.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    var category = _tabManifest2.default[_.findIndex(_tabManifest2.default, function (tab) {
      return tab.location === activeRoute;
    })].category;

    this.setState({
      category: category
    });
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    var RouteArr = newProps.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    var category = _tabManifest2.default[_.findIndex(_tabManifest2.default, function (tab) {
      return tab.location === activeRoute;
    })].category;

    if (category !== this.state.category) {
      this.setState({ category: category });
    }
  },
  _handleRouteChecker: function _handleRouteChecker(category) {
    var RouteArr = this.props.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    var array = _.filter(_tabManifest2.default, function (tab) {
      return tab.category === category;
    });

    var truthy = _.filter(array, function (tab) {
      return tab.location === activeRoute;
    });

    if (truthy.length > 0) {
      return true;
    }
    return false;
  },
  _handleCategoryToggle: function _handleCategoryToggle(category) {
    if (category !== this.state.category) {
      if (category === 'physical') {
        this.props.history.push('/editor/' + _activeTabRef2.default.store.activePhysicalTab);
      } else {
        this.props.history.push('/editor/' + _activeTabRef2.default.store.activeFinancialTab);
      }
      this.setState({
        category: category
      });
    }
  },
  _renderCategoryTabHTML: function _renderCategoryTabHTML(tabs) {
    var _this = this;

    return [{ category: 'physical', title: 'Physical' }, { category: 'financial', title: 'Financial' }].map(function (tab, index) {
      var TabSwitch__toggle = (0, _classnames2.default)({
        TabSwitch__toggle: true,
        'is-active': _this._handleRouteChecker(tab.category),
        'financial-is-active': _this._handleRouteChecker('financial')
      });
      return _react2.default.createElement(_tab2.default, {
        key: index,
        id: index,
        onClick: _this._handleCategoryToggle.bind(_this, tab.category),
        className: TabSwitch__toggle,
        fieldList: allTabFields[tab.category],
        title: tab.title
      });
    });
  },
  render: function render() {
    var _classes = (0, _classnames2.default)({
      TabCategories: true,
      'financial-is-active': this._handleRouteChecker('financial')
    });
    return _react2.default.createElement(
      'div',
      { className: _classes },
      this._renderCategoryTabHTML()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(allTabFields, 'allTabFields', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabCategories/index.jsx');

  __REACT_HOT_LOADER__.register(TabCategories, 'TabCategories', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabCategories/index.jsx');
}();

;

/***/ }),
/* 490 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1060);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _checkFarmAuth = __webpack_require__(148);

var _checkFarmAuth2 = _interopRequireDefault(_checkFarmAuth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var CopyMessage = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      createPortalOpen: false
    };
  },
  _toggleCreatePortal: function _toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  _renderCopyHTML: function _renderCopyHTML() {
    return !this.props.copyable ? null : _react2.default.createElement(
      'span',
      null,
      ', but you can',
      ' ',
      _react2.default.createElement(
        'button',
        { className: '_copyBtn', onClick: this._toggleCreatePortal },
        'copy it'
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.createPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleCreatePortal }),
          _react2.default.createElement(_CreateDatasetModal2.default, {
            callback: this._toggleCreatePortal,
            bulkCallback: this._toggleCreatePortal,
            prefillFarm: (0, _checkFarmAuth2.default)(this.props.dataset.DairyBaseId) ? this.props.dataset.DairyBaseId : undefined,
            prefillYear: this.props.dataset.FinancialYear,
            prefillDataset: this.props.dataset.Id })
        )
      )
    );
  },
  render: function render() {
    return this.props.editable ? null : _react2.default.createElement(
      'div',
      { className: 'TabHeader__copyMessage' },
      'You don\'t have authority to edit this dataset',
      this._renderCopyHTML(),
      '.'
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(CopyMessage, 'CopyMessage', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabHeader/_copyMessage/index.jsx');
}();

;

/***/ }),
/* 491 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1062);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _POST__saveActiveDataset = __webpack_require__(121);

var _POST__saveActiveDataset2 = _interopRequireDefault(_POST__saveActiveDataset);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var XhrState = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_activeDataset2.default, 'handleDatasetUpdate')],

  handleDatasetUpdate: function handleDatasetUpdate() {
    this.setState({
      farmId: _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id })
    });
  },
  getInitialState: function getInitialState() {
    return {
      saveRequestPortalOpen: false,
      createPortalOpen: false,
      farmId: _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id }) || { DairyBaseId: undefined }
    };
  },
  toggleCreatePortal: function toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  _toggleSaveRequestPortal: function _toggleSaveRequestPortal() {
    this.setState({
      saveRequestPortalOpen: !this.state.saveRequestPortalOpen
    });
  },
  _renderSaveBtn: function _renderSaveBtn() {
    return this.props.saved || this.props.pending || this.props.error ? null : _react2.default.createElement(
      'div',
      { className: '_actions' },
      _react2.default.createElement(
        'button',
        { className: '_btn', onClick: this._toggleSaveRequestPortal },
        'Save'
      ),
      _react2.default.createElement(
        'button',
        { className: '_btn', onClick: this.toggleCreatePortal },
        'Save As'
      )
    );
  },
  _getState: function _getState() {
    var state;
    if (this.props.error) return 'error';
    if (this.props.pending) return 'pending';
    if (!this.props.saved) return 'modified';
    return 'saved';
  },
  _renderMsgIcon: function _renderMsgIcon(states) {
    return typeof states[this._getState()].icon === 'undefined' ? null : _react2.default.createElement(_Icon2.default, { id: states[this._getState()].icon, className: '_icon' });
  },
  render: function render() {
    var _classnames;

    var states = {
      pending: {
        icon: 'cloudupload',
        text: 'Updating calculations',
        class: 'is-pending'
      },
      saved: {
        text: 'Dataset is saved.',
        class: 'is-saved'
      },
      modified: {
        icon: 'alert',
        text: 'Dataset has been modified:',
        class: 'is-modified'
      },
      error: {
        icon: 'alert',
        text: 'An error has occured - please check any highlighted inputs…',
        class: 'is-error'
      }
    };

    var TabHeader__actions = (0, _classnames3.default)((_classnames = {
      "TabHeader__actions": true
    }, _defineProperty(_classnames, states.pending.class, this.props.pending), _defineProperty(_classnames, states.saved.class, this.props.saved && !this.props.pending), _defineProperty(_classnames, states.modified.class, !this.props.saved && !this.props.pending), _defineProperty(_classnames, states.error.class, this.props.error), _classnames));

    return !this.props.editable ? null : _react2.default.createElement(
      'div',
      { className: TabHeader__actions },
      _react2.default.createElement(
        'div',
        { className: '_message' },
        this._renderMsgIcon(states),
        _react2.default.createElement(
          'span',
          { className: '_text' },
          states[this._getState()].text
        )
      ),
      _react2.default.createElement(
        'div',
        { className: '_saveBtn' },
        this._renderSaveBtn()
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.saveRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleSaveRequestPortal,
          failHandler: this._toggleSaveRequestPortal,
          request: _POST__saveActiveDataset2.default,
          data: {
            Overwrite: false
          },
          pendingText: {
            title: 'Please wait',
            text: 'Saving dataset...'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset was saved.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be saved.'
          } })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.createPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.toggleCreatePortal }),
          _react2.default.createElement(_CreateDatasetModal2.default, {
            callback: this.toggleCreatePortal,
            bulkCallback: this.toggleCreatePortal,
            prefillFarm: this.state.farmId.DairyBaseId,
            prefillYear: _activeDataset2.default.FinancialYear,
            useActive: true })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(XhrState, 'XhrState', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabHeader/_xhrState/index.jsx');
}();

;

/***/ }),
/* 492 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _FilterControls = __webpack_require__(107);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

var _LoadDatasetList = __webpack_require__(201);

var _LoadDatasetList2 = _interopRequireDefault(_LoadDatasetList);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _POST__createBudget = __webpack_require__(144);

var _POST__createBudget2 = _interopRequireDefault(_POST__createBudget);

var _CreateBudgetButton = __webpack_require__(150);

var _CreateBudgetButton2 = _interopRequireDefault(_CreateBudgetButton);

var _style = __webpack_require__(493);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  getInitialState: function getInitialState() {
    return {
      createBudgetPending: false
    };
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.Content,
        null,
        _react2.default.createElement(
          _style.Title,
          null,
          'Manage Budgets'
        ),
        _react2.default.createElement(
          _style.Box,
          null,
          _react2.default.createElement(
            _style.Header,
            null,
            _react2.default.createElement(
              _style.Description,
              null,
              this.props.list.length > 0 ? 'The following budgets are available for this dataset' : 'No budgets created yet.'
            ),
            _react2.default.createElement(_CreateBudgetButton2.default, {
              useFont: true,
              history: this.props.history,
              datasetId: this.props.datasetId
            }),
            _react2.default.createElement(_DARequestPortal2.default, {
              isOpen: this.state.createBudgetPending,
              onSuccess: function onSuccess(data) {
                var budgetId = data.body.CompCalculatorOutput.ScenarioDataset.Id;

                _this.props.history.push('/budget/' + budgetId + '/editor');
                _this.setState({ createBudgetPending: false });
              },
              onClose: function onClose() {
                return _this.setState({ createBudgetPending: false });
              },
              request: function request(callback) {
                return (0, _POST__createBudget2.default)({
                  FarmDataSetId: _this.props.datasetId,
                  FinancialYearId: 52,
                  Name: 'New Budget'
                }, callback);
              },
              text: {
                pendingTitle: 'Please wait a moment...',
                pendingDescription: 'Generating new budget dataset.',
                successTitle: 'Success!',
                successDescription: 'Your budget dataset has been created.',
                successButton: 'Launch budget editor',
                errorTitle: 'Oops, something went wrong',
                errorDescription: 'Connection timed out.'
              }
            })
          ),
          _react2.default.createElement(
            'div',
            {
              style: {
                borderBottom: '1px solid #dbdbdb',
                paddingTop: '25px',
                marginBottom: '25px'
              } },
            _react2.default.createElement(_FilterControls2.default, { emitColumnClick: function emitColumnClick(id) {
                return console.log(id);
              } })
          ),
          _react2.default.createElement(_LoadDatasetList2.default, { forceBudgetList: true, list: this.props.list })
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 493 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CloseIcon = exports.CloseButton = exports.Button = exports.Description = exports.Box = exports.Title = exports.Content = exports.Header = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__Root'
})(['display:flex;align-items:center;justify-content:center;height:100%;']);

var Header = exports.Header = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__Header'
})(['font-family:', ';display:flex;align-items:center;justify-content:space-between;'], _css.vars.Gilroy);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__Content'
})(['padding-top:200px;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__Title'
})(['font-family:', ';font-weight:700;font-size:40px;color:', ';padding-bottom:20px;text-align:center;'], _css.vars.Gilroy, _css.vars.DA_Dairy_blue);

var Box = exports.Box = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__Box'
})(['width:1000px;padding:30px;background:white;border-radius:4px;']);

var Description = exports.Description = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__Description'
})(['font-size:14px;text-align:center;']);

var Button = exports.Button = _styledComponents2.default.button.withConfig({
  displayName: 'BudgetList__Button'
})(['cursor:pointer;margin-top:20px;border:1px solid #babcc2;']);

var CloseButton = exports.CloseButton = _styledComponents2.default.div.withConfig({
  displayName: 'BudgetList__CloseButton'
})(['cursor:pointer;position:absolute;top:10px;right:10px;z-index:1;display:flex;align-items:center;padding:5px 10px;color:#407ec9;font-size:14px;&:hover{color:#407ec9;}&:active{color:#407ec9;}']);

var CloseIcon = exports.CloseIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_close' }).withConfig({
  displayName: 'BudgetList__CloseIcon'
})(['', ';margin-left:4px;'], _css.mixins.icon('24px', '24px'));
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(Header, 'Header', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(Box, 'Box', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(Description, 'Description', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(Button, 'Button', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(CloseButton, 'CloseButton', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');

  __REACT_HOT_LOADER__.register(CloseIcon, 'CloseIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/BudgetList/style.js');
}();

;

/***/ }),
/* 494 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _fieldGroupErrorMixin = __webpack_require__(263);

var _fieldGroupErrorMixin2 = _interopRequireDefault(_fieldGroupErrorMixin);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TabRoute = module.exports = __webpack_require__(1)({

  mixins: [(0, _fieldGroupErrorMixin2.default)(undefined)],

  _renderErrorIcon: function _renderErrorIcon() {
    return !this.state.requestError ? null : _react2.default.createElement(_Icon2.default, { id: 'alert', className: '_icon' });
  },
  render: function render() {
    return _react2.default.createElement(
      'button',
      {
        key: this.props.index,
        id: this.props.index,
        onClick: this.props.onClick,
        className: this.props.className },
      this._renderErrorIcon(),
      _react2.default.createElement(
        'span',
        { className: '_text' },
        this.props.name
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TabRoute, 'TabRoute', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TabList/_tab.jsx');
}();

;

/***/ }),
/* 495 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1063);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _tabManifest = __webpack_require__(38);

var _tabManifest2 = _interopRequireDefault(_tabManifest);

var _tab = __webpack_require__(494);

var _tab2 = _interopRequireDefault(_tab);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _marked = __webpack_require__(181);

var _marked2 = _interopRequireDefault(_marked);

var _Portal3 = __webpack_require__(61);

var _Portal4 = _interopRequireDefault(_Portal3);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _BudgetList = __webpack_require__(492);

var _BudgetList2 = _interopRequireDefault(_BudgetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  getInitialState: function getInitialState() {
    return {
      helpPortalOpen: false
    };
  },
  componentWillMount: function componentWillMount() {
    var RouteArr = this.props.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    var category = _tabManifest2.default[_.findIndex(_tabManifest2.default, function (tab) {
      return tab.location === activeRoute;
    })].category;

    if (category === 'physical') {
      _Actions2.default.UPDATE_PHYSICAL_TAB(activeRoute);
    } else {
      _Actions2.default.UPDATE_FINANCIAL_TAB(activeRoute);
    }
  },
  _handleClick: function _handleClick(category, id) {
    var tab = this.props[category][id];
    if (tab.category === 'physical') {
      _Actions2.default.UPDATE_PHYSICAL_TAB(tab.location);
    } else {
      _Actions2.default.UPDATE_FINANCIAL_TAB(tab.location);
    }
    this.props.history.push(tab.location);
  },
  _handleRouteChecker: function _handleRouteChecker(category) {
    var _this = this;

    var array = _.filter(this.props[category], function (tab) {
      return tab.category === category;
    });

    var truthy = _.filter(array, function (tab) {
      var pathArr = _this.props.location.pathname.split('/');

      var activePath = pathArr[pathArr.length - 1];

      return activePath === tab.location;
    });

    if (truthy.length > 0) {
      return true;
    }
    return false;
  },
  _toggleHelpPortal: function _toggleHelpPortal() {
    return this.setState({
      helpPortalOpen: !this.state.helpPortalOpen
    });
  },
  _renderTabHTML: function _renderTabHTML(tabs) {
    var _this2 = this;

    var RouteArr = this.props.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    return tabs.map(function (tab, index) {
      var tabClasses = (0, _classnames2.default)({
        TabList__link: true,
        'is-active': tab.location === activeRoute
      });
      return _react2.default.createElement(_tab2.default, {
        key: index,
        id: index,
        onClick: _this2._handleClick.bind(_this2, tab.category, index),
        className: tabClasses,
        fieldList: _.keys(tab.fields),
        name: tab.name
      });
    });
  },
  render: function render() {
    var _this3 = this;

    var dataset = this.props.dataset;
    var _budgets = dataset._budgets,
        IsActual = dataset.IsActual;


    var categories = [{ category: 'physical', title: 'Physical', icon: 'map' }, { category: 'financial', title: 'Financial', icon: 'dollarsign' }];

    var tabGroups = categories.map(function (button, index) {
      var _classes = (0, _classnames2.default)({
        TabGroup: true,
        'is-active': _this3._handleRouteChecker(button.category)
      });
      var _financeHelp = button.category === 'financial' ? _react2.default.createElement(
        'div',
        { className: 'TabGroup__help' },
        'All Income and Expenses need to be GST Exclusive and should meet the',
        _react2.default.createElement(
          'button',
          {
            className: 'TabGroup__helpTxt',
            onClick: _this3._toggleHelpPortal },
          ' ',
          'Matching Principle'
        ),
        '.'
      ) : false;
      var _tabs = button.category === 'physical' ? _this3._renderTabHTML(_this3.props.physical) : _this3._renderTabHTML(_this3.props.financial);
      return _react2.default.createElement(
        'div',
        { className: _classes, key: index },
        _react2.default.createElement(
          'div',
          { className: '_group is-' + button.category },
          _tabs
        ),
        _financeHelp
      );
    });

    var RouteArr = this.props.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    var currentTab = _tabManifest2.default[_.findIndex(_tabManifest2.default, function (tab) {
      return tab.location === activeRoute;
    })];

    var helpText = 'Income and expenses need to match the production year to which they relate not necessarily when they were received or paid. Milk income needs to be based on the payments for the July to June milk which normally means adjustments need to be made for payments received in July and August each year that relate to the previous production year. Similarly the expenses should match when the physical quantity was used so if there were prepayments made for fertiliser or feed or interest, for example for tax purposes, adjustments need to be made to exclude these.';

    var markedDescription = (0, _marked2.default)(helpText, { sanitize: true });

    return _react2.default.createElement(
      'div',
      { className: 'TabList' },
      tabGroups,
      _react2.default.createElement(
        'a',
        {
          className: '_carbonLink',
          href: '/dbcc/#/editor/' + this.props.dataset.Id + '/inputs/' + currentTab.dbcclocation },
        _react2.default.createElement(_Icon2.default, { id: 'navigateright', className: '_carbon_icon' }),
        'Carbon Calculator'
      ),
      IsActual && _react2.default.createElement(
        _Portal4.default,
        {
          fullscreen: true,
          background: '#EDF6F7',
          Button: function Button(_ref) {
            var isOpen = _ref.isOpen,
                onToggle = _ref.onToggle,
                onOpen = _ref.onOpen,
                onClose = _ref.onClose;
            return _react2.default.createElement(
              'button',
              { className: '_budgetLink', onClick: onOpen },
              _react2.default.createElement(_Icon2.default, { id: 'navigateright', className: '_budget_icon' }),
              'Manage Budgets'
            );
          } },
        function (_ref2) {
          var onToggle = _ref2.onToggle,
              onOpen = _ref2.onOpen,
              onClose = _ref2.onClose;
          return _react2.default.createElement(
            _DAStandardPortal2.default,
            { onClose: onClose },
            _react2.default.createElement(_BudgetList2.default, { datasetId: dataset.Id, list: _budgets || [] })
          );
        }
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalOpen,
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          { closePortal: this._toggleHelpPortal },
          _react2.default.createElement(
            'div',
            { className: 'HelpModal__text' },
            _react2.default.createElement('div', {
              className: 'HelpText__content',
              dangerouslySetInnerHTML: { __html: markedDescription }
            })
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 496 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1064);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _TableColSelect = __webpack_require__(468);

var _TableColSelect2 = _interopRequireDefault(_TableColSelect);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _financeCalculations = __webpack_require__(124);

var _financeCalculations2 = _interopRequireDefault(_financeCalculations);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _GenericTotal = __webpack_require__(203);

var _GenericTotal2 = _interopRequireDefault(_GenericTotal);

var _commas = __webpack_require__(33);

var _DescriptionTotal = __webpack_require__(275);

var _DescriptionTotal2 = _interopRequireDefault(_DescriptionTotal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FinancialTotals = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'UserPreference',
    fields: {
      'SwitchFinanceColumn1': {
        Options: [{ Id: 0, Title: "No Data" }],
        Value: 0
      },
      'SwitchFinanceColumn2': {
        Options: [{ Id: 0, Title: "No Data" }],
        Value: 0
      },
      'SwitchFinanceColumn3': {
        Options: [{ Id: 0, Title: "No Data" }],
        Value: 0
      }
    }
  }, {
    store: 'Data',
    fields: {
      'CowMilkerNumber': {},
      'MilkSolidsKgTotal': {},
      'AreaUsable': {},
      'AreaMilking': {},
      'MilkLitresTotal': {}
    }
  }])],

  _renderOutput: function _renderOutput(field, value) {

    var modifiers = {
      CowMilkerNumber: this.state.CowMilkerNumber.Value,
      MilkSolidsKgTotal: this.state.MilkSolidsKgTotal.Value,
      AreaUsable: this.state.AreaUsable.Value,
      AreaMilking: this.state.AreaMilking.Value,
      MilkLitresTotal: this.state.MilkLitresTotal.Value
    };

    var fnMap = ['NotDefined', 'PerCow', 'PerKgMS', 'PerMilkingHa', 'PerUsableHa', 'DollarsPerLitre', 'CentsPerLitre'];

    var selectedRatioId = this.state[field].Value;
    var fnId = fnMap[selectedRatioId];
    var caculation = (0, _financeCalculations2.default)(fnId, modifiers);

    return _react2.default.createElement(_GenericTotal2.default, {
      label: _.find(this.state[field].Options, { Id: selectedRatioId }).Title,
      value: caculation.fn(value) });
  },
  _renderColumnSelect: function _renderColumnSelect(field) {
    var column = this.state[field];
    return _react2.default.createElement(_TableColSelect2.default, { data: column });
  },
  _renderDollar: function _renderDollar(caculation) {
    if (caculation.cents) return;
    return '$';
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'FinancialTotals' },
      _react2.default.createElement(
        'div',
        { className: 'FinancialTotals__outputs' },
        _react2.default.createElement(
          'div',
          { className: '_totalCol' },
          _react2.default.createElement(_DescriptionTotal2.default, {
            preUnit: '$',
            label: this.props.label,
            value: (0, _commas.addCommas)(this.props.data.Value),
            description: this.props.data.Description })
        ),
        _react2.default.createElement(
          'div',
          { className: '_outputCols' },
          _react2.default.createElement(
            'div',
            { className: '_col' },
            this._renderOutput('SwitchFinanceColumn1', this.props.data.Value),
            this._renderColumnSelect('SwitchFinanceColumn1')
          ),
          _react2.default.createElement(
            'div',
            { className: '_col' },
            this._renderOutput('SwitchFinanceColumn2', this.props.data.Value),
            this._renderColumnSelect('SwitchFinanceColumn2')
          ),
          _react2.default.createElement(
            'div',
            { className: '_col' },
            this._renderOutput('SwitchFinanceColumn3', this.props.data.Value),
            this._renderColumnSelect('SwitchFinanceColumn3')
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FinancialTotals, 'FinancialTotals', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TotalsBanner/_financial/index.jsx');
}();

;

/***/ }),
/* 497 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1066);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericTotal = __webpack_require__(203);

var _GenericTotal2 = _interopRequireDefault(_GenericTotal);

var _commas = __webpack_require__(33);

var _DescriptionTotal = __webpack_require__(275);

var _DescriptionTotal2 = _interopRequireDefault(_DescriptionTotal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var PhysicalTotals = module.exports = __webpack_require__(1)({
  _renderTotals: function _renderTotals() {
    return this.props.data.map(function (field, index) {
      return _react2.default.createElement(_DescriptionTotal2.default, {
        key: index,
        label: field.label,
        value: (0, _commas.addCommas)(field.data.Value),
        description: field.data.Description });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'PhysicalTotals' },
      this._renderTotals()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(PhysicalTotals, 'PhysicalTotals', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TotalsBanner/_physical/index.jsx');
}();

;

/***/ }),
/* 498 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1065);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _financial = __webpack_require__(496);

var _financial2 = _interopRequireDefault(_financial);

var _physical = __webpack_require__(497);

var _physical2 = _interopRequireDefault(_physical);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TotalsBanner = module.exports = __webpack_require__(1)({
  _renderCategoryTotals: function _renderCategoryTotals() {
    var _fields = this.props.data.fields;
    return this.props.data.financial ? _react2.default.createElement(_financial2.default, {
      label: _fields[0].label,
      data: _fields[0].data,
      dollars: this.props.data.dollars }) : _react2.default.createElement(_physical2.default, {
      data: _fields });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'TotalsBanner' },
      this._renderCategoryTotals()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TotalsBanner, 'TotalsBanner', 'C:/_repos_windows/dairybase/Frontend/app/views/global/_TotalsBanner/index.jsx');
}();

;

/***/ }),
/* 499 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CloseIcon = exports.CloseButton = exports.Button = exports.ButtonBox = exports.Description = exports.Box = exports.Title = exports.Content = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__Root'
})(['font-family:', ';position:relative;z-index:1;display:flex;align-items:center;justify-content:center;height:100%;'], _css.vars.Gilroy);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__Content'
})(['margin-top:-200px;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__Title'
})(['font-weight:700;font-size:40px;padding-bottom:60px;text-align:center;color:', ';'], _css.vars.DA_Dairy_blue);

var Box = exports.Box = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__Box'
})(['padding:40px 60px;background:white;border-radius:4px;']);

var Description = exports.Description = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__Description'
})(['color:', ';font-size:16px;text-align:center;letter-spacing:0.8px;'], _css.vars.DA_Dairy_blue);

var ButtonBox = exports.ButtonBox = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__ButtonBox'
})(['display:flex;align-items:center;justify-content:center;padding-top:50px;']);

var Button = exports.Button = _styledComponents2.default.button.withConfig({
  displayName: 'DARequestPortal__Button'
})(['margin:0 auto;cursor:pointer;background:', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;border:none;', ' ', ' &:hover{background:', ';', ' ', '}&:active{color:white;', ' ', '}'], _css.vars.a(_css.vars.DA_pasture_green, 75), _css.vars.DA_Dairy_blue, function (props) {
  return props.error && '\n    background: white;\n    border: 1px solid ' + _css.vars.DA_sky_blue + ';\n  ';
}, function (props) {
  return props.blueButton && '\n    background: ' + _css.vars.a(_css.vars.DA_accent_blue, 25) + ';\n    border: 1px solid ' + _css.vars.DA_accent_blue + ';\n  ';
}, _css.vars.DA_accent_green, function (props) {
  return props.error && '\n      background: white;\n      border: 1px solid ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.blueButton && '\n      background: ' + _css.vars.a(_css.vars.DA_accent_blue, 25) + ';\n      border: 1px solid ' + _css.vars.DA_Dairy_blue + ';\n    ';
}, function (props) {
  return props.error && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.blueButton && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
});

var CloseButton = exports.CloseButton = _styledComponents2.default.div.withConfig({
  displayName: 'DARequestPortal__CloseButton'
})(['cursor:pointer;position:absolute;top:10px;right:10px;z-index:1;display:flex;align-items:center;padding:5px 10px;color:', ';font-size:14px;font-weight:700;border:1px solid ', ';border-radius:22px;&:hover{border:1px solid ', ';}&:active{background:', ';}'], _css.vars.DA_accent_blue, _css.vars.a(_css.vars.DA_sky_blue, 0), _css.vars.a(_css.vars.DA_sky_blue, 50), _css.vars.a(_css.vars.DA_sky_blue, 50));

var CloseIcon = exports.CloseIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_close' }).withConfig({
  displayName: 'DARequestPortal__CloseIcon'
})(['', ';margin-left:4px;'], _css.mixins.icon('24px', '24px'));
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(Box, 'Box', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(Description, 'Description', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(ButtonBox, 'ButtonBox', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(Button, 'Button', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(CloseButton, 'CloseButton', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');

  __REACT_HOT_LOADER__.register(CloseIcon, 'CloseIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/DARequestPortal/style.js');
}();

;

/***/ }),
/* 500 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1067);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _ConfirmAlign = __webpack_require__(268);

var _ConfirmAlign2 = _interopRequireDefault(_ConfirmAlign);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var UnsavedDatasetOverlay = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_activeDataset2.default, 'handleDatasetUpdate')],

  getInitialState: function getInitialState() {
    return {
      aligned: _activeDataset2.default.DataSetAligned
    };
  },
  handleDatasetUpdate: function handleDatasetUpdate() {
    this.setState({
      aligned: _activeDataset2.default.DataSetAligned
    });
  },
  render: function render() {
    return this.state.aligned ? null : _react2.default.createElement(
      'div',
      { className: 'UnsavedDatasetOverlay' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(_ConfirmAlign2.default, null)
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(UnsavedDatasetOverlay, 'UnsavedDatasetOverlay', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/UnAlignedDatasetOverlay/index.jsx');
}();

;

/***/ }),
/* 501 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1068);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _RequestPortal = __webpack_require__(156);

var _RequestPortal2 = _interopRequireDefault(_RequestPortal);

var _POST__createDataset = __webpack_require__(145);

var _POST__createDataset2 = _interopRequireDefault(_POST__createDataset);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _POST__saveActiveDataset = __webpack_require__(121);

var _POST__saveActiveDataset2 = _interopRequireDefault(_POST__saveActiveDataset);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ConfirmActions = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {

  mixins: [_reflux2.default.listenTo(_activeDataset2.default, 'handleDatasetUpdate')],

  getInitialState: function getInitialState() {
    return {
      saveRequest: false,
      discardRequest: false,
      createPortalOpen: false,
      datasetName: '',
      farmId: undefined
    };
  },
  handleDatasetUpdate: function handleDatasetUpdate() {
    var datasetDetail = _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id });
    this.setState({
      datasetName: datasetDetail.Name,
      farmId: datasetDetail.DairyBaseId
    });
  },
  handleCreateSuccess: function handleCreateSuccess() {
    this.toggleCreatePortal();
    this.handleLoadDataset();
  },
  toggleCreatePortal: function toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  toggleSaveRequest: function toggleSaveRequest() {
    this.setState({
      saveRequest: !this.state.saveRequest
    });
  },
  toggleDiscardRequest: function toggleDiscardRequest() {
    this.setState({
      discardRequest: !this.state.discardRequest
    });
  },
  handleLoadDataset: function handleLoadDataset() {
    this.props.history.push('/editor');
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ConfirmActions-wrapper' },
      _react2.default.createElement(
        'div',
        { className: 'ConfirmActions' },
        _react2.default.createElement(
          'h2',
          { className: '_title' },
          'You have unsaved changes to the following dataset:'
        ),
        _react2.default.createElement(
          'h3',
          { className: '_dataset' },
          this.state.datasetName
        ),
        _react2.default.createElement(
          'div',
          { className: '_mainAction' },
          _react2.default.createElement(
            'button',
            { className: '_btn', onClick: this.handleLoadDataset },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(
                'span',
                { className: '_label' },
                'Continue Editing'
              ),
              _react2.default.createElement(_Icon2.default, { id: 'forward', className: '_icon' })
            )
          )
        ),
        _react2.default.createElement(
          'p',
          { className: '_subtitle' },
          'Please save the dataset, discard your changes, or continue editing.'
        ),
        _react2.default.createElement(
          'div',
          { className: '_actions' },
          _react2.default.createElement(
            'button',
            {
              className: '_discardBtn',
              onClick: this.toggleDiscardRequest },
            'Discard my changes'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              onClick: this.toggleCreatePortal },
            'Save As'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              onClick: this.toggleSaveRequest },
            'Save changes'
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.createPortalOpen,
              className: 'Overlay' },
            _react2.default.createElement(
              'div',
              { className: '_modalBox' },
              _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.toggleCreatePortal }),
              _react2.default.createElement(_CreateDatasetModal2.default, {
                callback: this.handleCreateSuccess,
                bulkCallback: this.toggleCreatePortal,
                prefillFarm: this.state.farmId,
                prefillYear: _activeDataset2.default.FinancialYear,
                useActive: true })
            )
          ),
          _react2.default.createElement(_RequestPortal2.default, {
            isOpen: this.state.saveRequest,
            successHandler: this.toggleSaveRequest,
            failHandler: this.toggleSaveRequest,
            request: _POST__saveActiveDataset2.default,
            data: {
              Overwrite: false
            },
            pendingText: {
              title: 'Please wait',
              text: 'Saving Dataset...'
            },
            successText: {
              title: 'Success!',
              text: 'Dataset Saved.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'The Dataset could not be saved.'
            } }),
          _react2.default.createElement(_RequestPortal2.default, {
            isOpen: this.state.discardRequest,
            successHandler: this.toggleDiscardRequest,
            failHandler: this.toggleDiscardRequest,
            request: _POST__loadDataset2.default,
            data: _activeDataset2.default.id,
            pendingText: {
              title: 'Please wait',
              text: 'Discarding changes...'
            },
            successText: {
              title: 'Success!',
              text: 'Changes discarded.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'Your changes could not be discarded.'
            } })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ConfirmActions, 'ConfirmActions', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/UnsavedDatasetOverlay/ConfirmActions/index.js');
}();

;

/***/ }),
/* 502 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1069);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _ConfirmActions = __webpack_require__(501);

var _ConfirmActions2 = _interopRequireDefault(_ConfirmActions);

var _ConfirmAlign = __webpack_require__(268);

var _ConfirmAlign2 = _interopRequireDefault(_ConfirmAlign);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var UnsavedDatasetOverlay = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_activeDataset2.default, 'handleDatasetUpdate')],

  getInitialState: function getInitialState() {
    return {
      saved: _activeDataset2.default.DataSetSaved,
      aligned: _activeDataset2.default.DataSetAligned
    };
  },
  handleDatasetUpdate: function handleDatasetUpdate() {
    this.setState({
      saved: _activeDataset2.default.DataSetSaved,
      aligned: _activeDataset2.default.DataSetAligned
    });
  },
  render: function render() {
    return this.state.saved ? null : _react2.default.createElement(
      'div',
      { className: 'UnsavedDatasetOverlay' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        this.renderModalContent()
      )
    );
  },
  renderModalContent: function renderModalContent() {
    return this.state.aligned ? _react2.default.createElement(_ConfirmActions2.default, null) : _react2.default.createElement(_ConfirmAlign2.default, null);
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(UnsavedDatasetOverlay, 'UnsavedDatasetOverlay', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/UnsavedDatasetOverlay/index.jsx');
}();

;

/***/ }),
/* 503 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1070);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ActionListModal = module.exports = __webpack_require__(1)({
  getDefaultProps: function getDefaultProps() {
    return {
      topOffset: 0,
      leftOffset: 0,
      rightOffset: 0,
      bottomOffset: 0
    };
  },
  _handleBackgroundClick: function _handleBackgroundClick(evt) {
    if (evt.target === this.modalBackground) {
      this.props.closePortal();
    }
  },
  render: function render() {
    var _this = this;

    var _arrow = (0, _classnames2.default)({
      _arrow: true,
      'is-left': this.props.arrowLeft,
      'is-right': this.props.arrowRight
    });
    return _react2.default.createElement(
      'div',
      {
        className: 'ActionListModal',
        ref: function ref(_ref) {
          return _this.modalBackground = _ref;
        },
        onClick: this._handleBackgroundClick },
      _react2.default.createElement(
        'div',
        {
          className: 'ActionListModal__innerContainer',
          style: {
            top: this.props.coords.top + 25 + this.props.topOffset - this.props.bottomOffset,
            left: this.props.coords.left - 133 - this.props.leftOffset + this.props.rightOffset
          } },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(
            'div',
            { className: _arrow },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'curvedtriangle' })
          ),
          this.props.children
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ActionListModal, 'ActionListModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_ActionListModal/index.jsx');
}();

;

/***/ }),
/* 504 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1071);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var AlertModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'AlertModal' },
      _react2.default.createElement(
        'h1',
        { className: '_title' },
        'Warning!'
      ),
      _react2.default.createElement(
        'p',
        { className: '_text' },
        'You have unsaved changes to this dataset, are you sure you want to continue?'
      ),
      _react2.default.createElement(
        'div',
        { className: '_buttons' },
        _react2.default.createElement(
          'button',
          {
            className: '_saveBtn',
            onClick: this.props.emitSaveDataset },
          'Save & Exit'
        ),
        _react2.default.createElement(
          'button',
          {
            className: '_discardBtn',
            onClick: this.props.emitExitWithoutSave },
          'Continue without saving'
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(AlertModal, 'AlertModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_AlertModal/index.jsx');
}();

;

/***/ }),
/* 505 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1073);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _POST__confirmUploadExcelFile = __webpack_require__(414);

var _POST__confirmUploadExcelFile2 = _interopRequireDefault(_POST__confirmUploadExcelFile);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var RequestModal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      pending: true,
      fail: false,
      success: false,
      accepted: false
    };
  },
  componentWillMount: function componentWillMount() {
    this.callAsyncRequest();
  },
  setPendingState: function setPendingState() {
    this.setState({
      pending: true,
      fail: false,
      success: false,
      accepted: false
    }, this.callAsyncRequest);
  },
  confirmHandler: function confirmHandler() {
    var _this = this;

    this.setState({
      pending: true,
      fail: false,
      success: false,
      accepted: false
    }, function () {
      (0, _POST__confirmUploadExcelFile2.default)({
        Confirm: true,
        Filename: _this.state.filename
      }, _this.handleRequestResp);
    });
  },
  cancelConfirmHandler: function cancelConfirmHandler() {
    (0, _POST__confirmUploadExcelFile2.default)({
      Confirm: false,
      Filename: this.state.filename
    }, this.handleConfirmResp);
  },
  callAsyncRequest: function callAsyncRequest() {
    if (this.props.GET) return this.props.request(this.handleRequestResp);
    this.props.request(this.props.data, this.handleRequestResp);
  },
  handleRequestResp: function handleRequestResp(resp) {
    if (this.props.debug) return this.handleFail(resp);
    if (resp.statusCode === 200) return this.handleSuccess(resp);
    if (resp.statusCode === 202) return this.handleAccept(resp);
    return this.handleFail(resp);
  },
  handleConfirmResp: function handleConfirmResp(resp) {
    if (this.props.debug) return this.handleFail(resp);
    if (resp.statusCode === 200) return this.props.successHandler(true);
    return this.handleFail(resp);
  },
  handleSuccess: function handleSuccess(resp) {
    this.setState({
      pending: false,
      success: true,
      reponse: resp,
      accepted: false
    }, function () {
      if (this.props.wait) return;
      if (typeof this.props.timeout !== 'number') return this.props.successHandler();
      this._handleRespSuccessTimeout();
    });
  },
  handleAccept: function handleAccept(resp) {
    var data = JSON.parse(resp.body);
    this.setState({
      pending: false,
      fail: false,
      reponse: resp,
      accepted: true,
      filename: data.Filename,
      datasets: data.Datasets
    });
  },
  handleFail: function handleFail(resp) {
    this.setState({
      pending: false,
      fail: true,
      reponse: resp,
      accepted: false
    });
  },
  _handleRespSuccessTimeout: function _handleRespSuccessTimeout() {
    var _this2 = this;

    setTimeout(function () {
      _this2.props.successHandler();
    }, this.props.timeout);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'RequestModal' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: 'RequestModal__content' },
          this.renderPendingState(),
          this.renderSuccessState(),
          this.renderAcceptState(),
          this.renderFailState()
        )
      )
    );
  },
  _renderCloseBtn: function _renderCloseBtn() {
    return !this.props.wait ? null : _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.failHandler });
  },
  renderPendingState: function renderPendingState() {
    var content = this.props.pendingText;
    return !this.state.pending ? null : _react2.default.createElement(
      'div',
      { className: '_pending' },
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      )
    );
  },
  renderSuccessState: function renderSuccessState() {
    var content = this.props.successText;
    return !this.state.success ? null : _react2.default.createElement(
      'div',
      { className: '_success' },
      this._renderCloseBtn(),
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      )
    );
  },
  renderAcceptState: function renderAcceptState() {
    var content = this.props.acceptedText;
    return !this.state.accepted ? null : _react2.default.createElement(
      'div',
      { className: '_fail' },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.cancelHandler }),
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      ),
      _react2.default.createElement(
        'div',
        { className: 'RequestModal__datasetList' },
        this.renderDatasets()
      ),
      _react2.default.createElement(
        'div',
        { className: 'RequestModal__actions' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this.cancelConfirmHandler },
          'Cancel'
        ),
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this.confirmHandler },
          'Yes - Overwrite'
        )
      )
    );
  },
  renderDatasets: function renderDatasets() {
    return this.state.datasets.map(function (id) {
      var dataset = _.find(_datasetList2.default.store, { Id: id });
      var title = typeof dataset === 'undefined' ? id : dataset.Name;
      return _react2.default.createElement(
        'div',
        { className: '_item', key: id },
        title
      );
    });
  },
  renderFailState: function renderFailState() {
    var content = this.props.failText;
    return !this.state.fail ? null : _react2.default.createElement(
      'div',
      { className: '_fail' },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.failHandler }),
      _react2.default.createElement(
        'h2',
        { className: 'RequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'RequestModal__text' },
        content.text
      ),
      _react2.default.createElement(
        'div',
        { className: 'RequestModal__actions' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this.props.failHandler },
          'Cancel'
        ),
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this.setPendingState },
          'Try again?'
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RequestModal, 'RequestModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_CreateDatasetModal/UploadRequestModal/index.jsx');
}();

;

/***/ }),
/* 506 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  _handleSelect: function _handleSelect(evt) {
    this.props.handleChange(evt);
  },
  render: function render() {
    var selectElement = _react2.default.createElement(
      'select',
      { id: this.props.id,
        className: 'SelectInput__field is-disabled',
        disabled: false,
        value: '1' },
      _react2.default.createElement(
        'option',
        { value: '1' },
        'waiting for data...'
      )
    );

    if (typeof this.props.value !== "undefined") {

      var sortedOptions = _.sortBy(this.props.options, 'Id');

      var da0001 = _.find(sortedOptions, { Title: 'DA0001' });

      if (da0001) {
        sortedOptions = sortedOptions.filter(function (option) {
          return option.Title !== 'DA0001';
        }).concat([da0001]);
      }

      var optionsList = _.map(sortedOptions, function (option, index) {
        return _react2.default.createElement(
          'option',
          { key: index, value: option.Title },
          option.Title
        );
      });

      selectElement = _react2.default.createElement(
        'select',
        { id: this.props.id, className: 'SelectInput__field',
          value: this.props.value,
          onChange: this._handleSelect },
        optionsList
      );
    }

    return _react2.default.createElement(
      'div',
      { className: 'SelectInput' },
      _react2.default.createElement(
        'div',
        { className: 'SelectInput__dropdown' },
        selectElement,
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow', width: '9px' })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 507 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  _handleSelect: function _handleSelect(evt) {
    this.props.handleChange(evt);
  },
  render: function render() {
    var selectElement = _react2.default.createElement(
      'select',
      { id: this.props.id,
        className: 'SelectInput__field is-disabled',
        disabled: false,
        value: '1' },
      _react2.default.createElement(
        'option',
        { value: '1' },
        'waiting for data...'
      )
    );

    if (typeof this.props.value !== "undefined") {

      var optionsList = _.map(_.sortBy(this.props.options, 'Id'), function (option, index) {
        return _react2.default.createElement(
          'option',
          { key: index, value: option.Id },
          option.Title
        );
      });

      selectElement = _react2.default.createElement(
        'select',
        { id: this.props.id, className: 'SelectInput__field',
          value: this.props.value,
          onChange: this._handleSelect },
        optionsList
      );
    }

    return _react2.default.createElement(
      'div',
      { className: 'SelectInput' },
      _react2.default.createElement(
        'div',
        { className: 'SelectInput__dropdown' },
        selectElement,
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow', width: '9px' })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 508 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1075);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _UnfilteredList = __webpack_require__(198);

var _UnfilteredList2 = _interopRequireDefault(_UnfilteredList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var EditGroupModal__DatasetList = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList2.default, "_handleNewData")],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    if (_datasetList2.default.store.length >= 1) {
      this._handleNewData();
    }
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      list: (0, _filterVisibleDatasets2.default)()
    });
  },
  getSelectedList: function getSelectedList() {
    var _this = this;

    return this.state.list.filter(function (item, index) {
      return _.includes(_this.props.selectedList, item.Id);
    });
  },
  getUnSelectedList: function getUnSelectedList() {
    var _this2 = this;

    return this.state.list.filter(function (item, index) {
      return !_.includes(_this2.props.selectedList, item.Id);
    });
  },
  _renderSelectedGroup: function _renderSelectedGroup() {
    return this.props.selectedList.length < 1 ? null : _react2.default.createElement(
      'div',
      { className: '_selectedGroup' },
      _react2.default.createElement(
        'h3',
        { className: '_message' },
        'Select datasets to remove them from this group:'
      ),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(_DatasetList2.default, {
          list: this.getSelectedList(),
          emitItemClick: this.props.emitRemoveSelected })
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'EditGroupModal__DatasetList' },
      this._renderSelectedGroup(),
      _react2.default.createElement(
        'h3',
        { className: '_message' },
        'Select datasets to be included in this group:'
      ),
      _react2.default.createElement(_UnfilteredList2.default, {
        list: this.getUnSelectedList(),
        listComponent: _DatasetList2.default,
        emitItemClick: this.props.emitAddSelected })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(EditGroupModal__DatasetList, 'EditGroupModal__DatasetList', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_EditGroupModal/_DatasetList/index.jsx');
}();

;

/***/ }),
/* 509 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1076);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _TextInput = __webpack_require__(152);

var _TextInput2 = _interopRequireDefault(_TextInput);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _POST__createGroup = __webpack_require__(416);

var _POST__createGroup2 = _interopRequireDefault(_POST__createGroup);

var _POST__editGroup = __webpack_require__(418);

var _POST__editGroup2 = _interopRequireDefault(_POST__editGroup);

var _DatasetList = __webpack_require__(508);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var EditGroupModal = module.exports = __webpack_require__(1)({
  __getGroupDatasets: function __getGroupDatasets(id) {
    return _.find(_datasetGroups2.default.store, { Id: id }).DataSets;
  },
  __getGroupName: function __getGroupName(id) {
    return _.find(_datasetGroups2.default.store, { Id: id }).Title;
  },
  getInitialState: function getInitialState() {
    var group = this.props.group;
    var datasets = group === null ? [] : this.__getGroupDatasets(group);
    var title = group === null ? '' : this.__getGroupName(group);

    return {
      selectedList: datasets,
      title: title,
      createRequestPortalOpen: false,
      editRequestPortalOpen: false
    };
  },
  _toggleCreateRequestPortal: function _toggleCreateRequestPortal() {
    if (this.state.title === '') return;
    this.setState({
      createRequestPortalOpen: !this.state.createRequestPortalOpen
    });
  },
  _toggleEditRequestPortal: function _toggleEditRequestPortal() {
    if (this.state.title === '') return;
    this.setState({
      editRequestPortalOpen: !this.state.editRequestPortalOpen
    });
  },
  _handleCreateSuccess: function _handleCreateSuccess() {
    this._toggleCreateRequestPortal();
    this.props.toggleModal();
  },
  _handleEditSuccess: function _handleEditSuccess() {
    this._toggleEditRequestPortal();
    this.props.toggleModal();
  },
  _handleTitleUpdate: function _handleTitleUpdate(newTitle, id) {
    this.setState({
      title: newTitle
    });
  },
  _handleRemoveSelected: function _handleRemoveSelected(dataset) {
    this.setState({
      selectedList: this.state.selectedList.filter(function (item, index) {
        return item !== dataset.Id;
      })
    });
  },
  _handleAddSelected: function _handleAddSelected(dataset) {
    var newList = this.state.selectedList;
    newList.push(dataset.Id);
    this.setState({
      selectedList: newList
    });
  },
  _renderSaveBtn: function _renderSaveBtn() {
    var _btn = (0, _classnames2.default)({
      _btn: true,
      'is-disabled': this.state.title === ''
    });
    return this.props.group === null ? _react2.default.createElement(
      'button',
      { className: _btn, onClick: this._toggleCreateRequestPortal },
      'Create new group'
    ) : _react2.default.createElement(
      'button',
      { className: _btn, onClick: this._toggleEditRequestPortal },
      'Save changes to group'
    );
  },
  _renderLabelText: function _renderLabelText() {
    return this.props.group === null ? 'Enter new group title:' : 'Edit group title:';
  },
  _handleBackgroundClick: function _handleBackgroundClick(evt) {
    if (evt.target === this.modalContainer) {
      this.props.toggleModal();
    }
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      {
        className: 'EditGroupModal',
        ref: function ref(_ref) {
          return _this.modalContainer = _ref;
        },
        onClick: this._handleBackgroundClick },
      _react2.default.createElement(
        'div',
        { className: '_innerContainer' },
        _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.toggleModal }),
        _react2.default.createElement(
          'div',
          { className: 'EditGroupModal__Banner' },
          _react2.default.createElement(
            'div',
            { className: '_nameField' },
            _react2.default.createElement(
              'h2',
              { className: '_label' },
              this._renderLabelText()
            ),
            _react2.default.createElement(
              'div',
              { className: '_input' },
              _react2.default.createElement(_TextInput2.default, {
                id: 'GroupName',
                value: this.state.title,
                onSubmit: this._handleTitleUpdate
              })
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_saveBtn' },
            this._renderSaveBtn()
          )
        ),
        _react2.default.createElement(_DatasetList2.default, {
          selectedList: this.state.selectedList,
          emitRemoveSelected: this._handleRemoveSelected,
          emitAddSelected: this._handleAddSelected
        })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.createRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleCreateSuccess,
          failHandler: this._toggleCreateRequestPortal,
          request: _POST__createGroup2.default,
          data: {
            Title: this.state.title,
            DataSets: this.state.selectedList
          },
          pendingText: {
            title: 'Please wait',
            text: 'Creating group...'
          },
          successText: {
            title: 'Success!',
            text: 'Group was created.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The group could not be created.'
          }
        })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.editRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleEditSuccess,
          failHandler: this._toggleEditRequestPortal,
          request: _POST__editGroup2.default,
          data: {
            Id: this.props.group,
            Title: this.state.title,
            DataSets: this.state.selectedList
          },
          pendingText: {
            title: 'Please wait',
            text: 'Updating group...'
          },
          successText: {
            title: 'Success!',
            text: 'Group was updated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The group could not be updated.'
          }
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(EditGroupModal, 'EditGroupModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_EditGroupModal/index.jsx');
}();

;

/***/ }),
/* 510 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1079);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var InvisibleRequestModal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      pending: true,
      fail: false,
      success: false
    };
  },
  componentWillMount: function componentWillMount() {
    if (this.props.onPending) this.props.onPending();
    this._callAsyncRequest();
  },
  _setPendingState: function _setPendingState() {
    this.setState({
      pending: true,
      fail: false,
      success: false
    }, this._callAsyncRequest);
  },
  _callAsyncRequest: function _callAsyncRequest() {
    if (this.props.GET) return this.props.request(this._handleRequestResp);
    this.props.request(this.props.data, this._handleRequestResp);
  },
  _handleRequestResp: function _handleRequestResp(resp) {
    if (this.props.onClearPending) this.props.onClearPending();
    if (this.props.debug) return this._handleFail(resp);

    if (resp.statusCode === 200) {
      this._handleSuccess(resp);
    } else {
      this._handleFail(resp);
    }
  },
  _handleSuccess: function _handleSuccess(resp) {

    this.setState({
      pending: false,
      success: true,
      reponse: resp
    }, function () {
      if (this.props.wait) return;
      if (typeof this.props.timeout !== 'number') return this.props.successHandler();
      this._handleRespSuccessTimeout();
    });
  },
  _handleFail: function _handleFail(resp) {
    this.setState({
      pending: false,
      fail: true,
      reponse: resp
    });
  },
  _handleRespSuccessTimeout: function _handleRespSuccessTimeout() {
    var _this = this;

    setTimeout(function () {
      _this.props.successHandler();
    }, this.props.timeout);
  },
  _renderCloseBtn: function _renderCloseBtn() {
    return !this.props.wait ? null : _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.failHandler });
  },
  _renderPendingState: function _renderPendingState() {
    var content = this.props.pendingText;
    return !this.state.pending ? null : _react2.default.createElement(
      'div',
      { className: '_pending' },
      _react2.default.createElement(
        'h2',
        { className: 'InvisibleRequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'InvisibleRequestModal__text' },
        content.text
      )
    );
  },
  _renderSuccessState: function _renderSuccessState() {
    var content = this.props.successText;
    return !this.state.success ? null : _react2.default.createElement(
      'div',
      { className: '_success' },
      this._renderCloseBtn(),
      _react2.default.createElement(
        'h2',
        { className: 'InvisibleRequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'InvisibleRequestModal__text' },
        content.text
      )
    );
  },
  _renderFailState: function _renderFailState() {
    var content = this.props.failText;
    return !this.state.fail ? null : _react2.default.createElement(
      'div',
      { className: '_fail' },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.failHandler }),
      _react2.default.createElement(
        'h2',
        { className: 'InvisibleRequestModal__title' },
        content.title
      ),
      _react2.default.createElement(
        'p',
        { className: 'InvisibleRequestModal__text' },
        content.text
      ),
      _react2.default.createElement(
        'div',
        { className: 'InvisibleRequestModal__actions' },
        _react2.default.createElement(
          'button',
          {
            className: '_btn',
            onClick: this.props.failHandler },
          'Cancel'
        ),
        _react2.default.createElement(
          'button',
          {
            className: '_btn',
            onClick: this._setPendingState },
          'Try again?'
        )
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: (0, _classnames2.default)({
          InvisibleRequestModal: true,
          fail: this.state.fail
        }) },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: 'InvisibleRequestModal__content' },
          this._renderPendingState(),
          this._renderSuccessState(),
          this._renderFailState()
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(InvisibleRequestModal, 'InvisibleRequestModal', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_InvisibleRequestModal/index.jsx');
}();

;

/***/ }),
/* 511 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1080);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _velocityAnimate = __webpack_require__(186);

var _velocityAnimate2 = _interopRequireDefault(_velocityAnimate);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// use a function component because didMount isn't cutting it...
var Spinner = function Spinner(props) {
  var _spinner = (0, _react.useRef)(null);

  (0, _react.useEffect)(function () {
    (0, _velocityAnimate2.default)(_spinner.current, { rotateZ: 360 }, {
      loop: true,
      duration: 1000
    });
  }, []);

  return _react2.default.createElement(
    'div',
    null,
    _react2.default.createElement(
      'h2',
      null,
      _react2.default.createElement(_Icon2.default, {
        ref: _spinner,
        className: '_icon--spinner',
        id: 'loading',
        width: '14px',
        height: '14px'
      }),
      ' ',
      'Authorising...'
    )
  );
};

var Login = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_user2.default, '_handleSessionUpdate')],

  getInitialState: function getInitialState() {
    return {
      authorised: typeof _user2.default.auth.Authorised === 'undefined' ? false : _user2.default.auth.Authorised,
      denied: typeof _user2.default.auth.AccessDenied === 'undefined' ? false : _user2.default.auth.AccessDenied,
      disconnected: typeof _user2.default.auth.ConnectionError === 'undefined' ? false : _user2.default.auth.ConnectionError
    };
  },
  _handleSessionUpdate: function _handleSessionUpdate() {
    if (_user2.default.auth.Authorised) {
      this.setState({
        authorised: true,
        denied: false
      });
      this._animateSpinnerOut();
    }
    if (_user2.default.auth.AccessDenied) {
      this.setState({ denied: true });
    }
    if (_user2.default.auth.ConnectionError) {
      this.setState({ disconnected: true });
    }
  },
  _animateSpinnerOut: function _animateSpinnerOut() {
    (0, _velocityAnimate2.default)(this.tick || {}, { rotateZ: 0 }, 0);
    (0, _velocityAnimate2.default)(this.tick || {}, { scale: [1.0, 0.6] }, {
      duration: 600,
      easing: [250, 15],
      complete: this.props.handleAuth
    });
    (0, _velocityAnimate2.default)(this.tick || {}, 'stop');
  },
  _refreshApp: function _refreshApp() {
    window.location.reload();
  },
  render: function render() {
    var _this = this;

    var authHTML = _react2.default.createElement(Spinner, null);

    if (this.state.authorised) {
      authHTML = _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(
          'h2',
          { ref: function ref(_ref2) {
              return _this.authMsg = _ref2;
            } },
          _react2.default.createElement(_Icon2.default, {
            className: '_icon--tick',
            ref: function ref(_ref) {
              return _this.tick = _ref;
            },
            id: 'tick'
          }),
          ' ',
          _react2.default.createElement(
            'span',
            { className: 'positive' },
            'Account authorised'
          )
        )
      );
    }

    if (this.state.denied) {
      authHTML = _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(
          'h2',
          null,
          'Sorry, access denied.'
        ),
        _react2.default.createElement(
          'a',
          { href: 'http://authority.dairybase.com.au' },
          'Please login again'
        )
      );
    }

    if (this.state.disconnected) {
      authHTML = _react2.default.createElement(
        'div',
        null,
        _react2.default.createElement(
          'h2',
          null,
          'It seems like you\'re having trouble connecting to DairyBase. ',
          _react2.default.createElement('br', null),
          'Please check your internet connection.'
        ),
        _react2.default.createElement(
          'button',
          { onClick: this._refreshApp },
          'Try connecting again'
        )
      );
    }

    return _react2.default.createElement(
      'div',
      { className: 'Login' },
      _react2.default.createElement(
        'div',
        { className: 'Login__content' },
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' }),
        _react2.default.createElement(
          'div',
          { className: 'Datasets__LoginSublogo' },
          _react2.default.createElement(
            'div',
            null,
            'DairyBase'
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_auth' },
          authHTML
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Spinner, 'Spinner', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_Login/index.jsx');

  __REACT_HOT_LOADER__.register(Login, 'Login', 'C:/_repos_windows/dairybase/Frontend/app/views/modals/_Login/index.jsx');
}();

;

/***/ }),
/* 512 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames3 = __webpack_require__(7);

var _classnames4 = _interopRequireDefault(_classnames3);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _xchSpinner = __webpack_require__(200);

var _xchSpinner2 = _interopRequireDefault(_xchSpinner);

var _style = __webpack_require__(973);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var CheckBox = module.exports = __webpack_require__(1)({
  _handleSubmitData: function _handleSubmitData() {
    if (this.props.disabled) return;
    this.props.onSubmit(+this.props.value ? 0 : 1, this.props.id);
  },
  render: function render() {
    var _classnames, _classnames2;

    var InputSwitchbox = (0, _classnames4.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['root'], true), _defineProperty(_classnames, _style2.default['is-error'], this.props.error), _classnames));

    var checkClasses = (0, _classnames4.default)((_classnames2 = {}, _defineProperty(_classnames2, _style2.default['_box'], true), _defineProperty(_classnames2, _style2.default['is-checked'], this.props.value), _defineProperty(_classnames2, _style2.default['is-pending'], this.props.pending), _defineProperty(_classnames2, _style2.default['is-disabled'], this.props.disabled), _classnames2));

    return _react2.default.createElement(
      'div',
      { className: InputSwitchbox },
      _react2.default.createElement(
        'div',
        { className: checkClasses, onClick: this._handleSubmitData },
        this.renderIcon()
      )
    );
  },
  renderIcon: function renderIcon() {
    if (this.props.pending) return _react2.default.createElement(
      'div',
      { className: _style2.default.spinner },
      _react2.default.createElement(_xchSpinner2.default, null)
    );

    return !this.props.value ? null : _react2.default.createElement(_Icon2.default, { id: 'tick',
      className: _style2.default.icon });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(CheckBox, 'CheckBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/CheckBox/index.jsx');
}();

;

/***/ }),
/* 513 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _CCNumber = __webpack_require__(158);

var _CCNumber2 = _interopRequireDefault(_CCNumber);

var _CheckBox = __webpack_require__(512);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _style = __webpack_require__(514);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var _props = this.props,
        editObj = _props.editObj,
        expanded = _props.expanded,
        feedsInError = _props.feedsInError,
        onSetState = _props.onSetState;


    if (typeof editObj === 'undefined') return null;

    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.ToggleRow,
        null,
        _react2.default.createElement(
          _style.ToggleTitle,
          { onClick: function onClick() {
              return onSetState({ expanded: !expanded });
            } },
          _react2.default.createElement(_style.ToggleIcon, { id: expanded ? 'da_collapse' : 'da_expand' }),
          ' ',
          expanded ? 'Collapse' : 'Expand',
          ' feed records'
        ),
        _react2.default.createElement(
          _style.CheckBoxCol,
          null,
          _react2.default.createElement(
            _ConnectedCCField2.default,
            { FieldKey: 'CcModelSwitchId' },
            function (_ref) {
              var Value = _ref.Value,
                  _onSubmit = _ref.onSubmit;
              return _react2.default.createElement(_CheckBox2.default, {
                value: Value,
                onSubmit: function onSubmit() {
                  _onSubmit(Value === 0 ? 1 : 0);

                  if (Value === 0 && !expanded) {
                    onSetState({
                      expanded: true
                    });
                  }
                }
              });
            }
          ),
          _react2.default.createElement(
            _style.CheckBoxTitle,
            null,
            'Use feed records to set expense'
          )
        )
      ),
      expanded && (feedsInError ? null : _react2.default.createElement(
        _react2.default.Fragment,
        null,
        _react2.default.createElement(
          _style.Row,
          null,
          _react2.default.createElement('div', null),
          _react2.default.createElement(
            _style.Inputs,
            { header: true },
            _react2.default.createElement(
              _style.TopHeader,
              null,
              'Source Data'
            ),
            _react2.default.createElement(
              _style.ScenarioHeader,
              null,
              _react2.default.createElement(
                _style.TopHeader,
                null,
                'New Budget'
              )
            )
          )
        ),
        _react2.default.createElement(
          _style.Row,
          { header: true },
          _react2.default.createElement(_style.LabelCol, null),
          _react2.default.createElement(
            _style.Inputs,
            { header: true },
            _react2.default.createElement(
              _style.InputCol,
              { header: true, style: { width: '150px' } },
              'Tonnes Purchased'
            ),
            _react2.default.createElement(
              _style.InputCol,
              { header: true },
              '$ / Tonne'
            ),
            _react2.default.createElement(
              _style.ScenarioInputs,
              null,
              _react2.default.createElement(
                _style.InputCol,
                { header: true, scenario: true },
                '$ / Tonne'
              ),
              _react2.default.createElement(
                _style.InputCol,
                { header: true, scenario: true },
                '% Change'
              )
            )
          )
        ),
        this.renderGroup('Concentrate'),
        this.renderGroup('Fodder'),
        this.renderGroup('Other Feed')
      ))
    );
  },
  renderGroup: function renderGroup(key) {
    var groupedFeeds = this.props.groupedFeeds;


    if (!groupedFeeds[key] || groupedFeeds[key].length === 0) return null;
    return _react2.default.createElement(
      _react2.default.Fragment,
      null,
      _react2.default.createElement(
        _style.Row,
        { header: true },
        _react2.default.createElement(
          _style.LabelCol,
          { small: true },
          key
        ),
        _react2.default.createElement(
          _style.Inputs,
          { header: true },
          _react2.default.createElement(_style.InputCol, { header: true, style: { width: '150px' } }),
          _react2.default.createElement(_style.InputCol, { header: true }),
          _react2.default.createElement(
            _style.ScenarioInputs,
            null,
            _react2.default.createElement(_style.InputCol, { header: true, scenario: true }),
            _react2.default.createElement(_style.InputCol, { header: true, scenario: true })
          )
        )
      ),
      groupedFeeds[key].map(this.renderFeedRow)
    );
  },
  renderFeedRow: function renderFeedRow(sourceFeed, i) {
    var _props2 = this.props,
        budgetFeedsByRowKey = _props2.budgetFeedsByRowKey,
        FeedsByTypeId = _props2.FeedsByTypeId;
    var Id = sourceFeed.Id,
        FeedTypeId = sourceFeed.FeedTypeId,
        SwitchAsIsTdm = sourceFeed.SwitchAsIsTdm,
        QuantityPurchased = sourceFeed.QuantityPurchased,
        PricePerTonne = sourceFeed.PricePerTonne;

    // DO: budgetFeedsByRowKeyFeedsByTypeId

    var budgetFeed = budgetFeedsByRowKey[FeedTypeId + '_' + QuantityPurchased] || {};

    var FeedType = FeedsByTypeId[FeedTypeId] || {};

    return _react2.default.createElement(
      _style.Row,
      { key: Id },
      _react2.default.createElement(
        _style.LabelCol,
        null,
        FeedType.Title
      ),
      _react2.default.createElement(
        _ConnectedCCField2.default,
        { FieldKey: 'CcModelSwitchId' },
        function (_ref2) {
          var Value = _ref2.Value,
              onSubmit = _ref2.onSubmit;
          return _react2.default.createElement(
            _style.Inputs,
            null,
            _react2.default.createElement(
              _style.InputCol,
              { asis: true, style: { paddingRight: '15px' } },
              SwitchAsIsTdm === 0 ? 't DM' : 'As Is'
            ),
            _react2.default.createElement(
              _style.InputCol,
              { style: { paddingRight: '15px' } },
              QuantityPurchased
            ),
            _react2.default.createElement(
              _style.InputCol,
              { style: { paddingRight: '15px' } },
              _react2.default.createElement(_NumberOutput2.default, { value: PricePerTonne, decimal: 0 })
            ),
            _react2.default.createElement(
              _style.ScenarioInputs,
              null,
              _react2.default.createElement(
                _style.InputCol,
                { scenario: true },
                _react2.default.createElement(_CCNumber2.default, {
                  FeedRecordIds: {
                    budget: budgetFeed.Id,
                    source: Id
                  },
                  FieldKey: 'PricePerTonne',
                  IsInput: Value === 1
                })
              ),
              _react2.default.createElement(
                _style.InputCol,
                { scenario: true },
                _react2.default.createElement(_CCNumber2.default, {
                  FeedRecordIds: {
                    budget: budgetFeed.Id,
                    source: Id
                  },
                  FieldKey: 'PricePerTonne',
                  IsInput: Value === 1,
                  ratio: '%Change'
                })
              )
            )
          );
        }
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 514 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.CheckBoxTitle = exports.CheckBoxCol = exports.ToggleTitle = exports.ToggleIcon = exports.ToggleRow = exports.TopHeader = exports.InputCol = exports.ScenarioHeader = exports.ScenarioInputs = exports.Inputs = exports.LabelCol = exports.Row = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Records__Root'
})(['background:', ';margin-top:20px;'], _css.vars.a(_css.vars.DA_sun_yellow, 25));

var Row = exports.Row = _styledComponents2.default.div.withConfig({
  displayName: 'Records__Row'
})(['display:flex;justify-content:space-between;align-items:center;font-size:14px;', ' ', ' ', ''], function (props) {
  return props.scenario && '\n    background: ' + _css.mixins.opacity('#C3DC93', 25) + ';\n    border-top: 1px solid #C3DC93;\n    border-bottom: 1px solid #C3DC93;\n  ';
}, function (props) {
  return props.total && '\n    font-weight: bold;\n  ';
}, function (props) {
  return props.header && '\n    font-weight: bold;\n    align-items: flex-end;\n  ';
});

var LabelCol = exports.LabelCol = _styledComponents2.default.div.withConfig({
  displayName: 'Records__LabelCol'
})(['flex:1;display:flex;align-items:center;padding-right:10px;padding-left:10px;border-bottom:1px solid ', ';height:53px;font-weight:500;color:', ';font-size:14px;', ''], _css.vars.DA_Jersey_tan, _css.vars.DA_Dairy_blue, function (props) {
  return props.small && '\n      align-items: flex-end;\n      font-size: 12px;\n      font-weight: bold;\n      padding-bottom: 5px;\n  ';
});

var Inputs = exports.Inputs = _styledComponents2.default.div.withConfig({
  displayName: 'Records__Inputs'
})(['display:flex;justify-content:flex-end;align-items:center;']);

var ScenarioInputs = exports.ScenarioInputs = _styledComponents2.default.div.withConfig({
  displayName: 'Records__ScenarioInputs'
})(['display:flex;justify-content:flex-end;align-items:center;background:#f0f6e4;border-left:5px solid white;', ''], function (props) {
  return props.header && '\n    align-items: flex-end;\n  ';
});

var ScenarioHeader = exports.ScenarioHeader = _styledComponents2.default.div.withConfig({
  displayName: 'Records__ScenarioHeader'
})(['display:flex;justify-content:flex-end;align-items:center;background:#f0f6e4;border-left:5px solid white;border-top:5px solid white;', ''], function (props) {
  return props.header && '\n    align-items: flex-end;\n  ';
});

var InputCol = exports.InputCol = _styledComponents2.default.div.withConfig({
  displayName: 'Records__InputCol'
})(['color:', ';height:53px;display:flex;align-items:center;justify-content:flex-end;text-align:right;width:110px;padding-left:5px;padding-right:5px;padding-top:5px;padding-bottom:5px;border-bottom:1px solid ', ';', ' ', ' ', ''], _css.vars.DA_Dairy_blue, _css.vars.DA_Jersey_tan, function (props) {
  return props.asis && '\n    color: ' + _css.vars.DA_text + ';\n  ';
}, function (props) {
  return props.scenario && '\n    border-bottom: 1px solid ' + _css.vars.DA_pasture_green + ';\n  ';
}, function (props) {
  return props.header && '\n    padding-right: 15px;\n    font-size: 12px;\n    font-weight: bold;\n  ';
});
var TopHeader = exports.TopHeader = _styledComponents2.default.div.withConfig({
  displayName: 'Records__TopHeader'
})(['text-align:center;width:220px;padding-top:10px;padding-bottom:5px;font-size:12px;font-weight:bold;']);

var ToggleRow = exports.ToggleRow = _styledComponents2.default.div.withConfig({
  displayName: 'Records__ToggleRow'
})(['display:flex;align-items:center;justify-content:space-between;padding:10px;height:62px;']);

var ToggleIcon = exports.ToggleIcon = (0, _styledComponents2.default)(_xchIcon2.default).withConfig({
  displayName: 'Records__ToggleIcon'
})(['', ';margin-right:20px;margin-left:10px;path{fill:', ';}'], _css.mixins.icon('20px', '20px'), _css.vars.DA_Dairy_blue);

var ToggleTitle = exports.ToggleTitle = _styledComponents2.default.div.withConfig({
  displayName: 'Records__ToggleTitle'
})(['cursor:pointer;display:flex;align-items:center;font-weight:700;font-size:16px;color:', ';'], _css.vars.DA_Dairy_blue);

var CheckBoxCol = exports.CheckBoxCol = _styledComponents2.default.div.withConfig({
  displayName: 'Records__CheckBoxCol'
})(['display:flex;align-items:center;']);

var CheckBoxTitle = exports.CheckBoxTitle = _styledComponents2.default.div.withConfig({
  displayName: 'Records__CheckBoxTitle'
})(['padding-left:10px;padding-right:10px;color:', ';letter-spacing:0.8px;'], _css.vars.DA_text);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(LabelCol, 'LabelCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(Inputs, 'Inputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(ScenarioInputs, 'ScenarioInputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(ScenarioHeader, 'ScenarioHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(InputCol, 'InputCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(TopHeader, 'TopHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(ToggleRow, 'ToggleRow', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(ToggleIcon, 'ToggleIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(ToggleTitle, 'ToggleTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(CheckBoxCol, 'CheckBoxCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');

  __REACT_HOT_LOADER__.register(CheckBoxTitle, 'CheckBoxTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/Records/style.js');
}();

;

/***/ }),
/* 515 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _CCWarningIcon = __webpack_require__(285);

var _CCWarningIcon2 = _interopRequireDefault(_CCWarningIcon);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _Records = __webpack_require__(513);

var _Records2 = _interopRequireDefault(_Records);

var _EditorStyle = __webpack_require__(130);

var _CCHelpPortal = __webpack_require__(129);

var _CCHelpPortal2 = _interopRequireDefault(_CCHelpPortal);

var _style = __webpack_require__(516);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_budgets2.default, 'handleBudgetUpdate'), _reflux2.default.listenTo(_dataDefinition2.default, 'handleBudgetUpdate')],

  getInitialState: function getInitialState() {
    return {
      budgetObj: undefined,
      editObj: undefined,
      FeedsByTypeId: {},
      expanded: false,
      feedsInError: false,
      budgetFeedsByRowKey: {},
      groupedFeeds: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleBudgetUpdate();
  },
  handleBudgetUpdate: function handleBudgetUpdate() {
    var match = this.props.match;
    var budgetId = match.params.budgetId;


    var FeedGroupArr = _dataDefinition2.default.selectOptions.FeedGroupId || [];
    var FeedsByTypeId = FeedGroupArr.reduce(function (__obj, group) {
      var Options = group.Options;

      Options.forEach(function (option) {
        return __obj[option.Id] = option;
      });
      return __obj;
    }, {});

    var editObj = _budgets2.default.store.editsById[budgetId] || {};
    var budgetObj = _budgets2.default.store.budgetsById[budgetId] || {};

    var source = budgetObj.SourceDataset || {};
    var budget = editObj.ScenarioDataset || {};

    var CcModelSwitchId = budget.CcModelSwitchId;


    var sourceFeeds = source.CompCalculatorFeeds || [];
    var budgetFeeds = budget.CompCalculatorFeeds || [];

    var feedsInError = sourceFeeds.length !== budgetFeeds.length;

    var budgetFeedsByRowKey = budgetFeeds.reduce(function (__obj, feed) {
      var QuantityPurchased = feed.QuantityPurchased,
          FeedTypeId = feed.FeedTypeId;

      var key = FeedTypeId + '_' + QuantityPurchased;
      __obj[key] = feed;
      return __obj;
    }, {});

    var groupedFeeds = sourceFeeds.reduce(function (__obj, sourceFeed) {
      var FeedTypeId = sourceFeed.FeedTypeId,
          QuantityPurchased = sourceFeed.QuantityPurchased;

      var feedKey = FeedTypeId + '_' + QuantityPurchased;

      var budgetFeed = budgetFeedsByRowKey[feedKey];

      if (typeof budgetFeed === 'undefined') return __obj;

      var exists = __obj.exists[feedKey];

      if (exists) return __obj;

      var groupArr = __obj[sourceFeed.FeedCostGroupKey] || [];
      groupArr.push(sourceFeed);
      __obj.all.push(sourceFeed);
      __obj[sourceFeed.FeedCostGroupKey] = groupArr;
      __obj.exists[feedKey] = true;
      return __obj;
    }, { all: [], exists: {} });

    if (groupedFeeds.all.length !== budgetFeeds.length || groupedFeeds.all.length !== sourceFeeds.length) {
      feedsInError = true;
    }

    this.setState({
      FeedsByTypeId: FeedsByTypeId,
      budgetObj: budgetObj,
      editObj: editObj,
      groupedFeeds: groupedFeeds,
      budgetFeedsByRowKey: budgetFeedsByRowKey,
      expanded: this.state.expanded || CcModelSwitchId === 1,
      feedsInError: feedsInError
    });
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      _ConnectedCCField2.default,
      { FieldKey: 'CcModelSwitchId' },
      function (_ref) {
        var Value = _ref.Value,
            onSubmit = _ref.onSubmit;
        return _react2.default.createElement(
          _EditorStyle.Root,
          null,
          _react2.default.createElement(
            _CCBanner2.default,
            { TitleText: 'Budget Feed Prices', unit: '$ / t DM' },
            _react2.default.createElement(
              _style.BannerOutputs,
              null,
              _react2.default.createElement(
                _style.Output,
                null,
                _react2.default.createElement(
                  _style.OutputLabel,
                  null,
                  'Concentrate'
                ),
                _react2.default.createElement(
                  _style.OutputValue,
                  null,
                  _react2.default.createElement(
                    _ConnectedCCField2.default,
                    {
                      FieldKey: Value === 0 ? 'FeedConcCostPerTDM' : 'FeedConcPhysicalPurchaseCostPerTDM' },
                    function (_ref2) {
                      var Value = _ref2.Value,
                          Decimal = _ref2.Decimal;
                      return _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal });
                    }
                  )
                )
              ),
              _react2.default.createElement(
                _style.Output,
                null,
                _react2.default.createElement(
                  _style.OutputLabel,
                  null,
                  'Fodder'
                ),
                _react2.default.createElement(
                  _style.OutputValue,
                  null,
                  _react2.default.createElement(
                    _ConnectedCCField2.default,
                    {
                      FieldKey: Value === 0 ? 'FeedFodderCostPerTDM' : 'FeedFodderPhysicalCostPerTDM' },
                    function (_ref3) {
                      var Value = _ref3.Value,
                          Decimal = _ref3.Decimal;
                      return _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal });
                    }
                  )
                )
              ),
              _react2.default.createElement(
                _style.Output,
                null,
                _react2.default.createElement(
                  _style.OutputLabel,
                  null,
                  'Other'
                ),
                _react2.default.createElement(
                  _style.OutputValue,
                  null,
                  _react2.default.createElement(
                    _ConnectedCCField2.default,
                    {
                      FieldKey: Value === 0 ? 'FeedOtherCostPerTDM' : 'FeedOtherPhysicalPurchaseCostPerTDM' },
                    function (_ref4) {
                      var Value = _ref4.Value,
                          Decimal = _ref4.Decimal;
                      return _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal });
                    }
                  )
                )
              )
            ),
            _react2.default.createElement(
              _style.BannerContent,
              null,
              _react2.default.createElement(
                _ConnectedCCField2.default,
                {
                  IsSource: true,
                  FieldKey: 'ExpenseFeedPhysicalPurchaseTotal' },
                function (_ref5) {
                  var Value = _ref5.Value;
                  return _react2.default.createElement(
                    _ConnectedCCField2.default,
                    {
                      IsSource: true,
                      FieldKey: 'ExpenseFeedPurchaseTotal' },
                    function (props) {
                      var V1 = props.Value;
                      var V2 = Value;

                      var percent = (V1 - V2) / ((V1 + V2) / 2) * 100;

                      return percent < 5 && percent > -5 && !_this.state.feedsInError ? null : _react2.default.createElement(
                        'div',
                        { style: { paddingRight: '10px' } },
                        _react2.default.createElement(
                          _CCHelpPortal2.default,
                          { warning: true },
                          'The source data indicates that there is more than 5% variance in the total purchased feed costs based on the data entered in the physical feed section of DairyBase and the total purchased feed costs entered in the variable costs section.',
                          _react2.default.createElement('br', null),
                          _react2.default.createElement('br', null),
                          'Where there is a large discrepancy between the two it is recommended that you first ensure the quantities and purchase prices captured in the historical financial year used for budgeting are reflective of the actual quantities purchased and prices paid per tonne to align with the feed costs showing in the profit and loss for that financial year.',
                          _react2.default.createElement('br', null),
                          _react2.default.createElement('br', null),
                          'If changes are required to the feed quantities in the historical dataset you will need to create a new budget once those changes have been completed so they flow through to your budget.'
                        )
                      );
                    }
                  );
                }
              ),
              _react2.default.createElement(
                _CCHelpPortal2.default,
                null,
                'The $ value and $/tDM in the finance detail for your source dataset is based on the data entered into the variable costs in DairyBase, divided by the total tonnes of that feed type purchased, irrespective of the per tonne purchase price that was entered for each feed type. ',
                _react2.default.createElement('br', null),
                _react2.default.createElement('br', null),
                'The physical detail values are however, based on quantities purchased within each feed type multiplied by the purchase price per tonne entered for each feed in the physical tab without being validated back to the costs entered under variable costs from your profit and loss.',
                _react2.default.createElement('br', null),
                _react2.default.createElement('br', null),
                'Where there is a large discrepancy between the two it is recommended that you first ensure the quantities and purchase prices captured in the historical financial year used for budgeting are reflective of the actual quantities purchased and prices paid per tonne to align with the feed costs showing in the profit and loss for that financial year.',
                _react2.default.createElement('br', null),
                _react2.default.createElement('br', null),
                'If changes are required to the feed quantities in the historical dataset you will need to create a new budget once those changes have been completed so they flow through to your budget.',
                _react2.default.createElement('br', null),
                _react2.default.createElement('br', null),
                'Please note that all feed prices in the finance and physical detail are based on $/tDM. If you select to change the individual feed records for each feed, the budget prices you enter will be based on the dry matter selection you used for each feed in the source dataset'
              )
            )
          ),
          _react2.default.createElement(_CCTable2.default, {
            rows: [{
              IsHeader: true,
              Label: 'Source Data',
              cols: [{
                Label: '$ Value ',
                Line2: 'Finance Detail',
                FieldKey: 'ExpenseFeedPurchaseTotal'
              }, {
                Label: '$ / t DM',
                FieldKey: 'FeedTotalCostPerTDM'
              }, {
                Label: '$ Value ',
                Line2: 'Physical Detail',
                FieldKey: 'ExpenseFeedPhysicalPurchaseTotal'
              }, {
                Label: '$ / t DM',
                FieldKey: 'FeedTotalPhysicalCostPerTDM'
              }, {
                Label: 't DM ',
                Line2: 'Purchased',
                FieldKey: 'FeedPurchasedTotalTDM'
              }]
            }, {
              FieldKey: 'ExpenseFodderPurchase',
              BorderBottom: true,
              IsGrey: true,
              Background: true,
              cols: [{
                FieldKey: 'ExpenseFodderPurchase',
                IsSource: true
              }, {
                FieldKey: 'FeedFodderCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'ExpenseFodderPhysicalPurchase',
                IsSource: true
              }, {
                FieldKey: 'FeedFodderPhysicalCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'FeedPurchasedFodderTDM',
                IsSource: true
              }]
            }, {
              FieldKey: 'ExpenseConcentratesPurchase',
              BorderBottom: true,
              IsGrey: true,
              cols: [{
                FieldKey: 'ExpenseConcentratesPurchase',
                IsSource: true
              }, {
                FieldKey: 'FeedConcCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'ExpenseConcentratesPhysicalPurchase',
                IsSource: true
              }, {
                FieldKey: 'FeedConcPhysicalPurchaseCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'FeedPurchasedConcTDM',
                IsSource: true
              }]
            }, {
              FieldKey: 'ExpenseOtherFeedPurchase',
              BorderBottom: true,
              IsGrey: true,
              Background: true,
              cols: [{
                FieldKey: 'ExpenseOtherFeedPurchase',
                IsSource: true
              }, {
                FieldKey: 'FeedOtherCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'ExpenseOtherFeedPhysicalPurchase',
                IsSource: true
              }, {
                FieldKey: 'FeedOtherPhysicalPurchaseCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'FeedPurchasedOtherTDM',
                IsSource: true
              }]
            }, {
              Label: 'Total Feed Purchases',
              Description: 'Total expense for all purchased feeds',
              BorderBottom: true,
              IsGrey: true,
              IsTotal: true,
              cols: [{
                FieldKey: 'ExpenseFeedPurchaseTotal',
                IsSource: true
              }, {
                FieldKey: 'FeedTotalCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'ExpenseFeedPhysicalPurchaseTotal',
                IsSource: true
              }, {
                FieldKey: 'FeedTotalPhysicalCostPerTDM',
                IsSource: true
              }, {
                FieldKey: 'FeedPurchasedTotalTDM',
                IsSource: true
              }]
            }]
          }),
          _react2.default.createElement(_CCTable2.default, {
            scenarioTable: true,
            rows: [{
              IsHeader: true,
              Label: 'New Budget',
              cols: [{
                Label: '$ Value ',
                Line2: 'Finance Detail',
                FieldKey: 'ExpenseFeedPurchaseTotal'
              }, {
                Label: '$ / t DM',
                FieldKey: 'FeedTotalCostPerTDM'
              }, {
                Label: '$ Value ',
                Line2: 'Physical Detail',
                FieldKey: 'ExpenseFeedPhysicalPurchaseTotal'
              }, {
                Label: '$ / t DM',
                FieldKey: 'FeedTotalPhysicalCostPerTDM'
              }, {
                Label: '% Change',
                FieldKey: 'ExpenseFeedPurchaseTotalDiffPercent'
              }]
            }, {
              FieldKey: 'ExpenseFodderPurchase',
              cols: [{
                FieldKey: Value === 0 ? 'ExpenseFodderPurchase' : 'ExpenseFodderPhysicalPurchase',
                IsInput: Value === 0
              }, {
                FieldKey: Value === 0 ? 'FeedFodderCostPerTDM' : 'FeedFodderPhysicalCostPerTDM'
              }, {
                FieldKey: 'ExpenseFodderPhysicalPurchase'
              }, {
                FieldKey: 'FeedFodderPhysicalCostPerTDM'
              }, {
                FieldKey: Value === 0 ? 'ExpenseFodderPurchase' : 'ExpenseFodderPhysicalPurchase',
                IsInput: Value === 0,
                ratio: '%Change'
              }]
            }, {
              FieldKey: 'ExpenseConcentratesPurchase',
              cols: [{
                FieldKey: Value === 0 ? 'ExpenseConcentratesPurchase' : 'ExpenseConcentratesPhysicalPurchase',
                IsInput: Value === 0
              }, {
                FieldKey: Value === 0 ? 'FeedConcCostPerTDM' : 'FeedConcPhysicalPurchaseCostPerTDM'
              }, {
                FieldKey: 'ExpenseConcentratesPhysicalPurchase'
              }, {
                FieldKey: 'FeedConcPhysicalPurchaseCostPerTDM'
              }, {
                FieldKey: Value === 0 ? 'ExpenseConcentratesPurchase' : 'ExpenseConcentratesPhysicalPurchase',
                IsInput: Value === 0,
                ratio: '%Change'
              }]
            }, {
              FieldKey: 'ExpenseOtherFeedPurchase',
              cols: [{
                FieldKey: Value === 0 ? 'ExpenseOtherFeedPurchase' : 'ExpenseOtherFeedPhysicalPurchase',
                IsInput: Value === 0
              }, {
                FieldKey: Value === 0 ? 'FeedOtherCostPerTDM' : 'FeedOtherPhysicalPurchaseCostPerTDM'
              }, {
                FieldKey: 'ExpenseOtherFeedPhysicalPurchase'
              }, {
                FieldKey: 'FeedOtherPhysicalPurchaseCostPerTDM'
              }, {
                FieldKey: Value === 0 ? 'ExpenseOtherFeedPurchase' : 'ExpenseOtherFeedPhysicalPurchase',
                IsInput: Value === 0,
                ratio: '%Change'
              }]
            }, {
              Label: 'Total Feed Purchases',
              Description: 'Total expense for all purchased feeds',
              IsTotal: true,
              BorderBottom: true,
              cols: [{
                FieldKey: Value === 0 ? 'ExpenseFeedPurchaseTotal' : 'ExpenseFeedPhysicalPurchaseTotal'
              }, {
                FieldKey: Value === 0 ? 'FeedTotalCostPerTDM' : 'FeedTotalPhysicalCostPerTDM'
              }, {
                FieldKey: 'ExpenseFeedPhysicalPurchaseTotal'
              }, {
                FieldKey: 'FeedTotalPhysicalCostPerTDM'
              }, {
                FieldKey: Value === 0 ? 'ExpenseFeedPurchaseTotal' : 'ExpenseFeedPhysicalPurchaseTotal',
                ratio: '%Change'
              }]
            }]
          }),
          _react2.default.createElement(_Records2.default, {
            budgetObj: _this.state.budgetObj,
            editObj: _this.state.editObj,
            FeedsByTypeId: _this.state.FeedsByTypeId,
            expanded: _this.state.expanded,
            feedsInError: _this.state.feedsInError,
            budgetFeedsByRowKey: _this.state.budgetFeedsByRowKey,
            groupedFeeds: _this.state.groupedFeeds,
            onSetState: function onSetState(newState) {
              return _this.setState(newState);
            }
          }),
          _this.state.feedsInError && _react2.default.createElement(
            _style.FeedError,
            null,
            _react2.default.createElement(
              _style.FeedErrorIcon,
              null,
              _react2.default.createElement(_CCWarningIcon2.default, null)
            ),
            'Feed records from the source dataset are not aligned - please archive and re-create this budget'
          )
        );
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 516 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackLink = exports.OutputValue = exports.OutputLabel = exports.Output = exports.BannerOutputs = exports.BannerContent = exports.FeedErrorIcon = exports.FeedError = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__Root'
})(['']);

var FeedError = exports.FeedError = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__FeedError'
})(['display:flex;align-items:center;font-weight:700;font-size:14px;padding:20px;padding-left:10px;padding-bottom:10px;']);

var FeedErrorIcon = exports.FeedErrorIcon = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__FeedErrorIcon'
})(['margin-right:20px;']);

var BannerContent = exports.BannerContent = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__BannerContent'
})(['position:absolute;z-index:1;right:30px;top:39px;display:flex;align-items:center;justify-content:flex-end;']);

var BannerOutputs = exports.BannerOutputs = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__BannerOutputs'
})(['flex:1;display:flex;align-items:center;justify-content:flex-end;font-size:12px;padding-right:110px;']);

var Output = exports.Output = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__Output'
})(['padding-right:20px;width:110px;']);

var OutputLabel = exports.OutputLabel = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__OutputLabel'
})(['font-weight:700;padding-bottom:5px;text-align:right;']);
var OutputValue = exports.OutputValue = _styledComponents2.default.div.withConfig({
  displayName: 'Feed__OutputValue'
})(['font-weight:700;font-size:14px;text-align:right;']);
var BackLink = exports.BackLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'Feed__BackLink'
})(['color:#b3b3b2;&:hover{color:#2e76d8;}&:active{text-decoration:underline;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(FeedError, 'FeedError', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(FeedErrorIcon, 'FeedErrorIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(BannerContent, 'BannerContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(BannerOutputs, 'BannerOutputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(Output, 'Output', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(OutputLabel, 'OutputLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(OutputValue, 'OutputValue', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');

  __REACT_HOT_LOADER__.register(BackLink, 'BackLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Feed/style.js');
}();

;

/***/ }),
/* 517 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _style = __webpack_require__(518);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_budgets2.default, 'handleBudgetUpdate'), _reflux2.default.listenTo(_dataDefinition2.default, 'handleBudgetUpdate')],

  getInitialState: function getInitialState() {
    return {
      budgetObj: undefined,
      FertiliserTypes: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleBudgetUpdate();
  },
  handleBudgetUpdate: function handleBudgetUpdate() {
    var match = this.props.match;
    var budgetId = match.params.budgetId;


    var FertTypeArr = _dataDefinition2.default.selectOptions.FertiliserTypeId || [];
    var FertiliserTypes = FertTypeArr.reduce(function (__obj, type) {
      __obj[type.Id] = type;
      return __obj;
    }, {});

    var budgetObj = _budgets2.default.store.budgetsById[budgetId] || {};

    this.setState({
      FertiliserTypes: FertiliserTypes,
      budgetObj: budgetObj
    });
  },
  render: function render() {
    var _state = this.state,
        budgetObj = _state.budgetObj,
        FertiliserTypes = _state.FertiliserTypes;


    if (typeof budgetObj === 'undefined') return null;

    var source = budgetObj.SourceDataset || {};
    var sourceFerts = source.CompCalculatorFertilisers || [];

    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.Row,
        { header: true },
        _react2.default.createElement(
          _style.LabelCol,
          { header: true },
          'Fertilisers'
        ),
        _react2.default.createElement(
          _style.Inputs,
          { header: true },
          _react2.default.createElement(
            _style.InputCol,
            { header: true },
            'Tonnes applied'
          )
        )
      ),
      sourceFerts.map(function (sourceFeed, i) {
        var Id = sourceFeed.Id,
            TonnesApplied = sourceFeed.TonnesApplied,
            FertiliserTypeId = sourceFeed.FertiliserTypeId;


        var FertType = FertiliserTypes[FertiliserTypeId] || {};
        return _react2.default.createElement(
          _style.Row,
          { key: Id, odd: (i + 1) % 2 == 0 },
          _react2.default.createElement(
            _style.LabelCol,
            null,
            FertType.Title
          ),
          _react2.default.createElement(
            _style.Inputs,
            null,
            _react2.default.createElement(
              _style.InputCol,
              null,
              _react2.default.createElement(_NumberOutput2.default, { value: TonnesApplied, decimal: 0 })
            )
          )
        );
      }),
      _react2.default.createElement(
        _style.Row,
        { key: 'total', odd: sourceFerts.length % 2 !== 0, total: true },
        _react2.default.createElement(
          _style.LabelCol,
          null,
          'Total Fertiliser Applied'
        ),
        _react2.default.createElement(
          _style.Inputs,
          null,
          _react2.default.createElement(
            _style.InputCol,
            null,
            _react2.default.createElement(_NumberOutput2.default, {
              value: sourceFerts.reduce(function (__num, fert) {
                return __num + fert.TonnesApplied;
              }, 0),
              decimal: 0
            })
          )
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 518 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.InputCol = exports.Inputs = exports.LabelCol = exports.Row = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Records__Root'
})(['width:388px;']);

var Row = exports.Row = _styledComponents2.default.div.withConfig({
  displayName: 'Records__Row'
})(['color:', ';display:flex;justify-content:space-between;align-items:center;font-size:14px;border-bottom:1px solid #E5EDED;', ' ', ' ', ' ', ''], _css.vars.DA_text, function (props) {
  return props.odd && '\n\n    background: ' + _css.vars.a(_css.vars.DA_Dairy_grey, 50) + ';\n  ';
}, function (props) {
  return props.scenario && '\n    background: ' + _css.mixins.opacity('#C3DC93', 25) + ';\n    border-top: 1px solid #C3DC93;\n    border-bottom: 1px solid #C3DC93;\n  ';
}, function (props) {
  return props.total && '\n    font-weight: 700;\n  ';
}, function (props) {
  return props.header && '\n    font-weight: 700;\n    border-bottom: 1px solid #E5EDED;\n    align-items: flex-end;\n    padding-top: 10px;\n    padding-bottom: 5px;\n  ';
});

var LabelCol = exports.LabelCol = _styledComponents2.default.div.withConfig({
  displayName: 'Records__LabelCol'
})(['width:182px;padding-right:10px;padding-left:10px;', ''], function (props) {
  return props.header && '\n      font-size: 16px;\n    color: ' + _css.vars.DA_Dairy_blue + ';\n  ';
});

var Inputs = exports.Inputs = _styledComponents2.default.div.withConfig({
  displayName: 'Records__Inputs'
})(['display:flex;align-items:center;justify-content:space-between;']);

var InputCol = exports.InputCol = _styledComponents2.default.div.withConfig({
  displayName: 'Records__InputCol'
})(['font-size:14px;text-align:right;width:110px;padding-right:10px;padding-top:10px;padding-bottom:10px;', ' ', ''], function (props) {
  return props.scenario && '\n    background: ' + _css.mixins.opacity('#C3DC93', 25) + ';\n  ';
}, function (props) {
  return props.header && '\n    font-size: 12px;\n    font-weight: 700;\n    padding-bottom: 0;\n    color: ' + _css.vars.DA_Dairy_blue + ';\n  ';
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/style.js');

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/style.js');

  __REACT_HOT_LOADER__.register(LabelCol, 'LabelCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/style.js');

  __REACT_HOT_LOADER__.register(Inputs, 'Inputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/style.js');

  __REACT_HOT_LOADER__.register(InputCol, 'InputCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/Records/style.js');
}();

;

/***/ }),
/* 519 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _ConnectedCCField = __webpack_require__(79);

var _ConnectedCCField2 = _interopRequireDefault(_ConnectedCCField);

var _NumberOutput = __webpack_require__(93);

var _NumberOutput2 = _interopRequireDefault(_NumberOutput);

var _Records = __webpack_require__(517);

var _Records2 = _interopRequireDefault(_Records);

var _EditorStyle = __webpack_require__(130);

var _CCHelpPortal = __webpack_require__(129);

var _CCHelpPortal2 = _interopRequireDefault(_CCHelpPortal);

var _style = __webpack_require__(520);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    var budgetId = this.props.match.params.budgetId;

    return _react2.default.createElement(
      _EditorStyle.Root,
      null,
      _react2.default.createElement(
        _CCBanner2.default,
        {
          TitleText: 'Budget Fertiliser Cost',
          TitleKey: 'ExpenseFertiliser',
          FieldKey: 'ExpenseFertiliser' },
        ' ',
        _react2.default.createElement(
          _style.BannerContent,
          null,
          _react2.default.createElement(
            _ConnectedCCField2.default,
            {
              FieldKey: 'ExpenseFertiliser',
              ratio: 'PerTonneApplied' },
            function (_ref) {
              var Value = _ref.Value,
                  Decimal = _ref.Decimal;
              return Value < 400 || Value > 700 ? _react2.default.createElement(
                'div',
                { style: { paddingRight: '10px' } },
                _react2.default.createElement(
                  _CCHelpPortal2.default,
                  { warning: true },
                  'Based on the information entered for fertiliser costs in your budget year, the $ per tonne applied ($',
                  _react2.default.createElement(_NumberOutput2.default, { value: Value, decimal: Decimal }),
                  '/tonne) is indicating a price that is either lower (',
                  '<',
                  '$400/tonne) or higher (',
                  '>',
                  '$700/tonne) than the average price paid for fertiliser across the benchmark datasets. This can be dependent on the types of fertiliser you are applying but it may also indicate that the quantities of fertiliser purchased, as defined in the source dataset, need to be reviewed.'
                )
              ) : null;
            }
          ),
          _react2.default.createElement(
            _CCHelpPortal2.default,
            null,
            'The $ per tonne applied is based on the total quantity of purchased fertiliser from the selected historical dataset. If the fertiliser quantities in that year were not representative of the total quantities purchased of each fertiliser type then the $ per tonne applied will not be an accurate reference point. ',
            _react2.default.createElement('br', null),
            ' ',
            _react2.default.createElement('br', null),
            'If you are wanting to use the $ per tonne applied as the measure for adjusting your budget then it is recommended that you first ensure the quantities of fertiliser purchased in the source year are an accurate reflection of what occurred in that year.'
          )
        )
      ),
      _react2.default.createElement(_CCTable2.default, {
        rows: [{
          IsHeader: true,
          cols: [{
            Label: '$ Value',
            FieldKey: 'ExpenseFertiliser'
          }, {
            Label: 'switch'
          }, {
            Label: '$ / Tonne applied'
          }, {
            Label: '% Change'
          }]
        }, {
          Label: 'Source Data',
          cols: [{
            FieldKey: 'ExpenseFertiliser',
            IsSource: true
          }, {
            FieldKey: 'ExpenseFertiliser',
            ratio: 'switch',
            IsSource: true
          }, {
            FieldKey: 'ExpenseFertiliser',
            IsSource: true,
            ratio: 'PerTonneApplied'
          }, {}]
        }, {
          Label: 'New Budget',
          IsScenario: true,
          cols: [{
            FieldKey: 'ExpenseFertiliser',
            IsInput: true
          }, {
            FieldKey: 'ExpenseFertiliser',
            ratio: 'switch',
            IsInput: true
          }, {
            FieldKey: 'ExpenseFertiliser',
            IsInput: true,
            ratio: 'PerTonneApplied'
          }, {
            FieldKey: 'ExpenseFertiliser',
            ratio: '%Change',
            IsInput: true
          }]
        }, {
          Label: 'Difference',
          BorderBottom: true,
          IsGrey: true,
          cols: [{
            FieldKey: 'ExpenseFertiliser',
            IsDifference: true
          }, {
            FieldKey: 'ExpenseFertiliser',
            ratio: 'switch',
            IsDifference: true
          }, {
            FieldKey: 'ExpenseFertiliser',
            IsDifference: true,
            ratio: 'PerTonneApplied'
          }, {}]
        }]
      }),
      _react2.default.createElement(_Records2.default, null)
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 520 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackLink = exports.BannerContent = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Fertiliser__Root'
})(['']);

var BannerContent = exports.BannerContent = _styledComponents2.default.div.withConfig({
  displayName: 'Fertiliser__BannerContent'
})(['flex:1;padding-right:20px;display:flex;align-items:center;justify-content:flex-end;']);

var BackLink = exports.BackLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'Fertiliser__BackLink'
})(['color:#b3b3b2;&:hover{color:#2e76d8;}&:active{text-decoration:underline;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/style.js');

  __REACT_HOT_LOADER__.register(BannerContent, 'BannerContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/style.js');

  __REACT_HOT_LOADER__.register(BackLink, 'BackLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Fertiliser/style.js');
}();

;

/***/ }),
/* 521 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _CCHelpPortal = __webpack_require__(129);

var _CCHelpPortal2 = _interopRequireDefault(_CCHelpPortal);

var _EditorStyle = __webpack_require__(130);

var _style = __webpack_require__(522);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _EditorStyle.Root,
      null,
      _react2.default.createElement(
        _CCBanner2.default,
        {
          TitleText: 'Budget Livestock Trading Profit',
          TitleKey: 'IncomeLivestockTrading',
          FieldKey: 'IncomeLivestockTrading' },
        _react2.default.createElement(
          _style.BannerContent,
          null,
          _react2.default.createElement(_CCHelpPortal2.default, {
            text: 'The budgeted income from livestock sales and any budgeted purchases should be entered net of any levies and freight for those animals.\r\nThe livestock trading profit also includes the inventory changes from the source data so if the source data year had a large change in inventory from opening to close this could have a significant impact on the livestock trading profit in the budget year.'
          })
        )
      ),
      _react2.default.createElement(_CCTable2.default, {
        rows: [{
          IsHeader: true,
          cols: [{
            Label: 'Sales $',
            FieldKey: 'IncomeLivestock'
          }, {
            Label: 'Purchases $',
            FieldKey: 'CashFlowLivestockPurchase'
          }, {
            Label: 'Net Livestock Income',
            FieldKey: 'CashFlowLivestockNet'
          }, {
            Label: 'Livestock Trading Profit',
            FieldKey: 'IncomeLivestockTrading'
          }, {
            Label: 'switch'
          }]
        }, {
          Label: 'Source Data',
          cols: [{
            FieldKey: 'IncomeLivestock',
            IsSource: true
          }, {
            FieldKey: 'CashFlowLivestockPurchase',
            IsSource: true
          }, {
            FieldKey: 'CashFlowLivestockNet',
            IsSource: true
          }, {
            FieldKey: 'IncomeLivestockTrading',
            IsSource: true
          }, {
            FieldKey: 'IncomeLivestockTrading',
            ratio: 'switch',
            IsSource: true
          }]
        }, {
          Label: 'New Budget',
          IsScenario: true,
          cols: [{
            FieldKey: 'IncomeLivestock',
            IsInput: true
          }, {
            FieldKey: 'CashFlowLivestockPurchase',
            IsInput: true
          }, {
            FieldKey: 'CashFlowLivestockNet'
          }, {
            FieldKey: 'IncomeLivestockTrading'
          }, {
            FieldKey: 'IncomeLivestockTrading',
            ratio: 'switch'
          }]
        }, {
          Label: 'Difference',
          BorderBottom: true,
          IsGrey: true,
          cols: [{
            FieldKey: 'IncomeLivestock',
            IsDifference: true
          }, {
            FieldKey: 'CashFlowLivestockPurchase',
            IsDifference: true
          }, {
            FieldKey: 'CashFlowLivestockNet',
            IsDifference: true
          }, {
            FieldKey: 'IncomeLivestockTrading',
            IsDifference: true
          }, {
            FieldKey: 'IncomeLivestockTrading',
            ratio: 'switch',
            IsDifference: true
          }]
        }]
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Livestock/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Livestock/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 522 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackLink = exports.BannerContent = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Livestock__Root'
})(['']);

var BannerContent = exports.BannerContent = _styledComponents2.default.div.withConfig({
  displayName: 'Livestock__BannerContent'
})(['flex:1;padding-right:20px;display:flex;align-items:center;justify-content:flex-end;']);

var BackLink = exports.BackLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'Livestock__BackLink'
})(['color:#b3b3b2;&:hover{color:#2e76d8;}&:active{text-decoration:underline;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Livestock/style.js');

  __REACT_HOT_LOADER__.register(BannerContent, 'BannerContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Livestock/style.js');

  __REACT_HOT_LOADER__.register(BackLink, 'BackLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Livestock/style.js');
}();

;

/***/ }),
/* 523 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CCNumber = __webpack_require__(158);

var _CCNumber2 = _interopRequireDefault(_CCNumber);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _CCHelpPortal = __webpack_require__(129);

var _CCHelpPortal2 = _interopRequireDefault(_CCHelpPortal);

var _style = __webpack_require__(524);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _CCBanner2.default,
        {
          TitleText: 'Budget Milk Income',
          TitleKey: 'IncomeMilkTotal',
          FieldKey: 'IncomeMilkTotal' },
        _react2.default.createElement(
          _style.BannerContent,
          null,
          _react2.default.createElement(_CCHelpPortal2.default, { text: 'The milk income should be entered based on the budgeted income to be received for all milk sold less levies and transport charges.' })
        )
      ),
      _react2.default.createElement(_CCTable2.default, {
        rows: [{
          IsHeader: true,
          cols: [{
            Label: '$ Value',
            FieldKey: 'IncomeMilkTotal'
          }, {
            Label: '$ / kg MS'
          }, {
            Label: 'cpl'
          }, {
            Label: '% Change'
          }]
        }, {
          Label: 'Source Data',
          cols: [{
            FieldKey: 'IncomeMilkTotal',
            IsSource: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: 'kgMS',
            IsSource: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: 'cpl',
            IsSource: true
          }, {}]
        }, {
          Label: 'New Budget',
          IsScenario: true,
          cols: [{
            FieldKey: 'IncomeMilkTotal',
            IsInput: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: 'kgMS',
            IsInput: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: 'cpl',
            IsInput: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: '%Change',
            IsInput: true
          }]
        }, {
          Label: 'Difference',
          BorderBottom: true,
          IsGrey: true,
          cols: [{
            FieldKey: 'IncomeMilkTotal',
            IsDifference: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: 'kgMS',
            IsDifference: true
          }, {
            FieldKey: 'IncomeMilkTotal',
            ratio: 'cpl',
            IsDifference: true
          }, {}]
        }, {
          Label: 'Litres Sold To Processor',
          FieldKey: 'MilkLitresTotal',
          BorderBottom: true,
          IsGrey: true,
          IsTotal: true,
          cols: [{}, {
            FieldKey: 'MilkLitresTotal'
          }, {}, {}, {}]
        }, {
          Label: 'Total Kg Milksolids',
          FieldKey: 'MilkSolidsKgTotal',
          BorderBottom: true,
          IsGrey: true,
          IsTotal: true,
          cols: [{}, {
            FieldKey: 'MilkSolidsKgTotal'
          }, {}, {}, {}]
        }]
      }),
      _react2.default.createElement(
        _style.TabMessage,
        null,
        _react2.default.createElement(
          _style.Title,
          null,
          'Milk Value Portal'
        ),
        _react2.default.createElement(
          _style.Text,
          null,
          'This portal provides access to the',
          ' ',
          _react2.default.createElement(
            'strong',
            null,
            'Farmgate Milk Value Tool'
          ),
          ', which provides information on how milk is being valued in each region and how that varies across the season, influenced by different farm characteristics (seasonality of milk supply, size of farm, milk components).'
        ),
        _react2.default.createElement(
          _style.ExternalLink,
          {
            href: 'https://milkvalue.com.au/milk-prices/farmgate-milk-value-tool/',
            target: '_blank' },
          'Farmgate Milk Value Tool ',
          _react2.default.createElement(_style.LinkIcon, null)
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 524 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ExternalLink = exports.LinkIcon = exports.Text = exports.Title = exports.TabMessage = exports.BannerContent = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'MilkIncome__Root'
})(['position:relative;z-index:1;padding:10px;min-height:550px;']);

var BannerContent = exports.BannerContent = _styledComponents2.default.div.withConfig({
  displayName: 'MilkIncome__BannerContent'
})(['flex:1;padding-right:20px;display:flex;align-items:center;justify-content:flex-end;']);

var TabMessage = exports.TabMessage = _styledComponents2.default.div.withConfig({
  displayName: 'MilkIncome__TabMessage'
})(['position:absolute;z-index:1;bottom:0;right:0;width:360px;height:250px;padding:10px 35px;background:white;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'MilkIncome__Title'
})(['font-weight:700;font-size:12px;color:', ';padding-bottom:15px;'], _css.vars.DA_Dairy_blue);

var Text = exports.Text = _styledComponents2.default.div.withConfig({
  displayName: 'MilkIncome__Text'
})(['font-weight:500;font-size:14px;color:', ';padding-bottom:15px;'], _css.vars.DA_text);

var LinkIcon = exports.LinkIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({
  id: 'da_external_link'
}).withConfig({
  displayName: 'MilkIncome__LinkIcon'
})(['', ';margin-top:-2px;margin-left:5px;path{fill:', ';}'], _css.mixins.icon('22px', '22px'), _css.vars.a(_css.vars.DA_accent_blue, 40));

var ExternalLink = exports.ExternalLink = _styledComponents2.default.a.withConfig({
  displayName: 'MilkIncome__ExternalLink'
})(['display:flex;align-items:center;font-weight:500;font-size:14px;&:hover{text-decoration:underline;', '{path{fill:', ';}}}'], LinkIcon, _css.vars.DA_accent_blue);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');

  __REACT_HOT_LOADER__.register(BannerContent, 'BannerContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');

  __REACT_HOT_LOADER__.register(TabMessage, 'TabMessage', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');

  __REACT_HOT_LOADER__.register(Text, 'Text', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');

  __REACT_HOT_LOADER__.register(LinkIcon, 'LinkIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');

  __REACT_HOT_LOADER__.register(ExternalLink, 'ExternalLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/MilkIncome/style.js');
}();

;

/***/ }),
/* 525 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _SummaryTable = __webpack_require__(286);

var _SummaryTable2 = _interopRequireDefault(_SummaryTable);

var _EditorStyle = __webpack_require__(130);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _EditorStyle.Root,
      null,
      _react2.default.createElement(_SummaryTable2.default, { editor: true })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Summary/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Summary/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 526 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CCTable = __webpack_require__(92);

var _CCTable2 = _interopRequireDefault(_CCTable);

var _CCBanner = __webpack_require__(91);

var _CCBanner2 = _interopRequireDefault(_CCBanner);

var _EditorStyle = __webpack_require__(130);

var _CCHelpPortal = __webpack_require__(129);

var _CCHelpPortal2 = _interopRequireDefault(_CCHelpPortal);

var _style = __webpack_require__(527);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _EditorStyle.Root,
      null,
      _react2.default.createElement(
        _CCBanner2.default,
        {
          TitleText: 'Budget Irrigation Cost',
          TitleKey: 'ExpenseIrrigation',
          FieldKey: 'ExpenseIrrigation' },
        _react2.default.createElement(
          _style.BannerContent,
          null,
          _react2.default.createElement(_CCHelpPortal2.default, { text: 'When completing your budget year please keep in mind the amount of water you used in the financial year you have selected for your source data. This should include consideration of the ML of water purchased and the $/ML purchase price along with the total ML applied and corresponding irrigation costs for that year.' })
        )
      ),
      _react2.default.createElement(_CCTable2.default, {
        rows: [{
          IsHeader: true,
          cols: [{
            Label: 'Water Purchase',
            FieldKey: 'ExpenseWaterPurchase'
          }, {
            Label: 'Other ',
            Line2: 'Irrigation Cost',
            FieldKey: 'ExpenseIrrigationOther'
          }, {
            Label: 'Total ',
            Line2: 'Water Cost',
            FieldKey: 'ExpenseIrrigation'
          }, {
            Label: '$ / ML ',
            Line2: 'Water Applied',
            FieldKey: 'ExpenseIrrigationPerMlApplied'
          }]
        }, {
          Label: 'Source Data',
          cols: [{
            FieldKey: 'ExpenseWaterPurchase',
            IsSource: true
          }, {
            FieldKey: 'ExpenseIrrigationOther',
            IsSource: true
          }, {
            FieldKey: 'ExpenseIrrigation',
            IsSource: true
          }, {
            FieldKey: 'ExpenseIrrigation',
            IsSource: true,
            ratio: 'PerTotalML'
          }]
        }, {
          Label: 'New Budget',
          IsScenario: true,
          cols: [{
            FieldKey: 'ExpenseWaterPurchase',
            IsInput: true
          }, {
            FieldKey: 'ExpenseIrrigationOther',
            IsInput: true
          }, {
            FieldKey: 'ExpenseIrrigation'
          }, {
            FieldKey: 'ExpenseIrrigation',
            ratio: 'PerTotalML'
          }]
        }, {
          Label: 'Difference',
          BorderBottom: true,
          IsGrey: true,
          cols: [{
            FieldKey: 'ExpenseWaterPurchase',
            IsDifference: true
          }, {
            FieldKey: 'ExpenseIrrigationOther',
            IsDifference: true
          }, {
            FieldKey: 'ExpenseIrrigation',
            IsDifference: true
          }, {
            FieldKey: 'ExpenseIrrigation',
            IsDifference: true,
            ratio: 'PerTotalML'
          }]
        }, {
          Label: 'Total Irrigation Water Applied',
          FieldKey: 'WaterIrrigationTotalML',
          BorderBottom: true,
          IsGrey: true,
          IsTotal: true,
          cols: [{}, {
            FieldKey: 'WaterIrrigationTotalML',
            IsSource: true
          }, {}, {}, {}]
        }]
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Water/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Water/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 527 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackLink = exports.BannerContent = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Water__Root'
})(['']);

var BannerContent = exports.BannerContent = _styledComponents2.default.div.withConfig({
  displayName: 'Water__BannerContent'
})(['flex:1;padding-right:20px;display:flex;align-items:center;justify-content:flex-end;']);
var BackLink = exports.BackLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'Water__BackLink'
})(['color:#b3b3b2;&:hover{color:#2e76d8;}&:active{text-decoration:underline;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Water/style.js');

  __REACT_HOT_LOADER__.register(BannerContent, 'BannerContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Water/style.js');

  __REACT_HOT_LOADER__.register(BackLink, 'BackLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/Water/style.js');
}();

;

/***/ }),
/* 528 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reactRouterDom = __webpack_require__(12);

var _CCTextInput = __webpack_require__(256);

var _CCTextInput2 = _interopRequireDefault(_CCTextInput);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _POST__updateBudget = __webpack_require__(422);

var _POST__updateBudget2 = _interopRequireDefault(_POST__updateBudget);

var _MilkIncome = __webpack_require__(523);

var _MilkIncome2 = _interopRequireDefault(_MilkIncome);

var _Livestock = __webpack_require__(521);

var _Livestock2 = _interopRequireDefault(_Livestock);

var _Fertiliser = __webpack_require__(519);

var _Fertiliser2 = _interopRequireDefault(_Fertiliser);

var _Water = __webpack_require__(526);

var _Water2 = _interopRequireDefault(_Water);

var _Feed = __webpack_require__(515);

var _Feed2 = _interopRequireDefault(_Feed);

var _Summary = __webpack_require__(525);

var _Summary2 = _interopRequireDefault(_Summary);

var _style = __webpack_require__(529);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var staticRoutes = [{
  url: 'milk-income',
  Title: 'Milk Income',
  Component: _MilkIncome2.default
}, {
  url: 'livestock',
  Title: 'Livestock',
  Component: _Livestock2.default
}, {
  url: 'fertiliser',
  Title: 'Fertiliser',
  Component: _Fertiliser2.default
}, {
  url: 'water',
  Title: 'Water',
  Component: _Water2.default
}, {
  url: 'feed',
  Title: 'Feed',
  Component: _Feed2.default
}, {
  url: 'summary',
  Title: 'Summary',
  Component: _Summary2.default
}];

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_budgets2.default, 'handleBudgetUpdate')],

  getInitialState: function getInitialState() {
    return {
      updateRequestPending: false
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleBudgetUpdate();
  },
  handleBudgetUpdate: function handleBudgetUpdate() {
    var _props = this.props,
        history = _props.history,
        match = _props.match,
        cancelledEdit = _props.cancelledEdit;
    var budgetId = match.params.budgetId;


    var budget = _budgets2.default.store.budgetsById[budgetId];
    var editObj = _budgets2.default.store.editsById[budgetId];

    if (cancelledEdit) {
      return history.push('/budget/' + budgetId);
    }

    if (budget && !editObj && !cancelledEdit) {
      _Actions2.default.UPDATE_BUDGET_STATE(budget);
    }
  },
  handleInputUpdate: function handleInputUpdate(key, value) {
    var editObj = this.props.editObj;

    var _editObj = editObj || {};
    var _budget = _editObj.ScenarioDataset || {};

    var newScenarioState = _extends({}, _budget, _defineProperty({}, key, value));

    _Actions2.default.UPDATE_BUDGET_STATE(_extends({}, _editObj, {
      ScenarioDataset: newScenarioState
    }));
  },
  handleSave: function handleSave() {
    var _props2 = this.props,
        match = _props2.match,
        onCancelEdit = _props2.onCancelEdit;
    var budgetId = match.params.budgetId;

    var editObj = _budgets2.default.store.editsById[budgetId] || {};

    var _budget = editObj.ScenarioDataset || {};
    var Id = _budget.Id,
        Name = _budget.Name;


    this.props.onCancelEdit(function () {
      _Actions2.default.UPDATE_DATASET_DETAIL({ Id: Id, Name: Name });
      _Actions2.default.CLOSE_BUDGET_EDITOR(budgetId);
    });
  },
  render: function render() {
    var _this = this;

    var _props3 = this.props,
        history = _props3.history,
        match = _props3.match,
        onCancelEdit = _props3.onCancelEdit,
        editObj = _props3.editObj,
        budgetObj = _props3.budgetObj;
    var budgetId = match.params.budgetId;

    var _editObj = editObj || {};
    var _budgetObj = budgetObj || {};
    var _budget = _editObj.ScenarioDataset || {};
    var _source = _budgetObj.SourceDataset || {};

    var yearList = _dataDefinition2.default.selectOptions.FinancialYearId;
    var year = _.find(yearList, { Id: _budget.FinancialYearId }) || {};
    var sourceYear = _.find(yearList, { Id: _source.FinancialYearId }) || {};

    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.Header,
        null,
        _react2.default.createElement(
          _style.HeaderContent,
          null,
          _react2.default.createElement(
            _style.HeaderCol,
            null,
            _react2.default.createElement(
              _Portal2.default,
              {
                fullscreen: true,
                background: '#EDF6F7',
                Button: function Button(_ref) {
                  var isOpen = _ref.isOpen,
                      onToggle = _ref.onToggle,
                      onOpen = _ref.onOpen,
                      onClose = _ref.onClose;
                  return _react2.default.createElement(
                    _style.CancelButton,
                    { onClick: onOpen },
                    _react2.default.createElement(
                      _style.CancelButtonContent,
                      null,
                      _react2.default.createElement(_style.CancelIcon, null),
                      'Cancel'
                    )
                  );
                } },
              function (_ref2) {
                var onToggle = _ref2.onToggle,
                    onOpen = _ref2.onOpen,
                    onClose = _ref2.onClose;
                return _react2.default.createElement(
                  _DAStandardPortal2.default,
                  { onClose: onClose },
                  _react2.default.createElement(
                    _style.ContinueRoot,
                    null,
                    _react2.default.createElement(
                      _style.ContinueContent,
                      null,
                      _react2.default.createElement(
                        _style.ContinueTitle,
                        null,
                        'Are you sure you want to cancel?'
                      ),
                      _react2.default.createElement(
                        _style.ContinueBox,
                        null,
                        _react2.default.createElement(
                          _style.Description,
                          null,
                          'You will lose the changes made to this budget'
                        ),
                        _react2.default.createElement(
                          _style.ButtonBox,
                          null,
                          _react2.default.createElement(
                            _style.ContinueButton,
                            {
                              warning: true,
                              onClick: function onClick() {
                                return onCancelEdit(function () {
                                  _Actions2.default.CLOSE_BUDGET_EDITOR(budgetId);
                                });
                              } },
                            'Discard Changes'
                          ),
                          _react2.default.createElement(
                            _style.ContinueButton,
                            { error: true, onClick: onClose },
                            'Continue Editing'
                          )
                        )
                      )
                    )
                  )
                );
              }
            )
          ),
          _react2.default.createElement(
            'h2',
            null,
            'DairyBase Budgeting'
          ),
          _react2.default.createElement(
            _style.HeaderCol,
            { right: true },
            _react2.default.createElement(
              _style.SaveButton,
              {
                onClick: function onClick() {
                  return _this.setState({ updateRequestPending: true });
                } },
              'Save & Calculate'
            )
          ),
          _react2.default.createElement(_DARequestPortal2.default, {
            isOpen: this.state.updateRequestPending,
            onSuccess: this.handleSave,
            preventCloseWhilePending: true,
            onClose: function onClose(_ref3) {
              var error = _ref3.error,
                  success = _ref3.success;
              return error ? _this.setState({ updateRequestPending: false }) : _this.handleSave();
            },
            request: function request(callback) {
              return (0, _POST__updateBudget2.default)(_budget, callback);
            },
            text: {
              pendingTitle: 'Please wait a moment...',
              pendingDescription: 'Re-calculating budget dataset.',
              successTitle: 'Success!',
              successDescription: 'Your budget dataset has been re-calculated.',
              successButton: 'Load budget summary',
              errorTitle: 'Oops, something went wrong',
              errorDescription: 'Connection timed out.'
            }
          })
        )
      ),
      _react2.default.createElement(
        _style.SubHeader,
        null,
        _react2.default.createElement(
          _style.SubHeaderLeft,
          null,
          _react2.default.createElement(
            _style.SourceText,
            null,
            'Source Dataset:',
            ' ',
            _react2.default.createElement(
              'span',
              { style: { display: 'inline-block', marginLeft: '8px' } },
              _source.Name,
              ' - ',
              _source.DairyBaseId,
              ' - ',
              sourceYear.Title
            )
          ),
          _react2.default.createElement(_CCTextInput2.default, {
            id: 'Name',
            value: _budget.Name,
            onSubmit: function onSubmit(newValue) {
              return _this.handleInputUpdate('Name', newValue);
            }
          })
        ),
        _react2.default.createElement(
          _style.SubHeaderRight,
          null,
          _react2.default.createElement(
            _style.YearLabel,
            null,
            'Budget Year'
          ),
          _react2.default.createElement(
            _style.YearTitle,
            null,
            year.Title
          )
        )
      ),
      _react2.default.createElement(
        _style.Body,
        null,
        _react2.default.createElement(
          _style.Menu,
          null,
          staticRoutes.map(function (route) {
            return _react2.default.createElement(
              _style.MenuLink,
              {
                key: route.url,
                to: '/budget/' + budgetId + '/editor/' + route.url },
              route.Title,
              _react2.default.createElement(_style.MenuIcon, null)
            );
          })
        ),
        _react2.default.createElement(
          _style.Content,
          null,
          _react2.default.createElement(
            _reactRouterDom.Switch,
            null,
            _react2.default.createElement(_reactRouterDom.Redirect, {
              exact: true,
              from: '/budget/:budgetId/editor',
              to: '/budget/' + budgetId + '/editor/milk-income'
            }),
            _react2.default.createElement(_reactRouterDom.Redirect, {
              exact: true,
              from: '/budget/:budgetId/editor/',
              to: '/budget/' + budgetId + '/editor/milk-income'
            }),
            staticRoutes.map(function (route) {
              return _react2.default.createElement(_reactRouterDom.Route, {
                key: route.url,
                path: '/budget/:budgetId/editor/' + route.url,
                component: route.Component
              });
            })
          ),
          _react2.default.createElement(_reactRouterDom.Route, {
            path: '/budget/:budgetId/editor/summary',
            render: function render(props) {
              return _react2.default.createElement(
                'div',
                {
                  style: {
                    background: 'white',
                    padding: '10px',
                    display: 'flex',
                    justifyContent: 'flex-end'
                  } },
                _react2.default.createElement(
                  _style.SaveButton,
                  {
                    onClick: function onClick() {
                      return _this.setState({ updateRequestPending: true });
                    } },
                  'Save & Calculate'
                )
              );
            }
          })
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(staticRoutes, 'staticRoutes', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/index.js');

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 529 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ContinueButton = exports.ButtonBox = exports.Description = exports.ContinueBox = exports.ContinueTitle = exports.ContinueContent = exports.ContinueRoot = exports.CancelIcon = exports.CancelButtonContent = exports.CancelButton = exports.SaveButton = exports.HeaderCol = exports.Content = exports.MenuLink = exports.MenuIcon = exports.Menu = exports.Body = exports.SourceText = exports.YearTitle = exports.YearLabel = exports.SubHeaderRight = exports.SubHeaderLeft = exports.SubHeader = exports.HeaderContent = exports.Header = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__Root'
})(['position:absolute;z-index:1;top:0;bottom:0;right:0;left:0;overflow-y:scroll;background:#edf6f7;padding-bottom:40px;']);

var Header = exports.Header = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__Header'
})(['height:61px;padding:10px;padding-top:12px;padding-bottom:12px;background:white;']);
var HeaderContent = exports.HeaderContent = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__HeaderContent'
})(['display:flex;align-items:center;justify-content:space-between;width:1000px;margin:0 auto;h2{font-weight:600;font-size:25px;color:', ';}'], _css.vars.DA_Dairy_blue);

var SubHeader = exports.SubHeader = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__SubHeader'
})(['display:flex;align-items:flex-end;justify-content:space-between;width:1000px;margin:0 auto;padding-left:180px;padding-top:75px;padding-bottom:20px;']);
var SubHeaderLeft = exports.SubHeaderLeft = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__SubHeaderLeft'
})(['']);

var SubHeaderRight = exports.SubHeaderRight = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__SubHeaderRight'
})(['display:flex;align-items:center;']);
var YearLabel = exports.YearLabel = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__YearLabel'
})(['font-weight:700;font-size:13px;letter-spacing:1.1px;text-transform:uppercase;color:', ';padding-right:20px;'], _css.vars.DA_Dairy_blue);

var YearTitle = exports.YearTitle = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__YearTitle'
})(['width:84px;height:50px;background:white;border:1px solid ', ';font-size:14px;color:', ';display:flex;align-items:center;text-align:center;justify-content:center;letter-spacing:0.8px;'], _css.vars.a(_css.vars.DA_accent_blue, 30), _css.vars.DA_Dairy_blue);

var SourceText = exports.SourceText = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__SourceText'
})(['color:', ';font-size:14px;letter-spacing:0.8px;padding-bottom:4px;'], _css.vars.DA_text);

var Body = exports.Body = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__Body'
})(['display:flex;width:1000px;margin:0 auto;']);
var Menu = exports.Menu = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__Menu'
})(['width:180px;']);

var MenuIcon = exports.MenuIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_arrow_right' }).withConfig({
  displayName: 'Editor__MenuIcon'
})(['', ';margin-right:20px;display:none;path{fill:', ';}'], _css.mixins.icon('18px', '18px'), _css.vars.a(_css.vars.DA_Dairy_blue, 70));

var activeClassName = 'nav-item-active';

var MenuLink = exports.MenuLink = (0, _styledComponents2.default)(_reactRouterDom.NavLink).attrs({
  activeClassName: 'nav-item-active'
}).withConfig({
  displayName: 'Editor__MenuLink'
})(['min-height:50px;display:flex;align-items:center;justify-content:space-between;padding:10px;padding-top:11px;padding-left:19px;font-weight:700;color:', ';&:hover{background:', ';', '{display:block;}}&.', '{background:white;', '{display:block;}}'], _css.vars.DA_Dairy_blue, _css.vars.a('white', 50), MenuIcon, activeClassName, MenuIcon);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__Content'
})(['flex:1;background:white;min-height:500px;']);

var HeaderCol = exports.HeaderCol = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__HeaderCol'
})(['width:200px;', ''], function (props) {
  return props.right && '\n    display: flex;\n    justify-content: flex-end;\n  ';
});

var SaveButton = exports.SaveButton = _styledComponents2.default.button.withConfig({
  displayName: 'Editor__SaveButton'
})(['cursor:pointer;background:', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;border:none;&:hover{background:', ';}&:active{color:white;}'], _css.vars.a(_css.vars.DA_pasture_green, 75), _css.vars.DA_Dairy_blue, _css.vars.DA_accent_green);

var CancelButton = exports.CancelButton = _styledComponents2.default.button.withConfig({
  displayName: 'Editor__CancelButton'
})(['cursor:pointer;background:white;padding:5px 12px;color:', ';font-weight:500;border:1px solid white;border-radius:22px;&:hover{border:1px solid ', ';}&:active{background:', ';}'], _css.vars.DA_accent_blue, _css.vars.a(_css.vars.DA_sky_blue, 50), _css.vars.a(_css.vars.DA_sky_blue, 50));
var CancelButtonContent = exports.CancelButtonContent = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__CancelButtonContent'
})(['display:flex;align-items:center;']);

var CancelIcon = exports.CancelIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_close' }).withConfig({
  displayName: 'Editor__CancelIcon'
})(['', ';margin-right:10px;path{fill:', ';}'], _css.mixins.icon('18px', '18px'), _css.vars.DA_accent_blue);

var ContinueRoot = exports.ContinueRoot = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__ContinueRoot'
})(['font-family:', ';display:flex;align-items:center;justify-content:center;padding-top:200px;'], _css.vars.Gilroy);

var ContinueContent = exports.ContinueContent = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__ContinueContent'
})(['']);

var ContinueTitle = exports.ContinueTitle = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__ContinueTitle'
})(['font-weight:700;font-size:40px;padding-bottom:60px;text-align:center;color:', ';'], _css.vars.DA_Dairy_blue);

var ContinueBox = exports.ContinueBox = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__ContinueBox'
})(['padding:40px 60px;background:white;border-radius:4px;']);

var Description = exports.Description = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__Description'
})(['color:', ';font-size:16px;text-align:center;letter-spacing:0.8px;'], _css.vars.DA_Dairy_blue);

var ButtonBox = exports.ButtonBox = _styledComponents2.default.div.withConfig({
  displayName: 'Editor__ButtonBox'
})(['display:flex;align-items:center;justify-content:center;padding-top:50px;']);

var ContinueButton = exports.ContinueButton = _styledComponents2.default.button.withConfig({
  displayName: 'Editor__ContinueButton'
})(['margin:0 auto;cursor:pointer;background:', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;border:none;', ' ', ' &:hover{background:', ';', ' ', '}&:active{color:white;', ' ', '}'], _css.vars.a(_css.vars.DA_pasture_green, 75), _css.vars.DA_Dairy_blue, function (props) {
  return props.error && '\n    background: white;\n    border: 1px solid ' + _css.vars.DA_sky_blue + ';\n  ';
}, function (props) {
  return props.warning && '\n    background: ' + _css.vars.DA_dusk_pink + ';\n    border: 1px solid ' + _css.vars.DA_dusk_pink + ';\n  ';
}, _css.vars.DA_accent_green, function (props) {
  return props.error && '\n      background: white;\n      border: 1px solid ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      background: ' + _css.vars.DA_dusk_pink + ';\n      border: 1px solid ' + _css.vars.DA_accent_pink + ';\n    ';
}, function (props) {
  return props.error && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(Header, 'Header', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(HeaderContent, 'HeaderContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(SubHeader, 'SubHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(SubHeaderLeft, 'SubHeaderLeft', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(SubHeaderRight, 'SubHeaderRight', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(YearLabel, 'YearLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(YearTitle, 'YearTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(SourceText, 'SourceText', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(Body, 'Body', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(Menu, 'Menu', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(MenuIcon, 'MenuIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(activeClassName, 'activeClassName', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(MenuLink, 'MenuLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(HeaderCol, 'HeaderCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(SaveButton, 'SaveButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(CancelButton, 'CancelButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(CancelButtonContent, 'CancelButtonContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(CancelIcon, 'CancelIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(ContinueRoot, 'ContinueRoot', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(ContinueContent, 'ContinueContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(ContinueTitle, 'ContinueTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(ContinueBox, 'ContinueBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(Description, 'Description', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(ButtonBox, 'ButtonBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');

  __REACT_HOT_LOADER__.register(ContinueButton, 'ContinueButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Editor/style.js');
}();

;

/***/ }),
/* 530 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _POST__archiveDataset = __webpack_require__(188);

var _POST__archiveDataset2 = _interopRequireDefault(_POST__archiveDataset);

var _style = __webpack_require__(531);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  getInitialState: function getInitialState() {
    return {
      archiveRequestPending: false
    };
  },
  _toggleArchivePortal: function _toggleArchivePortal() {
    this.setState({
      archiveRequestPending: !this.state.archiveRequestPending
    });
  },
  render: function render() {
    var _this = this;

    var budgetId = this.props.match.params.budgetId;
    var history = this.props.history;

    return _react2.default.createElement(
      _Portal2.default,
      { fullscreen: true, background: '#EDF6F7', Button: this.props.Button },
      function (_ref) {
        var onToggle = _ref.onToggle,
            onOpen = _ref.onOpen,
            onClose = _ref.onClose;
        return _react2.default.createElement(
          _DAStandardPortal2.default,
          { onClose: onClose },
          _react2.default.createElement(
            _style.ContinueRoot,
            null,
            _react2.default.createElement(
              _style.ContinueContent,
              null,
              _react2.default.createElement(
                _style.ContinueTitle,
                null,
                'Are you sure you want to do this?'
              ),
              _react2.default.createElement(
                _style.ContinueBox,
                null,
                _react2.default.createElement(
                  _style.Description,
                  null,
                  'Once archived, this budget will no longer appear in your dataset list.'
                ),
                _react2.default.createElement(
                  _style.ButtonBox,
                  null,
                  _react2.default.createElement(
                    _style.ContinueButton,
                    { error: true, onClick: onClose },
                    'Keep this budget'
                  ),
                  _react2.default.createElement(
                    _style.ContinueButton,
                    {
                      warning: true,
                      onClick: function onClick() {
                        return _this.setState({ archiveRequestPending: true });
                      } },
                    'Archive Budget'
                  )
                )
              )
            )
          ),
          _react2.default.createElement(_DARequestPortal2.default, {
            blueButton: true,
            isOpen: _this.state.archiveRequestPending,
            onSuccess: function onSuccess() {
              return history.push('/');
            },
            onClose: function onClose(_ref2) {
              var error = _ref2.error,
                  success = _ref2.success;
              return error ? _this.setState({ archiveRequestPending: false }) : history.push('/');
            },
            request: function request(callback) {
              return (0, _POST__archiveDataset2.default)(+budgetId, callback);
            },
            text: {
              pendingTitle: 'Please wait a moment...',
              pendingDescription: 'Archiving budget dataset.',
              successTitle: 'Success!',
              successDescription: 'Your budget dataset has been archived.',
              successButton: 'Back to Homepage',
              errorTitle: 'Oops, something went wrong',
              errorDescription: 'Connection timed out.'
            }
          })
        );
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 531 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ContinueButton = exports.ButtonBox = exports.Description = exports.ContinueBox = exports.ContinueTitle = exports.ContinueContent = exports.ContinueRoot = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ContinueRoot = exports.ContinueRoot = _styledComponents2.default.div.withConfig({
  displayName: 'ArchivePortal__ContinueRoot'
})(['font-family:', ';display:flex;align-items:center;justify-content:center;padding-top:200px;'], _css.vars.Gilroy);

var ContinueContent = exports.ContinueContent = _styledComponents2.default.div.withConfig({
  displayName: 'ArchivePortal__ContinueContent'
})(['']);

var ContinueTitle = exports.ContinueTitle = _styledComponents2.default.div.withConfig({
  displayName: 'ArchivePortal__ContinueTitle'
})(['font-weight:700;font-size:40px;padding-bottom:60px;text-align:center;color:', ';'], _css.vars.DA_Dairy_blue);

var ContinueBox = exports.ContinueBox = _styledComponents2.default.div.withConfig({
  displayName: 'ArchivePortal__ContinueBox'
})(['padding:40px 60px;background:white;border-radius:4px;width:520px;margin:0 auto;']);

var Description = exports.Description = _styledComponents2.default.div.withConfig({
  displayName: 'ArchivePortal__Description'
})(['color:', ';font-size:16px;text-align:center;letter-spacing:0.8px;width:330px;margin:0 auto;'], _css.vars.DA_Dairy_blue);

var ButtonBox = exports.ButtonBox = _styledComponents2.default.div.withConfig({
  displayName: 'ArchivePortal__ButtonBox'
})(['display:flex;align-items:center;justify-content:center;padding-top:50px;']);

var ContinueButton = exports.ContinueButton = _styledComponents2.default.button.withConfig({
  displayName: 'ArchivePortal__ContinueButton'
})(['margin:0 auto;cursor:pointer;background:', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;border:none;', ' ', ' &:hover{background:', ';', ' ', '}&:active{color:white;', ' ', '}'], _css.vars.a(_css.vars.DA_pasture_green, 75), _css.vars.DA_Dairy_blue, function (props) {
  return props.error && '\n    background: white;\n    border: 1px solid ' + _css.vars.DA_sky_blue + ';\n  ';
}, function (props) {
  return props.warning && '\n    background: ' + _css.vars.DA_dusk_pink + ';\n    border: 1px solid ' + _css.vars.DA_dusk_pink + ';\n  ';
}, _css.vars.DA_accent_green, function (props) {
  return props.error && '\n      background: white;\n      border: 1px solid ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      background: ' + _css.vars.DA_dusk_pink + ';\n      border: 1px solid ' + _css.vars.DA_accent_pink + ';\n    ';
}, function (props) {
  return props.error && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ContinueRoot, 'ContinueRoot', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueContent, 'ContinueContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueTitle, 'ContinueTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueBox, 'ContinueBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');

  __REACT_HOT_LOADER__.register(Description, 'Description', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');

  __REACT_HOT_LOADER__.register(ButtonBox, 'ButtonBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueButton, 'ContinueButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/ArchivePortal/style.js');
}();

;

/***/ }),
/* 532 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _CreateBudgetButton = __webpack_require__(150);

var _CreateBudgetButton2 = _interopRequireDefault(_CreateBudgetButton);

var _Portal3 = __webpack_require__(5);

var _Portal4 = _interopRequireDefault(_Portal3);

var _POST__createBudget = __webpack_require__(144);

var _POST__createBudget2 = _interopRequireDefault(_POST__createBudget);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _checkFarmAuth = __webpack_require__(148);

var _checkFarmAuth2 = _interopRequireDefault(_checkFarmAuth);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _style = __webpack_require__(533);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  getInitialState: function getInitialState() {
    return {
      createBudgetCopyPending: false,
      createScenarioPortalOpen: false
    };
  },
  _toggleCreateScenarioPortal: function _toggleCreateScenarioPortal() {
    this.setState({
      createScenarioPortalOpen: !this.state.createScenarioPortalOpen
    });
  },
  _handleCreateScenarioTransition: function _handleCreateScenarioTransition() {
    this._toggleCreateScenarioPortal();
    this.props.history.push('/editor');
  },
  render: function render() {
    var _this = this;

    var budget = this.props.budget;

    return _react2.default.createElement(
      _Portal2.default,
      { fullscreen: true, background: '#EDF6F7', Button: this.props.Button },
      function (_ref) {
        var onToggle = _ref.onToggle,
            onOpen = _ref.onOpen,
            onClose = _ref.onClose;
        return _react2.default.createElement(
          _DAStandardPortal2.default,
          { onClose: onClose },
          _react2.default.createElement(
            _style.Root,
            null,
            _react2.default.createElement(
              _style.Content,
              null,
              _react2.default.createElement(
                _style.Title,
                null,
                'How would you like to copy this budget?'
              ),
              _react2.default.createElement(
                _style.Box,
                null,
                _react2.default.createElement(
                  _style.ButtonBox,
                  { border: true },
                  _react2.default.createElement(_CreateBudgetButton2.default, {
                    history: _this.props.history,
                    copyId: budget.Id,
                    sourceId: budget.CcModelSourceId,
                    Name: 'Copy of ' + budget.Name,
                    Button: function Button(_ref2) {
                      var onOpen = _ref2.onOpen;
                      return _react2.default.createElement(
                        _style.Button,
                        { onClick: onOpen },
                        'Create new budget'
                      );
                    }
                  }),
                  _react2.default.createElement(
                    _style.Description,
                    null,
                    'Uses the DairyBase budgeting model to generate a dataset for reports.'
                  )
                ),
                _react2.default.createElement(
                  _style.ButtonBox,
                  null,
                  _react2.default.createElement(
                    _style.Button,
                    {
                      error: true,
                      onClick: function onClick() {
                        _this.setState({ createScenarioPortalOpen: true });
                      } },
                    'Create new scenario'
                  ),
                  _react2.default.createElement(
                    _style.Description,
                    null,
                    'Creates a full editable dataset - but loses the ability to quickly calculate using the DairyBase budgeting model.'
                  )
                )
              )
            ),
            _react2.default.createElement(_DARequestPortal2.default, {
              isOpen: _this.state.createBudgetCopyPending,
              onSuccess: function onSuccess(data) {
                var budgetId = data.body.CompCalculatorOutput.ScenarioDataset.Id;

                _this.props.history.push('/budget/' + budgetId);
                onClose();
                _this.setState({ createBudgetCopyPending: false });
              },
              onClose: function onClose() {
                return _this.setState({ createBudgetCopyPending: false });
              },
              request: function request(callback) {
                return (0, _POST__createBudget2.default)({
                  _isBudgetCopy: true,
                  FarmDataSetId: budget.Id,
                  FinancialYearId: budget.FinancialYearId,
                  Name: 'Copy of ' + budget.Name
                }, callback);
              },
              text: {
                pendingTitle: 'Please wait a moment...',
                pendingDescription: 'Generating new budget dataset.',
                successTitle: 'Success!',
                successDescription: 'Your budget dataset has been created.',
                successButton: 'Launch budget summary',
                errorTitle: 'Oops, something went wrong',
                errorDescription: 'Connection timed out.'
              }
            }),
            _react2.default.createElement(
              _Portal4.default,
              {
                context: document.body,
                isOpen: _this.state.createScenarioPortalOpen,
                className: 'Overlay' },
              _react2.default.createElement(
                'div',
                { className: '_modalBox' },
                _react2.default.createElement(_GenericCloseBtn2.default, { onClick: _this._toggleCreateScenarioPortal }),
                _react2.default.createElement(_CreateDatasetModal2.default, {
                  callback: _this._handleCreateScenarioTransition,
                  bulkCallback: _this._toggleCreateScenarioPortal,
                  prefillFarm: (0, _checkFarmAuth2.default)(budget.DairyBaseId) ? budget.DairyBaseId : undefined,
                  prefillDataset: budget.FarmDataSetId
                })
              )
            )
          )
        );
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 533 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Button = exports.ButtonBox = exports.Description = exports.Box = exports.Title = exports.Content = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CopyPortal__Root'
})(['font-family:', ';display:flex;align-items:center;justify-content:center;padding-top:200px;'], _css.vars.Gilroy);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'CopyPortal__Content'
})(['width:630px;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'CopyPortal__Title'
})(['width:440px;margin:0 auto;font-weight:700;font-size:40px;padding-bottom:60px;text-align:center;color:', ';'], _css.vars.DA_Dairy_blue);

var Box = exports.Box = _styledComponents2.default.div.withConfig({
  displayName: 'CopyPortal__Box'
})(['padding:25px;background:white;border-radius:4px;padding-bottom:35px;width:660px;']);

var Description = exports.Description = _styledComponents2.default.div.withConfig({
  displayName: 'CopyPortal__Description'
})(['color:', ';font-size:16px;letter-spacing:0.8px;width:320px;'], _css.vars.DA_Dairy_blue);

var ButtonBox = exports.ButtonBox = _styledComponents2.default.div.withConfig({
  displayName: 'CopyPortal__ButtonBox'
})(['display:flex;align-items:center;padding-top:30px;', ''], function (props) {
  return props.border && '\n    border-bottom: 1px solid ' + _css.vars.DA_Dairy_grey + ';\n    padding-bottom: 30px;\n  ';
});

var Button = exports.Button = _styledComponents2.default.button.withConfig({
  displayName: 'CopyPortal__Button'
})(['margin-right:30px;margin-left:20px;width:220px;cursor:pointer;background:', ';border:1px solid ', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;', ' ', ' &:hover{border:1px solid ', ';', ' ', '}&:active{color:white;', ' ', '}'], _css.vars.DA_sky_blue, _css.vars.DA_sky_blue, _css.vars.DA_Dairy_blue, function (props) {
  return props.error && '\n    background: white;\n    border: 1px solid ' + _css.vars.DA_sky_blue + ';\n  ';
}, function (props) {
  return props.warning && '\n    background: ' + _css.vars.DA_dusk_pink + ';\n    border: 1px solid ' + _css.vars.DA_dusk_pink + ';\n  ';
}, _css.vars.DA_accent_blue, function (props) {
  return props.error && '\n      background: white;\n      border: 1px solid ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      background: ' + _css.vars.DA_dusk_pink + ';\n      border: 1px solid ' + _css.vars.DA_accent_pink + ';\n    ';
}, function (props) {
  return props.error && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');

  __REACT_HOT_LOADER__.register(Box, 'Box', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');

  __REACT_HOT_LOADER__.register(Description, 'Description', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');

  __REACT_HOT_LOADER__.register(ButtonBox, 'ButtonBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');

  __REACT_HOT_LOADER__.register(Button, 'Button', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/CopyPortal/style.js');
}();

;

/***/ }),
/* 534 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _style = __webpack_require__(535);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.Button,
        { onClick: this.props.onClick, save: this.props.editing },
        _react2.default.createElement(_style.EditIcon, null),
        'Cancel'
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/CancelButton/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/CancelButton/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 535 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.EditIcon = exports.Button = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CancelButton__Root'
})(['position:absolute;z-index:1;left:0;top 0;']);

var Button = exports.Button = _styledComponents2.default.div.withConfig({
  displayName: 'CancelButton__Button'
})(['cursor:pointer;display:flex;align-items:center;width:120px;font-size:12px;letter-spacing:1.1px;font-weight:600;position:absolute;z-index:1;left:0;bottom:0;']);

var EditIcon = exports.EditIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_close' }).withConfig({
  displayName: 'CancelButton__EditIcon'
})(['', ';margin-right:10px;margin-top:-2px;path{fill:', ';}'], _css.mixins.icon('14px', '14px'), _css.vars.DA_Dairy_blue);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/CancelButton/style.js');

  __REACT_HOT_LOADER__.register(Button, 'Button', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/CancelButton/style.js');

  __REACT_HOT_LOADER__.register(EditIcon, 'EditIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/CancelButton/style.js');
}();

;

/***/ }),
/* 536 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _style = __webpack_require__(537);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(
        _style.Button,
        { onClick: this.props.onClick, save: this.props.editing },
        !this.props.editing && _react2.default.createElement(_style.EditIcon, null),
        this.props.editing ? 'Save changes' : 'EDIT NOTES'
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/EditButton/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/EditButton/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 537 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.EditIcon = exports.Button = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'EditButton__Root'
})(['position:absolute;z-index:1;right:0;top 0;']);

var Button = exports.Button = _styledComponents2.default.div.withConfig({
  displayName: 'EditButton__Button'
})(['cursor:pointer;display:flex;align-items:center;width:120px;font-size:12px;font-weight:600;letter-spacing:1.1px;position:absolute;z-index:1;left:20px;top:20px;color:', ';', ''], _css.vars.DA_Dairy_blue, function (props) {
  return props.save && '\n\n      top: 16px;\n      width: 146px;\n      cursor: pointer;\n      background: ' + _css.vars.a(_css.vars.DA_pasture_green, 75) + ';\n      text-align: center;\n\n      font-weight: 700;\n      font-size: 14px;\n      letter-spacing: 0.8px;\n\n      color: ' + _css.vars.DA_Dairy_blue + ';\n\n      padding: 8px 22px;\n\n      border: none;\n\n      &:hover {\n        background: ' + _css.vars.DA_accent_green + ';\n      }\n\n      &:active {\n        color: white;\n      }\n\n  ';
});

var EditIcon = exports.EditIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_edit' }).withConfig({
  displayName: 'EditButton__EditIcon'
})(['', ';margin-right:5px;path{fill:', ';}'], _css.mixins.icon('24px', '24px'), _css.vars.DA_accent_blue);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/EditButton/style.js');

  __REACT_HOT_LOADER__.register(Button, 'Button', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/EditButton/style.js');

  __REACT_HOT_LOADER__.register(EditIcon, 'EditIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/EditButton/style.js');
}();

;

/***/ }),
/* 538 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(974);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchTextArea = __webpack_require__(539);

var _xchTextArea2 = _interopRequireDefault(_xchTextArea);

var _EditButton = __webpack_require__(536);

var _EditButton2 = _interopRequireDefault(_EditButton);

var _CancelButton = __webpack_require__(534);

var _CancelButton2 = _interopRequireDefault(_CancelButton);

var _IconButton = __webpack_require__(269);

var _IconButton2 = _interopRequireDefault(_IconButton);

var _convertMdToHTML = __webpack_require__(199);

var _convertMdToHTML2 = _interopRequireDefault(_convertMdToHTML);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      notes: this.props.notes
    };
  },
  handleSubmit: function handleSubmit(id, value) {
    this.setState({
      notes: value
    });
  },
  handleCancel: function handleCancel() {
    this.setState({
      notes: this.props.notes
    }, this.props.onToggleEditing);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.CC_root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.CC_controls },
        this.renderCancelButton(),
        this.renderEditButton()
      ),
      this.renderPreview(),
      this.renderEditor()
    );
  },
  renderCancelButton: function renderCancelButton() {
    return !this.props.editing ? null : _react2.default.createElement(_CancelButton2.default, { onClick: this.handleCancel });
  },
  renderSaveButton: function renderSaveButton() {
    var _this = this;

    return !this.props.editing ? null : _react2.default.createElement(
      'div',
      { className: _style2.default.CC_saveButton },
      _react2.default.createElement(_IconButton2.default, {
        icon: 'tick',
        text: 'save changes',
        onClick: function onClick() {
          _this.props.onSaveChanges(_this.state.notes);
        }
      })
    );
  },
  renderEditButton: function renderEditButton() {
    var _this2 = this;

    return !this.props.editAuthority ? null : _react2.default.createElement(_EditButton2.default, {
      onClick: this.props.editing ? function () {
        _this2.props.onSaveChanges(_this2.state.notes);
      } : this.props.onToggleEditing,
      editing: this.props.editing
    });
  },
  renderPreview: function renderPreview() {
    return this.props.editing ? null : _react2.default.createElement('div', {
      className: _style2.default.CC_preview,
      dangerouslySetInnerHTML: (0, _convertMdToHTML2.default)(this.state.notes)
    });
  },
  renderEditor: function renderEditor() {
    return !this.props.editing ? null : _react2.default.createElement(_xchTextArea2.default, {
      id: 'someId',
      rows: 15,
      value: this.state.notes,
      onSubmit: this.handleSubmit
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 539 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(975);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      isFocused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (!this.state.isFocused) {
      this.setState({
        value: newProps.value
      });
    }
  },
  _handleFocus: function _handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.setState({
        isFocused: true,
        value: this.state.value
      }, function () {
        setTimeout(function () {
          var input = _this.my_input;
          input.select();
          input.addEventListener('mousewheel', function (event) {
            event.preventDefault();
          });
        }, 30);
      });
    }
  },
  _handleBlur: function _handleBlur() {
    this.setState({
      isFocused: false
    }, function () {
      this._handleSubmitData();
    });
  },
  _handleChange: function _handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  _handleKeyDown: function _handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 27:
        // esc
        this._handleCancel();
        break;
    }
  },

  _handleCancel: function _handleCancel() {
    this.setState({
      isFocused: false,
      value: this.props.value
    });
  },
  _handleSubmitData: function _handleSubmitData() {
    var newValue = this.state.value;

    // validate all the things
    if (typeof newValue === 'undefined' || newValue === null || +newValue === +this.props.value || this.props.disabled) {
      if (!this.state.isFocused) {
        this.setState({
          value: this.props.value
        });
      }
      return;
    }

    // Passed validation? Send data out to smart handler
    this.props.onSubmit(this.props.id, newValue);
  },
  render: function render() {
    var _classnames,
        _this2 = this;

    var classList = (0, _classnames3.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['InputTextArea'], true), _defineProperty(_classnames, _style2.default['not-editable'], this.props.disabled), _defineProperty(_classnames, _style2.default['is-focused'], this.state.isFocused), _classnames));

    return _react2.default.createElement(
      'div',
      { ref: 'my_input_wrapper', className: classList },
      _react2.default.createElement('textarea', {
        ref: function ref(_ref) {
          return _this2.my_input = _ref;
        },
        rows: this.props.rows,
        className: _style2.default['_input'],
        value: this.state.value,
        onBlur: this._handleBlur,
        onChange: this._handleChange,
        onKeyDown: this._handleKeyDown,
        wrap: 'off'
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/NotesEditor/xch-TextArea/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 540 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _Portal = __webpack_require__(61);

var _Portal2 = _interopRequireDefault(_Portal);

var _DAStandardPortal = __webpack_require__(86);

var _DAStandardPortal2 = _interopRequireDefault(_DAStandardPortal);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _POST__archiveDataset = __webpack_require__(188);

var _POST__archiveDataset2 = _interopRequireDefault(_POST__archiveDataset);

var _NotesEditor = __webpack_require__(538);

var _NotesEditor2 = _interopRequireDefault(_NotesEditor);

var _POST__editDataSetDetail = __webpack_require__(191);

var _POST__editDataSetDetail2 = _interopRequireDefault(_POST__editDataSetDetail);

var _style = __webpack_require__(541);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  getInitialState: function getInitialState() {
    return {
      updateRequestPending: false,
      editing: false
    };
  },
  _toggleArchivePortal: function _toggleArchivePortal() {
    this.setState({
      updateRequestPending: !this.state.updateRequestPending
    });
  },
  toggleEdit: function toggleEdit() {
    this.setState({ editing: !this.state.editing });
  },
  render: function render() {
    var _this = this;

    var budgetId = this.props.match.params.budgetId;
    var _props = this.props,
        history = _props.history,
        budget = _props.budget;

    console.log(budget);
    return _react2.default.createElement(
      _Portal2.default,
      { fullscreen: true, background: '#EDF6F7', Button: this.props.Button },
      function (_ref) {
        var onToggle = _ref.onToggle,
            onOpen = _ref.onOpen,
            _onClose = _ref.onClose;
        return _react2.default.createElement(
          _DAStandardPortal2.default,
          {
            onClose: function onClose() {
              return _this.setState({
                updateRequestPending: false,
                editing: false
              }, _onClose);
            } },
          _react2.default.createElement(
            _style.ContinueRoot,
            null,
            _react2.default.createElement(
              _style.ContinueContent,
              null,
              _react2.default.createElement(
                _style.ContinueTitle,
                null,
                'Budget Notes'
              ),
              _react2.default.createElement(
                _style.ContinueBox,
                null,
                _react2.default.createElement(_NotesEditor2.default, {
                  onSaveChanges: function onSaveChanges(newNotes) {
                    return _this.setState({
                      newNotes: newNotes,
                      updateRequestPending: true
                    });
                  },
                  onToggleEditing: _this.toggleEdit,
                  editAuthority: _this.props.editDetailAuthority,
                  editing: _this.state.editing,
                  notes: _this.props.budget.DataSetNotes
                })
              )
            )
          ),
          _react2.default.createElement(_DARequestPortal2.default, {
            isOpen: _this.state.updateRequestPending,
            onSuccess: function onSuccess() {
              return _this.setState({ updateRequestPending: false, editing: false }, function () {
                return _onClose();
              });
            },
            onClose: function onClose(_ref2) {
              var error = _ref2.error,
                  success = _ref2.success;

              if (error) return _this.setState({ updateRequestPending: false });

              return _this.setState({ updateRequestPending: false, editing: false }, function () {
                return _onClose();
              });
            },
            request: function request(callback) {
              return (0, _POST__editDataSetDetail2.default)({
                DataSetNotes: _this.state.newNotes,
                FarmDataSetId: _this.props.budget.Id,
                Name: _this.props.budget.Name,
                Description: _this.props.budget.Description,
                DairyBaseId: _.find(_dataDefinition2.default.selectOptions.FarmId, {
                  Title: _this.props.budget.DairyBaseId
                }).Id,
                FinancialYearId: _this.props.budget.FinancialYearId,
                IsActual: _this.props.budget.IsActual,
                PrivacySettingId: _this.props.budget.PrivacySettingId
              }, callback);
            },
            text: {
              pendingTitle: 'Please wait a moment...',
              pendingDescription: 'Updating notes.',
              successTitle: 'Success!',
              successDescription: 'Your notes have been updated.',
              successButton: 'Back to Budget summary',
              errorTitle: 'Oops, something went wrong',
              errorDescription: 'Connection timed out.'
            }
          })
        );
      }
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 541 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ContinueButton = exports.ButtonBox = exports.Description = exports.ContinueBox = exports.ContinueTitle = exports.ContinueContent = exports.ContinueRoot = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ContinueRoot = exports.ContinueRoot = _styledComponents2.default.div.withConfig({
  displayName: 'NotesPortal__ContinueRoot'
})(['font-family:', ';display:flex;align-items:center;justify-content:center;padding-top:200px;'], _css.vars.Gilroy);

var ContinueContent = exports.ContinueContent = _styledComponents2.default.div.withConfig({
  displayName: 'NotesPortal__ContinueContent'
})(['']);

var ContinueTitle = exports.ContinueTitle = _styledComponents2.default.div.withConfig({
  displayName: 'NotesPortal__ContinueTitle'
})(['font-weight:700;font-size:40px;padding-bottom:20px;text-align:center;color:', ';'], _css.vars.DA_Dairy_blue);

var ContinueBox = exports.ContinueBox = _styledComponents2.default.div.withConfig({
  displayName: 'NotesPortal__ContinueBox'
})(['width:645px;margin:0 auto;position:relative;z-index:1;']);

var Description = exports.Description = _styledComponents2.default.div.withConfig({
  displayName: 'NotesPortal__Description'
})(['color:', ';font-size:16px;text-align:center;letter-spacing:0.8px;width:330px;margin:0 auto;'], _css.vars.DA_Dairy_blue);

var ButtonBox = exports.ButtonBox = _styledComponents2.default.div.withConfig({
  displayName: 'NotesPortal__ButtonBox'
})(['display:flex;align-items:center;justify-content:center;padding-top:50px;']);

var ContinueButton = exports.ContinueButton = _styledComponents2.default.button.withConfig({
  displayName: 'NotesPortal__ContinueButton'
})(['margin:0 auto;cursor:pointer;background:', ';text-align:center;font-weight:700;font-size:14px;letter-spacing:0.8px;color:', ';padding:8px 22px;border:none;', ' ', ' &:hover{background:', ';', ' ', '}&:active{color:white;', ' ', '}'], _css.vars.a(_css.vars.DA_pasture_green, 75), _css.vars.DA_Dairy_blue, function (props) {
  return props.error && '\n    background: white;\n    border: 1px solid ' + _css.vars.DA_sky_blue + ';\n  ';
}, function (props) {
  return props.warning && '\n    background: ' + _css.vars.DA_dusk_pink + ';\n    border: 1px solid ' + _css.vars.DA_dusk_pink + ';\n  ';
}, _css.vars.DA_accent_green, function (props) {
  return props.error && '\n      background: white;\n      border: 1px solid ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      background: ' + _css.vars.DA_dusk_pink + ';\n      border: 1px solid ' + _css.vars.DA_accent_pink + ';\n    ';
}, function (props) {
  return props.error && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
}, function (props) {
  return props.warning && '\n      color:  ' + _css.vars.DA_accent_blue + ';\n    ';
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ContinueRoot, 'ContinueRoot', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueContent, 'ContinueContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueTitle, 'ContinueTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueBox, 'ContinueBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');

  __REACT_HOT_LOADER__.register(Description, 'Description', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');

  __REACT_HOT_LOADER__.register(ButtonBox, 'ButtonBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');

  __REACT_HOT_LOADER__.register(ContinueButton, 'ContinueButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/NotesPortal/style.js');
}();

;

/***/ }),
/* 542 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _reactRouterDom = __webpack_require__(12);

var _CCNumber = __webpack_require__(158);

var _CCNumber2 = _interopRequireDefault(_CCNumber);

var _SummaryTable = __webpack_require__(286);

var _SummaryTable2 = _interopRequireDefault(_SummaryTable);

var _CopyPortal = __webpack_require__(532);

var _CopyPortal2 = _interopRequireDefault(_CopyPortal);

var _ArchivePortal = __webpack_require__(530);

var _ArchivePortal2 = _interopRequireDefault(_ArchivePortal);

var _NotesPortal = __webpack_require__(540);

var _NotesPortal2 = _interopRequireDefault(_NotesPortal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _style = __webpack_require__(543);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_datasetList2.default, 'handleListUpdate')],

  getInitialState: function getInitialState() {
    return {
      loadRequestPortalOpen: false,
      loadDatasetId: undefined,
      datasetList: []
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleListUpdate();
  },
  handleListUpdate: function handleListUpdate() {
    this.setState({ datasetList: _datasetList2.default.store });
  },
  _loadDataset: function _loadDataset(datasetId) {
    var newDataset = datasetId;
    var activeDataset = _activeDataset2.default.id;

    if (+newDataset === +activeDataset) {
      this._loadSameDataset();
    } else {
      this._toggleLoadRequestPortal(datasetId);
    }
  },
  _loadSameDataset: function _loadSameDataset() {
    this.props.history.push({
      pathname: '/editor',
      state: { backToBudgetId: this.props.match.params.budgetId }
    });
  },
  _handleLoadResponse: function _handleLoadResponse() {
    setTimeout(this._toggleLoadRequestPortal, 500);
    this.props.history.push({
      pathname: '/editor',
      state: { backToBudgetId: this.props.match.params.budgetId }
    });
  },
  _toggleLoadRequestPortal: function _toggleLoadRequestPortal(datasetId) {
    this.setState({
      loadRequestPortalOpen: !this.state.loadRequestPortalOpen,
      loadDatasetId: datasetId
    });
  },
  render: function render() {
    var _this = this;

    var _props = this.props,
        history = _props.history,
        match = _props.match,
        budget = _props.budget,
        editObj = _props.editObj,
        onEdit = _props.onEdit,
        cancelledEdit = _props.cancelledEdit;
    var budgetId = match.params.budgetId;


    var _Obj = budget || {};
    var _budget = _Obj.ScenarioDataset || {};
    var _source = _Obj.SourceDataset || {};

    var _budgetInList = _.find(this.state.datasetList, { Id: _budget.Id }) || {};

    var EditAuthority = _budgetInList.EditAuthority,
        EditDetailAuthority = _budgetInList.EditDetailAuthority,
        _isOrphan = _budgetInList._isOrphan;


    var yearList = _dataDefinition2.default.selectOptions.FinancialYearId;
    var year = _.find(yearList, { Id: _budget.FinancialYearId }) || {};
    var sourceYear = _.find(yearList, { Id: _source.FinancialYearId }) || {};

    return _react2.default.createElement(
      _style.Root,
      null,
      editObj && !cancelledEdit && _react2.default.createElement(_reactRouterDom.Redirect, { to: '/budget/' + budgetId + '/editor' }),
      _react2.default.createElement(
        _style.Header,
        null,
        _react2.default.createElement(
          _style.HeaderContent,
          null,
          _react2.default.createElement(
            _style.HeaderCol,
            null,
            _react2.default.createElement(
              _style.BackButton,
              { to: '/' },
              _react2.default.createElement(
                _style.BackButtonContent,
                null,
                _react2.default.createElement(_style.BackIcon, null),
                'Homepage'
              )
            )
          ),
          _react2.default.createElement(
            'h2',
            null,
            'DairyBase Budgeting'
          ),
          _react2.default.createElement(_style.HeaderCol, { right: true })
        )
      ),
      _react2.default.createElement(
        _style.SubHeader,
        null,
        _react2.default.createElement(
          _style.SubHeaderLeft,
          null,
          _react2.default.createElement(
            _style.SourceText,
            {
              'is-disabled': _isOrphan,
              onClick: function onClick() {
                return _isOrphan ? null : _this._loadDataset(_source.Id);
              } },
            'Source Dataset:',
            ' ',
            _react2.default.createElement(
              'span',
              { style: { display: 'inline-block', marginLeft: '8px' } },
              _isOrphan ? 'Not found - it\'s either archived, or you don\'t have access.' : _source.Name + ' - ' + _source.DairyBaseId + ' - ' + sourceYear.Title
            ),
            !_isOrphan && _react2.default.createElement(_style.SourceIcon, null)
          ),
          _react2.default.createElement(
            _style.BudgetName,
            null,
            _budget.Name
          )
        ),
        _react2.default.createElement(
          _style.SubHeaderRight,
          null,
          _react2.default.createElement(
            _style.YearLabel,
            null,
            'Budget Year'
          ),
          _react2.default.createElement(
            _style.YearTitle,
            null,
            year.Title
          )
        )
      ),
      _react2.default.createElement(
        _style.Body,
        null,
        _react2.default.createElement(
          _style.Content,
          null,
          _react2.default.createElement(_SummaryTable2.default, null)
        ),
        _react2.default.createElement(
          _style.SideMenu,
          null,
          EditAuthority && _react2.default.createElement(
            _style.SideMenuButton,
            {
              onClick: function onClick() {
                onEdit(function () {
                  return history.push('/budget/' + budgetId + '/editor');
                });
              } },
            _react2.default.createElement(
              _style.SideMenuItem,
              null,
              _react2.default.createElement(_style.SideMenuIcon, { id: 'da_edit' }),
              'EDIT BUDGET'
            )
          ),
          _react2.default.createElement(_CopyPortal2.default, {
            budget: _budget,
            Button: function Button(_ref) {
              var onOpen = _ref.onOpen;
              return _react2.default.createElement(
                _style.SideMenuButton,
                { onClick: onOpen },
                _react2.default.createElement(
                  _style.SideMenuItem,
                  null,
                  _react2.default.createElement(_style.SideMenuIcon, { id: 'da_create' }),
                  'CREATE A COPY'
                )
              );
            }
          }),
          EditDetailAuthority && _react2.default.createElement(_NotesPortal2.default, {
            budget: _budgetInList,
            editDetailAuthority: EditDetailAuthority,
            Button: function Button(_ref2) {
              var onOpen = _ref2.onOpen;
              return _react2.default.createElement(
                _style.SideMenuButton,
                { onClick: onOpen },
                _react2.default.createElement(
                  _style.SideMenuItem,
                  null,
                  _react2.default.createElement(_style.SideMenuIcon, { id: 'da_notes' }),
                  'VIEW NOTES'
                )
              );
            }
          }),
          _react2.default.createElement(
            _style.SideMenuButton,
            {
              style: { marginTop: '10px' },
              onClick: function onClick() {
                return _this._loadDataset(_budget.Id);
              } },
            _react2.default.createElement(
              _style.SideMenuItem,
              null,
              _react2.default.createElement(_style.SideMenuIcon, { id: 'da_external_link' }),
              'LOAD DATASET'
            )
          ),
          _react2.default.createElement(
            _style.SideMenuButton,
            {
              blue: true,
              style: { marginTop: '10px' },
              onClick: function onClick() {
                return _this.props.history.push({
                  pathname: '/reports',
                  state: {
                    backToBudgetId: _this.props.match.params.budgetId,
                    prefillDatasetIds: [_source.Id, _budget.Id]
                  }
                });
              } },
            _react2.default.createElement(
              _style.SideMenuItem,
              { blue: true },
              _react2.default.createElement(_style.SideMenuIcon, { id: 'da_copy', blue: true }),
              'LOAD REPORTS'
            )
          ),
          EditAuthority && _react2.default.createElement(_ArchivePortal2.default, {
            Button: function Button(_ref3) {
              var onOpen = _ref3.onOpen;
              return _react2.default.createElement(
                _style.SideMenuButton,
                {
                  red: true,
                  style: { marginTop: '44px' },
                  onClick: onOpen },
                _react2.default.createElement(
                  _style.SideMenuItem,
                  { red: true },
                  _react2.default.createElement(_style.SideMenuIcon, { id: 'da_launch', red: true }),
                  'ARCHIVE BUDGET'
                )
              );
            }
          })
        )
      ),
      _react2.default.createElement(
        _style.Acknowledgement,
        null,
        _react2.default.createElement(
          _style.AcknowledgementContent,
          null,
          _react2.default.createElement('img', {
            src: __webpack_require__(1391)
          }),
          _react2.default.createElement(
            'p',
            null,
            'This project is supported by the Department of Agriculture, ',
            _react2.default.createElement('br', null),
            'through funding from the Australian Government.'
          )
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.loadRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleLoadResponse,
          failHandler: this._toggleLoadRequestPortal,
          request: _POST__loadDataset2.default,
          data: this.state.loadDatasetId,
          pendingText: {
            title: 'Please wait',
            text: 'Loading Dataset...'
          },
          successText: {
            title: 'Success!',
            text: 'Dataset Loaded'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be loaded.'
          }
        })
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 543 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AcknowledgementContent = exports.Acknowledgement = exports.BackIcon = exports.BackButtonContent = exports.BackButton = exports.SideMenuLink = exports.SideMenuButton = exports.SideMenuIcon = exports.SideMenuItem = exports.SideMenu = exports.Content = exports.Body = exports.SourceText = exports.SourceIcon = exports.YearTitle = exports.YearLabel = exports.SubHeaderRight = exports.BudgetName = exports.SubHeaderLeft = exports.SubHeader = exports.HeaderCol = exports.HeaderContent = exports.Header = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__Root'
})(['position:absolute;z-index:1;top:0;bottom:0;right:0;left:0;overflow-y:scroll;background:', ';padding-bottom:40px;'], _css.vars.DA_Dairy_grey);

var Header = exports.Header = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__Header'
})(['height:61px;padding:10px;padding-top:12px;padding-bottom:12px;background:white;']);
var HeaderContent = exports.HeaderContent = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__HeaderContent'
})(['display:flex;align-items:center;justify-content:space-between;width:1000px;margin:0 auto;h2{font-weight:600;font-size:25px;color:', ';}'], _css.vars.DA_Dairy_blue);

var HeaderCol = exports.HeaderCol = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__HeaderCol'
})(['width:200px;', ''], function (props) {
  return props.right && '\n    display: flex;\n    justify-content: flex-end;\n  ';
});

var SubHeader = exports.SubHeader = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__SubHeader'
})(['display:flex;align-items:flex-end;justify-content:space-between;width:1000px;margin:0 auto;padding-left:10px;padding-top:75px;padding-bottom:20px;padding-right:20px;']);
var SubHeaderLeft = exports.SubHeaderLeft = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__SubHeaderLeft'
})(['']);

var BudgetName = exports.BudgetName = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__BudgetName'
})(['font-weight:700;font-size:22px;color:', ';'], _css.vars.DA_accent_blue);

var SubHeaderRight = exports.SubHeaderRight = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__SubHeaderRight'
})(['display:flex;align-items:center;']);
var YearLabel = exports.YearLabel = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__YearLabel'
})(['font-weight:700;font-size:13px;letter-spacing:1.1px;text-transform:uppercase;color:', ';padding-right:20px;'], _css.vars.DA_Dairy_blue);

var YearTitle = exports.YearTitle = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__YearTitle'
})(['width:84px;height:50px;background:white;border:1px solid ', ';font-size:14px;color:', ';display:flex;align-items:center;text-align:center;justify-content:center;letter-spacing:0.8px;'], _css.vars.a(_css.vars.DA_accent_blue, 30), _css.vars.DA_Dairy_blue);

var SourceIcon = exports.SourceIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_external_link' }).withConfig({
  displayName: 'Summary__SourceIcon'
})(['', ';margin-top:-4px;path{fill:', ';}'], _css.mixins.icon('27px', '27px'), _css.vars.DA_text);

var SourceText = exports.SourceText = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__SourceText'
})(['cursor:default;display:flex;align-items:center;color:', ';font-size:14px;letter-spacing:0.8px;padding-bottom:4px;', ''], _css.vars.DA_text, function (props) {
  return !props['is-disabled'] && '\n    cursor: pointer;\n      &:hover {\n    color: ' + _css.vars.DA_accent_blue + ';\n\n    ' + SourceIcon + ' {\n      path {\n        fill: ' + _css.vars.DA_accent_blue + ';\n      }\n    }\n  }\n  ';
});

var Body = exports.Body = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__Body'
})(['display:flex;width:1000px;margin:0 auto;']);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__Content'
})(['flex:1;background:white;min-height:500px;max-width:800px;padding:10px;']);

var SideMenu = exports.SideMenu = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__SideMenu'
})(['width:170px;margin-left:10px;']);

var SideMenuItem = exports.SideMenuItem = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__SideMenuItem'
})(['width:170px;display:flex;align-items:center;padding-left:5px;padding-right:5px;height:50px;background:white;color:', ';font-weight:600;font-size:12px;letter-spacing:1.1px;', ''], _css.vars.DA_Dairy_blue, function (props) {
  return props.blue && '\n    background: ' + _css.vars.DA_accent_blue + ';\n    color: white;\n\n  ';
});

var SideMenuIcon = exports.SideMenuIcon = (0, _styledComponents2.default)(_xchIcon2.default).withConfig({
  displayName: 'Summary__SideMenuIcon'
})(['margin-right:5px;', ';path{fill:', ';}', ''], function (props) {
  switch (props.id) {
    case 'da_edit':
      {
        return _css.mixins.icon('28px', '28px');
      }
    default:
      return _css.mixins.icon('32px', '32px');
  }
}, _css.vars.DA_accent_blue, function (props) {
  return props.blue && '\n      path {\n        fill: white;\n      }\n  ';
});

var SideMenuButton = exports.SideMenuButton = _styledComponents2.default.button.withConfig({
  displayName: 'Summary__SideMenuButton'
})(['display:block;background:none;border:none;padding:0;margin:0;&:hover{', '{background:', ';', ' ', '}', '{path{fill:', ';}}}&:active{', '{color:', ';}', '{path{fill:', ';}}}'], SideMenuItem, _css.vars.a(_css.vars.DA_accent_blue, 40), function (props) {
  return props.blue && '\n          background: ' + _css.vars.a(_css.vars.DA_accent_blue, 40) + ';\n          color: ' + _css.vars.DA_Dairy_blue + ';\n      ';
}, function (props) {
  return props.red && '\n          background: ' + _css.vars.DA_dusk_pink + ';\n      ';
}, SideMenuIcon, _css.vars.DA_Dairy_blue, SideMenuItem, _css.vars.DA_accent_blue, SideMenuIcon, _css.vars.DA_accent_blue);

var SideMenuLink = exports.SideMenuLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'Summary__SideMenuLink'
})(['display:block;&:hover{', '{background:', ';}}&:active{', '{color:', ';}}'], SideMenuItem, _css.vars.DA_sky_blue, SideMenuItem, _css.vars.DA_accent_blue);

var BackButton = exports.BackButton = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'Summary__BackButton'
})(['display:inline-block;background:white;padding:5px 12px;color:', ';font-weight:500;border:1px solid white;border-radius:22px;&:hover{border:1px solid ', ';}&:active{background:', ';}'], _css.vars.DA_accent_blue, _css.vars.a(_css.vars.DA_sky_blue, 50), _css.vars.a(_css.vars.DA_sky_blue, 50));

var BackButtonContent = exports.BackButtonContent = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__BackButtonContent'
})(['display:flex;align-items:center;']);

var BackIcon = exports.BackIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_arrow_left' }).withConfig({
  displayName: 'Summary__BackIcon'
})(['', ';margin-right:5px;path{fill:', ';}'], _css.mixins.icon('28px', '28px'), _css.vars.DA_accent_blue);

var Acknowledgement = exports.Acknowledgement = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__Acknowledgement'
})(['width:1000px;margin:0 auto;']);

var AcknowledgementContent = exports.AcknowledgementContent = _styledComponents2.default.div.withConfig({
  displayName: 'Summary__AcknowledgementContent'
})(['width:800px;display:flex;align-items:center;justify-content:space-between;margin-top:40px;border-top:1px solid ', ';border-bottom:1px solid ', ';padding:20px;img{width:278px;margin-top:-4px;}p{width:381px;color:black;font-weight:500;font-size:14px;}'], _css.vars.a(_css.vars.DA_text, 25), _css.vars.a(_css.vars.DA_text, 25));
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(Header, 'Header', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(HeaderContent, 'HeaderContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(HeaderCol, 'HeaderCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SubHeader, 'SubHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SubHeaderLeft, 'SubHeaderLeft', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(BudgetName, 'BudgetName', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SubHeaderRight, 'SubHeaderRight', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(YearLabel, 'YearLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(YearTitle, 'YearTitle', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SourceIcon, 'SourceIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SourceText, 'SourceText', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(Body, 'Body', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SideMenu, 'SideMenu', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SideMenuItem, 'SideMenuItem', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SideMenuIcon, 'SideMenuIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SideMenuButton, 'SideMenuButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(SideMenuLink, 'SideMenuLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(BackButton, 'BackButton', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(BackButtonContent, 'BackButtonContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(BackIcon, 'BackIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(Acknowledgement, 'Acknowledgement', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');

  __REACT_HOT_LOADER__.register(AcknowledgementContent, 'AcknowledgementContent', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/Summary/style.js');
}();

;

/***/ }),
/* 544 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.OutputValue = exports.OutputField = exports.Unit = exports.Title = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CCBanner__Root'
})(['display:flex;align-items:center;background:#edf6f7;height:92px;padding-left:30px;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'CCBanner__Title'
})(['width:250px;font-size:16px;font-weight:700;color:', ';display:flex;align-items:center;', ''], _css.vars.DA_Dairy_blue, function (props) {
  return props.hasDescription && '\n\n    cursor: pointer;\n\n    &:hover {\n      color: ' + _css.vars.DA_accent_blue + ';\n    }\n  ';
});

var Unit = exports.Unit = _styledComponents2.default.span.withConfig({
  displayName: 'CCBanner__Unit'
})(['display:inline-block;margin-left:20px;font-size:12px;']);

var OutputField = exports.OutputField = _styledComponents2.default.div.withConfig({
  displayName: 'CCBanner__OutputField'
})(['display:flex;align-items:center;padding:10px;font-weight:700;color:', ';'], _css.vars.DA_Dairy_blue);

var OutputValue = exports.OutputValue = _styledComponents2.default.div.withConfig({
  displayName: 'CCBanner__OutputValue'
})(['padding-right:20px;text-align:right;width:60px;']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/style.js');

  __REACT_HOT_LOADER__.register(Unit, 'Unit', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/style.js');

  __REACT_HOT_LOADER__.register(OutputField, 'OutputField', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/style.js');

  __REACT_HOT_LOADER__.register(OutputValue, 'OutputValue', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCBanner/style.js');
}();

;

/***/ }),
/* 545 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _style = __webpack_require__(546);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {};

var _default = (0, _xchReactClass2.default)(options, {
  render: function render() {
    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(_style.HelpIcon, null)
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpIcon/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpIcon/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 546 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.HelpIcon = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpIcon__Root'
})(['width:34px;height:34px;display:flex;align-items:center;justify-content:center;background:white;border:1px solid ', ';border-radius:50%;'], _css.vars.DA_accent_blue);

var HelpIcon = exports.HelpIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_info' }).withConfig({
  displayName: 'CCHelpIcon__HelpIcon'
})(['', ';path{fill:', ';}'], _css.mixins.icon('26px', '26px'), _css.vars.DA_accent_blue);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpIcon/style.js');

  __REACT_HOT_LOADER__.register(HelpIcon, 'HelpIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpIcon/style.js');
}();

;

/***/ }),
/* 547 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Button = exports.ButtonBox = exports.Box = exports.Title = exports.Content = exports.Header = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__Root'
})(['font-family:', ';display:flex;align-items:center;justify-content:center;padding-top:200px;'], _css.vars.Gilroy);

var Header = exports.Header = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__Header'
})(['width:630px;display:flex;justify-content:center;padding-bottom:20px;']);

var Content = exports.Content = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__Content'
})(['width:630px;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__Title'
})(['width:440px;margin:0 auto;font-weight:700;font-size:40px;padding-bottom:60px;text-align:center;color:', ';'], _css.vars.DA_Dairy_blue);

var Box = exports.Box = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__Box'
})(['padding:25px;background:white;padding-bottom:35px;border:1px solid ', ';color:', ';font-size:16px;letter-spacing:0.8px;', ''], _css.vars.DA_sky_blue, _css.vars.DA_Dairy_blue, function (props) {
  return props.warning && '\n    border-color: ' + _css.vars.DA_accent_pink + ';\n  ';
});

var ButtonBox = exports.ButtonBox = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__ButtonBox'
})(['display:flex;align-items:center;padding-top:30px;', ''], function (props) {
  return props.border && '\n    border-bottom: 1px solid ' + _css.vars.DA_Dairy_grey + ';\n    padding-bottom: 30px;\n  ';
});

var Button = exports.Button = _styledComponents2.default.div.withConfig({
  displayName: 'CCHelpPortal__Button'
})(['cursor:pointer;']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');

  __REACT_HOT_LOADER__.register(Header, 'Header', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');

  __REACT_HOT_LOADER__.register(Content, 'Content', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');

  __REACT_HOT_LOADER__.register(Box, 'Box', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');

  __REACT_HOT_LOADER__.register(ButtonBox, 'ButtonBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');

  __REACT_HOT_LOADER__.register(Button, 'Button', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCHelpPortal/style.js');
}();

;

/***/ }),
/* 548 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

exports.addCommas = addCommas;
exports.removeCommas = removeCommas;
function addCommas(num) {
  if (typeof num === "string" || typeof num === "number") {
    var parts = num.toString().split(".");
    parts[0] = parts[0].replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
    return parts.join(".");
  } else {
    return num;
  }
}

function removeCommas(num) {
  if ((typeof num === "undefined" ? "undefined" : _typeof(num)) === ("string" || "number")) {
    return num.toString().replace(/,/g, "");
  } else {
    return num;
  }
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(addCommas, "addCommas", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/commas/index.js");

  __REACT_HOT_LOADER__.register(removeCommas, "removeCommas", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/commas/index.js");
}();

;

/***/ }),
/* 549 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _commas = __webpack_require__(548);

var _numberParser = __webpack_require__(550);

var _style = __webpack_require__(551);

var style = _interopRequireWildcard(_style);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: (0, _numberParser.parseIn)(this.props.value, this.props),
      focused: false
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    // removed focus lock here to allow ratio updates on tab
    // if (this.state.focused && !this.props.error) return

    this.setState({
      value: (0, _numberParser.parseIn)(newProps.value, newProps)
    });
  },
  componentWillUnmount: function componentWillUnmount() {
    this.validateData();
  },
  parentFn: function parentFn(fn) {
    if (typeof fn !== 'undefined') fn();
  },
  preventScroll: function preventScroll(event) {
    event.preventDefault();
  },
  validateData: function validateData() {
    var newValue = this.state.value;
    var currentValue = (0, _numberParser.parseIn)(this.props.value, this.props);

    if (typeof newValue === 'undefined' || newValue === null || newValue === '' || typeof +newValue !== 'number' || isNaN(newValue) || this.props.disabled ||
    // same as prev value
    +newValue === +currentValue && this.props.value !== null && !this.props.error) {
      // not valid
      return this.handleCancel();
    }

    // is valid
    return this.props.onSubmit((0, _numberParser.parseOut)(this.state.value, this.props));
  },
  handleFocus: function handleFocus(evt) {
    var _this = this;

    if (!this.props.disabled) {
      this.parentFn(this.props.onFocus);
      this.setState({
        focused: true
      }, function () {
        setTimeout(function () {
          if (_this.state.focused) {
            var input = _this.my_input;
            input.select();
            input.addEventListener('mousewheel', _this.preventScroll);
          }
        }, 30);
      });
    }
  },
  handleChange: function handleChange(evt) {
    this.setState({ value: evt.target.value });
  },


  handleKeyDown: function handleKeyDown(evt) {
    switch (evt.keyCode) {
      case 13:
        // Enter
        this.validateData();
        break;
      case 27:
        // esc
        this.handleCancel();
        break;
    }
  },

  handleCancel: function handleCancel() {
    this.setState({
      focused: false,
      value: (0, _numberParser.parseIn)(this.props.value, this.props)
    });
  },
  handleBlur: function handleBlur() {
    this.parentFn(this.props.onBlur);
    var input = this.my_input;
    input.removeEventListener('mousewheel', this.preventScroll);
    this.setState({
      focused: false
    }, function () {
      this.validateData();
    });
  },
  render: function render() {
    var _this2 = this;

    var _state = this.state,
        value = _state.value,
        focused = _state.focused;
    var _props = this.props,
        readOnly = _props.readOnly,
        disabled = _props.disabled,
        percent = _props.percent,
        error = _props.error,
        autofocus = _props.autofocus,
        frontUnit = _props.frontUnit,
        backUnit = _props.backUnit,
        CustomStyle = _props.CustomStyle,
        isGrey = _props.isGrey;


    var nonNullValue = this.state.value === null || this.state.value === 'NaN' || this.state.value === 'Infinity' ? '' : this.state.value;

    var _renderedValue = value == null || value === 'NaN' || value === 'Infinity' ? '-' : (0, _commas.addCommas)(value);

    var negative = value < 0;

    var _$merge = _.merge(style, CustomStyle),
        Root = _$merge.Root,
        Input = _$merge.Input,
        Output = _$merge.Output,
        FrontUnit = _$merge.FrontUnit,
        BackUnit = _$merge.BackUnit;

    return _react2.default.createElement(
      Root,
      {
        readOnly: readOnly,
        disabled: disabled && !readOnly,
        focused: focused,
        percent: percent,
        negative: negative,
        error: error },
      readOnly ? null : _react2.default.createElement(Input, {
        innerRef: function innerRef(ref) {
          _this2.my_input = ref;
        },
        type: 'number',
        value: nonNullValue,
        disabled: disabled,
        onFocus: this.handleFocus,
        onBlur: this.handleBlur,
        onChange: this.handleChange,
        onKeyDown: this.handleKeyDown,
        autoFocus: autofocus,
        negative: negative,
        isGrey: isGrey
      }),
      _react2.default.createElement(
        Output,
        { negative: negative, isGrey: isGrey },
        frontUnit && _react2.default.createElement(
          FrontUnit,
          null,
          frontUnit
        ),
        _renderedValue,
        backUnit && _react2.default.createElement(
          BackUnit,
          null,
          backUnit
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 550 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.parseIn = parseIn;
exports.parseOut = parseOut;
function parseIn(value) {
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  if (value === null) return value;
  var _value = +value;
  if (props.percent) _value = _value * 100;
  return _value.toFixed(props.decimal);
}

function parseOut(value) {
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  var _value = +value;
  if (props.percent) _value = _value / 100;
  return _value;
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(parseIn, "parseIn", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/numberParser/index.js");

  __REACT_HOT_LOADER__.register(parseOut, "parseOut", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/numberParser/index.js");
}();

;

/***/ }),
/* 551 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Root = exports.Output = exports.Input = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var shade = _css.mixins.shade,
    tint = _css.mixins.tint,
    opacity = _css.mixins.opacity;


var input_layer = '\n  cursor: inherit;\n  color: ' + _css.vars.DA_Dairy_blue + ';\n\n  font-size: 14px;\n  letter-spacing: 0.8px;\n\n\n  position: absolute;\n  z-index: 1;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  width: 100%;\n  height: 100%;\n\n  padding: 0 10px;\n\n  text-align: right;\n';

var Input = exports.Input = _styledComponents2.default.input.withConfig({
  displayName: 'NumberInput__Input'
})(['', ';position:relative;z-index:2;opacity:0;width:100%;border:none;-webkit-font-smoothing:antialiased;', ' &:focus{opacity:1;}'], input_layer, function (props) {
  return props.isGrey && '\n      color: ' + _css.vars.DA_text + ';\n  ';
});

var Output = exports.Output = _styledComponents2.default.div.withConfig({
  displayName: 'NumberInput__Output'
})(['', ';', ';', ' position:absolute;display:flex;justify-content:flex-end;align-items:center;z-index:1;top:0;bottom:0;left:0;right:0;'], input_layer, _css.mixins.ellipsis(), function (props) {
  return props.isGrey && '\n      color: ' + _css.vars.DA_text + ';\n  ';
});

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'NumberInput__Root'
})(['width:100%;position:relative;z-index:1;border:1px solid #C3DC93;border-radius:2px;height:42px;cursor:text;background:white;&:hover{border-color:#6CC24A;}', ' ', ' ', ' ', ' ', ' ', '{', '}'], function (props) {
  return props.readOnly && '\n    background: none;\n    border: none;\n\n    &:hover {\n      border: none;\n    }\n  ';
}, function (props) {
  return props.disabled && '\n    cursor: not-allowed;\n    border: 1px solid ' + tint(_css.vars.blue_grey, 20) + ';\n    opacity: 0.6;\n  ';
}, function (props) {
  return props.focused && '\n    border-color: #6CC24A;\n  ';
}, function (props) {
  return props.waiting && '\n    border-color: ' + tint(_css.vars.blue_grey, 20) + ';\n    -webkit-animation: pulsate 1.5s ease-out;\n    -webkit-animation-iteration-count: infinite;\n    opacity: 1.0;\n  ';
}, function (props) {
  return props.error && '\n    border-color: ' + _css.vars.daves_orange + ';\n    color: ' + _css.vars.daves_orange + ';\n  ';
}, Output, function (props) {
  return props.focused && '\n      opacity: 0;\n    ';
});
var FrontUnit = _styledComponents2.default.span.withConfig({
  displayName: 'NumberInput__FrontUnit'
})(['color:', ';'], _css.vars.DA_Dairy_blue);

var BackUnit = _styledComponents2.default.span.withConfig({
  displayName: 'NumberInput__BackUnit'
})(['color:', ';'], _css.vars.DA_Dairy_blue);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(shade, 'shade', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(tint, 'tint', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(opacity, 'opacity', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(input_layer, 'input_layer', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(Input, 'Input', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(Output, 'Output', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(FrontUnit, 'FrontUnit', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');

  __REACT_HOT_LOADER__.register(BackUnit, 'BackUnit', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCNumber/NumberInput/style.js');
}();

;

/***/ }),
/* 552 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.InputCol = exports.Inputs = exports.LabelCol = exports.ColLabel = exports.LabelText = exports.Row = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__Root'
})(['padding-top:10px;', ''], function (props) {
  return props.scenarioTable && '\n  ';
});

var Row = exports.Row = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__Row'
})(['display:flex;justify-content:space-between;align-items:center;font-size:14px;', ' ', ' ', ' ', ' ', ' ', ' ', ''], function (props) {
  return (props.scenarioTable || props.scenario) && '\n    border-bottom: 1px solid ' + _css.vars.DA_pasture_green + ';\n\n    padding-top: 6px;\n    padding-bottom: 6px;\n    background: ' + _css.mixins.opacity(_css.vars.DA_pasture_green, 25) + ';\n\n  ';
}, function (props) {
  return props.scenario && '\n    border-top: 1px solid ' + _css.vars.DA_pasture_green + ';\n  ';
}, function (props) {
  return props.total && '\n    padding: 0;\n    font-weight: 700;\n  ';
}, function (props) {
  return props.greenTotal && '\n    background: ' + _css.mixins.opacity(_css.vars.DA_pasture_green, 25) + ';\n    border-top: 2px solid ' + _css.vars.DA_pasture_green + ';\n    border-bottom: 2px solid ' + _css.vars.DA_pasture_green + ';\n  ';
}, function (props) {
  return props.header && '\n    font-weight: 700;\n    border-bottom: 1px solid #E5EDED;\n    align-items: flex-end;\n    min-height: 45px;\n    padding-bottom: 8px;\n\n    ' + (props.scenarioTable && '\n      border-color: ' + _css.vars.DA_pasture_green + ';\n    ') + '\n  ';
}, function (props) {
  return props.border && '\n      border-bottom: 1px solid #eeeeed;\n  ';
}, function (props) {
  return props.background && '\n      background: ' + _css.vars.a(_css.vars.DA_Dairy_grey, 50) + ';\n  ';
});

var LabelText = exports.LabelText = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__LabelText'
})(['', ''], function (props) {
  return props.hasDescription && '\n\n    cursor: pointer;\n\n    &:hover {\n      color: ' + _css.vars.DA_accent_blue + ';\n    }\n  ';
});

var ColLabel = exports.ColLabel = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__ColLabel'
})(['', ''], function (props) {
  return props.hasDescription && '\n\n    cursor: pointer;\n\n    &:hover {\n      color: ' + _css.vars.DA_accent_blue + ';\n    }\n  ';
});

var LabelCol = exports.LabelCol = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__LabelCol'
})(['flex:1;padding-right:10px;padding-left:10px;font-family:', ';font-weight:500;font-size:14px;color:', ';', ' ', ' ', ' ', ';'], _css.vars.Gilroy, _css.vars.DA_Dairy_blue, function (props) {
  return props.isGrey && '\n      color: ' + _css.vars.DA_text + ';\n  ';
}, function (props) {
  return props.total && '\n    font-weight: 700;\n  ';
}, function (props) {
  return props.long && '\n    width: 400px;\n  ';
}, function (props) {
  return props.greyBorder && '\n      padding-top: 17px;\n      padding-bottom: 16px;\n      border-bottom: 1px solid ' + _css.vars.DA_Dairy_grey + ';\n  ';
});

var Inputs = exports.Inputs = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__Inputs'
})(['display:flex;justify-content:flex-end;align-items:center;', ''], function (props) {
  return props.header && '\n    align-items: flex-end;\n  ';
});

var InputCol = exports.InputCol = _styledComponents2.default.div.withConfig({
  displayName: 'CCTable__InputCol'
})(['text-align:right;width:110px;padding-right:10px;color:', ' ', ' ', ' ', ';', ';', ';', ';', ';'], _css.vars.DA_Dairy_blue, function (props) {
  return props.scenario && '\n    background: ' + _css.mixins.opacity(_css.vars.DA_pasture_green, 25) + ';\n\n  ';
}, function (props) {
  return props.right && '\n    display: flex;\n    justify-content: flex-end;\n    align-items: flex-end;\n    margin-bottom: -4px;\n  ';
}, function (props) {
  return props.header && '\n    padding-right: 20px;\n    font-size: 12px;\n    font-weight: 700;\n    line-height: 1.3;\n  ';
}, function (props) {
  return props.padded && '\n    padding-top: 6px;\n    padding-bottom: 6px;\n  ';
}, function (props) {
  return props.greenBorder && '\n    position: relative;\n    z-index: 2;\n    border-bottom: 1px solid ' + _css.vars.DA_pasture_green + ';\n  ';
}, function (props) {
  return props.greyBorder && '\n    position: relative;\n    z-index: 1;\n    border-bottom: 1px solid ' + _css.vars.DA_Dairy_grey + ';\n  ';
}, function (props) {
  return props.padLeft && '\n    width: 120px;\n    padding-left: 10px;\n  ';
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');

  __REACT_HOT_LOADER__.register(LabelText, 'LabelText', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');

  __REACT_HOT_LOADER__.register(ColLabel, 'ColLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');

  __REACT_HOT_LOADER__.register(LabelCol, 'LabelCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');

  __REACT_HOT_LOADER__.register(Inputs, 'Inputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');

  __REACT_HOT_LOADER__.register(InputCol, 'InputCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCTable/style.js');
}();

;

/***/ }),
/* 553 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.WarningIcon = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'CCWarningIcon__Root'
})(['width:34px;height:34px;display:flex;align-items:center;justify-content:center;background:white;border:1px solid ', ';border-radius:50%;'], _css.vars.DA_accent_pink);

var WarningIcon = exports.WarningIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_alert' }).withConfig({
  displayName: 'CCWarningIcon__WarningIcon'
})(['', ';path{fill:', ';}'], _css.mixins.icon('28px', '28px'), _css.vars.DA_accent_pink);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCWarningIcon/style.js');

  __REACT_HOT_LOADER__.register(WarningIcon, 'WarningIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/CCWarningIcon/style.js');
}();

;

/***/ }),
/* 554 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

exports.addCommas = addCommas;
exports.removeCommas = removeCommas;
function addCommas(num) {
  if (typeof num === "string" || typeof num === "number") {
    var parts = num.toString().split(".");
    parts[0] = parts[0].replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
    return parts.join(".");
  } else {
    return num;
  }
}

function removeCommas(num) {
  if ((typeof num === "undefined" ? "undefined" : _typeof(num)) === ("string" || "number")) {
    return num.toString().replace(/,/g, "");
  } else {
    return num;
  }
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(addCommas, "addCommas", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/NumberOutput/commas/index.js");

  __REACT_HOT_LOADER__.register(removeCommas, "removeCommas", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/NumberOutput/commas/index.js");
}();

;

/***/ }),
/* 555 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.parseIn = parseIn;
exports.parseOut = parseOut;
function parseIn(value) {
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  if (value === null) return value;
  var _value = +value;
  if (props.percent) _value = _value * 100;
  return _value.toFixed(props.decimal);
}

function parseOut(value) {
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

  var _value = +value;
  if (props.percent) _value = _value / 100;
  return _value;
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(parseIn, "parseIn", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/NumberOutput/numberParser/index.js");

  __REACT_HOT_LOADER__.register(parseOut, "parseOut", "C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/NumberOutput/numberParser/index.js");
}();

;

/***/ }),
/* 556 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1083);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _style = __webpack_require__(557);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      options: this.sortOptions(this.props)
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.setState({
      value: newProps.value,
      options: this.sortOptions(newProps)
    });
  },
  sortOptions: function sortOptions(props) {
    var options = props.options,
        value = props.value;


    if (!options) return options;
    if (options.length === 0) return options;

    var hasOrder = typeof options[0].Order === 'number';
    var orderKey = hasOrder ? 'Order' : 'Id';
    var filteredList = !hasOrder ? options : options.filter(function (item) {
      return item.Id === value || item.Order > 0;
    });

    return _.sortBy(filteredList, orderKey);
  },
  _handleSelect: function _handleSelect(evt) {
    if (!this.props.disabled) {
      this._handleSubmitData(evt.target.value);
    }
  },
  _handleSubmitData: function _handleSubmitData(newValue) {
    this.props.onSubmit(+newValue, this.props.id);
  },
  render: function render() {
    var CC_RatioSelectInput__dropdown = (0, _classnames2.default)({
      CC_RatioSelectInput__dropdown: true,
      'is-error': this.props.error
    });
    return _react2.default.createElement(
      _style.RatioDropdown,
      null,
      this._renderSelectElement(),
      _react2.default.createElement(_style.DownIcon, null)
    );
  },
  _renderSelectElement: function _renderSelectElement() {
    var selectElement;

    var classList = (0, _classnames2.default)({
      CC_RatioSelectInput__field: true,
      'is-error': this.props.error,
      'is-disabled': this.props.disabled
    });

    if (typeof this.state.value !== 'undefined' && this.state.options.length !== 0) {
      selectElement = _react2.default.createElement(
        _style.RatioInput,
        {
          disabled: this.props.disabled,
          value: this.state.value,
          onChange: this._handleSelect },
        this.state.options.map(function (option, index) {
          return _react2.default.createElement(
            'option',
            { key: index, value: option.Id },
            option.Title
          );
        })
      );
    } else {
      selectElement = _react2.default.createElement(
        _style.RatioInput,
        {
          className: 'CC_RatioSelectInput__field',
          disabled: true,
          value: '1' },
        _react2.default.createElement(
          'option',
          { value: '1' },
          'waiting for data...'
        )
      );
    }
    return selectElement;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 557 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.RatioInput = exports.RatioDropdown = exports.DownIcon = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DownIcon = exports.DownIcon = (0, _styledComponents2.default)(_xchIcon2.default).attrs({ id: 'da_arrow_down' }).withConfig({
  displayName: 'SelectInput__DownIcon'
})(['', ';position:absolute;z-index:1;right:-5px;top:50%;margin-top:-8px;path{fill:', ';}'], _css.mixins.icon('18px', '18px'), _css.vars.a(_css.vars.DA_Dairy_blue, 50));

var RatioDropdown = exports.RatioDropdown = _styledComponents2.default.div.withConfig({
  displayName: 'SelectInput__RatioDropdown'
})(['position:relative;z-index:1;width:82px;height:30px;&:hover{', '{path{fill:', ';}}}'], DownIcon, _css.vars.DA_accent_blue);

var RatioInput = exports.RatioInput = _styledComponents2.default.select.withConfig({
  displayName: 'SelectInput__RatioInput'
})(['position:absolute;z-index:2;top:0;left:0;right:0;bottom:0;text-align:right;line-height:1.2;background:none;border:none;color:', ';cursor:pointer;font-size:14px;font-weight:300;padding:8px;padding-bottom:7px;width:100%;-webkit-appearance:none;-moz-appearance:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-weight:700;font-size:12px;&:hover{color:', ';', '{path{fill:', ';}}}&:focus{color:', ';', '{path{fill:', ';}}}&.is-disabled{cursor:not-allowed;opacity:0.6;}&:focus{outline:none;}&.is-error{color:', ';}'], _css.vars.DA_Dairy_blue, _css.vars.DA_accent_blue, DownIcon, _css.vars.DA_accent_blue, _css.vars.DA_accent_blue, DownIcon, _css.vars.DA_accent_blue, _css.vars.DA_red);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DownIcon, 'DownIcon', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/SelectInput/style.js');

  __REACT_HOT_LOADER__.register(RatioDropdown, 'RatioDropdown', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/SelectInput/style.js');

  __REACT_HOT_LOADER__.register(RatioInput, 'RatioInput', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/SelectInput/style.js');
}();

;

/***/ }),
/* 558 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.OutputValue = exports.OutputField = exports.Unit = exports.Title = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'RatioInput__Root'
})(['display:flex;align-items:center;background:#edf6f7;height:92px;padding-left:30px;']);

var Title = exports.Title = _styledComponents2.default.div.withConfig({
  displayName: 'RatioInput__Title'
})(['width:250px;font-size:16px;font-weight:700;color:', ';display:flex;align-items:center;'], _css.vars.DA_Dairy_blue);

var Unit = exports.Unit = _styledComponents2.default.span.withConfig({
  displayName: 'RatioInput__Unit'
})(['display:inline-block;margin-left:20px;font-size:12px;']);

var OutputField = exports.OutputField = _styledComponents2.default.div.withConfig({
  displayName: 'RatioInput__OutputField'
})(['display:flex;align-items:center;padding:10px;font-weight:700;color:', ';'], _css.vars.DA_Dairy_blue);

var OutputValue = exports.OutputValue = _styledComponents2.default.div.withConfig({
  displayName: 'RatioInput__OutputValue'
})(['padding-right:20px;text-align:right;width:60px;']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/style.js');

  __REACT_HOT_LOADER__.register(Title, 'Title', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/style.js');

  __REACT_HOT_LOADER__.register(Unit, 'Unit', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/style.js');

  __REACT_HOT_LOADER__.register(OutputField, 'OutputField', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/style.js');

  __REACT_HOT_LOADER__.register(OutputValue, 'OutputValue', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/RatioInput/style.js');
}();

;

/***/ }),
/* 559 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1084);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      value: this.props.value,
      options: this.sortOptions(this.props)
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.setState({
      value: newProps.value,
      options: this.sortOptions(newProps)
    });
  },
  sortOptions: function sortOptions(props) {
    var options = props.options,
        value = props.value;


    if (!options) return options;
    if (options.length === 0) return options;

    var hasOrder = typeof options[0].Order === 'number';
    var orderKey = hasOrder ? 'Order' : 'Id';
    var filteredList = !hasOrder ? options : options.filter(function (item) {
      return item.Id === value || item.Order > 0;
    });

    return _.sortBy(filteredList, orderKey);
  },
  _handleSelect: function _handleSelect(evt) {
    if (!this.props.disabled) {
      this._handleSubmitData(evt.target.value);
    }
  },
  _handleSubmitData: function _handleSubmitData(newValue) {
    this.props.onSubmit(+newValue, this.props.id);
  },
  render: function render() {
    var CC_SelectInput__dropdown = (0, _classnames2.default)({
      'CC_SelectInput__dropdown': true,
      'is-error': this.props.error
    });
    return _react2.default.createElement(
      'div',
      { className: 'CC_SelectInput' },
      _react2.default.createElement(
        'div',
        { className: CC_SelectInput__dropdown },
        this._renderSelectElement(),
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow', width: '9px' })
      )
    );
  },
  _renderSelectElement: function _renderSelectElement() {
    var selectElement;

    var classList = (0, _classnames2.default)({
      "CC_SelectInput__field": true,
      "is-error": this.props.error,
      "is-disabled": this.props.disabled
    });

    if (typeof this.state.value !== "undefined" && this.state.options.length !== 0) {
      selectElement = _react2.default.createElement(
        'select',
        { className: classList,
          disabled: this.props.disabled,
          value: this.state.value,
          onChange: this._handleSelect },
        this.state.options.map(function (option, index) {
          return _react2.default.createElement(
            'option',
            { key: index, value: option.Id },
            option.Title
          );
        })
      );
    } else {
      selectElement = _react2.default.createElement(
        'select',
        { className: 'CC_SelectInput__field is-disabled',
          disabled: true,
          value: '1' },
        _react2.default.createElement(
          'option',
          { value: '1' },
          'waiting for data...'
        )
      );
    }
    return selectElement;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 560 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackLink = exports.OutputValue = exports.RatioBox = exports.OutputLabel = exports.Output = exports.BannerOutputs = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'SummaryTable__Root'
})(['']);

var BannerOutputs = exports.BannerOutputs = _styledComponents2.default.div.withConfig({
  displayName: 'SummaryTable__BannerOutputs'
})(['flex:1;display:flex;align-items:center;justify-content:flex-end;font-size:12px;padding-right:110px;']);

var Output = exports.Output = _styledComponents2.default.div.withConfig({
  displayName: 'SummaryTable__Output'
})(['padding-right:20px;width:110px;']);

var OutputLabel = exports.OutputLabel = _styledComponents2.default.div.withConfig({
  displayName: 'SummaryTable__OutputLabel'
})(['font-weight:700;padding-bottom:5px;text-align:right;']);

var RatioBox = exports.RatioBox = _styledComponents2.default.div.withConfig({
  displayName: 'SummaryTable__RatioBox'
})(['font-weight:bold;padding-bottom:5px;margin-left:-10px;margin-top:-14px;display:flex;justify-content:flex-end;']);

var OutputValue = exports.OutputValue = _styledComponents2.default.div.withConfig({
  displayName: 'SummaryTable__OutputValue'
})(['font-weight:700;font-size:14px;text-align:right;']);

var BackLink = exports.BackLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: 'SummaryTable__BackLink'
})(['color:#b3b3b2;&:hover{color:#2e76d8;}&:active{text-decoration:underline;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');

  __REACT_HOT_LOADER__.register(BannerOutputs, 'BannerOutputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');

  __REACT_HOT_LOADER__.register(Output, 'Output', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');

  __REACT_HOT_LOADER__.register(OutputLabel, 'OutputLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');

  __REACT_HOT_LOADER__.register(RatioBox, 'RatioBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');

  __REACT_HOT_LOADER__.register(OutputValue, 'OutputValue', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');

  __REACT_HOT_LOADER__.register(BackLink, 'BackLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/_shared/SummaryTable/style.js');
}();

;

/***/ }),
/* 561 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _budgets = __webpack_require__(88);

var _budgets2 = _interopRequireDefault(_budgets);

var _POST__readBudget = __webpack_require__(420);

var _POST__readBudget2 = _interopRequireDefault(_POST__readBudget);

var _DARequestPortal = __webpack_require__(78);

var _DARequestPortal2 = _interopRequireDefault(_DARequestPortal);

var _reactRouterDom = __webpack_require__(12);

var _Summary = __webpack_require__(542);

var _Summary2 = _interopRequireDefault(_Summary);

var _Editor = __webpack_require__(528);

var _Editor2 = _interopRequireDefault(_Editor);

var _style = __webpack_require__(562);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var options = {
  withRouter: true
};

var _default = (0, _xchReactClass2.default)(options, {
  mixins: [_reflux2.default.listenTo(_budgets2.default, 'handleBudgetUpdate')],

  getInitialState: function getInitialState() {
    return {
      requestPending: false,
      unsavedEdits: false,
      budget: {},
      editObj: undefined,
      cancelledEdit: false
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleBudgetUpdate(true);
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (this.props.match.params.budgetId !== newProps.match.params.budgetId) {
      this.handleBudgetUpdate(true);
    }
  },
  handleBudgetUpdate: function handleBudgetUpdate(forceReload) {
    var budgetId = this.props.match.params.budgetId;


    this.setState({
      requestPending: forceReload,
      unsavedEdits: _budgets2.default.store.editsById[budgetId],
      budget: _budgets2.default.store.budgetsById[budgetId],
      editObj: _budgets2.default.store.editsById[budgetId]
    });
  },
  render: function render() {
    var _this = this;

    var _state = this.state,
        requestPending = _state.requestPending,
        unsavedEdits = _state.unsavedEdits,
        budget = _state.budget,
        editObj = _state.editObj,
        cancelledEdit = _state.cancelledEdit;
    var budgetId = this.props.match.params.budgetId;


    return _react2.default.createElement(
      _style.Root,
      null,
      _react2.default.createElement(_DARequestPortal2.default, {
        skipSuccess: true,
        isOpen: this.state.requestPending,
        request: function request(callback) {
          return (0, _POST__readBudget2.default)({ FarmDataSetId: budgetId }, callback);
        },
        onSuccess: function onSuccess() {
          return _this.setState({ requestPending: false });
        },
        text: {
          pendingTitle: 'Please wait a moment...',
          pendingDescription: 'Reading budget data.',
          errorTitle: 'Oops, something went wrong',
          errorDescription: 'Connection timed out.'
        }
      }),
      _react2.default.createElement(
        _reactRouterDom.Switch,
        null,
        _react2.default.createElement(_reactRouterDom.Route, {
          exact: true,
          path: '/budget/:budgetId',
          render: function render(props) {
            return _react2.default.createElement(_Summary2.default, _extends({}, props, {
              budget: budget,
              editObj: editObj,
              cancelledEdit: cancelledEdit,
              onEdit: function onEdit(callback) {
                return _this.setState({ cancelledEdit: false }, callback);
              }
            }));
          }
        }),
        _react2.default.createElement(_reactRouterDom.Route, {
          path: '/budget/:budgetId/editor',
          render: function render(props) {
            return _react2.default.createElement(_Editor2.default, _extends({}, props, {
              budgetObj: budget,
              editObj: editObj,
              cancelledEdit: cancelledEdit,
              onCancelEdit: function onCancelEdit(callback) {
                return _this.setState({ cancelledEdit: true }, callback);
              }
            }));
          }
        })
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(options, 'options', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 562 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.BackLink = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _css = __webpack_require__(21);

var _reactRouterDom = __webpack_require__(12);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: '_Budget__Root'
})(['font-family:', ';'], _css.vars.Gilroy);

var BackLink = exports.BackLink = (0, _styledComponents2.default)(_reactRouterDom.Link).withConfig({
  displayName: '_Budget__BackLink'
})(['color:#b3b3b2;&:hover{color:#2e76d8;}&:active{text-decoration:underline;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/style.js');

  __REACT_HOT_LOADER__.register(BackLink, 'BackLink', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Budget/style.js');
}();

;

/***/ }),
/* 563 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1085);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _POST__unArchiveDataset = __webpack_require__(421);

var _POST__unArchiveDataset2 = _interopRequireDefault(_POST__unArchiveDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

var _filterArchivedDatasets = __webpack_require__(265);

var _filterArchivedDatasets2 = _interopRequireDefault(_filterArchivedDatasets);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter__UnFilteredList = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList2.default, "_handleListUpdate")],

  getInitialState: function getInitialState() {
    return {
      list: [],
      id: undefined,
      archiveRequestPortalOpen: false
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleListUpdate();
  },
  _handleListUpdate: function _handleListUpdate() {
    this.setState({
      list: (0, _filterArchivedDatasets2.default)()
    });
  },
  handleItemClick: function handleItemClick(item) {
    this.setState({
      id: item.Id,
      archiveRequestPortalOpen: true
    });
  },
  _toggleArchiveRequestPortal: function _toggleArchiveRequestPortal() {
    this.setState({
      archiveRequestPortalOpen: !this.state.archiveRequestPortalOpen
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ArchiveList' },
      this.renderList()
    );
  },
  renderList: function renderList() {
    return this.state.list.length < 1 ? _react2.default.createElement(
      'div',
      { className: '_list' },
      _react2.default.createElement(
        'span',
        { className: '_noItems' },
        'You have no archived datasets!'
      )
    ) : _react2.default.createElement(
      'div',
      { className: '_list' },
      _react2.default.createElement(_DatasetList2.default, {
        list: this.state.list,
        emitItemClick: this.handleItemClick }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.archiveRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleArchiveRequestPortal,
          failHandler: this._toggleArchiveRequestPortal,
          request: _POST__unArchiveDataset2.default,
          data: this.state.id,
          pendingText: {
            title: 'Please wait',
            text: 'Restoring Dataset...'
          },
          successText: {
            title: 'Success!',
            text: 'The dataset has been restored.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The dataset could not be restored.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter__UnFilteredList, 'Filter__UnFilteredList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/Archive/ArchiveList/index.jsx');
}();

;

/***/ }),
/* 564 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _index = __webpack_require__(1086);

var _index2 = _interopRequireDefault(_index);

var _ArchiveList = __webpack_require__(563);

var _ArchiveList2 = _interopRequireDefault(_ArchiveList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Archive = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Archive' },
      _react2.default.createElement(
        'h2',
        { className: '_title' },
        'Restore Archived Datasets'
      ),
      _react2.default.createElement(
        'h2',
        { className: '_subtitle' },
        'To restore a dataset, select it from the list:'
      ),
      _react2.default.createElement(_ArchiveList2.default, null)
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Archive, 'Archive', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/Archive/index.jsx');
}();

;

/***/ }),
/* 565 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _Item = __webpack_require__(1)({
  _onClick: function _onClick() {
    _Actions2.default.UPDATE_DATASETLIST_FILTER(this.props.filter, this.props.id);
  },
  render: function render() {
    return _react2.default.createElement(
      'button',
      { className: 'DownloadPortal__FilterHeader__Item', onClick: this._onClick },
      this.props.title
    );
  }
});

module.exports = _Item;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_Item, '_Item', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_FilteredList/_FilterHeader/_Item/index.jsx');
}();

;

/***/ }),
/* 566 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1087);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _Item = __webpack_require__(565);

var _Item2 = _interopRequireDefault(_Item);

var _getAllDatasetFilters = __webpack_require__(266);

var _getAllDatasetFilters2 = _interopRequireDefault(_getAllDatasetFilters);

var _xchCheckBox = __webpack_require__(125);

var _xchCheckBox2 = _interopRequireDefault(_xchCheckBox);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterHeader = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleNewFilter')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _clearFilter: function _clearFilter() {
    _Actions2.default.CLEAR_DATASETLIST_FILTER();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      list: (0, _getAllDatasetFilters2.default)(),
      filtering: _datasetListFilter2.default.filtering
    });
  },
  render: function render() {
    return !this.state.filtering ? null : _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__FilterHeader' },
      _react2.default.createElement(
        'div',
        { className: '_box' },
        _react2.default.createElement(_xchCheckBox2.default, {
          value: this.props.allSelected,
          onSubmit: this.props.handleSelectOrClearAll
        })
      ),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(
          'h3',
          { className: '_intro' },
          'Filtered datasets:'
        ),
        _react2.default.createElement(
          'div',
          { className: '_filters' },
          this._renderFilters()
        )
      ),
      _react2.default.createElement(
        'button',
        { className: '_btn', onClick: this._clearFilter },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' }),
          _react2.default.createElement(
            'span',
            { className: '_text' },
            'clear filter'
          )
        )
      )
    );
  },
  _renderFilters: function _renderFilters() {
    return this.state.list.map(function (filter, index) {
      return _react2.default.createElement(_Item2.default, {
        key: index,
        title: filter.title,
        id: filter.id,
        filter: filter.filter
      });
    });
  }
});

module.exports = FilterHeader;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterHeader, 'FilterHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_FilteredList/_FilterHeader/index.jsx');
}();

;

/***/ }),
/* 567 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1088);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _FilterHeader = __webpack_require__(566);

var _FilterHeader2 = _interopRequireDefault(_FilterHeader);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter__FilteredList = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, "_handleNewFilter"), _reflux2.default.listenTo(_datasetGroups2.default, "_handleNewFilter")],

  getInitialState: function getInitialState() {
    return {
      filter: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      filter: _datasetListFilter2.default.store,
      filtering: _datasetListFilter2.default.filtering
    });
  },
  _getFilteredList: function _getFilteredList() {
    var _this = this;

    // nothing filtered so return an empty list
    if (!this.state.filtering) return [];
    return this.props.list.filter(function (item, index) {
      // includes anything from the filter
      return _.includes((0, _checkItemInFilter2.default)(item, _this.state.filter), true);
    });
  },
  _handleSelectOrClearAll: function _handleSelectOrClearAll() {
    var listIds = _.map(this._getFilteredList(), 'Id');

    return this.props.handleSelectOrClearAll(listIds);
  },
  render: function render() {
    var filteredList = this._getFilteredList();

    var notEmptyList = filteredList.length !== 0;
    var allSelected = _.difference(_.map(filteredList, 'Id'), this.props.selectedList).length === 0;

    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__Filter__FilteredList is-in-filter' },
      _react2.default.createElement(_FilterHeader2.default, {
        allSelected: notEmptyList && allSelected,
        handleSelectOrClearAll: this._handleSelectOrClearAll }),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(_DatasetList2.default, {
          list: filteredList,
          emitItemClick: this.props.emitItemClick,
          selectedList: this.props.selectedList,
          hasCheckbox: true })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter__FilteredList, 'Filter__FilteredList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_FilteredList/index.jsx');
}();

;

/***/ }),
/* 568 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GroupModal = __webpack_require__(287);

var _GroupModal2 = _interopRequireDefault(_GroupModal);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Col = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      groupPortalOpen: false
    };
  },
  _openGroupPortal: function _openGroupPortal() {
    this.setState({
      groupPortalOpen: true,
      coords: (0, _getDomCoords3.default)(this.myBtn, true)
    });
  },
  _toggleGroupPortal: function _toggleGroupPortal() {
    this.setState({
      groupPortalOpen: !this.state.groupPortalOpen
    });
  },
  render: function render() {
    var _this = this;

    var ModalHandler = this.props.colData.handler;
    return _react2.default.createElement(
      'button',
      {
        ref: function ref(_ref) {
          return _this.myBtn = _ref;
        },
        onClick: this._openGroupPortal,
        className: 'DatasetList__column' },
      this.props.colData.title,
      _react2.default.createElement(
        _Portal2.default,
        { context: document.body, isOpen: this.state.groupPortalOpen },
        _react2.default.createElement(
          _GroupModal2.default,
          {
            coords: this.state.coords,
            closePortal: this._toggleGroupPortal,
            arrowRight: this.props.colData.id === 'OwnerName',
            leftOffset: this.props.colData.id === 'OwnerName' ? 130 : 0 },
          _react2.default.createElement(ModalHandler, null)
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Col, 'Col', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_SmallFilterbar/_FilterControls/_Col/index.jsx');
}();

;

/***/ }),
/* 569 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = [{
  title: "Farm ID",
  id: "DairyBaseId",
  handler: __webpack_require__(281)
}, {
  title: "Year",
  id: "FinancialYear",
  handler: __webpack_require__(283)
}, {
  title: "Actual",
  id: "IsActual",
  handler: __webpack_require__(279)
}, {
  title: "Editable",
  id: "EditAuthority",
  handler: __webpack_require__(280)
}, {
  title: "User",
  id: "OwnerName",
  handler: __webpack_require__(282)
}];
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 570 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1090);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _columnData = __webpack_require__(569);

var _columnData2 = _interopRequireDefault(_columnData);

var _Col = __webpack_require__(568);

var _Col2 = _interopRequireDefault(_Col);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GroupModal = __webpack_require__(287);

var _GroupModal2 = _interopRequireDefault(_GroupModal);

var _Groups = __webpack_require__(90);

var _Groups2 = _interopRequireDefault(_Groups);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      groupPortalOpen: false
    };
  },
  _openGroupPortal: function _openGroupPortal(ref) {
    this.setState({
      groupPortalOpen: true,
      coords: (0, _getDomCoords3.default)(this[ref], true)
    });
  },
  _toggleGroupPortal: function _toggleGroupPortal() {
    this.setState({
      groupPortalOpen: !this.state.groupPortalOpen
    });
  },
  _renderColumnHeaders: function _renderColumnHeaders() {
    return _columnData2.default.map(function (column, index) {
      return _react2.default.createElement(_Col2.default, { colData: column, key: index });
    });
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__FilterControls' },
      _react2.default.createElement(
        'div',
        { className: 'DatasetList__header' },
        _react2.default.createElement(
          'div',
          { className: 'DatasetList__column DownloadPortal__FilterControls__NameCol' },
          _react2.default.createElement(
            'span',
            { className: '_title' },
            'Name'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              ref: function ref(_ref) {
                return _this.groupFilterRef = _ref;
              },
              onClick: this._openGroupPortal.bind(this, 'groupFilterRef') },
            _react2.default.createElement(
              'div',
              { className: '_content' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'folder' }),
              _react2.default.createElement(
                'span',
                { className: '_text' },
                'Filter by Groups'
              )
            )
          ),
          _react2.default.createElement(
            _Portal2.default,
            { context: document.body, isOpen: this.state.groupPortalOpen },
            _react2.default.createElement(
              _GroupModal2.default,
              {
                coords: this.state.coords,
                closePortal: this._toggleGroupPortal },
              _react2.default.createElement(_Groups2.default, null)
            )
          )
        ),
        this._renderColumnHeaders()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 571 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1091);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilterControls = __webpack_require__(570);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SmallFilterbar = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__SmallFilterbar' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_FilterControls2.default, null)
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SmallFilterbar, 'SmallFilterbar', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_SmallFilterbar/index.jsx');
}();

;

/***/ }),
/* 572 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _index = __webpack_require__(1092);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _xchCheckBox = __webpack_require__(125);

var _xchCheckBox2 = _interopRequireDefault(_xchCheckBox);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, '_handleNewFilter'), _reflux2.default.listenTo(_datasetGroups2.default, '_handleNewFilter')],

  getInitialState: function getInitialState() {
    return {
      filter: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      filter: _datasetListFilter2.default.store,
      filtering: _datasetListFilter2.default.filtering
    });
  },
  _getFilteredList: function _getFilteredList() {
    var _this = this;

    // nothing filtered so return whole list
    if (!this.state.filtering) return this.props.list;
    return this.props.list.filter(function (item, index) {
      // item is not included in the filter
      return !_.includes((0, _checkItemInFilter2.default)(item, _this.state.filter), true);
    });
  },
  render: function render() {
    var DatasetListComponent = this.props.listComponent;
    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__Filter__UnFilteredList' },
      _react2.default.createElement(
        'div',
        { className: '_list' },
        this.renderSubGroup('My datasets', this.getUserList),
        this.renderSubGroup('Shared user datasets', this.getOtherUserList),
        this.renderSubGroup('Industry datasets', this.getIndustryList)
      )
    );
  },
  renderSubGroup: function renderSubGroup(title, listfn) {
    var _this2 = this;

    var DatasetListComponent = this.props.listComponent;
    var list = listfn();

    var listIds = _.map(list, 'Id');

    var notEmptyList = list.length !== 0;
    var allSelected = _.difference(listIds, this.props.selectedList).length === 0;

    return list.length === 0 ? null : _react2.default.createElement(
      'div',
      { className: '_subGroup' },
      _react2.default.createElement(
        'div',
        { className: '_header' },
        _react2.default.createElement(
          'div',
          { className: '_box' },
          _react2.default.createElement(_xchCheckBox2.default, {
            value: notEmptyList && allSelected,
            onSubmit: function onSubmit() {
              return _this2.props.handleSelectOrClearAll(listIds);
            }
          })
        ),
        _react2.default.createElement(
          'h3',
          { className: '_text' },
          title
        )
      ),
      _react2.default.createElement(DatasetListComponent, {
        list: list,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        hasCheckbox: true
      })
    );
  },
  getUserList: function getUserList() {
    return this._getFilteredList().filter(function (item) {
      return item.IsThisOwner;
    });
  },
  getOtherUserList: function getOtherUserList() {
    return this._getFilteredList().filter(function (item) {
      return !item.IsThisOwner && !item.SystemDataSet;
    });
  },
  getIndustryList: function getIndustryList() {
    return this._getFilteredList().filter(function (item) {
      return item.SystemDataSet;
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/_UnfilteredList/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 573 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1093);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _SmallFilterbar = __webpack_require__(571);

var _SmallFilterbar2 = _interopRequireDefault(_SmallFilterbar);

var _FilteredList = __webpack_require__(567);

var _FilteredList2 = _interopRequireDefault(_FilteredList);

var _UnfilteredList = __webpack_require__(572);

var _UnfilteredList2 = _interopRequireDefault(_UnfilteredList);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _DatasetList = __webpack_require__(76);

var _DatasetList2 = _interopRequireDefault(_DatasetList);

var _GroupFilters = __webpack_require__(197);

var _GroupFilters2 = _interopRequireDefault(_GroupFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_datasetList2.default, '_handleNewData'), _reflux2.default.listenTo(_activeDataset2.default, '_handleDatasetUpdate'), _reflux2.default.listenTo(_datasetListGroups2.default, '_handleNewData')],

  getInitialState: function getInitialState() {
    return {
      unfilteredList: [],
      list: [],
      recentlyOpen: [],
      activeDatasetId: 1
    };
  },
  componentWillMount: function componentWillMount() {
    if (_datasetList2.default.store.length >= 1) {
      this._handleNewData();
      this._handleDatasetUpdate();
    }
  },
  _handleDatasetUpdate: function _handleDatasetUpdate() {
    this.setState({
      activeDatasetId: _activeDataset2.default.id
    });
  },
  _handleNewData: function _handleNewData() {
    var listGroups = _datasetListGroups2.default.store;

    var visibleList = (0, _filterVisibleDatasets2.default)();

    this.setState({
      unfilteredList: visibleList,
      recentlyOpen: visibleList,
      list: visibleList.filter(function (item) {
        var user = item.OwnerName;
        var _budgets = item._budgets,
            _isOrphan = item._isOrphan;

        var itemHasBudgets = (_budgets && _budgets.length > 0 || _isOrphan) && listGroups.budgets;

        if (item.IsCcModel) {
          return listGroups.budgets;
        }

        if (item.IsThisOwner) {
          return listGroups.user || itemHasBudgets;
        }
        if (item.SystemDataSet) {
          return listGroups.industry || itemHasBudgets;
        }
        return listGroups.other || itemHasBudgets;
      })
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__FilteringDatasetList' },
      _react2.default.createElement(_SmallFilterbar2.default, null),
      _react2.default.createElement(
        'div',
        { className: '_insideFilter' },
        _react2.default.createElement(_GroupFilters2.default, { onSelectDataset: this.props.emitItemClick, isZZtop: true })
      ),
      _react2.default.createElement(_FilteredList2.default, {
        list: this.state.list,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        handleSelectOrClearAll: this.props.handleSelectOrClearAll
      }),
      _react2.default.createElement(_UnfilteredList2.default, {
        list: this.state.list,
        listComponent: _DatasetList2.default,
        emitItemClick: this.props.emitItemClick,
        selectedList: this.props.selectedList,
        handleSelectOrClearAll: this.props.handleSelectOrClearAll
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_FilteringDatasetList/index.jsx');
}();

;

/***/ }),
/* 574 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1094);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SelectedList = module.exports = __webpack_require__(1)({
  _renderEmptySlots: function _renderEmptySlots() {

    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__ReportModalEmptyList' },
      _react2.default.createElement(
        'div',
        { className: '_item' },
        'Select Dataset'
      )
    );
  },
  _handleClickSelected: function _handleClickSelected(id) {
    this.props.emitRemoveFromSelected(id);
  },
  _renderSelectedList: function _renderSelectedList() {
    var _this = this;

    var selected = this.props.selected;

    var list = this.props.datasetList.filter(function (item) {
      return _.includes(selected, item.Id);
    });

    var selectedList = _.sortBy(list, function (item) {
      return _.indexOf(selected, item.Id);
    });

    var _listItems = selectedList.map(function (item, index) {
      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: '_item' },
        _react2.default.createElement(
          'div',
          { className: '_text' },
          item.DairyBaseId,
          ' ',
          item.FinancialYear,
          ' ',
          item.Name
        ),
        _react2.default.createElement(
          'button',
          { className: '_delete', onClick: _this._handleClickSelected.bind(_this, item.Id) },
          _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
        )
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__ReportModalSelectedList' },
      _listItems
    );
  },
  _renderSubmitBtn: function _renderSubmitBtn() {
    var onClick = this.props.selected.length < 1 ? null : this.props.handleDownload;

    var ReportModalBody__submitBtn = (0, _classnames2.default)({
      'DownloadPortal__ReportModalDatasets__submitBtn': true,
      'is-clickable': this.props.selected.length >= 1
    });

    return _react2.default.createElement(
      'button',
      {
        className: ReportModalBody__submitBtn,
        onClick: onClick },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Download'
        ),
        _react2.default.createElement(_Icon2.default, { id: 'forward', className: '_icon' })
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__ReportModalSelectedDatasets' },
      _react2.default.createElement(
        'div',
        { className: '_listContainer' },
        _react2.default.createElement(
          'h3',
          { className: '_title' },
          'Selected Datasets:'
        ),
        this._renderSubmitBtn(),
        this.props.selected.length < 1 ? this._renderEmptySlots() : this._renderSelectedList(),
        this._renderSubmitBtn()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SelectedList, 'SelectedList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/_SelectedList/index.jsx');
}();

;

/***/ }),
/* 575 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1095);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _POST__bulkDatasetDownload = __webpack_require__(413);

var _POST__bulkDatasetDownload2 = _interopRequireDefault(_POST__bulkDatasetDownload);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilteringDatasetList = __webpack_require__(573);

var _FilteringDatasetList2 = _interopRequireDefault(_FilteringDatasetList);

var _SelectedList = __webpack_require__(574);

var _SelectedList2 = _interopRequireDefault(_SelectedList);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList2.default, "_handleNewData"), _reflux2.default.listenTo(_datasetListGroups2.default, "handleGroupUpdate"), _reflux2.default.listenTo(_user2.default, "handleUserUpdate"), (0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      datasetList: [],
      selectedDatasets: [],
      requestPortalOpen: false
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleUserUpdate();
    this.handleGroupUpdate();
    this._handleNewData();
  },
  handleUserUpdate: function handleUserUpdate() {
    var _datasetObj = _user2.default.store.BulkDownloadDatasetIdArray || {};
    this.setState({
      selectedDatasets: _datasetObj.Value || []
    });
  },
  handleGroupUpdate: function handleGroupUpdate() {
    this.setState({
      user: _datasetListGroups2.default.store.user,
      other: _datasetListGroups2.default.store.other,
      industry: _datasetListGroups2.default.store.industry
    });
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      datasetList: (0, _filterVisibleDatasets2.default)()
    });
  },
  _addToSelected: function _addToSelected(id) {
    var selectedList = this.state.selectedDatasets;
    if (_.includes(selectedList, id)) return this._removeFromSelected(id);

    var newArr = selectedList;
    newArr.push(id);

    this.setState({ selectedDatasets: newArr });
  },
  _removeFromSelected: function _removeFromSelected(id) {
    var newArr = this.state.selectedDatasets.filter(function (item) {
      return item !== id;
    });

    this.setState({ selectedDatasets: newArr });
  },
  _checkAllSelected: function _checkAllSelected() {
    var _state = this.state,
        user = _state.user,
        other = _state.other,
        industry = _state.industry,
        datasetList = _state.datasetList,
        selectedDatasets = _state.selectedDatasets;


    var displayedList = datasetList.filter(function (item) {
      var includeUser = user && item.IsThisOwner;
      var includeOther = other && !item.IsThisOwner && !item.SystemDataSet;
      var includeIndustry = industry && item.SystemDataSet;

      return includeUser || includeOther || includeIndustry;
    });

    return displayedList.length <= this.state.selectedDatasets.length;
  },
  _selectAllDatasets: function _selectAllDatasets() {
    var _state2 = this.state,
        user = _state2.user,
        other = _state2.other,
        industry = _state2.industry,
        datasetList = _state2.datasetList,
        selectedDatasets = _state2.selectedDatasets;


    var addedList = datasetList.filter(function (item) {
      var includeUser = user && item.IsThisOwner;
      var includeOther = other && !item.IsThisOwner && !item.SystemDataSet;
      var includeIndustry = industry && item.SystemDataSet;

      return includeUser || includeOther || includeIndustry;
    });

    var ids = _.map(addedList, 'Id');

    return this._selectOrClearDatasets(ids);
  },
  _clearAllDatasets: function _clearAllDatasets() {
    return this.setState({ selectedDatasets: [] });
  },
  _selectOrClearDatasets: function _selectOrClearDatasets(ids) {
    var selectedList = this.state.selectedDatasets;

    if (_.difference(ids, selectedList).length === 0) return this._removeDatasetsFromSelected(ids);

    var newArr = _.union(selectedList, ids);

    this.setState({ selectedDatasets: newArr });
  },
  _removeDatasetsFromSelected: function _removeDatasetsFromSelected(ids) {
    var selectedList = this.state.selectedDatasets;

    var newArr = _.difference(selectedList, ids);

    this.setState({ selectedDatasets: newArr });
  },
  _handleDatasetItemClick: function _handleDatasetItemClick(item) {
    this._addToSelected(item.Id);
  },
  _handleDownloadDatasets: function _handleDownloadDatasets() {
    var selectedList = this.state.selectedDatasets;

    this.__toggleRequestPortal();
  },
  __toggleRequestPortal: function __toggleRequestPortal() {
    this.setState({ requestPortalOpen: !this.state.requestPortalOpen });
  },
  _handleFinishDownload: function _handleFinishDownload() {
    var _this = this;

    this.setState({ requestPortalOpen: false }, function () {
      _this.props.toggleBulkDownload();
    });
  },
  render: function render() {

    var allSelected = this._checkAllSelected();

    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__Datasets' },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.toggleBulkDownload }),
      _react2.default.createElement(
        'div',
        { className: '_title' },
        'Select Datasets to Download',
        _react2.default.createElement(
          'button',
          { className: '_selectall', onClick: this._selectAllDatasets },
          'Select All'
        ),
        _react2.default.createElement(
          'button',
          { className: '_clearall', onClick: this._clearAllDatasets },
          'Clear All'
        )
      ),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(_FilteringDatasetList2.default, {
          list: this.state.datasetList,
          selectedList: this.state.selectedDatasets,
          emitItemClick: this._handleDatasetItemClick,
          handleSelectOrClearAll: this._selectOrClearDatasets }),
        _react2.default.createElement(_SelectedList2.default, {
          datasetList: this.state.datasetList,
          selected: this.state.selectedDatasets,
          emitRemoveFromSelected: this._removeFromSelected,
          handleDownload: this._handleDownloadDatasets })
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.requestPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleFinishDownload,
          failHandler: this.__toggleRequestPortal,
          request: _POST__bulkDatasetDownload2.default,
          data: this.state.selectedDatasets,
          wait: true,
          pendingText: {
            title: 'Please wait',
            text: 'Generating bulk dataset spreadsheet.'
          },
          successText: {
            title: 'Spreadsheet created!',
            text: 'The Excel file should be in your download folder. To use this in Excel you will need to Enable Editing at the top of the spreadsheet.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The spreadsheet was not generated.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/DownloadPortal/index.js');
}();

;

/***/ }),
/* 576 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1096);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FilterControls = __webpack_require__(107);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets__Filterbar = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Datasets__Filterbar' },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_FilterControls2.default, null)
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets__Filterbar, 'Datasets__Filterbar', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/_Filterbar/index.jsx');
}();

;

/***/ }),
/* 577 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1097);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListFilter = __webpack_require__(40);

var _datasetListFilter2 = _interopRequireDefault(_datasetListFilter);

var _datasetGroups = __webpack_require__(69);

var _datasetGroups2 = _interopRequireDefault(_datasetGroups);

var _LoadDatasetList = __webpack_require__(201);

var _LoadDatasetList2 = _interopRequireDefault(_LoadDatasetList);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _FilterHeader = __webpack_require__(154);

var _FilterHeader2 = _interopRequireDefault(_FilterHeader);

var _checkItemInFilter = __webpack_require__(75);

var _checkItemInFilter2 = _interopRequireDefault(_checkItemInFilter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter__FilteredList = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetListFilter2.default, "_handleNewFilter"), _reflux2.default.listenTo(_datasetGroups2.default, "_handleNewFilter")],

  getInitialState: function getInitialState() {
    return {
      filter: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewFilter();
  },
  _handleNewFilter: function _handleNewFilter() {
    this.setState({
      filter: _datasetListFilter2.default.store,
      filtering: _datasetListFilter2.default.filtering
    });
  },
  _getFilteredList: function _getFilteredList() {
    var _this = this;

    // nothing filtered so return an empty list
    if (!this.state.filtering) return [];
    return this.props.list.filter(function (item, index) {
      // includes anything from the filter
      return _.includes((0, _checkItemInFilter2.default)(item, _this.state.filter), true);
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Filter__FilteredList is-in-filter' },
      _react2.default.createElement(_FilterHeader2.default, null),
      _react2.default.createElement(
        'div',
        { className: '_list' },
        _react2.default.createElement(_LoadDatasetList2.default, { list: this._getFilteredList() })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter__FilteredList, 'Filter__FilteredList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/_FilteredList/index.jsx');
}();

;

/***/ }),
/* 578 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1098);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _CreateBudgetButton = __webpack_require__(150);

var _CreateBudgetButton2 = _interopRequireDefault(_CreateBudgetButton);

var _getDomCoords2 = __webpack_require__(62);

var _getDomCoords3 = _interopRequireDefault(_getDomCoords2);

var _GET__bulkDatasetDownload = __webpack_require__(409);

var _GET__bulkDatasetDownload2 = _interopRequireDefault(_GET__bulkDatasetDownload);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _FilteredList = __webpack_require__(577);

var _FilteredList2 = _interopRequireDefault(_FilteredList);

var _checkToken = __webpack_require__(264);

var _checkToken2 = _interopRequireDefault(_checkToken);

var _FilterController = __webpack_require__(467);

var _FilterController2 = _interopRequireDefault(_FilterController);

var _FilterControls = __webpack_require__(107);

var _FilterControls2 = _interopRequireDefault(_FilterControls);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _RecentlyOpen = __webpack_require__(463);

var _RecentlyOpen2 = _interopRequireDefault(_RecentlyOpen);

var _Archive = __webpack_require__(564);

var _Archive2 = _interopRequireDefault(_Archive);

var _GroupFilters = __webpack_require__(197);

var _GroupFilters2 = _interopRequireDefault(_GroupFilters);

var _DownloadPortal = __webpack_require__(575);

var _DownloadPortal2 = _interopRequireDefault(_DownloadPortal);

var _UnsavedDatasetOverlay = __webpack_require__(502);

var _UnsavedDatasetOverlay2 = _interopRequireDefault(_UnsavedDatasetOverlay);

var _Filterbar = __webpack_require__(576);

var _Filterbar2 = _interopRequireDefault(_Filterbar);

var _filterArchivedDatasets = __webpack_require__(265);

var _filterArchivedDatasets2 = _interopRequireDefault(_filterArchivedDatasets);

var _ActionListModal = __webpack_require__(503);

var _ActionListModal2 = _interopRequireDefault(_ActionListModal);

var _LoadDetailModal = __webpack_require__(206);

var _LoadDetailModal2 = _interopRequireDefault(_LoadDetailModal);

var _UnfilteredList = __webpack_require__(198);

var _UnfilteredList2 = _interopRequireDefault(_UnfilteredList);

var _LoadDatasetList = __webpack_require__(201);

var _LoadDatasetList2 = _interopRequireDefault(_LoadDatasetList);

var _reactRouterDom = __webpack_require__(12);

var _POST__BenchmarkCSVDownload = __webpack_require__(412);

var _POST__BenchmarkCSVDownload2 = _interopRequireDefault(_POST__BenchmarkCSVDownload);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  mixins: [_reflux2.default.listenTo(_datasetList2.default, '_handleNewData'), _reflux2.default.listenTo(_activeDataset2.default, '_handleDatasetUpdate'), _reflux2.default.listenTo(_datasetListGroups2.default, '_handleNewData'), _reflux2.default.listenTo(_user2.default, '_handleNewData')],

  getInitialState: function getInitialState() {
    return {
      CSVRequestPortalOpen: false,
      reportPortalOpen: false,
      groupPortalOpen: false,
      createPortalOpen: false,
      archivePortalOpen: false,
      bulkDownloadOpen: false,
      actionListOpen: false,
      activeDataset: {},
      recentlyOpen: [],
      industryDataList: [],
      list: [],
      unfilteredList: [],
      activeDatasetId: undefined,
      loadDatasetPortalOpen: false
    };
  },
  _toggleCSVRequestPortal: function _toggleCSVRequestPortal() {
    this.setState({ CSVRequestPortalOpen: !this.state.CSVRequestPortalOpen });
  },
  _toggleBulkDownload: function _toggleBulkDownload() {
    this.setState({
      bulkDownloadOpen: !this.state.bulkDownloadOpen
    });
  },
  componentWillMount: function componentWillMount() {
    if (_datasetList2.default.store.length >= 1) {
      this._handleNewData();
    }
  },
  _handleNewData: function _handleNewData() {
    var listGroups = _datasetListGroups2.default.store;
    var visibleList = (0, _filterVisibleDatasets2.default)();

    this.setState({
      industryDataList: _user2.default.industryDataList,
      recentlyOpen: visibleList,
      isConsultant: _user2.default.industryDataProvider,
      isAdmin: _user2.default.userAuthority <= 1,
      unfilteredList: visibleList,
      list: visibleList.filter(function (item) {
        var user = item.OwnerName;
        var _budgets = item._budgets,
            _isOrphan = item._isOrphan;

        var itemHasBudgets = (_budgets && _budgets.length > 0 || _isOrphan) && listGroups.budgets;

        if (item.IsCcModel) {
          return listGroups.budgets;
        }

        if (item.IsThisOwner) {
          return listGroups.user || itemHasBudgets;
        }

        if (item.SystemDataSet) {
          return listGroups.industry || itemHasBudgets;
        }

        return listGroups.other || itemHasBudgets;
      })
    });
  },
  _handleDatasetUpdate: function _handleDatasetUpdate() {
    this.setState({
      activeDataset: _.find(this.state.list, { Id: _activeDataset2.default.id })
    });
  },
  _handleCreateTransition: function _handleCreateTransition(cancelled) {
    if (cancelled) return this._toggleCreatePortal();
    this._toggleCreatePortal();
    this.props.history.push('/editor');
  },
  _toggleCreatePortal: function _toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  _toggleArchivePortal: function _toggleArchivePortal() {
    this.setState({
      archivePortalOpen: !this.state.archivePortalOpen
    });
  },
  _openActionList: function _openActionList(ref) {
    this.setState({
      actionListOpen: !this.state.actionListOpen,
      actionListCoords: (0, _getDomCoords3.default)(this[ref], true)
    });
  },
  _toggleActionList: function _toggleActionList() {
    this.setState({
      actionListOpen: !this.state.actionListOpen
    });
  },
  _handleReportTransition: function _handleReportTransition() {
    this.props.history.push('/reports');
  },
  _handleLogout: function _handleLogout() {
    localStorage.clear();
    window.location.reload();
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      { className: 'Datasets' },
      _react2.default.createElement(_UnsavedDatasetOverlay2.default, null),
      _react2.default.createElement(
        'div',
        {
          className: 'Datasets__banner',
          style: { marginRight: (0, _getScrollbarWidth2.default)() } },
        _react2.default.createElement(
          'div',
          { className: '_container' },
          _react2.default.createElement(
            'div',
            { className: 'Datasets__logo' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' }),
            _react2.default.createElement(
              'div',
              { className: 'Datasets__sublogo' },
              'DairyBase'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: 'Datasets__actions' },
            _react2.default.createElement(
              'div',
              { className: 'Datasets__actionList' },
              _react2.default.createElement(
                'button',
                {
                  className: '_btn',
                  ref: function ref(_ref) {
                    _this.actionListRef = _ref;
                  },
                  onClick: this._openActionList.bind(this, 'actionListRef') },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'cog' })
              ),
              _react2.default.createElement(
                _Portal2.default,
                {
                  context: document.body,
                  isOpen: this.state.actionListOpen },
                _react2.default.createElement(
                  _ActionListModal2.default,
                  {
                    coords: this.state.actionListCoords,
                    closePortal: this._toggleActionList },
                  this.renderBulkDownload(),
                  this.renderCSVdownload(),
                  this.renderRestoreBtn()
                )
              )
            ),
            _react2.default.createElement(
              'div',
              { className: 'Datasets__createDataset' },
              _react2.default.createElement(
                'button',
                { className: '_btn', onClick: this._toggleCreatePortal },
                _react2.default.createElement(
                  'div',
                  { className: '_content' },
                  _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'plus' }),
                  'Create Dataset'
                )
              )
            ),
            _react2.default.createElement(
              _Portal2.default,
              {
                context: document.body,
                isOpen: this.state.createPortalOpen,
                className: 'Overlay' },
              _react2.default.createElement(
                'div',
                { className: '_modalBox' },
                _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleCreatePortal }),
                _react2.default.createElement(_CreateDatasetModal2.default, {
                  callback: this._handleCreateTransition,
                  bulkCallback: this._toggleCreatePortal
                })
              )
            ),
            _react2.default.createElement(
              'div',
              { style: { marginLeft: '20px' } },
              _react2.default.createElement(_CreateBudgetButton2.default, { history: this.props.history })
            ),
            _react2.default.createElement(
              'div',
              { className: 'Datasets__generateReport' },
              _react2.default.createElement(
                'button',
                {
                  className: '_btn',
                  onClick: this._handleReportTransition },
                _react2.default.createElement(
                  'div',
                  { className: '_content' },
                  _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'barchart' }),
                  'Reports'
                )
              )
            ),
            _react2.default.createElement(
              'div',
              { className: 'Datasets__carbonCalculator' },
              _react2.default.createElement(
                'a',
                { href: '/dbcc', className: '_btn' },
                'Carbon Calculator'
              )
            )
          )
        ),
        _react2.default.createElement(_Filterbar2.default, null)
      ),
      this.renderDatasetList()
    );
  },
  renderRestoreBtn: function renderRestoreBtn() {
    return (0, _filterArchivedDatasets2.default)().length < 1 ? _react2.default.createElement(
      'div',
      { className: 'Datasets__ArchivedDatasets' },
      _react2.default.createElement(
        'div',
        { className: '_btn disabled', disabled: true },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'inbox' }),
          'No archived Datasets'
        )
      )
    ) : _react2.default.createElement(
      'div',
      { className: 'Datasets__ArchivedDatasets' },
      _react2.default.createElement(
        'button',
        { className: '_btn', onClick: this._toggleArchivePortal },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'inbox' }),
          'Restore Datasets'
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.archivePortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleArchivePortal }),
          _react2.default.createElement(_Archive2.default, null)
        )
      )
    );
  },
  _handleDatasetSelection: function _handleDatasetSelection(dataset) {
    this.setState({
      activeDatasetId: dataset.Id,
      loadDatasetPortalOpen: true
    });
  },
  _toggleLoadDataset: function _toggleLoadDataset() {
    this.setState({
      loadDatasetPortalOpen: !this.state.loadDatasetPortalOpen
    });
  },


  _getSelectedDataset: function _getSelectedDataset() {
    if (typeof this.state.activeDatasetId === 'undefined') return;
    return _.find(this.state.unfilteredList, {
      Id: this.state.activeDatasetId
    });
  },

  renderDatasetList: function renderDatasetList() {
    return _react2.default.createElement(
      'div',
      { className: 'Datasets__listArea' },
      _react2.default.createElement(
        'div',
        { className: '_scrollbox' },
        _react2.default.createElement(
          'div',
          { className: '_container' },
          _react2.default.createElement(
            'div',
            { className: '_insideFilter' },
            this.renderAuthLink(),
            _react2.default.createElement(
              'div',
              { className: '_row' },
              _react2.default.createElement(_GroupFilters2.default, {
                onSelectDataset: this._handleDatasetSelection
              }),
              _react2.default.createElement(
                _Portal2.default,
                {
                  forceZ: true,
                  context: document.body,
                  isOpen: this.state.loadDatasetPortalOpen,
                  className: 'Overlay' },
                _react2.default.createElement(_LoadDetailModal2.default, {
                  history: this.props.history,
                  toggleMethod: this._toggleLoadDataset,
                  dataset: this._getSelectedDataset()
                })
              ),
              _react2.default.createElement(_RecentlyOpen2.default, {
                list: this.state.recentlyOpen,
                listComponent: _LoadDatasetList2.default
              })
            )
          ),
          _react2.default.createElement(_FilteredList2.default, { list: this.state.list }),
          _react2.default.createElement(_UnfilteredList2.default, {
            list: this.state.list,
            listComponent: _LoadDatasetList2.default
          })
        )
      )
    );
  },
  renderAuthLink: function renderAuthLink() {
    var _state = this.state,
        isConsultant = _state.isConsultant,
        isAdmin = _state.isAdmin;

    var text = isConsultant ? 'Authorise Industry Datasets' : 'Approve Industry Datasets';

    return !isConsultant && !isAdmin ? null : _react2.default.createElement(
      'div',
      { className: '_row __industry' },
      _react2.default.createElement(
        _reactRouterDom.Link,
        { className: '_link', to: '/industry-authority' },
        text
      ),
      this.renderIndustryPending()
    );
  },
  renderIndustryPending: function renderIndustryPending() {
    var _state2 = this.state,
        isAdmin = _state2.isAdmin,
        industryDataList = _state2.industryDataList;

    if (!isAdmin) return null;
    var pendingList = industryDataList.filter(function (d) {
      return !d.DaApproved;
    });
    return !pendingList ? null : _react2.default.createElement(
      'div',
      { className: 'pendingMsg' },
      'You have ',
      pendingList.length,
      ' datasets waiting approval'
    );
  },
  renderBulkDownload: function renderBulkDownload() {
    return _user2.default.userAuthority > 2 ? null : _react2.default.createElement(
      'div',
      { className: 'Datasets__BulkDownloadBtn' },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._toggleBulkDownload },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'download' }),
            'Bulk Dataset Download'
          )
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.bulkDownloadOpen,
          className: 'Overlay' },
        _react2.default.createElement(_DownloadPortal2.default, {
          toggleBulkDownload: this._toggleBulkDownload,
          bulkDownloadOpen: this.state.bulkDownloadOpen
        })
      )
    );
  },
  renderCSVdownload: function renderCSVdownload() {
    if (!this.state.isAdmin) return null;
    return _react2.default.createElement(
      'div',
      { className: 'Datasets__BulkDownloadBtn' },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._toggleCSVRequestPortal },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'download' }),
            'Benchmark CSV Download'
          )
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.CSVRequestPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleCSVRequestPortal,
          failHandler: this._toggleCSVRequestPortal,
          request: _POST__BenchmarkCSVDownload2.default,
          data: {},
          wait: true,
          pendingText: {
            title: 'Please wait',
            text: 'Generating CSV file.'
          },
          successText: {
            title: 'CSV file created!',
            text: 'The CSV file should be in your download folder.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The CSV file was not generated.'
          }
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Datasets/index.jsx');
}();

;

/***/ }),
/* 579 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1099);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _RequestPortal = __webpack_require__(156);

var _RequestPortal2 = _interopRequireDefault(_RequestPortal);

var _POST__createDataset = __webpack_require__(145);

var _POST__createDataset2 = _interopRequireDefault(_POST__createDataset);

var _POST__loadDataset = __webpack_require__(87);

var _POST__loadDataset2 = _interopRequireDefault(_POST__loadDataset);

var _POST__saveActiveDataset = __webpack_require__(121);

var _POST__saveActiveDataset2 = _interopRequireDefault(_POST__saveActiveDataset);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _CreateDatasetModal = __webpack_require__(72);

var _CreateDatasetModal2 = _interopRequireDefault(_CreateDatasetModal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var AbortModal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      saveRequest: false,
      discardRequest: false,
      createPortalOpen: false
    };
  },
  _stopPropagation: function _stopPropagation(evt) {
    evt.stopPropagation();
  },
  handleCreateSuccess: function handleCreateSuccess() {
    this.toggleCreatePortal();
    this.props.continueAction();
  },
  toggleCreatePortal: function toggleCreatePortal() {
    this.setState({
      createPortalOpen: !this.state.createPortalOpen
    });
  },
  handleSaveSuccess: function handleSaveSuccess() {
    this.props.continueAction();
    setTimeout(this.toggleSaveRequest, 500);
  },
  toggleSaveRequest: function toggleSaveRequest() {
    this.setState({
      saveRequest: !this.state.saveRequest
    });
  },
  handleDiscardSuccess: function handleDiscardSuccess() {
    this.props.continueAction();
    setTimeout(this.toggleDiscardRequest, 500);
  },
  toggleDiscardRequest: function toggleDiscardRequest() {
    this.setState({
      discardRequest: !this.state.discardRequest
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'AbortModal-wrapper' },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.emitClosePortal }),
      _react2.default.createElement(
        'div',
        { className: 'AbortModal', onClick: this._stopPropagation },
        _react2.default.createElement(
          'h2',
          { className: '_title' },
          'Warning: You have unsaved changes!'
        ),
        _react2.default.createElement(
          'p',
          { className: '_subtitle' },
          'Please save the dataset, or discard your changes to continue.'
        ),
        _react2.default.createElement(
          'div',
          { className: '_actions' },
          _react2.default.createElement(
            'button',
            {
              className: '_discardBtn',
              onClick: this.toggleDiscardRequest },
            'Discard my changes'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              onClick: this.toggleCreatePortal },
            'Save As'
          ),
          _react2.default.createElement(
            'button',
            {
              className: '_btn',
              onClick: this.toggleSaveRequest },
            'Save & Continue'
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.createPortalOpen,
              className: 'Overlay' },
            _react2.default.createElement(
              'div',
              { className: '_modalBox' },
              _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.toggleCreatePortal }),
              _react2.default.createElement(_CreateDatasetModal2.default, {
                callback: this.handleCreateSuccess,
                prefillFarm: _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id }).DairyBaseId,
                prefillYear: _activeDataset2.default.FinancialYear,
                useActive: true })
            )
          ),
          _react2.default.createElement(_RequestPortal2.default, {
            isOpen: this.state.saveRequest,
            successHandler: this.handleSaveSuccess,
            failHandler: this.toggleSaveRequest,
            request: _POST__saveActiveDataset2.default,
            data: {
              Overwrite: false
            },
            pendingText: {
              title: 'Please wait',
              text: 'Saving Dataset...'
            },
            successText: {
              title: 'Success!',
              text: 'Dataset Saved.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'The Dataset could not be saved.'
            } }),
          _react2.default.createElement(_RequestPortal2.default, {
            isOpen: this.state.discardRequest,
            successHandler: this.handleDiscardSuccess,
            failHandler: this.toggleDiscardRequest,
            request: _POST__loadDataset2.default,
            data: _activeDataset2.default.id,
            pendingText: {
              title: 'Please wait',
              text: 'Discarding changes...'
            },
            successText: {
              title: 'Success!',
              text: 'Changes discarded.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'Your changes could not be discarded.'
            } })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(AbortModal, 'AbortModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Editor/AbortModal/index.js');
}();

;

/***/ }),
/* 580 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; // TODO: deal with statics

var _index = __webpack_require__(1100);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _AbortModal = __webpack_require__(579);

var _AbortModal2 = _interopRequireDefault(_AbortModal);

var _reactRouterDom = __webpack_require__(12);

var _handlerMap = __webpack_require__(426);

var _handlerMap2 = _interopRequireDefault(_handlerMap);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _TabList = __webpack_require__(495);

var _TabList2 = _interopRequireDefault(_TabList);

var _tabManifest = __webpack_require__(38);

var _tabManifest2 = _interopRequireDefault(_tabManifest);

var _checkToken = __webpack_require__(264);

var _checkToken2 = _interopRequireDefault(_checkToken);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _TabCategories = __webpack_require__(489);

var _TabCategories2 = _interopRequireDefault(_TabCategories);

var _UnAlignedDatasetOverlay = __webpack_require__(500);

var _UnAlignedDatasetOverlay2 = _interopRequireDefault(_UnAlignedDatasetOverlay);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  mixins: [_reflux2.default.listenTo(_activeDataset2.default, '_handleNewData'), _reflux2.default.listenTo(_datasetList2.default, '_handleNewData')],

  getInitialState: function getInitialState() {
    return {
      dataset: {},
      datasetEditable: true,
      datasetCopyable: true,
      dataSetSaved: true,
      dataSetAligned: true,
      editorDOMRef: undefined,
      abortPortalOpen: false,
      continueAction: function continueAction() {
        console.log('no action');
      }
    };
  },
  componentDidMount: function componentDidMount() {
    this._handleNewData();

    this.setState({
      editorDOMRef: this.editor
    });
  },
  componentWillReceiveProps: function componentWillReceiveProps() {
    var RouteArr = this.props.location.pathname.split('/');
    var activeRoute = RouteArr[RouteArr.length - 1];

    var category = _tabManifest2.default[_.findIndex(_tabManifest2.default, function (tab) {
      return tab.location === activeRoute;
    })].category;

    if (category === 'physical') {
      _Actions2.default.UPDATE_PHYSICAL_TAB(activeRoute);
    } else {
      _Actions2.default.UPDATE_FINANCIAL_TAB(activeRoute);
    }
  },
  toggleAbortPortal: function toggleAbortPortal(callback) {
    this.setState({
      abortPortalOpen: !this.state.abortPortalOpen,
      continueAction: callback
    });
  },
  _handleNewData: function _handleNewData() {
    if (_datasetList2.default.store.length >= 1) {
      var activeDatasetDetail = _.find(_datasetList2.default.store, {
        Id: _activeDataset2.default.id
      });
      this.setState({
        dataSetSaved: _activeDataset2.default.DataSetSaved,
        dataSetAligned: _activeDataset2.default.DataSetAligned,
        dataset: activeDatasetDetail,
        datasetEditable: activeDatasetDetail.EditAuthority,
        datasetCopyable: activeDatasetDetail.CopyAuthority
      });
    }
  },
  _handleResetScroll: function _handleResetScroll() {
    var _this = this;

    var interval = setInterval(function () {
      if (!_this.scrollBox) return;
      stop();
      _this.scrollBox.scrollTop = 0;
    }, 0);

    function stop() {
      clearInterval(interval);
    }
  },
  render: function render() {
    var _this2 = this;

    return _react2.default.createElement(
      'div',
      { ref: function ref(_ref2) {
          return _this2.editor = _ref2;
        } },
      _react2.default.createElement(_UnAlignedDatasetOverlay2.default, null),
      _react2.default.createElement(
        'div',
        { className: 'Editor__sidebar' },
        _react2.default.createElement(_TabCategories2.default, null),
        _react2.default.createElement(_TabList2.default, {
          dataset: this.state.dataset,
          physical: _tabManifest2.default.filter(function (tab, index) {
            return tab.category === 'physical';
          }),
          financial: _tabManifest2.default.filter(function (tab, index) {
            return tab.category === 'financial';
          })
        })
      ),
      _react2.default.createElement(
        'div',
        {
          className: 'Editor__content',
          ref: function ref(_ref) {
            return _this2.scrollBox = _ref;
          } },
        _react2.default.createElement(
          'div',
          { className: '_innerContainer' },
          _react2.default.createElement(
            _reactRouterDom.Switch,
            null,
            _tabManifest2.default.map(function (tab, index) {
              return _react2.default.createElement(_reactRouterDom.Route, {
                key: tab.location,
                path: '/editor/' + tab.location,
                render: function render(props) {
                  var Component = _handlerMap2.default[tab.location];
                  return _react2.default.createElement(Component, _extends({}, props, {
                    editorDOMRef: _this2.state.editorDOMRef,
                    parentMethods: _this2.props.parentMethods,
                    emitResetScroll: _this2._handleResetScroll
                  }));
                }
              });
            })
          )
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          className: 'Overlay',
          isOpen: this.state.abortPortalOpen,
          context: document.body },
        _react2.default.createElement(_AbortModal2.default, {
          emitClosePortal: this.toggleAbortPortal.bind(this, function () {
            console.log('no action');
          }),
          continueAction: this.state.continueAction
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 581 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(976);

var _style2 = _interopRequireDefault(_style);

var _CheckBox = __webpack_require__(288);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _POST__editDataSetAuthority = __webpack_require__(261);

var _POST__editDataSetAuthority2 = _interopRequireDefault(_POST__editDataSetAuthority);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var RequestModal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      pending: false,
      fail: false,
      success: false
    };
  },
  handleSubmit: function handleSubmit(value) {
    var _this = this;

    var _props = this.props,
        row = _props.row,
        id = _props.id;


    var rowObj = {
      Id: row.Id,
      IndustryApproved: !!value,
      ResearchApproved: !!value
    };

    this.setState({
      pending: true,
      fail: false,
      success: false
    }, function () {
      return (0, _POST__editDataSetAuthority2.default)([rowObj], _this._handleRequestResp);
    });
  },
  _handleRequestResp: function _handleRequestResp(resp) {
    if (this.props.debug) return this._handleFail(resp);

    if (resp.statusCode === 200) {
      this._handleSuccess(resp);
    } else {
      this._handleFail(resp);
    }
  },
  _handleSuccess: function _handleSuccess(resp) {
    this.setState({
      pending: false,
      success: true,
      error: false
    });
  },
  _handleFail: function _handleFail(resp) {
    this.setState({
      pending: false,
      success: false,
      error: true
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      this.renderStatefulCheckbox()
    );
  },
  renderStatefulCheckbox: function renderStatefulCheckbox() {
    var _this2 = this;

    return _react2.default.createElement(_CheckBox2.default, {
      pending: this.state.pending,
      error: this.state.error,
      value: this.props.value,
      onSubmit: function onSubmit(value) {
        return _this2.handleSubmit(value);
      } });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RequestModal, 'RequestModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_IndustryAuthority/DatasetItem/DoubleCheckbox/index.jsx');
}();

;

/***/ }),
/* 582 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(977);

var _style2 = _interopRequireDefault(_style);

var _CheckBox = __webpack_require__(288);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _POST__editDataSetAuthority = __webpack_require__(261);

var _POST__editDataSetAuthority2 = _interopRequireDefault(_POST__editDataSetAuthority);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var RequestModal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      pending: false,
      fail: false,
      success: false
    };
  },
  handleSubmit: function handleSubmit(value) {
    var _this = this;

    var _props = this.props,
        row = _props.row,
        id = _props.id;

    var forceIndustry = id === 'ResearchApproved' && !!value;

    var rowObj = _extends({}, row, _defineProperty({
      IndustryApproved: forceIndustry ? true : row.IndustryApproved
    }, id, !!value));

    this.setState({
      pending: true,
      fail: false,
      success: false
    }, function () {
      return (0, _POST__editDataSetAuthority2.default)([rowObj], _this._handleRequestResp);
    });
  },
  _handleRequestResp: function _handleRequestResp(resp) {
    if (this.props.debug) return this._handleFail(resp);

    if (resp.statusCode === 200) {
      this._handleSuccess(resp);
    } else {
      this._handleFail(resp);
    }
  },
  _handleSuccess: function _handleSuccess(resp) {
    this.setState({
      pending: false,
      success: true,
      error: false
    });
  },
  _handleFail: function _handleFail(resp) {
    this.setState({
      pending: false,
      success: false,
      error: true
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      this.renderStatefulCheckbox()
    );
  },
  renderStatefulCheckbox: function renderStatefulCheckbox() {
    var _this2 = this;

    return _react2.default.createElement(_CheckBox2.default, {
      id: this.props.id,
      pending: this.state.pending,
      error: this.state.error,
      value: this.props.value,
      onSubmit: function onSubmit(value) {
        return _this2.handleSubmit(value);
      } });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RequestModal, 'RequestModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_IndustryAuthority/DatasetItem/SingleCheckbox/index.jsx');
}();

;

/***/ }),
/* 583 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _style = __webpack_require__(979);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ActualIcon = __webpack_require__(271);

var _ActualIcon2 = _interopRequireDefault(_ActualIcon);

var _CheckBox = __webpack_require__(151);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _EditableIcon = __webpack_require__(272);

var _EditableIcon2 = _interopRequireDefault(_EditableIcon);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _DoubleCheckbox = __webpack_require__(581);

var _DoubleCheckbox2 = _interopRequireDefault(_DoubleCheckbox);

var _SingleCheckbox = __webpack_require__(582);

var _SingleCheckbox2 = _interopRequireDefault(_SingleCheckbox);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var DatasetList__Item = module.exports = __webpack_require__(1)({
  render: function render() {
    var _classnames;

    var _dataset = this.props.dataset;
    var DatasetList__item = (0, _classnames3.default)((_classnames = {}, _defineProperty(_classnames, _style2.default['DatasetList__item'], true), _defineProperty(_classnames, _style2.default['is-selected'], this.props.selected), _classnames));
    return _react2.default.createElement(
      'div',
      { className: DatasetList__item },
      _react2.default.createElement(
        'div',
        { className: _style2.default['_button'] },
        _react2.default.createElement(
          'div',
          { className: _style2.default['_content'] },
          _react2.default.createElement(
            'div',
            { className: _style2.default['DatasetList__column'] },
            _react2.default.createElement(
              'div',
              { className: _style2.default['detail'] },
              _react2.default.createElement(
                'div',
                { className: _style2.default['name'] },
                _dataset.Name
              ),
              _react2.default.createElement(
                'div',
                { className: _style2.default['other'] },
                _dataset.DairyBaseId,
                ' \u2014 ',
                this.renderSubDetail()
              )
            )
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default['DatasetList__column'] },
            this.renderConsultantCol()
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default['DatasetList__column'] },
            this.renderDaApproved()
          )
        )
      )
    );
  },
  renderSubDetail: function renderSubDetail() {
    var _props = this.props,
        isAdmin = _props.isAdmin,
        dataset = _props.dataset;


    if (!isAdmin) return dataset.FinancialYear;

    var consultants = _dataDefinition2.default.selectOptions.ConsultantId;
    var Consultant = _.find(consultants, { Id: dataset.ConsultantId }) || {};

    return Consultant.Title;
  },
  renderConsultantCol: function renderConsultantCol(key) {
    var _props2 = this.props,
        dataset = _props2.dataset,
        isAdmin = _props2.isAdmin,
        isConsultant = _props2.isConsultant;


    var Bool = dataset['IndustryApproved'] && dataset['ResearchApproved'];

    if (isConsultant && !isAdmin) return _react2.default.createElement(_DoubleCheckbox2.default, {
      value: Bool,
      row: _extends({}, dataset, {
        FarmDataSetId: dataset.Id
      })
    });

    return _react2.default.createElement(_ActualIcon2.default, {
      value: Bool,
      classes: {
        icon: _style2.default['_icon']
      }
    });
  },
  renderDaApproved: function renderDaApproved() {
    var dataset = this.props.dataset;
    var IndustryApproved = dataset.IndustryApproved,
        ResearchApproved = dataset.ResearchApproved,
        DaApproved = dataset.DaApproved;


    if (this.props.isAdmin) return _react2.default.createElement(_SingleCheckbox2.default, { id: 'DaApproved', row: dataset, value: DaApproved });

    if (IndustryApproved || ResearchApproved) return _react2.default.createElement(
      'div',
      null,
      DaApproved ? _react2.default.createElement(_xchIcon2.default, {
        classes: {
          icon: _style2.default['_icon']
        },
        id: 'tick'
      }) : _react2.default.createElement(
        'span',
        { className: _style2.default.pendingText },
        'pending review'
      )
    );

    return _react2.default.createElement(
      'span',
      { className: _style2.default.pendingText },
      '-'
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DatasetList__Item, 'DatasetList__Item', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_IndustryAuthority/DatasetItem/index.js');
}();

;

/***/ }),
/* 584 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _DatasetItem = __webpack_require__(583);

var _DatasetItem2 = _interopRequireDefault(_DatasetItem);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _style = __webpack_require__(980);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Authorities = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList2.default, "_handleNewData"), _reflux2.default.listenTo(_dataDefinition2.default, "_handleNewData"), _reflux2.default.listenTo(_user2.default, "_handleNewData")],

  getInitialState: function getInitialState() {
    return {
      selectedConsultant: 1,
      isConsultant: false,
      isAdmin: false,
      consultantList: [],
      list: [],
      order: 'desc'
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewData();
  },
  _handleNewData: function _handleNewData() {
    var consultantList = _dataDefinition2.default.selectOptions.ConsultantId;
    var isConsultant = _user2.default.industryDataProvider;
    var isAdmin = _user2.default.userAuthority <= 1;
    var list = isAdmin ? this.filterIndustryList(this.state.selectedConsultant) : _datasetList2.default.store.filter(function (item, index) {
      return !item.ArchiveStatus && !item.Invisible && item.IsThisOwner && !item.SystemDataSet && item.IsActual;
    });

    this.setState({
      consultantList: consultantList,
      isConsultant: isConsultant,
      isAdmin: isAdmin,
      list: list
    });
  },
  filterIndustryList: function filterIndustryList(selectedConsultant) {
    var industryDataList = _user2.default.industryDataList;

    return selectedConsultant === 1 ? industryDataList : industryDataList.filter(function (r) {
      return r.ConsultantId === selectedConsultant;
    });
  },
  sortBy: function sortBy(col) {
    var newOrder = this.state.order === 'desc' ? 'asc' : 'desc';
    var newList = _.sortBy(this.state.list, col);
    var orderedList = this.state.order === 'desc' ? newList : newList.reverse();
    this.setState({
      order: newOrder,
      list: orderedList
    });
  },
  render: function render() {
    var _this = this;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.banner, style: { paddingRight: (0, _getScrollbarWidth2.default)() } },
        _react2.default.createElement(
          'div',
          { className: _style2.default.banner_container },
          _react2.default.createElement(
            'div',
            { className: _style2.default.header },
            this.renderHeader()
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.banner_content },
            _react2.default.createElement(
              'div',
              { className: _style2.default.col, onClick: function onClick() {
                  return _this.sortBy('Name');
                } },
              'Dataset'
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default.col, onClick: function onClick() {
                  return _this.sortBy('ResearchApproved');
                } },
              'Consultant Approved'
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default.col, onClick: function onClick() {
                  return _this.sortBy('DaApproved');
                } },
              'DA Approved'
            )
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.scrollbox },
        _react2.default.createElement(
          'div',
          { className: _style2.default.content },
          _react2.default.createElement(
            'div',
            { className: _style2.default.list },
            this.state.list.map(function (dataset, index) {
              return _react2.default.createElement(_DatasetItem2.default, {
                key: index,
                isConsultant: _this.state.isConsultant,
                isAdmin: _this.state.isAdmin,
                dataset: dataset });
            })
          )
        )
      )
    );
  },
  renderHeader: function renderHeader() {
    var _this2 = this;

    var _state = this.state,
        isConsultant = _state.isConsultant,
        isAdmin = _state.isAdmin;


    if (isConsultant && !isAdmin) return 'Authorise your datasets for review';
    if (isAdmin) return _react2.default.createElement(
      'div',
      { className: _style2.default.select },
      _react2.default.createElement(_InputSelect2.default, {
        id: 'consultant',
        options: this.state.consultantList.map(function (r) {
          if (r.Id === 1) return _extends({}, r, { Title: 'All Consultants' });
          return r;
        }),
        value: this.state.selectedConsultant,
        onSubmit: function onSubmit(newValue, id) {
          return _this2.setState({
            selectedConsultant: newValue,
            list: _this2.filterIndustryList(newValue)
          });
        } })
    );
    return 'you shouldn\'t be here...';
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Authorities, 'Authorities', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_IndustryAuthority/index.jsx');
}();

;

/***/ }),
/* 585 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1101);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Banner = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportSubRoute__Banner' },
      _react2.default.createElement(
        'h2',
        { className: '_title' },
        this.props.report.name
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Banner, 'Banner', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_ReportSubRoute/_Banner/index.jsx');
}();

;

/***/ }),
/* 586 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1104);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Banner = __webpack_require__(585);

var _Banner2 = _interopRequireDefault(_Banner);

var _SingleReport = __webpack_require__(694);

var _SingleReport2 = _interopRequireDefault(_SingleReport);

var _ComparisonReport = __webpack_require__(640);

var _ComparisonReport2 = _interopRequireDefault(_ComparisonReport);

var _BulkComparisonReport = __webpack_require__(632);

var _BulkComparisonReport2 = _interopRequireDefault(_BulkComparisonReport);

var _FarmSizeAnalysis = __webpack_require__(686);

var _FarmSizeAnalysis2 = _interopRequireDefault(_FarmSizeAnalysis);

var _FarmHistoryReport = __webpack_require__(681);

var _FarmHistoryReport2 = _interopRequireDefault(_FarmHistoryReport);

var _DFMPFarmClientReport = __webpack_require__(676);

var _DFMPFarmClientReport2 = _interopRequireDefault(_DFMPFarmClientReport);

var _reportManifest2 = __webpack_require__(192);

var _reportManifest3 = _interopRequireDefault(_reportManifest2);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportSubRoute = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  getInitialState: function getInitialState() {
    return {
      bannerDOMRef: undefined
    };
  },
  componentDidMount: function componentDidMount() {
    this.setState({
      bannerDOMRef: this.banner
    });
  },
  _handleResetScroll: function _handleResetScroll() {
    var DOMref = this.scrollBox;
    if (typeof DOMref === 'undefined') return;
    DOMref.scrollTop = 0;
  },
  _transitionToReportSelector: function _transitionToReportSelector() {
    this.props.history.push('/reports');
  },
  _renderChosenReportView: function _renderChosenReportView(activeReport) {
    var reportViews = {
      single: _react2.default.createElement(_SingleReport2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        emitResetScroll: this._handleResetScroll,
        bannerDOMRef: this.state.bannerDOMRef
      }),
      comparison: _react2.default.createElement(_ComparisonReport2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        emitResetScroll: this._handleResetScroll,
        bannerDOMRef: this.state.bannerDOMRef
      }),
      'bulk-comparison': _react2.default.createElement(_BulkComparisonReport2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        emitResetScroll: this._handleResetScroll,
        bannerDOMRef: this.state.bannerDOMRef
      }),
      'farm-size': _react2.default.createElement(_FarmSizeAnalysis2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        emitResetScroll: this._handleResetScroll,
        bannerDOMRef: this.state.bannerDOMRef
      }),
      'farm-history': _react2.default.createElement(_FarmHistoryReport2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        emitResetScroll: this._handleResetScroll,
        bannerDOMRef: this.state.bannerDOMRef
      }),
      'dfmp-farm-client-report': _react2.default.createElement(_DFMPFarmClientReport2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        emitResetScroll: this._handleResetScroll,
        bannerDOMRef: this.state.bannerDOMRef
      })
    };

    return reportViews[activeReport.url];
  },
  render: function render() {
    var _this = this;

    var url = this.props.location.pathname.split('/')[2];
    var activeReport = _.find(_reportManifest3.default, { url: url });
    return _react2.default.createElement(
      'div',
      { className: 'ReportSubRoute' },
      _react2.default.createElement(
        'div',
        {
          ref: function ref(_ref) {
            return _this.banner = _ref;
          },
          className: '_banner',
          style: { paddingRight: (0, _getScrollbarWidth2.default)() } },
        _react2.default.createElement(_Banner2.default, {
          emitBackToSelector: this._transitionToReportSelector,
          report: activeReport
        })
      ),
      _react2.default.createElement(
        'div',
        { className: '_body', ref: function ref(_ref2) {
            return _this.scrollBox = _ref2;
          } },
        this._renderChosenReportView(activeReport)
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportSubRoute, 'ReportSubRoute', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_ReportSubRoute/index.jsx');
}();

;

/***/ }),
/* 587 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1105);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _xchReactClass = __webpack_require__(8);

var _xchReactClass2 = _interopRequireDefault(_xchReactClass);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _reportManifest2 = __webpack_require__(192);

var _reportManifest3 = _interopRequireDefault(_reportManifest2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportType = module.exports = (0, _xchReactClass2.default)({
  withRouter: true
}, {
  getInitialState: function getInitialState() {
    return {
      UserIsFarmClient: false,
      UserIsAdmin: false
    };
  },


  mixins: [_reflux2.default.listenTo(_user2.default, '_handleUserSessionUpdate')],

  componentWillMount: function componentWillMount() {
    this._handleUserSessionUpdate();
  },
  _handleUserSessionUpdate: function _handleUserSessionUpdate() {
    this.setState({
      UserIsFarmClient: _.contains(_user2.default.dairyBaseGroups, 'farmclient'),
      UserIsAdmin: _user2.default.userAuthority === 1
    });
  },
  _chooseDatasets: function _chooseDatasets(url) {
    this.props.history.push('/reports/' + url);
  },
  _renderReportList: function _renderReportList() {
    var _this = this;

    return _reportManifest3.default.map(function (report, index) {
      var isDbcc = report.id === 'CarbonCalculator';

      var isFarmClient = report.id === 'DFMPFarmClientReport';
      var _state = _this.state,
          UserIsFarmClient = _state.UserIsFarmClient,
          UserIsAdmin = _state.UserIsAdmin;


      if (isFarmClient && !UserIsFarmClient && !UserIsAdmin) return null;

      return isDbcc ? _react2.default.createElement(
        'a',
        { key: index, href: '/dbcc' },
        _react2.default.createElement(
          'button',
          { className: 'ReportsPicker__item' },
          _react2.default.createElement(
            'h3',
            { className: '_text' },
            report.name
          ),
          _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'forward' })
        )
      ) : _react2.default.createElement(
        'button',
        {
          key: index,
          className: 'ReportsPicker__item',
          onClick: _this._chooseDatasets.bind(_this, report.url) },
        _react2.default.createElement(
          'h3',
          { className: '_text' },
          report.name
        ),
        _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'forward' })
      );
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportsPicker' },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'h2',
          { className: 'ReportsPicker__heading' },
          'Choose a report:'
        ),
        _react2.default.createElement(
          'div',
          { className: 'ReportsPicker__list' },
          this._renderReportList()
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportType, 'ReportType', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_ReportsPicker/index.jsx');
}();

;

/***/ }),
/* 588 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1106);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactRouterDom = __webpack_require__(12);

var _reportManifest2 = __webpack_require__(192);

var _reportManifest3 = _interopRequireDefault(_reportManifest2);

var _ReportsPicker = __webpack_require__(587);

var _ReportsPicker2 = _interopRequireDefault(_ReportsPicker);

var _ReportSubRoute = __webpack_require__(586);

var _ReportSubRoute2 = _interopRequireDefault(_ReportSubRoute);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Report = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      prefillDatasetIds: undefined
    };
  },
  componentWillMount: function componentWillMount() {
    var state = this.props.location.state;

    if (state && state.prefillDatasetIds) {
      this.setState({
        prefillDatasetIds: state.prefillDatasetIds
      });
    }
  },
  render: function render() {
    var prefillDatasetIds = this.state.prefillDatasetIds;

    return _react2.default.createElement(
      'div',
      { className: 'Report' },
      _react2.default.createElement(
        _reactRouterDom.Switch,
        null,
        _react2.default.createElement(_reactRouterDom.Route, { exact: true, path: '/reports', component: _ReportsPicker2.default }),
        _reportManifest3.default.map(function (report, index) {
          return _react2.default.createElement(_reactRouterDom.Route, {
            key: report.url,
            path: '/reports/' + report.url,
            render: function render(props) {
              return _react2.default.createElement(_ReportSubRoute2.default, _extends({}, props, { prefillDatasetIds: prefillDatasetIds }));
            }
          });
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Report, 'Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/_Reports/index.jsx');
}();

;

/***/ }),
/* 589 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FinancialTable = __webpack_require__(108);

var _FinancialTable2 = _interopRequireDefault(_FinancialTable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {

    // <GenericHelpBtn offsetLeft={24} offsetTop={52} onClick={this._toggleHelpPortal.bind(this, 'AssetsTabHelp2')} />

    // <GenericHelpBtn offsetLeft={88} offsetTop={282} onClick={this._toggleHelpPortal.bind(this, 'AssetsTabHelp3')} />
    // table definitions
    var owned = {
      header: {
        title: "Farm Operating Assets Owned",
        extraHeaders: [{
          text: 'Opening'
        }, {
          text: 'Closing'
        }],
        extraCols: true
      },
      rows: [{
        title: 'Feed',
        help: 'AssetsTabHelp2',
        inputs: [{
          data: this.props.data.AssetsFeedOpening,
          editable: false
        }, {
          data: this.props.data.AssetsFeedClosing,
          editable: false
        }]
      }, {
        title: 'Carryover Water',
        help: 'AssetsTabHelp4',
        inputs: [{
          data: this.props.data.AssetsCarryoverWaterOpening,
          editable: false
        }, {
          data: this.props.data.AssetsCarryoverWaterClosing,
          editable: false
        }]
      }, {
        title: 'Other Current Assets',
        help: 'AssetsTabHelp1',
        inputs: [{
          data: this.props.data.AssetsCurrentOtherOpening,
          editable: true
        }, {
          data: this.props.data.AssetsCurrentOtherClosing,
          editable: true
        }]
      }, {
        title: 'Owned Land & Improvements',
        inputs: [{
          data: this.props.data.AssetsLandAndBuildingsOpening,
          editable: true
        }, {
          data: this.props.data.AssetsLandAndBuildingsClosing,
          editable: true
        }]
      }, {
        title: 'Owned Water',
        inputs: [{
          data: this.props.data.AssetsOwnedWaterOpening,
          editable: true
        }, {
          data: this.props.data.AssetsOwnedWaterClosing,
          editable: true
        }]
      }, {
        title: 'Owned Plant & Equipment',
        inputs: [{
          data: this.props.data.AssetsPlantEquipmentOpening,
          editable: true
        }, {
          data: this.props.data.AssetsPlantEquipmentClosing,
          editable: true
        }]
      }, {
        title: 'Owned Livestock',
        help: 'AssetsTabHelp3',
        inputs: [{
          data: this.props.data.AssetsLivestockOpening,
          editable: false
        }, {
          data: this.props.data.AssetsLivestockClosing,
          editable: false
        }]
      }, {
        title: 'Total Operating Assets Owned',
        isTotal: true,
        inputs: [{
          data: this.props.data.AssetsOperatingTotalOpening,
          editable: false
        }, {
          data: this.props.data.AssetsOperatingTotalClosing,
          editable: false
        }]
      }]
    };

    var leased = {
      header: {
        title: "Operating Assets Leased",
        extraHeaders: [{
          text: 'Opening'
        }, {
          text: 'Closing'
        }],
        extraCols: true
      },
      rows: [{
        title: 'Total Assets Leased',
        inputs: [{
          data: this.props.data.AssetsLeasedTotalOpening,
          editable: true
        }, {
          data: this.props.data.AssetsLeasedTotalClosing,
          editable: true
        }]
      }]
    };

    var other = {
      header: {
        title: "Other Farm Business Assets",
        extraHeaders: [{
          text: 'Opening'
        }, {
          text: 'Closing'
        }],
        extraCols: true
      },
      rows: [{
        title: 'Milk Company Shares',
        inputs: [{
          data: this.props.data.AssetsFactorySharesOpening,
          editable: true
        }, {
          data: this.props.data.AssetsFactorySharesClosing,
          editable: true
        }]
      }, {
        title: 'Farm Management Deposits',
        inputs: [{
          data: this.props.data.AssetsFmdOpening,
          editable: true
        }, {
          data: this.props.data.AssetsFmdClosing,
          editable: true
        }]
      }, {
        title: 'Other Owned Farm Assets',
        inputs: [{
          data: this.props.data.AssetsFarmOtherOpening,
          editable: true
        }, {
          data: this.props.data.AssetsFarmOtherClosing,
          editable: true
        }]
      }, {
        title: 'Total Other Assets',
        isTotal: true,
        inputs: [{
          data: this.props.data.AssetsOtherBusinessTotalOpening,
          editable: false
        }, {
          data: this.props.data.AssetsOtherBusinessTotalClosing,
          editable: false
        }]
      }]
    };

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: owned.header,
        rows: owned.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: leased.header,
        rows: leased.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: other.header,
        rows: other.rows
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 590 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1107);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _tables = __webpack_require__(589);

var _tables2 = _interopRequireDefault(_tables);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Assets = __webpack_require__(1)({
  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'assets' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Assets',
        data: {
          financial: true,
          dollars: true,
          fields: [{
            label: 'Total Assets Under Management',
            data: this.state.AssetsAllCapitalAvg
          }]
        }
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['AssetsTabHelp1'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'AssetsTabHelp1') },
          _react2.default.createElement(_HelpText2.default, { id: 'AssetsTabHelp1', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['AssetsTabHelp2'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'AssetsTabHelp2') },
          _react2.default.createElement(_HelpText2.default, { id: 'AssetsTabHelp2', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['AssetsTabHelp3'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'AssetsTabHelp3') },
          _react2.default.createElement(_HelpText2.default, { id: 'AssetsTabHelp3', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['AssetsTabHelp4'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'AssetsTabHelp4') },
          _react2.default.createElement(_HelpText2.default, { id: 'AssetsTabHelp4', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(_tables2.default, { togglePortal: this._toggleHelpPortal, data: this.state })
    );
  }
});

module.exports = Assets;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Assets, 'Assets', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/financial-tabs/_Assets/index.jsx');
}();

;

/***/ }),
/* 591 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FinancialTable = __webpack_require__(108);

var _FinancialTable2 = _interopRequireDefault(_FinancialTable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {

    // table definitions
    var financeCosts = {
      header: {
        title: 'Finance Costs',
        extraHeaders: [{
          text: ''
        }, {
          text: 'Rate %',
          padded: true
        }],
        extraCols: true
      },
      rows: [{
        title: 'Interest on Loans',
        extraCol: true,
        extraColData: this.props.data.ExpenseInterestPercent.Value,
        inputs: [{
          data: this.props.data.ExpenseInterest,
          editable: true
        }]
      }, {
        title: 'Lease Costs',
        extraCol: true,
        extraColData: this.props.data.ExpenseLeasePercent.Value,
        inputs: [{
          data: this.props.data.ExpenseLease,
          editable: true
        }]
      }, {
        title: 'Total Finance Cost',
        extraCol: true,
        extraColData: this.props.data.ExpenseInterestLeasePercent.Value,
        isTotal: true,
        inputs: [{
          data: this.props.data.ExpenseInterestLease,
          editable: false
        }]
      }]
    };

    var capitalCosts = {
      header: {
        title: "Capital Costs"
      },
      rows: [{
        title: 'Livestock Purchases',
        inputs: [{
          data: this.props.data.CashFlowLivestockPurchase,
          editable: true
        }]
      }, {
        title: 'Other Capital Purchases',
        help: 'CapitalPurchaseHelp',
        inputs: [{
          data: this.props.data.CashFlowCapitalPurchase,
          editable: true
        }]
      }, {
        title: 'Total Capital Costs',
        isTotal: true,
        inputs: [{
          data: this.props.data.CashFlowCapitalPurchaseTotal,
          editable: false
        }]
      }]
    };

    var otherCosts = {
      header: {
        title: "Other Cash Payments"
      },
      rows: [{
        title: 'Principal Repayments',
        inputs: [{
          data: this.props.data.CashFlowPrincipalRepayment,
          editable: true
        }]
      }, {
        title: 'Drawings',
        inputs: [{
          data: this.props.data.CashFlowOwnerDrawings,
          editable: true
        }]
      }, {
        title: 'Total Other Cash Payments',
        isTotal: true,
        inputs: [{
          data: {
            Value: +this.props.data.CashFlowOwnerDrawings.Value + +this.props.data.CashFlowPrincipalRepayment.Value
          },
          editable: false
        }]
      }]
    };

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: financeCosts.header,
        rows: financeCosts.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: capitalCosts.header,
        rows: capitalCosts.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: otherCosts.header,
        rows: otherCosts.rows
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 592 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1108);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _tables = __webpack_require__(591);

var _tables2 = _interopRequireDefault(_tables);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FinanceCosts = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'finance-costs' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Finance Costs',
        data: {
          financial: true,
          dollars: true,
          fields: [{
            label: 'Total Finance Cost',
            data: this.state.ExpenseInterestLease
          }]
        } }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['CapitalPurchaseHelp'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'CapitalPurchaseHelp') },
          _react2.default.createElement(_HelpText2.default, { id: 'CapitalPurchaseHelp', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(_tables2.default, {
        togglePortal: this._toggleHelpPortal,
        data: this.state })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FinanceCosts, 'FinanceCosts', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/financial-tabs/_FinanceCosts/index.jsx');
}();

;

/***/ }),
/* 593 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FinancialTable = __webpack_require__(108);

var _FinancialTable2 = _interopRequireDefault(_FinancialTable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {
    // table definitions
    var farmIncome = {
      header: {
        title: "Farm Income"
      },
      rows: [{
        title: 'Milk Income (Net)',
        help: 'IncomeTabHelp1',
        inputs: [{
          data: this.props.data.IncomeMilkTotal,
          editable: true
        }]
      }, {
        title: 'Livestock Sales (Net)',
        inputs: [{
          data: this.props.data.IncomeLivestock,
          editable: true
        }]
      }, {
        title: 'Feed Sales',
        inputs: [{
          data: this.props.data.IncomeFeedSale,
          editable: true
        }]
      }, {
        title: 'Water Sales',
        inputs: [{
          data: this.props.data.IncomeWaterSale,
          editable: true
        }]
      }, {
        title: 'Other Farm Income',
        inputs: [{
          data: this.props.data.IncomeFarmOther,
          editable: true
        }]
      }, {
        title: 'Total Farm Income',
        help: 'IncomeTableHelp2',
        isTotal: true,
        inputs: [{
          data: this.props.data.IncomeFarmCashTotal,
          editable: false
        }]
      }, {
        title: 'Non-Farm Income',
        isSpaced: true,
        inputs: [{
          data: this.props.data.IncomeNonFarm,
          editable: true
        }]
      }]
    };

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: farmIncome.header,
        data: this.props.data,
        rows: farmIncome.rows
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 594 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1109);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _tables = __webpack_require__(593);

var _tables2 = _interopRequireDefault(_tables);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Income = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'income' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Income',
        data: {
          financial: true,
          dollars: true,
          fields: [{
            label: 'Total Cash Income',
            data: this.state.IncomeTotalCash
          }]
        } }),
      _react2.default.createElement(_tables2.default, {
        togglePortal: this._toggleHelpPortal,
        data: this.state }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['IncomeTabHelp1'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'IncomeTabHelp1') },
          _react2.default.createElement(_HelpText2.default, { id: 'IncomeTabHelp1', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['IncomeTableHelp2'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'IncomeTableHelp2') },
          _react2.default.createElement(_HelpText2.default, { id: 'IncomeTableHelp2', className: 'HelpModal__text' })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Income, 'Income', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/financial-tabs/_Income/index.jsx');
}();

;

/***/ }),
/* 595 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FinancialTable = __webpack_require__(108);

var _FinancialTable2 = _interopRequireDefault(_FinancialTable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {

    // table definitions
    var liabilities = {
      header: {
        title: "Owner Liabilities",
        extraHeaders: [{
          text: 'Opening'
        }, {
          text: 'Closing'
        }],
        extraCols: true
      },
      rows: [{
        title: 'Current Liabilities',
        inputs: [{
          data: this.props.data.LiabilitiesCurrentOpening,
          editable: true
        }, {
          data: this.props.data.LiabilitiesCurrentClosing,
          editable: true
        }]
      }, {
        title: 'Equipment Loans',
        inputs: [{
          data: this.props.data.LiabilitiesEquipmentLoansOpening,
          editable: true
        }, {
          data: this.props.data.LiabilitiesEquipmentLoansClosing,
          editable: true
        }]
      }, {
        title: 'Long Term Loans',
        inputs: [{
          data: this.props.data.LiabilitiesLongTermLoansOpening,
          editable: true
        }, {
          data: this.props.data.LiabilitiesLongTermLoansClosing,
          editable: true
        }]
      }, {
        title: 'Total Farm Liabilities',
        isTotal: true,
        inputs: [{
          data: this.props.data.LiabilitiesTotalOpening,
          editable: false
        }, {
          data: this.props.data.LiabilitiesTotalClosing,
          editable: false
        }]
      }]
    };

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_FinancialTable2.default, {
        header: liabilities.header,
        rows: liabilities.rows
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 596 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1110);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _tables = __webpack_require__(595);

var _tables2 = _interopRequireDefault(_tables);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Liabilities = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'liabilities' }).fields
  }])],

  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Liabilities',
        data: {
          financial: true,
          dollars: true,
          fields: [{
            label: 'Total Liabilities',
            data: this.state.LiabilitiesTotalAvg
          }]
        } }),
      _react2.default.createElement(_tables2.default, { data: this.state }),
      _react2.default.createElement(
        'div',
        { className: 'Liabilities__help' },
        _react2.default.createElement(
          'p',
          null,
          'The value of Current Liabilities and loans can be obtained from your Financial Statements with a requirement to enter the opening (July 1) and closing (June 30) value of these liabilities.'
        ),
        _react2.default.createElement(
          'p',
          null,
          'This should only be loans for the dairy farm business and should not include land, water or equipment leases, or non-farm loans such as off-farm rental properties.'
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Liabilities, 'Liabilities', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/financial-tabs/_Liabilities/index.jsx');
}();

;

/***/ }),
/* 597 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FinancialTable = __webpack_require__(108);

var _FinancialTable2 = _interopRequireDefault(_FinancialTable);

var _OptimisticCheckBox = __webpack_require__(126);

var _OptimisticCheckBox2 = _interopRequireDefault(_OptimisticCheckBox);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {

    // table definitions
    var cash = {
      header: {
        title: "Cash Overhead Costs"
      },
      rows: [{
        title: 'Rates',
        inputs: [{
          data: this.props.data.ExpenseRates,
          editable: true
        }]
      }, {
        title: 'Farm Insurance',
        inputs: [{
          data: this.props.data.ExpenseRegistrationInsurance,
          editable: true
        }]
      }, {
        title: 'Motor Vehicle Expenses',
        inputs: [{
          data: this.props.data.ExpenseMotorVehicles,
          editable: true
        }]
      }, {
        title: 'Repairs & Maintenance',
        inputs: [{
          data: this.props.data.ExpenseRepairsMaintenance,
          editable: true
        }]
      }, {
        title: 'Paid Labour',
        inputs: [{
          data: this.props.data.ExpenseEmployedPeople,
          editable: true
        }]
      }, {
        title: 'Other Overheads',
        inputs: [{
          data: this.props.data.ExpenseOtherOverheads,
          editable: true
        }]
      }, {
        title: 'Total Cash Overheads',
        isTotal: true,
        inputs: [{
          data: this.props.data.ExpenseCashOverheadsTotal,
          editable: false
        }]
      }]
    };

    var nonCash = {
      header: {
        title: "Non-Cash Overhead Costs",
        switchRow: true,
        switch: this.props.data.SwitchDepreciation
      },
      rows: [{
        title: 'Depreciation %',
        help: 'OverheadsTabHelp1',
        percent: true,
        inputs: [{
          data: this.props.data.ExpenseDepreciationPercent,
          editable: !this.props.data.SwitchDepreciation.Value
        }]
      }, {
        title: 'Depreciation',
        inputs: [{
          data: this.props.data.ExpenseDepreciation,
          editable: this.props.data.SwitchDepreciation.Value
        }]
      }, {
        title: 'Imputed Labour',
        inputs: [{
          data: this.props.data.ExpenseImputedPeople,
          editable: false
        }]
      }, {
        title: 'Total Non-Cash Overheads',
        isTotal: true,
        inputs: [{
          data: this.props.data.ExpenseNonCashOverheadsTotal,
          editable: false
        }]
      }]
    };

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: cash.header,
        rows: cash.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        togglePortal: this.props.togglePortal,
        header: nonCash.header,
        rows: nonCash.rows
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 598 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1111);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _tables = __webpack_require__(597);

var _tables2 = _interopRequireDefault(_tables);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var OverheadCosts = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'overhead-costs' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Overhead Costs',
        data: {
          financial: true,
          dollars: true,
          fields: [{
            label: 'Total Overhead Cost',
            data: this.state.ExpenseOverheadsTotal
          }]
        } }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.helpPortalsOpen['OverheadsTabHelp1'],
          className: 'Overlay--help' },
        _react2.default.createElement(
          _HelpModal2.default,
          {
            closePortal: this._toggleHelpPortal.bind(this, 'OverheadsTabHelp1') },
          _react2.default.createElement(_HelpText2.default, { id: 'OverheadsTabHelp1', className: 'HelpModal__text' })
        )
      ),
      _react2.default.createElement(_tables2.default, {
        togglePortal: this._toggleHelpPortal,
        data: this.state }),
      _react2.default.createElement(
        'div',
        { className: 'OverheadCosts__help' },
        _react2.default.createElement(
          'p',
          null,
          'Depreciation will default to a % of the Owned Plant and Equipment + Other Owned Assets. You can choose to change the % or enter an actual value for depreciation.'
        ),
        _react2.default.createElement(_HelpText2.default, { id: 'OverheadsTabHelp2' })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(OverheadCosts, 'OverheadCosts', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/financial-tabs/_OverheadCosts/index.jsx');
}();

;

/***/ }),
/* 599 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FinancialTable = __webpack_require__(108);

var _FinancialTable2 = _interopRequireDefault(_FinancialTable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

module.exports = __webpack_require__(1)({
  render: function render() {

    // table definitions
    var herdCosts = {
      header: {
        title: "Herd Costs"
      },
      rows: [{
        title: 'AI & Herd Test',
        inputs: [{
          data: this.props.data.ExpenseAIHerdTest,
          editable: true
        }]
      }, {
        title: 'Animal Health',
        inputs: [{
          data: this.props.data.ExpenseAnimalHealth,
          editable: true
        }]
      }, {
        title: 'Calf Rearing',
        inputs: [{
          data: this.props.data.ExpenseCalfRearing,
          editable: true
        }]
      }, {
        title: 'Other Herd Costs',
        inputs: [{
          data: this.props.data.ExpenseOtherHerd,
          editable: true
        }]
      }, {
        title: 'Total Herd Costs',
        isTotal: true,
        inputs: [{
          data: this.props.data.ExpenseHerdTotal,
          editable: false
        }]
      }]
    };

    var shedCosts = {
      header: {
        title: "Shed Costs"
      },
      rows: [{
        title: 'Electricity',
        inputs: [{
          data: this.props.data.ExpenseShedPower,
          editable: true
        }]
      }, {
        title: 'Dairy Supplies',
        inputs: [{
          data: this.props.data.ExpenseDairySupplies,
          editable: true
        }]
      }, {
        title: 'Other Shed Costs',
        inputs: [{
          data: this.props.data.ExpenseOtherShed,
          editable: true
        }]
      }, {
        title: 'Total Shed Costs',
        isTotal: true,
        inputs: [{
          data: this.props.data.ExpenseShedTotal,
          editable: false
        }]
      }]
    };

    var feedCosts = {
      header: {
        title: "Feed Costs"
      },
      rows: [{
        title: 'Fertiliser',
        inputs: [{
          data: this.props.data.ExpenseFertiliser,
          editable: true
        }]
      }, {
        title: 'Water Purchase',
        inputs: [{
          data: this.props.data.ExpenseWaterPurchase,
          editable: true
        }]
      }, {
        title: 'Other Irrigation Costs',
        inputs: [{
          data: this.props.data.ExpenseIrrigationOther,
          editable: true
        }]
      }, {
        title: 'Water Inventory Change',
        inputs: [{
          data: this.props.data.ExpenseCarryoverWater,
          editable: false
        }]
      }, {
        title: 'Hay & Silage Making',
        inputs: [{
          data: this.props.data.ExpenseHaySilage,
          editable: true
        }]
      }, {
        title: 'Purchased Fodder',
        inputs: [{
          data: this.props.data.ExpenseFodderPurchase,
          editable: true
        }]
      }, {
        title: 'Concentrates',
        inputs: [{
          data: this.props.data.ExpenseConcentratesPurchase,
          editable: true
        }]
      }, {
        title: 'Other Feed',
        inputs: [{
          data: this.props.data.ExpenseOtherFeedPurchase,
          editable: true
        }]
      }, {
        title: 'Pasture & Cropping',
        inputs: [{
          data: this.props.data.ExpensePastureCropping,
          editable: true
        }]
      }, {
        title: 'Fuel & Oil',
        inputs: [{
          data: this.props.data.ExpenseFuelOil,
          editable: true
        }]
      }, {
        title: 'Agistment',
        inputs: [{
          data: this.props.data.ExpenseAgistment,
          editable: true
        }]
      }, {
        title: 'Other Feed Costs',
        inputs: [{
          data: this.props.data.ExpenseOtherFeed,
          editable: true
        }]
      }, {
        title: 'Feed Inventory Change',
        inputs: [{
          data: this.props.data.ExpenseFeedInventoryChange,
          editable: false
        }]
      }, {
        title: 'Total Feed Costs',
        isTotal: true,
        inputs: [{
          data: this.props.data.ExpenseFeedTotal,
          editable: false
        }]
      }]
    };

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_FinancialTable2.default, {
        header: herdCosts.header,
        rows: herdCosts.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        header: shedCosts.header,
        rows: shedCosts.rows
      }),
      _react2.default.createElement(_FinancialTable2.default, {
        header: feedCosts.header,
        rows: feedCosts.rows
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }
}();

;

/***/ }),
/* 600 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1112);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _tables = __webpack_require__(599);

var _tables2 = _interopRequireDefault(_tables);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var VariableCosts = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'variable-costs' }).fields
  }])],

  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Variable Costs',
        data: {
          financial: true,
          dollars: true,
          fields: [{
            label: 'Total Variable Cost',
            data: this.state.ExpenseVariableTotal
          }]
        } }),
      _react2.default.createElement(_tables2.default, { data: this.state })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(VariableCosts, 'VariableCosts', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/financial-tabs/_VariableCosts/index.jsx');
}();

;

/***/ }),
/* 601 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var GroupTemplate = module.exports = __webpack_require__(1)({
  _renderChildren: function _renderChildren() {
    return _react2.default.Children.map(this.props.children, function (child) {
      return _react2.default.createElement(
        'div',
        { className: '_col' },
        child
      );
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: this.props.className },
      this._renderChildren()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(GroupTemplate, 'GroupTemplate', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Feed/_Form/_groupTemplate.jsx');
}();

;

/***/ }),
/* 602 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1114);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Form = __webpack_require__(291);

var _Form2 = _interopRequireDefault(_Form);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _POST__deleteData = __webpack_require__(190);

var _POST__deleteData2 = _interopRequireDefault(_POST__deleteData);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _ConfirmationModal = __webpack_require__(109);

var _ConfirmationModal2 = _interopRequireDefault(_ConfirmationModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Row;

var FeedItems = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  _renderColumnHeadings: function _renderColumnHeadings() {
    var _this = this;

    var headingHtml = ['', 'Fed', 'Harvested', 'Purchased', '', ''].map(function (heading, index) {
      var columnClass = '_col' + (index + 1);
      return _react2.default.createElement(
        'h3',
        { className: columnClass + ' is-header', key: index },
        index === 0 ? _this.props.title : heading
      );
    });

    return headingHtml;
  },
  render: function render() {
    var _this2 = this;

    var rows = this.props.tableData.map(function (row, index) {
      return _react2.default.createElement(Row, { rowData: row, key: index, editAuthority: _this2.state.editAuthority });
    });
    return _react2.default.createElement(
      'div',
      { className: 'FeedItems' },
      _react2.default.createElement(
        'div',
        { className: 'FeedItems__row is-header' },
        this._renderColumnHeadings()
      ),
      rows
    );
  }
});

Row = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      FeedFormPortalOpen: false
    };
  },
  _handleConfirmDelete: function _handleConfirmDelete() {
    this._toggleConfirmDeletePortal();
    this._toggleDeleteRequestPortal();
  },
  _toggleConfirmDeletePortal: function _toggleConfirmDeletePortal() {
    this.setState({
      confirmDeletePortalOpen: !this.state.confirmDeletePortalOpen
    });
  },
  _toggleFeedFormPortal: function _toggleFeedFormPortal() {
    this.setState({
      FeedFormPortalOpen: !this.state.FeedFormPortalOpen
    });
  },
  _toggleDeleteRequestPortal: function _toggleDeleteRequestPortal() {
    if (!this.props.editAuthority) return;
    this.setState({
      deleteRequestPortalOpen: !this.state.deleteRequestPortalOpen
    });
  },
  _renderCol: function _renderCol(id) {
    var value = this.props.rowData[id].Value;
    return _react2.default.createElement(
      'div',
      { className: 'FeedItems__output' },
      _react2.default.createElement(_OutputSimple2.default, { value: value })
    );
  },
  _renderSwitchUnit: function _renderSwitchUnit() {
    var data = this.props.rowData.SwitchAsIsTdm;
    return _.find(data.Options, { Id: data.Value }).Title;
  },
  render: function render() {
    var group = _.find(this.props.rowData.FeedGroupId.Options, { Id: this.props.rowData.FeedGroupId.Value });
    var type = _.find(group.Options, { Id: this.props.rowData.FeedTypeId.Value });
    return _react2.default.createElement(
      'div',
      { className: 'FeedItems__rowContainer' },
      _react2.default.createElement(
        'div',
        { className: 'FeedItems__row is-item', onClick: this._toggleFeedFormPortal },
        _react2.default.createElement(
          'div',
          { className: '_col1' },
          _react2.default.createElement(
            'span',
            { className: '_title' },
            type.Title
          ),
          _react2.default.createElement(
            'span',
            { className: '_unit' },
            this._renderSwitchUnit()
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col2' },
          this._renderCol('QuantityFedTotal')
        ),
        _react2.default.createElement(
          'div',
          { className: '_col3' },
          this._renderCol('QuantityProducedTotal')
        ),
        _react2.default.createElement(
          'div',
          { className: '_col4' },
          this._renderCol('QuantityPurchased')
        ),
        _react2.default.createElement(
          'div',
          { className: '_col5' },
          _react2.default.createElement(
            'button',
            { className: 'generic__editBtn' },
            _react2.default.createElement(_Icon2.default, { id: 'edit', className: '_icon' })
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.FeedFormPortalOpen,
            className: 'Overlay' },
          _react2.default.createElement(
            'div',
            { className: '_modalBox' },
            _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleFeedFormPortal }),
            _react2.default.createElement(_Form2.default, {
              data: this.props.rowData,
              groupOptions: this.props.rowData.FeedGroupId.Options,
              closePortal: this._toggleFeedFormPortal,
              editAuthority: this.props.editAuthority })
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.deleteRequestPortalOpen },
          _react2.default.createElement(_RequestModal2.default, {
            successHandler: this._toggleDeleteRequestPortal,
            failHandler: this._toggleDeleteRequestPortal,
            request: _POST__deleteData2.default,
            data: {
              Table: 'FarmFeeds',
              RowId: this.props.rowData.Id
            },
            pendingText: {
              title: 'Please wait',
              text: 'Deleting feed item'
            },
            successText: {
              title: 'Feed item deleted!',
              text: 'Updating feed list.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'Feed item could not be deleted.'
            } })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.confirmDeletePortalOpen },
          _react2.default.createElement(_ConfirmationModal2.default, {
            confirmHandler: this._handleConfirmDelete,
            cancelHandler: this._toggleConfirmDeletePortal,
            content: {
              title: 'Are you sure?',
              text: 'You will lose this feed data',
              btns: {
                confirm: 'Delete Feed',
                cancel: 'Cancel'
              }
            } })
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'FeedItems__deleteBtn' },
        _react2.default.createElement(
          'button',
          { className: 'generic__deleteBtn', onClick: this._toggleConfirmDeletePortal },
          _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Feed/_Items/index.jsx');

  __REACT_HOT_LOADER__.register(FeedItems, 'FeedItems', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Feed/_Items/index.jsx');
}();

;

/***/ }),
/* 603 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1115);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

var _Form = __webpack_require__(291);

var _Form2 = _interopRequireDefault(_Form);

var _Items = __webpack_require__(602);

var _Items2 = _interopRequireDefault(_Items);

var _blankItems = __webpack_require__(262);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Feed = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, (0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'feed' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      FeedFormPortalOpen: false,
      helpPortalsOpen: {},
      blankFeed: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
    this.handlePropertyUpdate();
    this.unsubscribeToProps = _dataDefinition2.default.listen(this.handlePropertyUpdate);
  },


  componentWillUnmount: function componentWillUnmount() {
    this.unsubscribeToProps();
  },

  handlePropertyUpdate: function handlePropertyUpdate() {
    this.setState({
      blankFeed: (0, _blankItems.getBlankFeed)()
    });
  },
  _toggleFeedFormPortal: function _toggleFeedFormPortal() {
    if (!this.state.editAuthority) return;
    this.setState({
      FeedFormPortalOpen: !this.state.FeedFormPortalOpen
    });
  },
  _renderFeedBtnText: function _renderFeedBtnText() {
    return this.state.FarmFeeds.length >= 1 ? 'Add another feed' : 'Add your first feed';
  },
  _filterFeeds: function _filterFeeds(groupIds) {
    return this.state.FarmFeeds.filter(function (feed) {
      return _.some(groupIds, { id: feed.FeedGroupId.Value });
    });
  },
  _renderFeedGroup: function _renderFeedGroup(title, idArray) {
    var filteredFeeds = this._filterFeeds(idArray);
    return filteredFeeds.length < 1 ? null : _react2.default.createElement(
      'div',
      { className: 'FeedGroup' },
      _react2.default.createElement(_Items2.default, { title: title, tableData: this._filterFeeds(idArray) })
    );
  },
  _renderFeedItems: function _renderFeedItems() {
    return this.state.FarmFeeds.length >= 1 ? _react2.default.createElement(
      'div',
      null,
      this._renderFeedGroup('Concentrates', [{ id: 2 }]),
      this._renderFeedGroup('Fodder', [{ id: 3 }, { id: 4 }]),
      this._renderFeedGroup('Other Purchased Feed', [{ id: 5 }])
    ) : _react2.default.createElement(
      'div',
      { className: 'Feed__zeroState' },
      _react2.default.createElement(
        'h3',
        { className: '_title' },
        'This dataset has no feeds!'
      )
    );
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Feed',
        data: {
          fields: [{
            label: 'Grazed Feed: <br/> t DM / Milking ha',
            data: this.state.FeedGrazedTDMPerMilkingHa
          }, {
            label: 'Conserved Feed: <br/> t DM / Milking ha',
            data: this.state.FeedConservedTDMPerMilkingHa
          }, {
            label: 'Homegrown Feed: <br/> t DM / Milking ha',
            data: this.state.FeedHomegrownTDMPerMilkingHa
          }, {
            label: 'Concentrate per <br/> Cow: t As Is / Yr',
            data: this.state.FeedFedConcMilkingAreaTAsIsPerCow
          }, {
            label: 'Fodder per Cow: <br/> t DM / Yr',
            data: this.state.FeedFedFodderTotalMilkingAreaTDMPerCow
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'Feed__topRow' },
        _react2.default.createElement(
          'button',
          { className: 'generic__addBtn', onClick: this._toggleFeedFormPortal },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_Icon2.default, { id: 'plus', className: '_icon' }),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              this._renderFeedBtnText()
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_help' },
          _react2.default.createElement(_GenericHelpBtn2.default, { offsetLeft: -45, offsetTop: 13, onClick: this._toggleHelpPortal.bind(this, 'FeedTabHelp1') })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.helpPortalsOpen['FeedTabHelp1'],
            className: 'Overlay--help' },
          _react2.default.createElement(
            _HelpModal2.default,
            {
              closePortal: this._toggleHelpPortal.bind(this, 'FeedTabHelp1') },
            _react2.default.createElement(_HelpText2.default, { id: 'FeedTabHelp1', className: 'HelpModal__text' })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Feed__help' },
          'The feed data collected in this tab is used for multiple purposes including feed inventory, pasture harvest and quantities of each feed fed to the herd'
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.FeedFormPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleFeedFormPortal }),
          _react2.default.createElement(_Form2.default, {
            data: this.state.blankFeed,
            newRow: true,
            closePortal: this._toggleFeedFormPortal,
            editAuthority: this.state.editAuthority })
        )
      ),
      this._renderFeedItems()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Feed, 'Feed', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Feed/index.jsx');
}();

;

/***/ }),
/* 604 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1117);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Form = __webpack_require__(292);

var _Form2 = _interopRequireDefault(_Form);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _POST__deleteData = __webpack_require__(190);

var _POST__deleteData2 = _interopRequireDefault(_POST__deleteData);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _ConfirmationModal = __webpack_require__(109);

var _ConfirmationModal2 = _interopRequireDefault(_ConfirmationModal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Row;

var FeedItems = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  _renderColumnHeadings: function _renderColumnHeadings() {
    var headingHtml = ['Fertiliser Type', 'Total (t)', 'Milking Area (t)', '', ''].map(function (heading, index) {
      var columnClass = '_col' + (index + 1);
      return _react2.default.createElement(
        'h3',
        { className: columnClass + ' is-header', key: index },
        heading
      );
    });

    return headingHtml;
  },
  render: function render() {
    var _this = this;

    var rows = this.props.tableData.map(function (row, index) {
      return _react2.default.createElement(Row, { rowData: row, key: index, editAuthority: _this.state.editAuthority });
    });
    return _react2.default.createElement(
      'div',
      { className: 'FeedItems' },
      _react2.default.createElement(
        'div',
        { className: 'FertiliserItems__row' },
        this._renderColumnHeadings()
      ),
      rows
    );
  }
});

Row = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      FertiliserFormPortalOpen: false
    };
  },
  _toggleFertiliserFormPortal: function _toggleFertiliserFormPortal() {
    this.setState({
      FertiliserFormPortalOpen: !this.state.FertiliserFormPortalOpen
    });
  },
  _handleConfirmDelete: function _handleConfirmDelete() {
    this._toggleConfirmDeletePortal();
    this._toggleDeleteRequestPortal();
  },
  _toggleConfirmDeletePortal: function _toggleConfirmDeletePortal() {
    this.setState({
      confirmDeletePortalOpen: !this.state.confirmDeletePortalOpen
    });
  },
  _toggleDeleteRequestPortal: function _toggleDeleteRequestPortal() {
    if (!this.props.editAuthority) return;
    this.setState({
      deleteRequestPortalOpen: !this.state.deleteRequestPortalOpen
    });
  },
  render: function render() {
    var type = _.find(this.props.rowData.FertiliserTypeId.Options, { Id: this.props.rowData.FertiliserTypeId.Value });
    return _react2.default.createElement(
      'div',
      { className: 'FeedItems__rowContainer' },
      _react2.default.createElement(
        'div',
        { className: 'FertiliserItems__row is-item', onClick: this._toggleFertiliserFormPortal },
        _react2.default.createElement(
          'div',
          { className: '_col1' },
          type.Title
        ),
        _react2.default.createElement(
          'div',
          { className: '_col2' },
          this.props.rowData.TonnesApplied.Value
        ),
        _react2.default.createElement(
          'div',
          { className: '_col3' },
          this.props.rowData.TonnesAppliedMilkingArea.Value
        ),
        _react2.default.createElement(
          'div',
          { className: '_col4' },
          _react2.default.createElement(
            'button',
            { className: 'generic__editBtn' },
            _react2.default.createElement(_Icon2.default, { id: 'edit', className: '_icon' })
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.FertiliserFormPortalOpen,
            className: 'Overlay' },
          _react2.default.createElement(
            'div',
            { className: '_modalBox' },
            _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleFertiliserFormPortal }),
            _react2.default.createElement(_Form2.default, {
              data: this.props.rowData,
              closePortal: this._toggleFertiliserFormPortal,
              editAuthority: this.props.editAuthority })
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.deleteRequestPortalOpen },
          _react2.default.createElement(_RequestModal2.default, {
            successHandler: this._toggleDeleteRequestPortal,
            failHandler: this._toggleDeleteRequestPortal,
            request: _POST__deleteData2.default,
            data: {
              Table: 'FarmFertilisers',
              RowId: this.props.rowData.Id
            },
            pendingText: {
              title: 'Please wait',
              text: 'Deleting fertiliser item'
            },
            successText: {
              title: 'Fertiliser item deleted!',
              text: 'Updating fertiliser list.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'Fertiliser item could not be deleted.'
            } })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.confirmDeletePortalOpen },
          _react2.default.createElement(_ConfirmationModal2.default, {
            confirmHandler: this._handleConfirmDelete,
            cancelHandler: this._toggleConfirmDeletePortal,
            content: {
              title: 'Are you sure?',
              text: 'You will lose this fertiliser data',
              btns: {
                confirm: 'Delete Fertiliser',
                cancel: 'Cancel'
              }
            } })
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'Fertilisertems__deleteBtn' },
        _react2.default.createElement(
          'button',
          { className: 'generic__deleteBtn', onClick: this._toggleConfirmDeletePortal },
          _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Fertiliser/_Items/index.jsx');

  __REACT_HOT_LOADER__.register(FeedItems, 'FeedItems', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Fertiliser/_Items/index.jsx');
}();

;

/***/ }),
/* 605 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1118);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _Items = __webpack_require__(604);

var _Items2 = _interopRequireDefault(_Items);

var _Form = __webpack_require__(292);

var _Form2 = _interopRequireDefault(_Form);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

var _blankItems = __webpack_require__(262);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fertiliser = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, (0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'fertiliser' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      FertiliserFormPortalOpen: false,
      helpPortalsOpen: {},
      blankFertiliser: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
    this.handlePropertyUpdate();
    this.unsubscribeToProps = _dataDefinition2.default.listen(this.handlePropertyUpdate);
  },


  componentWillUnmount: function componentWillUnmount() {
    this.unsubscribeToProps();
  },

  handlePropertyUpdate: function handlePropertyUpdate() {
    this.setState({
      blankFertiliser: (0, _blankItems.getBlankFertiliser)()
    });
  },
  _toggleFertiliserFormPortal: function _toggleFertiliserFormPortal() {
    if (!this.state.editAuthority) return;
    this.setState({
      FertiliserFormPortalOpen: !this.state.FertiliserFormPortalOpen
    });
  },
  _renderFertBtnText: function _renderFertBtnText() {
    return this.state.FarmFertilisers.length >= 1 ? 'Add another fertiliser' : 'Add your first fertiliser';
  },
  _renderFertItems: function _renderFertItems() {
    return this.state.FarmFertilisers.length >= 1 ? _react2.default.createElement(_Items2.default, { tableData: this.state.FarmFertilisers }) : _react2.default.createElement(
      'div',
      { className: 'Fertiliser__zeroState' },
      _react2.default.createElement(
        'h3',
        { className: '_title' },
        'This dataset has no fertilisers!'
      )
    );
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Fertiliser',
        data: {
          fields: [{
            label: 'Nitrogen: <br/> kg / Milking ha',
            data: this.state.FertiliserNKgPerMilkingHa
          }, {
            label: 'Phosphorous: <br/> kg / Milking ha',
            data: this.state.FertiliserPKgPerMilkingHa
          }, {
            label: 'Potassium: <br/> kg / Milking ha',
            data: this.state.FertiliserKKgPerMilkingHa
          }, {
            label: 'Sulphur: <br/> kg/ Milking ha',
            data: this.state.FertiliserSKgPerMilkingHa
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'Fertiliser__topRow' },
        _react2.default.createElement(
          'button',
          { className: 'generic__addBtn', onClick: this._toggleFertiliserFormPortal },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_Icon2.default, { id: 'plus', className: '_icon' }),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              this._renderFertBtnText()
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_help' },
          _react2.default.createElement(_GenericHelpBtn2.default, { offsetLeft: -52, offsetTop: 12, onClick: this._toggleHelpPortal.bind(this, 'FertiliserTabHelp1') })
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.helpPortalsOpen['FertiliserTabHelp1'],
            className: 'Overlay--help' },
          _react2.default.createElement(
            _HelpModal2.default,
            {
              closePortal: this._toggleHelpPortal.bind(this, 'FertiliserTabHelp1') },
            _react2.default.createElement(_HelpText2.default, { id: 'FertiliserTabHelp1', className: 'HelpModal__text' })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Fertiliser__help' },
          'Adding fertiliser information is highly recommended because it is essential for carbon calculations and allows nutrient usage comparisons with other farms'
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.FertiliserFormPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleFertiliserFormPortal }),
          _react2.default.createElement(_Form2.default, {
            data: this.state.blankFertiliser,
            newRow: true,
            closePortal: this._toggleFertiliserFormPortal,
            editAuthority: this.state.editAuthority })
        )
      ),
      this._renderFertItems()
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fertiliser, 'Fertiliser', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Fertiliser/index.jsx');
}();

;

/***/ }),
/* 606 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1119);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _OptimisticInputNumber = __webpack_require__(127);

var _OptimisticInputNumber2 = _interopRequireDefault(_OptimisticInputNumber);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LabourAndManagement = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'labour-and-management' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Labour & Management',
        data: {
          fields: [{
            label: 'Labour Units per <br/> 100 Cows',
            data: this.state.LabourFtePerCow
          }, {
            label: 'Cows per <br/> Labour Unit',
            data: this.state.LabourCowsPerFte
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'Labour__inputs' },
        _react2.default.createElement(
          'div',
          { className: 'Labour__row' },
          _react2.default.createElement(
            'h2',
            { className: '_labelCol _heading' },
            'Labour Usage'
          ),
          _react2.default.createElement(
            'h3',
            { className: '_valueCol _heading' },
            'Number'
          ),
          _react2.default.createElement(
            'h3',
            { className: '_valueCol _heading' },
            'Total Hours',
            _react2.default.createElement(_GenericHelpBtn2.default, { onClick: this._toggleHelpPortal.bind(this, 'LabourTabHelp1') })
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.helpPortalsOpen['LabourTabHelp1'],
              className: 'Overlay--help' },
            _react2.default.createElement(
              _HelpModal2.default,
              {
                closePortal: this._toggleHelpPortal.bind(this, 'LabourTabHelp1') },
              _react2.default.createElement(_HelpText2.default, { id: 'LabourTabHelp1', className: 'HelpModal__text' })
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Labour__row' },
          _react2.default.createElement(
            'div',
            { className: '_labelCol' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: 'Paid Employees',
              description: this.state.LabourFteEmployed.Description })
          ),
          _react2.default.createElement(
            'div',
            { className: '_valueCol' },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.LabourFteEmployed })
          ),
          _react2.default.createElement(
            'div',
            { className: '_valueCol' },
            _react2.default.createElement(_OutputSimple2.default, { value: this.state.LabourFteEmployedHours.Value })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Labour__row' },
          _react2.default.createElement(
            'div',
            { className: '_labelCol' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: 'Unpaid Family / Sharefarmer',
              description: this.state.LabourFteOwner.Description })
          ),
          _react2.default.createElement(
            'div',
            { className: '_valueCol' },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.LabourFteOwner })
          ),
          _react2.default.createElement(
            'div',
            { className: '_valueCol' },
            _react2.default.createElement(_OutputSimple2.default, { value: this.state.LabourFteOwnerHours.Value })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Labour__row' },
          _react2.default.createElement(
            'div',
            { className: '_labelCol' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: 'Total Labour',
              description: this.state.LabourFteTotal.Description })
          ),
          _react2.default.createElement(
            'div',
            { className: '_valueCol' },
            _react2.default.createElement(_OutputSimple2.default, { value: this.state.LabourFteTotal.Value })
          ),
          _react2.default.createElement(
            'div',
            { className: '_valueCol' },
            _react2.default.createElement(_OutputSimple2.default, { value: this.state.LabourFteTotalHours.Value })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'Labour__help' },
        'One full time labour unit is equivalent to 50 hours per week, 48 weeks per year. This does not include subcontractors.'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LabourAndManagement, 'LabourAndManagement', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_LabourAndManagement/index.jsx');
}();

;

/***/ }),
/* 607 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1120);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _OptimisticInputNumber = __webpack_require__(127);

var _OptimisticInputNumber2 = _interopRequireDefault(_OptimisticInputNumber);

var _OptimisticInputSelect = __webpack_require__(202);

var _OptimisticInputSelect2 = _interopRequireDefault(_OptimisticInputSelect);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var fieldList = _.find(__webpack_require__(38), { location: 'land' }).fields;

var Land = module.exports = __webpack_require__(1)({
  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: fieldList
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Land _content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Land Resource (ha)',
        data: {
          fields: [{
            label: 'Total Available </br> Farm Area',
            data: this.state.AreaAvailable
          }, {
            label: 'Total Usable </br> Farm Area',
            data: this.state.AreaUsable
          }, {
            label: 'Milking Area',
            data: this.state.AreaMilking
          }, {
            label: 'Support Area',
            data: this.state.AreaSupport
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'Land__row' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: 'Total Owned Area', description: this.state.AreaOwnedWtdAvg.Description },
          _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.AreaOwnedWtdAvg })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: 'Total Leased Area', description: this.state.AreaLeasedNet.Description },
          _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.AreaLeasedNet })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: 'Total Usable Farm Area', description: this.state.AreaUsable.Description },
          _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.AreaUsable })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: 'Unusable Area', description: this.state.AreaUnusable.Description },
          _react2.default.createElement(
            'div',
            { className: 'Land__output' },
            _react2.default.createElement(_OutputSimple2.default, { value: this.state.AreaUnusable.Value })
          )
        ),
        _react2.default.createElement(_GenericHelpBtn2.default, { offsetLeft: -80, offsetTop: -4, onClick: this._toggleHelpPortal.bind(this, 'LandTabHelp1') }),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.helpPortalsOpen['LandTabHelp1'],
            className: 'Overlay--help' },
          _react2.default.createElement(
            _HelpModal2.default,
            {
              closePortal: this._toggleHelpPortal.bind(this, 'LandTabHelp1') },
            _react2.default.createElement(_HelpText2.default, { id: 'LandTabHelp1', className: 'HelpModal__text' })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'Land__group' },
        _react2.default.createElement(
          'div',
          { className: 'Land__row' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Milking Area', description: this.state.AreaMilking.Description },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.AreaMilking })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Irrigated Milking Area', description: this.state.AreaIrrigatedMilking.Description },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.AreaIrrigatedMilking })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Irrigated Support Area', description: this.state.AreaIrrigatedSupport.Description },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.AreaIrrigatedSupport })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Land__row' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Support Area', description: this.state.AreaSupport.Description },
            _react2.default.createElement(
              'div',
              { className: 'Land__output' },
              _react2.default.createElement(_OutputSimple2.default, { value: this.state.AreaSupport.Value })
            )
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Dryland Milking Area', description: this.state.AreaDryLandMilking.Description },
            _react2.default.createElement(
              'div',
              { className: 'Land__output' },
              _react2.default.createElement(_OutputSimple2.default, { value: this.state.AreaDryLandMilking.Value })
            )
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Dryland Support Area', description: this.state.AreaDryLandSupport.Description },
            _react2.default.createElement(
              'div',
              { className: 'Land__output' },
              _react2.default.createElement(_OutputSimple2.default, { value: this.state.AreaDryLandSupport.Value })
            )
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'Land__TerrainRow' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: 'Terrain', description: this.state.TerrainId.Description },
          _react2.default.createElement(_OptimisticInputSelect2.default, { data: this.state.TerrainId })
        ),
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: 'Distance Walked by Milkers (km)', description: this.state.CowDistanceWalked.Description },
          _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.CowDistanceWalked })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(fieldList, 'fieldList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Land/index.jsx');

  __REACT_HOT_LOADER__.register(Land, 'Land', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Land/index.jsx');
}();

;

/***/ }),
/* 608 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Row = module.exports = __webpack_require__(1)({
  _handleInputSubmit: function _handleInputSubmit(value, month, field) {
    this.props.updateRow(month, this.props.rowData.FieldId, value);
  },
  render: function render() {
    var _this = this;

    var cols = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'].map(function (id, index) {
      return _react2.default.createElement(
        'div',
        { className: '_input', key: index },
        _react2.default.createElement(_InputNumber2.default, {
          id: id,
          decimal: _this.props.rowData.Decimal,
          value: _this.props.rowData[id],
          onSubmit: _this._handleInputSubmit })
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'LivestockCalving__row' },
      _react2.default.createElement(
        'div',
        { className: '_rowLabel' },
        this.props.rowData.Title
      ),
      cols
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Livestock/_CalvingTable/_Row.jsx');
}();

;

/***/ }),
/* 609 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1121);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _Row = __webpack_require__(608);

var _Row2 = _interopRequireDefault(_Row);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LivestockCalvingTable = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  getInitialState: function getInitialState() {
    return {
      table: this.props.tableData
    };
  },
  _flipTable: function _flipTable(table) {
    // (╯°□°)╯︵ ┻━┻

    var CowsMilking = {
      FieldId: 'CowsMilking',
      Title: 'Cows Milking',
      Decimal: table[0].CowsMilking.Decimal
    };
    var CowsDry = {
      FieldId: 'CowsDry',
      Title: 'Cows Dry',
      Decimal: table[0].CowsDry.Decimal
    };
    var CowsCalving = {
      FieldId: 'CowsCalving',
      Title: 'Cows Calving',
      Decimal: table[0].CowsCalving.Decimal
    };

    table.forEach(function (item, index) {
      CowsMilking[item.MonthId.Value] = item.CowsMilking.Value;
      CowsDry[item.MonthId.Value] = item.CowsDry.Value;
      CowsCalving[item.MonthId.Value] = item.CowsCalving.Value;
    });

    return [CowsMilking, CowsDry, CowsCalving];
  },
  _updateRow: function _updateRow(month, field, value) {
    // send input data up to row...
    var newTable = _.cloneDeep(this.state.table);
    var rowIndex = _.findIndex(newTable, function (row) {
      return row.MonthId.Value === +month;
    });

    newTable[rowIndex][field].Value = value;

    this.setState({
      table: newTable
    });
  },
  _toggleSubmitRequestPortal: function _toggleSubmitRequestPortal() {
    if (!this.state.editAuthority) return;
    this.setState({
      submitRequestPortalOpen: !this.state.submitRequestPortalOpen
    });
  },
  _handleSubmitSuccess: function _handleSubmitSuccess() {
    if (!+this.props.monthly.Value) {
      this.props.onToggleSwitch(1, this.props.monthly.FieldId);
    }

    this._toggleSubmitRequestPortal();
    this.props.closePortal();
  },
  _renderColumnHeadings: function _renderColumnHeadings() {
    var headingHtml = ['Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'].map(function (heading, index) {
      return _react2.default.createElement(
        'h3',
        { className: '_input', key: index },
        heading
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'LivestockCalving__row' },
      _react2.default.createElement('div', { className: '_rowLabel' }),
      headingHtml
    );
  },
  _calculateRowAvg: function _calculateRowAvg(row) {
    var row = this._flipTable(this.state.table)[row];
    var values = [+row['1'], +row['2'], +row['3'], +row['4'], +row['5'], +row['6'], +row['7'], +row['8'], +row['9'], +row['10'], +row['11'], +row['12']];
    var total = values.reduce(function (previousValue, currentValue, index, array) {
      return previousValue + currentValue;
    });
    return (total / 12).toFixed(0);
  },
  render: function render() {
    var _this = this;

    // TODO: flip this table using a generic utility.
    var flippedTable = this._flipTable(this.state.table);
    var rows = flippedTable.map(function (row, index) {
      return _react2.default.createElement(_Row2.default, { rowData: row, key: index, updateRow: _this._updateRow });
    });

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(
        'div',
        { className: 'LivestockCalving__header' },
        _react2.default.createElement(
          'h2',
          { className: '_title' },
          'Monthly Cow Numbers & Calving Pattern'
        ),
        _react2.default.createElement(
          'div',
          { className: '_outputs' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Average Cows Milking',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateRowAvg(0) })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Average Cows Dry',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateRowAvg(1) })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'LivestockCalving__table' },
        this._renderColumnHeadings(),
        rows
      ),
      _react2.default.createElement(
        'button',
        {
          className: 'LivestockCalving__submitBtn',
          onClick: this._toggleSubmitRequestPortal },
        'Submit Monthly Data'
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.submitRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleSubmitSuccess,
          failHandler: this._toggleSubmitRequestPortal,
          request: _POST__editData2.default,
          data: {
            Table: this.state.table[0].CowsCalving.Table,
            Data: this.state.table.map(function (row, index) {
              return {
                RowId: row.Id,
                Fields: {
                  CowsCalving: row.CowsCalving.Value,
                  CowsDry: row.CowsDry.Value,
                  CowsMilking: row.CowsMilking.Value,
                  MonthId: row.MonthId.Value
                }
              };
            })
          },
          pendingText: {
            title: 'Please wait',
            text: 'Saving monthly calving data'
          },
          successText: {
            title: 'Monthly Data saved!',
            text: 'You are now using the monthly data.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Monthly calving data cuold not be saved.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LivestockCalvingTable, 'LivestockCalvingTable', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Livestock/_CalvingTable/index.jsx');
}();

;

/***/ }),
/* 610 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1122);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var LivestockForm = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      LivestockBreedTypeId: this.props.data.LivestockBreedTypeId.Value,
      AgeAverage: this.props.data.AgeAverage.Value,
      PriceOpening: this.props.data.PriceOpening.Value,
      LiveweightAverage: this.props.data.LiveweightAverage.Value,
      NumberAverage: this.props.data.NumberAverage.Value,
      NumberOpening: this.props.data.NumberOpening.Value,
      NumberClosing: this.props.data.NumberClosing.Value,
      WeeksOnSupportArea: this.props.data.WeeksOnSupportArea.Value,
      WeeksOnAgistment: this.props.data.WeeksOnAgistment.Value,
      helpPortalsOpen: {}
    };
  },
  _handleInputSubmit: function _handleInputSubmit(value, id) {
    var obj = _defineProperty({}, id, value);
    if (id === "WeeksOnAgistment") obj.WeeksOnSupportArea = this.adjustWeeksOnSupportArea(value);
    if (id === "WeeksOnSupportArea") obj.WeeksOnAgistment = this.adjustWeeksOnAgistment(value);

    if (id === 'LivestockBreedTypeId') {
      var calculateAverageLiveweight = function calculateAverageLiveweight() {
        if (+averageAge > 2.75) {
          return 1;
        } else {
          return 0.000000000000333 * (+averageAge * 365 ^ 4) - 0.0000000012 * (+averageAge * 365 ^ 3) + 0.000000836 * (+averageAge * 365 ^ 2) + 0.000941 * (+averageAge * 365) + 0.0743;
        }
      };

      var checkForBulls = function checkForBulls(value) {
        if (livestockTypeId !== 15) return value;
        return +value * 1.8;
      };

      var YearId = _.find(_datasetList2.default.store, { Id: _activeDataset2.default.id }).FinancialYearId;
      var standardValue = _.find(_dataDefinition2.default.selectOptions.FinancialYearId, { Id: YearId }).MatureLivestockValue;

      var livestockTypeObj = _.find(this.props.data.LivestockTypeId.Options, { Id: this.props.data.LivestockTypeId.Value });
      var classPercent = livestockTypeObj.MatureLivestockValuePercent;
      var averageAge = livestockTypeObj.AgeAverage;

      var breedTypeOptions = _.find(this.props.data.LivestockBreedGroupId.Options, { Id: this.props.data.LivestockBreedGroupId.Value }).Options;
      var breedGroup = _.find(breedTypeOptions, { Id: value });
      var breedPercent = breedGroup.BreedValuePercent;
      var matureLiveweight = breedGroup.MatureLiveweight;

      var defaultAverageValue = +standardValue * +classPercent * +breedPercent;
      var defaultAverageLiveweight = calculateAverageLiveweight() * +matureLiveweight;

      var livestockTypeId = this.props.data.LivestockTypeId.Value;


      var priceOpeningFactor = this.props.data.LivestockTypeId.Value === 4 ? 25 : 50;

      obj.PriceOpening = (defaultAverageValue / priceOpeningFactor).toFixed(0) * priceOpeningFactor;
      obj.LiveweightAverage = checkForBulls(defaultAverageLiveweight).toFixed(0);
    }

    // TODO: set a min / max value range on inputs?
    this.setState(obj);
  },
  adjustWeeksOnSupportArea: function adjustWeeksOnSupportArea(value) {

    var _value = +value;
    var returnValue = +this.state.WeeksOnSupportArea;
    var calculateWeeks = 52 - returnValue - _value;
    if (calculateWeeks < 0) {
      var calculated = 52 - _value;
      returnValue = calculated.toFixed(1);
    }
    return returnValue;
  },
  adjustWeeksOnAgistment: function adjustWeeksOnAgistment(value) {
    var _value = +value;
    var returnValue = +this.state.WeeksOnAgistment;
    var calculateWeeks = 52 - returnValue - _value;
    if (calculateWeeks < 0) {
      var calculated = 52 - _value;
      returnValue = calculated.toFixed(1);
    }
    return returnValue;
  },
  _toggleSubmitRequestPortal: function _toggleSubmitRequestPortal() {
    if (!this.props.editAuthority) return;
    this.setState({
      submitRequestPortalOpen: !this.state.submitRequestPortalOpen
    });
  },
  _handleSubmitSuccess: function _handleSubmitSuccess() {
    this._toggleSubmitRequestPortal();
    this.props.closePortal();
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'LivestockForm' },
      _react2.default.createElement(
        'div',
        { className: 'LivestockForm__type' },
        _react2.default.createElement(
          'h3',
          { className: 'Livestock__header' },
          _react2.default.createElement(
            'div',
            { className: 'help' },
            _react2.default.createElement(_GenericHelpBtn2.default, { onClick: this._toggleHelpPortal.bind(this, 'LivestockTabHelp2') })
          ),
          'Livestock Group: ',
          this.props.type
        ),
        _react2.default.createElement(
          'div',
          { className: '_input' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Breed Type',
              description: this.props.data.LivestockBreedGroupId.Description },
            _react2.default.createElement(_InputSelect2.default, {
              id: 'LivestockBreedTypeId',
              value: this.state.LivestockBreedTypeId,
              options: _.find(this.props.data.LivestockBreedGroupId.Options, { Id: this.props.data.LivestockBreedGroupId.Value }).Options,
              onSubmit: this._handleInputSubmit }),
            _react2.default.createElement(
              _Portal2.default,
              {
                context: document.body,
                isOpen: this.state.helpPortalsOpen['LivestockTabHelp2'],
                className: 'Overlay--help' },
              _react2.default.createElement(
                _HelpModal2.default,
                {
                  closePortal: this._toggleHelpPortal.bind(this, 'LivestockTabHelp2') },
                _react2.default.createElement(_HelpText2.default, { id: 'LivestockTabHelp2', className: 'HelpModal__text' })
              )
            )
          ),
          _react2.default.createElement(
            'div',
            { className: 'Livestock_notes' },
            'Additional Notes',
            _react2.default.createElement(_GenericHelpBtn2.default, { onClick: this._toggleHelpPortal.bind(this, 'LivestockTabHelp4') })
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.helpPortalsOpen['LivestockTabHelp4'],
              className: 'Overlay--help' },
            _react2.default.createElement(
              _HelpModal2.default,
              {
                closePortal: this._toggleHelpPortal.bind(this, 'LivestockTabHelp4') },
              _react2.default.createElement(_HelpText2.default, { id: 'LivestockTabHelp4', className: 'HelpModal__text' })
            )
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'LivestockForm__groups' },
        _react2.default.createElement(
          'div',
          { className: '_col' },
          _react2.default.createElement(
            'h3',
            { className: 'Livestock__header' },
            _react2.default.createElement(
              'div',
              { className: 'help' },
              _react2.default.createElement(_GenericHelpBtn2.default, { onClick: this._toggleHelpPortal.bind(this, 'LivestockTabHelp3') })
            ),
            'Livestock Inventory'
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.helpPortalsOpen['LivestockTabHelp3'],
              className: 'Overlay--help' },
            _react2.default.createElement(
              _HelpModal2.default,
              {
                closePortal: this._toggleHelpPortal.bind(this, 'LivestockTabHelp3') },
              _react2.default.createElement(_HelpText2.default, { id: 'LivestockTabHelp3', className: 'HelpModal__text' })
            )
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Average Stock Number',
              description: this.props.data.NumberAverage.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'NumberAverage',
              decimal: this.props.data.NumberAverage.Decimal,
              value: this.state.NumberAverage,
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Year Opening Number',
              description: this.props.data.NumberOpening.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'NumberOpening',
              decimal: this.props.data.NumberOpening.Decimal,
              value: this.state.NumberOpening,
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Year Closing Number',
              description: this.props.data.NumberClosing.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'NumberClosing',
              decimal: this.props.data.NumberClosing.Decimal,
              value: this.state.NumberClosing,
              onSubmit: this._handleInputSubmit })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col' },
          _react2.default.createElement(
            'h3',
            null,
            'Livestock Grazing'
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Time on Support Area (wks)',
              description: this.props.data.WeeksOnSupportArea.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'WeeksOnSupportArea',
              decimal: this.props.data.WeeksOnSupportArea.Decimal,
              value: this.state.WeeksOnSupportArea,
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Time on Agistment (wks)',
              description: this.props.data.WeeksOnAgistment.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'WeeksOnAgistment',
              decimal: this.props.data.WeeksOnAgistment.Decimal,
              value: this.state.WeeksOnAgistment,
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Time on Milking Area (wks)',
              description: this.props.data.WeeksOnMilkingArea.Description },
            _react2.default.createElement(
              'div',
              { className: '__physicalOutput' },
              _react2.default.createElement(_OutputSimple2.default, { value: (52 - +this.state.WeeksOnSupportArea - +this.state.WeeksOnAgistment).toFixed(1) })
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col' },
          _react2.default.createElement(
            'h3',
            null,
            'Livestock Defaults'
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Average Age (months)',
              description: this.props.data.AgeAverage.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'AgeAverage',
              decimal: this.props.data.AgeAverage.Decimal,
              value: this.state.AgeAverage,
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Average Value ($)',
              description: this.props.data.PriceOpening.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'PriceOpening',
              decimal: this.props.data.PriceOpening.Decimal,
              value: this.state.PriceOpening,
              onSubmit: this._handleInputSubmit })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Average Liveweight (kg)',
              description: this.props.data.LiveweightAverage.Description },
            _react2.default.createElement(_InputNumber2.default, {
              id: 'LiveweightAverage',
              decimal: this.props.data.LiveweightAverage.Decimal,
              value: this.state.LiveweightAverage,
              onSubmit: this._handleInputSubmit })
          )
        )
      ),
      _react2.default.createElement(
        'button',
        {
          className: 'generic__submitBtn',
          onClick: this._toggleSubmitRequestPortal },
        'Submit Livestock Group'
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.submitRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleSubmitSuccess,
          failHandler: this._toggleSubmitRequestPortal,
          request: _POST__editData2.default,
          data: {
            Table: 'FarmLivestocks',
            Data: [{
              RowId: this.props.data.Id,
              Fields: {
                LivestockBreedTypeId: this.state.LivestockBreedTypeId,
                AgeAverage: this.state.AgeAverage,
                PriceOpening: this.state.PriceOpening,
                LiveweightAverage: this.state.LiveweightAverage,
                NumberAverage: this.state.NumberAverage,
                NumberOpening: this.state.NumberOpening,
                NumberClosing: this.state.NumberClosing,
                WeeksOnSupportArea: this.state.WeeksOnSupportArea,
                WeeksOnAgistment: this.state.WeeksOnAgistment
              }
            }]
          },
          pendingText: {
            title: 'Please wait',
            text: 'Saving livestock data'
          },
          successText: {
            title: 'Livestock Data saved!',
            text: 'Updating livestock list.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Livestock data cuold not be saved.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LivestockForm, 'LivestockForm', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Livestock/_Form/index.jsx');
}();

;

/***/ }),
/* 611 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1123);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _Form = __webpack_require__(610);

var _Form2 = _interopRequireDefault(_Form);

var _livestockTypeLookup = __webpack_require__(427);

var _livestockTypeLookup2 = _interopRequireDefault(_livestockTypeLookup);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Row;

var LivestockItems = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  _renderColumnHeadings: function _renderColumnHeadings() {
    var headingHtml = ['Livestock <br/> Group', 'Average <br/> Number', 'Average <br/> Value ($)', 'Liveweight <br/> (kilograms)', 'Weeks on <br/> Milking Area', ''].map(function (heading, index) {
      var columnClass = '_col' + (index + 1);
      return _react2.default.createElement('h3', { className: columnClass + ' is-header', key: index, dangerouslySetInnerHTML: { __html: heading } });
    });

    return headingHtml;
  },
  render: function render() {
    var _this = this;

    var rows = this.props.tableData.map(function (row, index) {
      return _react2.default.createElement(Row, { rowData: row, key: index, editAuthority: _this.state.editAuthority });
    });
    return _react2.default.createElement(
      'div',
      { className: 'LivestockItems' },
      _react2.default.createElement(
        'h2',
        { className: '_title' },
        'Livestock Detail'
      ),
      _react2.default.createElement(
        'div',
        { className: 'LivestockItems__row' },
        this._renderColumnHeadings()
      ),
      rows
    );
  }
});

Row = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      livestockPortalOpen: false
    };
  },
  _togglePortal: function _togglePortal() {
    this.setState({
      livestockPortalOpen: !this.state.livestockPortalOpen
    });
  },
  render: function render() {
    var type = _.find(this.props.rowData.LivestockTypeId.Options, { Id: this.props.rowData.LivestockTypeId.Value }).Title;
    return _react2.default.createElement(
      'div',
      { className: 'LivestockItems__row is-item', onClick: this._togglePortal },
      _react2.default.createElement(
        'div',
        { className: '_col1' },
        type
      ),
      _react2.default.createElement(
        'div',
        { className: '_col2' },
        this.props.rowData.NumberAverage.Value
      ),
      _react2.default.createElement(
        'div',
        { className: '_col3' },
        this.props.rowData.PriceOpening.Value
      ),
      _react2.default.createElement(
        'div',
        { className: '_col4' },
        this.props.rowData.LiveweightAverage.Value
      ),
      _react2.default.createElement(
        'div',
        { className: '_col5' },
        this.props.rowData.WeeksOnMilkingArea.Value
      ),
      _react2.default.createElement(
        'div',
        { className: '_col6' },
        _react2.default.createElement(
          'button',
          { className: 'generic__editBtn' },
          _react2.default.createElement(_Icon2.default, { id: 'edit', className: '_icon' })
        )
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.livestockPortalOpen,
          className: 'Overlay' },
        _react2.default.createElement(
          'div',
          { className: '_modalBox' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._togglePortal }),
          _react2.default.createElement(_Form2.default, {
            data: this.props.rowData,
            type: type,
            closePortal: this._togglePortal,
            editAuthority: this.props.editAuthority })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Livestock/_Items/index.jsx');

  __REACT_HOT_LOADER__.register(LivestockItems, 'LivestockItems', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Livestock/_Items/index.jsx');
}();

;

/***/ }),
/* 612 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1124);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _OptimisticInputNumber = __webpack_require__(127);

var _OptimisticInputNumber2 = _interopRequireDefault(_OptimisticInputNumber);

var _OptimisticInputSelect = __webpack_require__(202);

var _OptimisticInputSelect2 = _interopRequireDefault(_OptimisticInputSelect);

var _OptimisticCheckBox = __webpack_require__(126);

var _OptimisticCheckBox2 = _interopRequireDefault(_OptimisticCheckBox);

var _Items = __webpack_require__(611);

var _Items2 = _interopRequireDefault(_Items);

var _CalvingTable = __webpack_require__(609);

var _CalvingTable2 = _interopRequireDefault(_CalvingTable);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Livestock = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, (0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'livestock' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {}
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleCalvingPortal: function _toggleCalvingPortal() {
    this.setState({
      calvingPortalOpen: !this.state.calvingPortalOpen
    });
  },
  _toggleSwitch: function _toggleSwitch(newValue, fieldId) {
    _Actions2.default.UPDATE_DATA_ELEMENT({
      "Element": fieldId,
      "Value": newValue,
      "Table": this.state[fieldId].Table
    });
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Livestock',
        data: {
          fields: [{
            label: 'Litres per Cow',
            data: this.state.MilkLitresTotalPerCow
          }, {
            label: 'kg MS per Cow',
            data: this.state.MilkSolidsKgTotalPerCow
          }, {
            label: 'Cows per Milking ha',
            data: this.state.CowNumberPerMilkingHa
          }, {
            label: 'kg MS per kg Liveweight',
            data: this.state.MilkSolidsKgPerKgLw
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'Livestock__configGroup' },
        _react2.default.createElement(
          _LabelWrapper2.default,
          { label: this.state.CowMilkerNumber.Label, description: this.state.CowMilkerNumber.Description },
          _react2.default.createElement(
            'div',
            null,
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.CowMilkerNumber })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Calving & Milk Supply Pattern', description: this.state.CalvingPatternTypeId.Description },
            _react2.default.createElement(_OptimisticInputSelect2.default, { data: this.state.CalvingPatternTypeId })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col _monthly' },
          _react2.default.createElement(
            'div',
            { className: '_toggle' },
            _react2.default.createElement(
              'button',
              {
                className: '_btn',
                onClick: this._toggleCalvingPortal },
              'Edit Monthly Data'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_switch' },
            _react2.default.createElement(_OptimisticCheckBox2.default, {
              data: this.state.SwitchCowCalvingMonthly,
              label: 'Use Monthly Data',
              pendingText: {
                title: 'Please wait',
                text: 'Switching monthly data.'
              },
              successText: {
                title: 'Success!',
                text: 'Monthly was switched.'
              },
              failText: {
                title: 'Oops, something went wrong.',
                text: 'Could not switch monthly data.'
              } })
          ),
          _react2.default.createElement(
            'div',
            null,
            _react2.default.createElement(_GenericHelpBtn2.default, { offsetLeft: 5, offsetTop: 7, onClick: this._toggleHelpPortal.bind(this, 'LivestockTabHelp1') })
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: this.state.helpPortalsOpen['LivestockTabHelp1'],
              className: 'Overlay--help' },
            _react2.default.createElement(
              _HelpModal2.default,
              {
                closePortal: this._toggleHelpPortal.bind(this, 'LivestockTabHelp1') },
              _react2.default.createElement(_HelpText2.default, { id: 'LivestockTabHelp1', className: 'HelpModal__text' })
            )
          )
        ),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.calvingPortalOpen,
            className: 'Overlay' },
          _react2.default.createElement(
            'div',
            { className: '_modalBox' },
            _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleCalvingPortal }),
            _react2.default.createElement(_CalvingTable2.default, {
              tableData: this.state.FarmCalvings,
              monthly: this.state.SwitchCowCalvingMonthly,
              closePortal: this._toggleCalvingPortal,
              onToggleSwitch: this._toggleSwitch })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'Livestock__help' },
        'The livestock data collected in this tab is used for multiple purposes including livestock inventory, pasture harvest and the per cow calculations'
      ),
      _react2.default.createElement(_Items2.default, { tableData: this.state.FarmLivestocks })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Livestock, 'Livestock', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_Livestock/index.jsx');
}();

;

/***/ }),
/* 613 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _InputNumber = __webpack_require__(77);

var _InputNumber2 = _interopRequireDefault(_InputNumber);

var _SwitchableInput = __webpack_require__(276);

var _SwitchableInput2 = _interopRequireDefault(_SwitchableInput);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Row = module.exports = __webpack_require__(1)({
  _handleInputSubmit: function _handleInputSubmit(value, month, field) {
    var _this = this;

    // TODO: move this up a level so I can just set the state of the whole table once
    // ... and avoid callbacks.
    this.props.updateRow(month, this.props.rowData.FieldId, value, function () {
      _this._calcKgPercent(month, _this.props.rowData.FieldId);
    });
  },
  _calcKgPercent: function _calcKgPercent(month, editedField) {
    var _this2 = this;

    var calculatedValue;
    var Litres = +_.find(this.props.tableRef, { FieldId: 'Litres' })[month];
    var FatPercent = +_.find(this.props.tableRef, { FieldId: 'FatPercent' })[month];
    var ProteinPercent = +_.find(this.props.tableRef, { FieldId: 'ProteinPercent' })[month];
    var FatKg = +_.find(this.props.tableRef, { FieldId: 'FatKg' })[month];
    var ProteinKg = +_.find(this.props.tableRef, { FieldId: 'ProteinKg' })[month];

    var calcPercent = function calcPercent(kg, litres) {
      return (kg / litres * 100).toFixed(2);
    };

    var calcFat = function calcFat(percent, litres) {
      return (percent * litres / 100).toFixed(0);
    };

    switch (editedField) {
      case "FatKg":
        this.props.updateRow(month, 'FatPercent', calcPercent(FatKg, Litres));
        break;
      case "ProteinKg":
        this.props.updateRow(month, 'ProteinPercent', calcPercent(ProteinKg, Litres));
        break;
      case "FatPercent":
        this.props.updateRow(month, 'FatKg', calcFat(FatPercent, Litres));
        break;
      case "ProteinPercent":
        this.props.updateRow(month, 'ProteinKg', calcFat(ProteinPercent, Litres));
        break;
      case "Litres":
        if (this.props.composition) {
          this.props.updateRow(month, 'FatKg', calcFat(FatPercent, Litres), function () {
            _this2.props.updateRow(month, 'ProteinKg', calcFat(ProteinPercent, Litres));
          });
        } else {
          this.props.updateRow(month, 'FatPercent', calcPercent(FatKg, Litres), function () {
            _this2.props.updateRow(month, 'ProteinPercent', calcPercent(ProteinKg, Litres));
          });
        }
        break;
    }
  },
  render: function render() {
    var _this3 = this;

    var cols = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'].map(function (id, index) {
      var field = _this3.props.rowData.FieldId;
      return _react2.default.createElement(
        'div',
        { className: '_input', key: index },
        _react2.default.createElement(_SwitchableInput2.default, {
          id: id,
          decimal: _this3.props.rowData.Decimal,
          value: _this3.props.rowData[id],
          editable: _this3.props.rowData.editable,
          onSubmit: _this3._handleInputSubmit })
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'MilkMonthly__row' },
      _react2.default.createElement(
        'div',
        { className: '_rowLabel' },
        this.props.rowData.Title
      ),
      cols
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Row, 'Row', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_MilkProduction/_MonthlyTable/_Row.jsx');
}();

;

/***/ }),
/* 614 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1125);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _CheckBox = __webpack_require__(151);

var _CheckBox2 = _interopRequireDefault(_CheckBox);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _OptimisticCheckBox = __webpack_require__(126);

var _OptimisticCheckBox2 = _interopRequireDefault(_OptimisticCheckBox);

var _Row = __webpack_require__(613);

var _Row2 = _interopRequireDefault(_Row);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var MilkMonthlyTable = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default],

  getInitialState: function getInitialState() {
    return {
      composition: this.props.composition,
      table: this.props.tableData
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.setState({
      composition: newProps.composition
    });
  },
  _updateRow: function _updateRow(month, field, value, callback) {
    var newTable = _.cloneDeep(this.state.table);
    var rowIndex = _.findIndex(newTable, function (row) {
      return row.MonthId.Value === +month;
    });

    newTable[rowIndex][field].Value = value;

    this.setState({
      table: newTable
    }, callback);
  },
  _toggleSubmitRequestPortal: function _toggleSubmitRequestPortal() {
    if (!this.state.editAuthority) return;
    this.setState({
      submitRequestPortalOpen: !this.state.submitRequestPortalOpen
    });
  },
  _handleSubmitSuccess: function _handleSubmitSuccess() {
    if (!+this.props.monthly.Value) {
      this.props.onToggleSwitch(1, this.props.monthly.FieldId);
    }

    this._toggleSubmitRequestPortal();
    this.props.closePortal();
  },
  _flipTable: function _flipTable(table) {
    // (╯°□°)╯︵ ┻━┻

    var Litres = {
      FieldId: 'Litres',
      Title: 'Litres',
      Decimal: table[0].Litres.Decimal,
      editable: true
    };
    var FatKg = {
      FieldId: 'FatKg',
      Title: 'kg Fat',
      Decimal: table[0].FatKg.Decimal,
      editable: !this.state.composition
    };
    var ProteinKg = {
      FieldId: 'ProteinKg',
      Title: 'kg Protein',
      Decimal: table[0].ProteinKg.Decimal,
      editable: !this.state.composition
    };
    var FatPercent = {
      FieldId: 'FatPercent',
      Title: 'Fat %',
      Decimal: table[0].FatPercent.Decimal,
      editable: this.state.composition
    };
    var ProteinPercent = {
      FieldId: 'ProteinPercent',
      Title: 'Protein %',
      Decimal: table[0].ProteinPercent.Decimal,
      editable: this.state.composition
    };

    table.forEach(function (item, index) {
      Litres[item.MonthId.Value] = item.Litres.Value;
      FatKg[item.MonthId.Value] = item.FatKg.Value;
      ProteinKg[item.MonthId.Value] = item.ProteinKg.Value;
      FatPercent[item.MonthId.Value] = item.FatPercent.Value;
      ProteinPercent[item.MonthId.Value] = item.ProteinPercent.Value;
    });

    return [Litres, FatKg, ProteinKg, FatPercent, ProteinPercent];
  },
  _renderColumnHeadings: function _renderColumnHeadings() {
    var headingHtml = ['Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'].map(function (heading, index) {
      return _react2.default.createElement(
        'h3',
        { className: '_input', key: index },
        heading
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'MilkMonthly__row' },
      _react2.default.createElement('div', { className: '_rowLabel' }),
      headingHtml
    );
  },
  _calculateRowTotal: function _calculateRowTotal(row) {
    var row = this._flipTable(this.state.table)[row];
    var values = [+row['1'], +row['2'], +row['3'], +row['4'], +row['5'], +row['6'], +row['7'], +row['8'], +row['9'], +row['10'], +row['11'], +row['12']];
    return values.reduce(function (previousValue, currentValue, index, array) {
      return +previousValue + +currentValue;
    });
  },
  _calculateAnnualPercent: function _calculateAnnualPercent(row) {
    var totalRow1 = this._calculateRowTotal(row);
    var totalRow0 = this._calculateRowTotal(0);
    var divideBy = totalRow1 / totalRow0;
    var value = isNaN(divideBy) ? 0 : divideBy;
    return (value * 100).toFixed(2);
  },
  render: function render() {
    var _this = this;

    var flippedTable = this._flipTable(this.state.table);
    var rows = flippedTable.map(function (row, index) {
      return _react2.default.createElement(_Row2.default, { key: index,
        rowData: row,
        updateRow: _this._updateRow,
        tableRef: flippedTable,
        composition: _this.state.composition });
    });

    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(
        'h2',
        { className: 'MilkMonthly__header' },
        'Monthly Milk Production'
      ),
      _react2.default.createElement(
        'div',
        { className: 'MilkMonthly__topRow' },
        _react2.default.createElement(
          'div',
          { className: '_switch' },
          _react2.default.createElement(_OptimisticCheckBox2.default, {
            data: this.props.SwitchMilkComposition,
            label: 'Use % composition',
            pendingText: {
              title: 'Please wait',
              text: 'Switching composition.'
            },
            successText: {
              title: 'Success!',
              text: 'Composition was switched.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'Could not switch composition.'
            } })
        ),
        _react2.default.createElement(
          'div',
          { className: '_output' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Total Litres',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateRowTotal(0) })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_output' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Total kg Fat',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateRowTotal(1) })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_output' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Total kg Protein',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateRowTotal(2) })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_output' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Annual Fat %',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateAnnualPercent(1) })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_output' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            {
              label: 'Annual Protein %',
              description: null },
            _react2.default.createElement(_OutputSimple2.default, { value: this._calculateAnnualPercent(2) })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: 'MilkMonthly__table' },
        this._renderColumnHeadings(),
        rows
      ),
      _react2.default.createElement(
        'button',
        {
          className: 'MilkMonthly__submitBtn',
          onClick: this._toggleSubmitRequestPortal },
        'Submit Monthly Data'
      ),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.submitRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleSubmitSuccess,
          failHandler: this._toggleSubmitRequestPortal,
          request: _POST__editData2.default,
          data: {
            Table: this.state.table[0].Litres.Table,
            Data: this.state.table.map(function (row, index) {
              return {
                RowId: row.Id,
                Fields: {
                  Litres: row.Litres.Value,
                  FatKg: row.FatKg.Value,
                  ProteinKg: row.ProteinKg.Value,
                  FatPercent: +row.FatPercent.Value / 100,
                  ProteinPercent: +row.ProteinPercent.Value / 100,
                  MonthId: row.MonthId.Value
                }
              };
            })
          },
          pendingText: {
            title: 'Please wait',
            text: 'Saving monthly milk production data'
          },
          successText: {
            title: 'Monthly Data saved!',
            text: 'You are now using the monthly data.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Monthly milk production data cuold not be saved.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(MilkMonthlyTable, 'MilkMonthlyTable', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_MilkProduction/_MonthlyTable/index.jsx');
}();

;

/***/ }),
/* 615 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1126);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _OptimisticCheckBox = __webpack_require__(126);

var _OptimisticCheckBox2 = _interopRequireDefault(_OptimisticCheckBox);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _OptimisticSwitchableInput = __webpack_require__(273);

var _OptimisticSwitchableInput2 = _interopRequireDefault(_OptimisticSwitchableInput);

var _MonthlyTable = __webpack_require__(614);

var _MonthlyTable2 = _interopRequireDefault(_MonthlyTable);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _HelpText = __webpack_require__(44);

var _HelpText2 = _interopRequireDefault(_HelpText);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _editAuthMixin = __webpack_require__(43);

var _editAuthMixin2 = _interopRequireDefault(_editAuthMixin);

var _GenericHelpBtn = __webpack_require__(46);

var _GenericHelpBtn2 = _interopRequireDefault(_GenericHelpBtn);

var _HelpModal = __webpack_require__(39);

var _HelpModal2 = _interopRequireDefault(_HelpModal);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var MilkProduction = module.exports = __webpack_require__(1)({

  mixins: [_editAuthMixin2.default, (0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'milk-production' }).fields
  }])],

  getInitialState: function getInitialState() {
    return {
      helpPortalsOpen: {},
      milkMonthlyPortalOpen: false
    };
  },
  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  _toggleSwitch: function _toggleSwitch(newValue, fieldId) {
    _Actions2.default.UPDATE_DATA_ELEMENT({
      "Element": fieldId,
      "Value": newValue,
      "Table": this.state[fieldId].Table
    });
  },
  _evaluateSwitches: function _evaluateSwitches(typeIsKg) {
    var type = typeIsKg ? !this.state.SwitchMilkComposition.Value : this.state.SwitchMilkComposition.Value;
    return type && !this.state.SwitchMilkMonthlyAnnual.Value;
  },
  _toggleMilkMonthlyPortal: function _toggleMilkMonthlyPortal() {
    this.setState({
      milkMonthlyPortalOpen: !this.state.milkMonthlyPortalOpen
    });
  },
  _toggleHelpPortal: function _toggleHelpPortal(id) {
    var helpPortalsState = this.state.helpPortalsOpen || {};
    helpPortalsState[id] = !helpPortalsState[id];
    this.setState({
      helpPortalsOpen: helpPortalsState
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Milk Production',
        data: {
          fields: [{
            label: 'Litres per Cow',
            data: this.state.MilkLitresTotalPerCow
          }, {
            label: 'kg MS per Cow',
            data: this.state.MilkSolidsKgTotalPerCow
          }, {
            label: 'Litres per Milking ha',
            data: this.state.MilkLitresTotalPerMilkingHa
          }, {
            label: 'kg MS per Milking ha',
            data: this.state.MilkSolidsKgTotalPerMilkingHa
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'MilkProduction' },
        _react2.default.createElement(
          'div',
          { className: 'MilkProduction__group' },
          _react2.default.createElement(
            'div',
            { className: 'MilkProduction__configGroup' },
            _react2.default.createElement(
              'div',
              { className: '_monthly' },
              _react2.default.createElement(
                'div',
                { className: '_toggle' },
                _react2.default.createElement(
                  'button',
                  {
                    className: '_btn',
                    onClick: this._toggleMilkMonthlyPortal },
                  'Edit Monthly Data'
                )
              ),
              _react2.default.createElement(
                'div',
                { className: '_switch' },
                _react2.default.createElement(_OptimisticCheckBox2.default, {
                  data: this.state.SwitchMilkMonthlyAnnual,
                  label: 'Use Monthly Data',
                  pendingText: {
                    title: 'Please wait',
                    text: 'Switching to monthly data'
                  },
                  successText: {
                    title: 'Success!',
                    text: 'Monthly data was switched.'
                  },
                  failText: {
                    title: 'Oops, something went wrong.',
                    text: 'Could not switch monthly data.'
                  } })
              )
            ),
            _react2.default.createElement(
              _Portal2.default,
              {
                context: document.body,
                isOpen: this.state.milkMonthlyPortalOpen,
                className: 'Overlay' },
              _react2.default.createElement(
                'div',
                { className: '_modalBox' },
                _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this._toggleMilkMonthlyPortal }),
                _react2.default.createElement(_MonthlyTable2.default, {
                  tableData: this.state.FarmMilks,
                  composition: this.state.SwitchMilkComposition.Value,
                  SwitchMilkComposition: this.state.SwitchMilkComposition,
                  monthly: this.state.SwitchMilkMonthlyAnnual,
                  closePortal: this._toggleMilkMonthlyPortal,
                  onToggleSwitch: this._toggleSwitch,
                  switchDisabled: !this.state.editAuthority })
              )
            ),
            _react2.default.createElement(_GenericHelpBtn2.default, { offsetLeft: 3, offsetTop: 6, onClick: this._toggleHelpPortal.bind(this, 'MilkTabHelp1') }),
            _react2.default.createElement(
              _Portal2.default,
              {
                context: document.body,
                isOpen: this.state.helpPortalsOpen['MilkTabHelp1'],
                className: 'Overlay--help' },
              _react2.default.createElement(
                _HelpModal2.default,
                {
                  closePortal: this._toggleHelpPortal.bind(this, 'MilkTabHelp1') },
                _react2.default.createElement(_HelpText2.default, { id: 'MilkTabHelp1', className: 'HelpModal__text' })
              )
            ),
            _react2.default.createElement(
              'div',
              { className: 'MilkProduction__help' },
              'Annual production is based on the milk supplied to the factory'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'MilkProduction__group' },
          _react2.default.createElement(
            'h2',
            { className: '_title' },
            'Milk Volume'
          ),
          _react2.default.createElement(
            'div',
            { className: '_data' },
            _react2.default.createElement(
              'div',
              { className: '_first-col' },
              _react2.default.createElement(
                _LabelWrapper2.default,
                {
                  label: 'Litres to processor',
                  description: this.state.MilkLitresTotal.Description },
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__SwitchableOutput' },
                  _react2.default.createElement(_OptimisticSwitchableInput2.default, {
                    editable: !this.state.SwitchMilkMonthlyAnnual.Value,
                    data: this.state.MilkLitresTotal })
                )
              )
            ),
            _react2.default.createElement(
              _LabelWrapper2.default,
              {
                label: 'kg Fat',
                description: this.state.MilkFatKgTotal.Description },
              _react2.default.createElement(
                'div',
                { className: 'Milk__SwitchableOutput' },
                _react2.default.createElement(_OptimisticSwitchableInput2.default, {
                  editable: this._evaluateSwitches(true),
                  data: this.state.MilkFatKgTotal })
              )
            ),
            _react2.default.createElement(
              _LabelWrapper2.default,
              {
                label: 'kg Protein',
                description: this.state.MilkProteinKgTotal.Description },
              _react2.default.createElement(
                'div',
                { className: 'Milk__SwitchableOutput' },
                _react2.default.createElement(_OptimisticSwitchableInput2.default, {
                  editable: this._evaluateSwitches(true),
                  data: this.state.MilkProteinKgTotal })
              )
            ),
            _react2.default.createElement(
              _LabelWrapper2.default,
              {
                label: 'kg Milksolids',
                description: this.state.MilkSolidsKgTotal.Description },
              _react2.default.createElement(
                'div',
                { className: 'Milk__Output' },
                _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkSolidsKgTotal.Value })
              )
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'MilkProduction__group' },
          _react2.default.createElement(
            'div',
            { className: '_data' },
            _react2.default.createElement(
              'div',
              { className: '_first-col' },
              _react2.default.createElement(
                'div',
                { className: '_compositionSwitch' },
                _react2.default.createElement(_OptimisticCheckBox2.default, {
                  data: this.state.SwitchMilkComposition,
                  label: 'Use % composition',
                  pendingText: {
                    title: 'Please wait',
                    text: 'Switching composition.'
                  },
                  successText: {
                    title: 'Success!',
                    text: 'Composition was switched.'
                  },
                  failText: {
                    title: 'Oops, something went wrong.',
                    text: 'Could not switch composition.'
                  } })
              )
            ),
            _react2.default.createElement(
              _LabelWrapper2.default,
              {
                label: 'Fat %',
                description: this.state.MilkFatPercentAnnual.Description },
              _react2.default.createElement(
                'div',
                { className: 'Milk__SwitchableOutput' },
                _react2.default.createElement(_OptimisticSwitchableInput2.default, {
                  editable: this._evaluateSwitches(false),
                  data: this.state.MilkFatPercentAnnual })
              )
            ),
            _react2.default.createElement(
              _LabelWrapper2.default,
              {
                label: 'Protein %',
                description: this.state.MilkProteinPercentAnnual.Description },
              _react2.default.createElement(
                'div',
                { className: 'Milk__SwitchableOutput' },
                _react2.default.createElement(_OptimisticSwitchableInput2.default, {
                  editable: this._evaluateSwitches(false),
                  data: this.state.MilkProteinPercentAnnual })
              )
            ),
            _react2.default.createElement(
              _LabelWrapper2.default,
              {
                label: 'Milksolids %',
                description: this.state.MilkSolidsPercentAnnual.Description },
              _react2.default.createElement(
                'div',
                { className: 'Milk__Output' },
                _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkSolidsPercentAnnual.Value })
              )
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'MilkProduction__group' },
          _react2.default.createElement(
            'h2',
            { className: '_title' },
            'Productivity Measures'
          ),
          _react2.default.createElement(
            'div',
            { className: 'Milk__tableCols' },
            _react2.default.createElement(
              'div',
              { className: '_col labels' },
              _react2.default.createElement(
                'h3',
                { className: 'Milk__rowTitle' },
                'Per Cow'
              ),
              _react2.default.createElement(
                'h3',
                { className: 'Milk__rowTitle' },
                'Per Milking ha'
              )
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: 'physical__output' },
                _react2.default.createElement(
                  'span',
                  { className: '_title' },
                  'Litres'
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkLitresTotalPerCow.Value })
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkLitresTotalPerMilkingHa.Value })
                )
              )
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: 'physical__output' },
                _react2.default.createElement(
                  'span',
                  { className: '_title' },
                  'kg Fat'
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkFatKgTotalPerCow.Value })
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkFatKgTotalPerMilkingHa.Value })
                )
              )
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: 'physical__output' },
                _react2.default.createElement(
                  'span',
                  { className: '_title' },
                  'kg Protein'
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkProteinKgTotalPerCow.Value })
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkProteinKgTotalPerMilkingHa.Value })
                )
              )
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: 'physical__output' },
                _react2.default.createElement(
                  'span',
                  { className: '_title' },
                  'kg Milksolids'
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkSolidsKgTotalPerCow.Value })
                ),
                _react2.default.createElement(
                  'div',
                  { className: 'Milk__Output' },
                  _react2.default.createElement(_OutputSimple2.default, { value: this.state.MilkSolidsKgTotalPerMilkingHa.Value })
                )
              )
            )
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(MilkProduction, 'MilkProduction', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_MilkProduction/index.jsx');
}();

;

/***/ }),
/* 616 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1127);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _activeDataset = __webpack_require__(13);

var _activeDataset2 = _interopRequireDefault(_activeDataset);

var _OutputTotal = __webpack_require__(71);

var _OutputTotal2 = _interopRequireDefault(_OutputTotal);

var _ColumnWrapper = __webpack_require__(63);

var _ColumnWrapper2 = _interopRequireDefault(_ColumnWrapper);

var _OptimisticInputNumber = __webpack_require__(127);

var _OptimisticInputNumber2 = _interopRequireDefault(_OptimisticInputNumber);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _LabelWrapper = __webpack_require__(64);

var _LabelWrapper2 = _interopRequireDefault(_LabelWrapper);

var _TabHeader = __webpack_require__(47);

var _TabHeader2 = _interopRequireDefault(_TabHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var RainfallAndIrrigation = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Data',
    fields: _.find(__webpack_require__(38), { location: 'rainfall-and-irrigation' }).fields
  }])],

  componentDidMount: function componentDidMount() {
    this.props.emitResetScroll();
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'Rain _content' },
      _react2.default.createElement(_TabHeader2.default, {
        portalContext: this.props.editorDOMRef,
        title: 'Rainfall & Irrigation',
        data: {
          fields: [{
            label: 'Total Water Applied <br/> mm / Usable ha',
            data: this.state.WaterTotalUsedMmPerHa
          }, {
            label: 'Irrigation Rate <br/> mm / Irrigated ha',
            data: this.state.WaterMmPerHaIrrigated
          }, {
            label: 'Pasture Harvest / 100mm <br/> Water Applied / Usable ha',
            data: this.state.FeedHomegrownTDMPer100MmWater
          }]
        } }),
      _react2.default.createElement(
        'div',
        { className: 'Rain__section' },
        _react2.default.createElement(
          'div',
          { className: 'Rain__inputs' },
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Annual Average Rainfall', description: this.state.RainfallAnnualAvgMm.Description },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.RainfallAnnualAvgMm })
          ),
          _react2.default.createElement(
            _LabelWrapper2.default,
            { label: 'Rainfall Measured', description: this.state.RainfallAnnualMm.Description },
            _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.RainfallAnnualMm })
          ),
          _react2.default.createElement(
            'div',
            { className: 'Rain__inputs' },
            _react2.default.createElement(
              _LabelWrapper2.default,
              { label: 'Irrigation Water Use', description: this.state.WaterIrrigationTotalML.Description },
              _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.WaterIrrigationTotalML })
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Rain__help' },
          _react2.default.createElement(
            'p',
            null,
            'You need to enter both the annual average rainfall and the rainfall measured for the particular financial year being assessed.'
          ),
          _react2.default.createElement(
            'p',
            { className: '_padded' },
            'Irrigation water use is only required for dairy farms with access to irrigation. Water volumes are in units of megalitres.'
          )
        )
      ),
      _react2.default.createElement(
        _LabelWrapper2.default,
        { label: 'Water Carried Over at Year End', description: this.state.WaterCarryoverOpeningML.Description },
        _react2.default.createElement(
          'div',
          { className: 'Rain__inputs__horizon' },
          _react2.default.createElement(
            'div',
            { className: 'Rain__fieldWrapper' },
            _react2.default.createElement(
              _LabelWrapper2.default,
              { label: 'Opening Volume' },
              _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.WaterCarryoverOpeningML })
            )
          ),
          _react2.default.createElement(
            'div',
            { className: 'Rain__fieldWrapper' },
            _react2.default.createElement(
              _LabelWrapper2.default,
              { label: 'Closing Volume' },
              _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.WaterCarryoverClosingML })
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: 'Rain__inputs__horizon' },
          _react2.default.createElement(
            'div',
            { className: 'Rain__fieldWrapper' },
            _react2.default.createElement(
              _LabelWrapper2.default,
              { label: 'Water Value ($ / ML)' },
              _react2.default.createElement(_OptimisticInputNumber2.default, { data: this.state.WaterCarryoverClosingPricePerML })
            )
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(RainfallAndIrrigation, 'RainfallAndIrrigation', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/physical-tabs/_RainfallAndIrrigation/index.jsx');
}();

;

/***/ }),
/* 617 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1128);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportStepTemplate = __webpack_require__(164);

var _ReportStepTemplate2 = _interopRequireDefault(_ReportStepTemplate);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__generateReport = __webpack_require__(146);

var _POST__generateReport2 = _interopRequireDefault(_POST__generateReport);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_user2.default, 'handleUserUpdate')],

  getInitialState: function getInitialState() {
    return {
      selectedDatasets: [],
      selectedFilters: [],
      ratioField: {},
      reportRequestPortalOpen: false,
      reportLoaded: false,
      approvedStep: 1
    };
  },
  componentWillMount: function componentWillMount() {
    this.handleUserUpdate();
  },
  componentWillUnmount: function componentWillUnmount() {
    this._handlePostDatasetChange();
    this._handlePostFilterChange();
  },
  handleUserUpdate: function handleUserUpdate() {
    var _datasetObj = _user2.default.store.BulkComparisonDatasetIdArray || {};
    var _filterObj = _user2.default.store.BulkComparisonFilterIdArray || {};
    var _ratioObj = _user2.default.store.BulkComparisonFinanceRatioId || {};

    this.setState({
      selectedDatasets: _datasetObj.Value || [],
      selectedFilters: _filterObj.Value || [],
      ratioField: _ratioObj
    });
  },
  _handleDatasetSelection: function _handleDatasetSelection(newList) {
    _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      Element: 'BulkComparisonDatasetIdArray',
      Value: newList
    });

    this.setState({
      selectedDatasets: newList,
      approvedStep: 1
    });
  },
  _handlePostDatasetChange: function _handlePostDatasetChange() {
    return _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      Element: 'BulkComparisonDatasetIdArray',
      Value: this.state.selectedDatasets
    });
  },
  _handlePostFilterChange: function _handlePostFilterChange() {
    return _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      Element: 'BulkComparisonFilterIdArray',
      Value: this.state.selectedFilters
    });
  },
  _handleFilterSelection: function _handleFilterSelection(newList) {
    _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      Element: 'BulkComparisonFilterIdArray',
      Value: newList
    });

    this.setState({
      selectedFilters: newList,
      approvedStep: 1
    });
  },
  _toggleReportRequestPortal: function _toggleReportRequestPortal() {
    if (this.state.selectedDatasets.length === 0 && this.state.selectedFilters.length === 0) return;

    this.setState({
      reportRequestPortalOpen: !this.state.reportRequestPortalOpen
    });
  },
  _handleGenerateSuccess: function _handleGenerateSuccess() {
    return this._toggleReportRequestPortal();
  },
  _handleLoadReportSuccess: function _handleLoadReportSuccess() {
    var _this = this;

    this.setState({
      reportLoaded: true,
      approvedStep: 2
    }, function () {
      _this._toggleReportRequestPortal();
      _this.setState({
        reportLoaded: false
      });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ComparisonReport' },
      _react2.default.createElement(_ReportStepTemplate2.default, {
        emitResetScroll: this.props.emitResetScroll,
        approvedStep: this.state.approvedStep,
        reportLoaded: this.state.reportLoaded,
        emitGenerateReport: this._toggleReportRequestPortal,
        selectedDatasets: this.state.selectedDatasets,
        bannerDOMRef: this.props.bannerDOMRef,
        emitChangeDatasets: this._handleDatasetSelection,
        steps: this.props.steps,
        selectedRatio: this.state.ratioField,
        selectedFilters: this.state.selectedFilters // this one
        , emitChangeFilters: this._handleFilterSelection // this one

        // emitFilterChange={this._handleFilterChange}
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.reportRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleLoadReportSuccess,
          failHandler: this._toggleReportRequestPortal,
          request: _POST__generateReport2.default,
          data: {
            ReportId: 5,
            FarmDataSetList: this.state.selectedDatasets,
            GroupFilterList: this.state.selectedFilters
          },
          pendingText: {
            title: 'Please wait',
            text: 'Generating Report'
          },
          successText: {
            title: 'Success!',
            text: 'Report generated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Your report could not be generated.'
          }
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport, 'ComparisonReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_BulkReportTemplate/index.jsx');
}();

;

/***/ }),
/* 618 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _index = __webpack_require__(1129);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDndCjs = __webpack_require__(84);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var ItemTypes = {
  CARD: 'card'
};

var cardSource = {
  beginDrag: function beginDrag(props) {
    return { id: props.id };
  },


  endDrag: function endDrag(props, monitor, component) {
    props.onDropCard();
  }
};

var cardTarget = {
  hover: function hover(props, monitor) {
    var draggedId = monitor.getItem().id;

    if (draggedId !== props.id) {
      props.moveCard(draggedId, props.id);
    }
  }
};

var Card = function (_Component) {
  _inherits(Card, _Component);

  function Card() {
    _classCallCheck(this, Card);

    return _possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).apply(this, arguments));
  }

  _createClass(Card, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          text = _props.text,
          isDragging = _props.isDragging,
          connectDragSource = _props.connectDragSource,
          connectDropTarget = _props.connectDropTarget,
          onDelete = _props.onDelete,
          DairyBaseId = _props.DairyBaseId,
          FinancialYear = _props.FinancialYear,
          Name = _props.Name;


      var opacity = isDragging ? 0 : 1;
      return connectDragSource(connectDropTarget(_react2.default.createElement(
        'div',
        {
          className: 'BulkComparison__ReportModalSelectedList__item',
          style: { cursor: 'move', opacity: opacity } },
        _react2.default.createElement(
          'div',
          { className: '_item' },
          _react2.default.createElement(
            'div',
            { className: '_text' },
            DairyBaseId,
            ' ',
            FinancialYear,
            ' ',
            Name
          ),
          _react2.default.createElement(
            'button',
            { className: '_delete', onClick: onDelete },
            _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
          )
        )
      )));
    }
  }]);

  return Card;
}(_react.Component);

var _default = (0, _reactDndCjs.DropTarget)(ItemTypes.CARD, cardTarget, function (connect) {
  return {
    connectDropTarget: connect.dropTarget()
  };
})((0, _reactDndCjs.DragSource)(ItemTypes.CARD, cardSource, function (connect, monitor) {
  return {
    connectDragSource: connect.dragSource(),
    isDragging: monitor.isDragging()
  };
})(Card));

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ItemTypes, 'ItemTypes', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(cardSource, 'cardSource', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(cardTarget, 'cardTarget', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(Card, 'Card', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/Card/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 619 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _immutabilityHelper = __webpack_require__(243);

var _immutabilityHelper2 = _interopRequireDefault(_immutabilityHelper);

var _Card = __webpack_require__(618);

var _Card2 = _interopRequireDefault(_Card);

var _reactDndHtml5BackendCjs = __webpack_require__(250);

var _reactDndHtml5BackendCjs2 = _interopRequireDefault(_reactDndHtml5BackendCjs);

var _reactDndCjs = __webpack_require__(84);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var Container = function (_Component) {
  _inherits(Container, _Component);

  function Container(props) {
    _classCallCheck(this, Container);

    var _this = _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));

    _this.moveCard = _this.moveCard.bind(_this);
    _this.drawFrame = _this.drawFrame.bind(_this);
    _this.handleDelete = _this.handleDelete.bind(_this);
    _this.handleDropCard = _this.handleDropCard.bind(_this);

    var cardsById = {};
    var cardsByIndex = [];

    var loop = props.list.forEach(function (r, i) {
      var card = {
        id: r.Id,
        DairyBaseId: r.DairyBaseId,
        FinancialYear: r.FinancialYear,
        Name: r.Name
      };

      cardsById[r.Id] = card;
      cardsByIndex[i] = card;
    });

    _this.state = {
      cardsById: cardsById,
      cardsByIndex: cardsByIndex
    };
    return _this;
  }

  _createClass(Container, [{
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(newProps) {
      var _this2 = this;

      if (this.props.list.length !== newProps.list.length) {
        var cardsById = {};
        var cardsByIndex = [];

        var loop = newProps.list.forEach(function (r, i) {
          // if(i > 10) return;
          var card = {
            id: r.Id,
            DairyBaseId: r.DairyBaseId,
            FinancialYear: r.FinancialYear,
            Name: r.Name
          };

          cardsById[r.Id] = card;
          cardsByIndex[i] = card;
        });

        this.setState({
          cardsById: cardsById
        }, function () {
          return _this2.scheduleUpdate({
            cardsByIndex: {
              $set: cardsByIndex
            }
          });
        });
      }
    }
  }, {
    key: 'handleDelete',
    value: function handleDelete(index, id) {
      this.scheduleUpdate({
        cardsByIndex: {
          $splice: [[index, 1]]
        }
      });

      this.props.onDelete(id);
    }
  }, {
    key: 'handleDropCard',
    value: function handleDropCard() {
      var newState = this.state.cardsByIndex.map(function (card) {
        return card.id;
      });
      this.props.onReorder(newState);
    }
  }, {
    key: 'moveCard',
    value: function moveCard(id, afterId) {
      var _state = this.state,
          cardsById = _state.cardsById,
          cardsByIndex = _state.cardsByIndex;


      var card = cardsById[id];
      var afterCard = cardsById[afterId];

      var cardIndex = cardsByIndex.indexOf(card);
      var afterIndex = cardsByIndex.indexOf(afterCard);

      this.scheduleUpdate({
        cardsByIndex: {
          $splice: [[cardIndex, 1], [afterIndex, 0, card]]
        }
      });
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      cancelAnimationFrame(this.requestedFrame);
    }
  }, {
    key: 'scheduleUpdate',
    value: function scheduleUpdate(update) {
      this.pendingUpdate = update;

      if (!this.requestedFrame) {
        this.requestedFrame = requestAnimationFrame(this.drawFrame);
      }
    }
  }, {
    key: 'drawFrame',
    value: function drawFrame() {
      var nextState = (0, _immutabilityHelper2.default)(this.state, this.pendingUpdate);
      this.setState(nextState);

      this.pendingUpdate = null;
      this.requestedFrame = null;
    }
  }, {
    key: 'render',
    value: function render() {
      var _this3 = this;

      var cardsByIndex = this.state.cardsByIndex;

      return _react2.default.createElement(
        _reactDndCjs.DndProvider,
        { backend: _reactDndHtml5BackendCjs2.default },
        _react2.default.createElement(
          'div',
          null,
          cardsByIndex.map(function (card, index) {
            return _react2.default.createElement(_Card2.default, {
              key: card.id,
              id: card.id,
              DairyBaseId: card.DairyBaseId,
              FinancialYear: card.FinancialYear,
              Name: card.Name,
              moveCard: _this3.moveCard,
              onDropCard: function onDropCard() {
                return _this3.handleDropCard();
              },
              onDelete: function onDelete() {
                return _this3.handleDelete(index, card.id);
              }
            });
          })
        )
      );
    }
  }]);

  return Container;
}(_react.Component);

var _default = Container;
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Container, 'Container', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/index.jsx');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/DndList/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 620 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1130);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _DndList = __webpack_require__(619);

var _DndList2 = _interopRequireDefault(_DndList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SelectedList = module.exports = __webpack_require__(1)({
  _renderEmptySlots: function _renderEmptySlots() {
    return _react2.default.createElement(
      'div',
      { className: 'BulkComparison__ReportModalEmptyList' },
      _react2.default.createElement(
        'div',
        { className: '_item' },
        'Select Dataset'
      )
    );
  },
  _handleClickSelected: function _handleClickSelected(id) {
    this.props.emitRemoveFromSelected(id);
  },
  _renderSelectedList: function _renderSelectedList() {
    var _this = this;

    var selected = this.props.selected;

    var list = this.props.datasetList.filter(function (item) {
      return _.includes(selected, item.Id);
    });

    var selectedList = _.sortBy(list, function (item) {
      return _.indexOf(selected, item.Id);
    });

    if (selectedList.length === 0) return null;

    return _react2.default.createElement(
      'div',
      { className: 'BulkComparison__ReportModalSelectedList' },
      _react2.default.createElement(_DndList2.default, {
        list: selectedList,
        onReorder: function onReorder(arr) {
          return _this.props.reorder(arr);
        },
        onDelete: function onDelete(id) {
          return _this.props.emitRemoveFromSelected(id);
        } })
    );
  },
  _renderListItem: function _renderListItem(index, item) {
    return _react2.default.createElement(
      'div',
      {
        key: index,
        className: '_item' },
      _react2.default.createElement(
        'div',
        { className: '_text' },
        item.DairyBaseId,
        ' ',
        item.FinancialYear,
        ' ',
        item.Name
      ),
      _react2.default.createElement(
        'button',
        { className: '_delete', onClick: this._handleClickSelected.bind(this, item.Id) },
        _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
      )
    );
  },
  _renderSubmitBtn: function _renderSubmitBtn() {
    var onClick = this.props._emitTransitionToFilters;

    return _react2.default.createElement(
      'button',
      {
        className: 'BulkComparison__ReportModalDatasets__submitBtn is-clickable',
        onClick: onClick },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Set Report Filters'
        ),
        _react2.default.createElement(_Icon2.default, { id: 'forward', className: '_icon' })
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'BulkComparison__ReportModalSelectedDatasets' },
      _react2.default.createElement(
        'div',
        { className: '_listContainer' },
        _react2.default.createElement(
          'h3',
          { className: '_title' },
          'Selected Datasets:'
        ),
        this._renderSubmitBtn(),
        this.props.selected.length < 1 ? this._renderEmptySlots() : this._renderSelectedList(),
        this._renderSubmitBtn()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SelectedList, 'SelectedList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/_SelectedList/index.jsx');
}();

;

/***/ }),
/* 621 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _datasetList2 = __webpack_require__(10);

var _datasetList3 = _interopRequireDefault(_datasetList2);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilteringDatasetList = __webpack_require__(155);

var _FilteringDatasetList2 = _interopRequireDefault(_FilteringDatasetList);

var _SmallFilterBar = __webpack_require__(290);

var _SmallFilterBar2 = _interopRequireDefault(_SmallFilterBar);

var _SelectedList = __webpack_require__(620);

var _SelectedList2 = _interopRequireDefault(_SelectedList);

var _datasetListGroups = __webpack_require__(89);

var _datasetListGroups2 = _interopRequireDefault(_datasetListGroups);

var _style = __webpack_require__(981);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList3.default, "_handleNewData"), _reflux2.default.listenTo(_datasetListGroups2.default, "handleGroupUpdate"), (0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      datasetList: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewData();
    this.handleGroupUpdate();
  },
  handleGroupUpdate: function handleGroupUpdate() {
    this.setState({
      user: _datasetListGroups2.default.store.user,
      other: _datasetListGroups2.default.store.other,
      industry: _datasetListGroups2.default.store.industry
    });
  },
  _handleNewData: function _handleNewData() {
    var _datasetList = (0, _filterVisibleDatasets2.default)();

    var selectedDatasets = this.props.selectedDatasets;


    var existingDatasets = _.map(_datasetList, 'Id');
    var validSelectedIds = _.intersection(selectedDatasets, existingDatasets);

    this.props.emitChangeDatasets(validSelectedIds);

    this.setState({
      datasetList: _datasetList
    });
  },
  _reorderSelected: function _reorderSelected(newArr) {
    this.props.emitChangeDatasets(newArr);
  },
  _addToSelected: function _addToSelected(id) {
    var selectedList = this.props.selectedDatasets;
    if (_.includes(selectedList, id)) return this._removeFromSelected(id);

    var newArr = selectedList;
    newArr.push(id);

    this.props.emitChangeDatasets(newArr);
  },
  _removeFromSelected: function _removeFromSelected(id) {
    var newArr = this.props.selectedDatasets.filter(function (item) {
      return item !== id;
    });

    this.props.emitChangeDatasets(newArr);
  },
  _checkAllSelected: function _checkAllSelected() {
    var _state = this.state,
        user = _state.user,
        other = _state.other,
        industry = _state.industry,
        datasetList = _state.datasetList;


    var displayedList = datasetList.filter(function (item) {
      var includeUser = user && item.IsThisOwner;
      var includeOther = other && !item.IsThisOwner && !item.SystemDataSet;
      var includeIndustry = industry && item.SystemDataSet;

      return includeUser || includeOther || includeIndustry;
    });

    return displayedList.length <= this.props.selectedDatasets.length;
  },
  _selectAllDatasets: function _selectAllDatasets() {
    var selectedDatasets = this.props.selectedDatasets;
    var _state2 = this.state,
        user = _state2.user,
        other = _state2.other,
        industry = _state2.industry,
        datasetList = _state2.datasetList;


    var addedList = datasetList.filter(function (item) {
      var includeUser = user && item.IsThisOwner;
      var includeOther = other && !item.IsThisOwner && !item.SystemDataSet;
      var includeIndustry = industry && item.SystemDataSet;

      return includeUser || includeOther || includeIndustry;
    });

    var ids = _.map(addedList, 'Id');

    if (_.difference(ids, selectedDatasets).length === 0) return;

    var newArr = _.union(selectedDatasets, ids);

    return this.props.emitChangeDatasets(newArr);
  },
  _clearAllDatasets: function _clearAllDatasets() {
    var selectedDatasets = this.props.selectedDatasets;


    if (selectedDatasets.length === 0) return;

    return this.props.emitChangeDatasets([]);
  },
  _handleDatasetItemClick: function _handleDatasetItemClick(item) {
    this._addToSelected(item.Id);
  },
  _handleTransitionToFilters: function _handleTransitionToFilters() {
    this.props.emitChangeStep('filter');
  },
  render: function render() {
    var allSelected = this._checkAllSelected();
    var noSelected = this.props.selectedDatasets.length === 0;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        _Portal2.default,
        {
          context: this.props.bannerDOMRef,
          isOpen: this.state.permaPortalOpen },
        _react2.default.createElement(
          'div',
          { className: _style2.default.banner, style: { right: (0, _getScrollbarWidth2.default)() } },
          _react2.default.createElement(
            'div',
            { className: _style2.default.bannerContent },
            _react2.default.createElement(_SmallFilterBar2.default, { hasCheckbox: true })
          )
        )
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.content },
        _react2.default.createElement(
          'div',
          { className: _style2.default.list },
          _react2.default.createElement(
            'div',
            { className: _style2.default.listTitle },
            _react2.default.createElement(
              'button',
              {
                className: _style2.default.allButton + ' ' + (allSelected ? _style2.default.disabled : ''),
                onClick: this._selectAllDatasets },
              'Select All'
            ),
            _react2.default.createElement(
              'button',
              {
                className: _style2.default.allButton + ' ' + (noSelected ? _style2.default.disabled : ''),
                onClick: this._clearAllDatasets },
              'Clear All'
            )
          ),
          _react2.default.createElement(_FilteringDatasetList2.default, {
            hasCheckbox: true,
            list: this.state.datasetList,
            selectedList: this.props.selectedDatasets,
            emitItemClick: this._handleDatasetItemClick })
        ),
        _react2.default.createElement(_SelectedList2.default, {
          datasetList: this.state.datasetList,
          selected: this.props.selectedDatasets,
          emitRemoveFromSelected: this._removeFromSelected,
          reorder: this._reorderSelected,
          _emitTransitionToFilters: this._handleTransitionToFilters })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Datasets/index.jsx');
}();

;

/***/ }),
/* 622 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _style = __webpack_require__(982);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fields__RegionField = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.fieldWrapper },
      _react2.default.createElement(
        'div',
        { className: _style2.default.label },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields['GrpRegionSelect'].Label,
          description: this.props.fields['GrpRegionSelect'].Description })
      ),
      this._renderCols()
    );
  },
  _renderCols: function _renderCols() {
    var options = _.find(_dataDefinition2.default.selectOptions.ReportRegionGroupId, { Id: this.props.typeValue }).Options;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.col },
      _react2.default.createElement(
        'div',
        { className: _style2.default.field },
        _react2.default.createElement(_InputSelect2.default, {
          id: 'GrpRegionSelect',
          disabled: this.props.disabled,
          value: this.props.value,
          options: options,
          onSubmit: this.props.emitUpdate })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields__RegionField, 'Fields__RegionField', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/FilterEditorPortal/_RegionField/index.jsx');
}();

;

/***/ }),
/* 623 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _InputMultiSelect = __webpack_require__(204);

var _InputMultiSelect2 = _interopRequireDefault(_InputMultiSelect);

var _TextInput = __webpack_require__(152);

var _TextInput2 = _interopRequireDefault(_TextInput);

var _TextArea = __webpack_require__(277);

var _TextArea2 = _interopRequireDefault(_TextArea);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _InvisibleRequestModal = __webpack_require__(510);

var _InvisibleRequestModal2 = _interopRequireDefault(_InvisibleRequestModal);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _RegionField = __webpack_require__(622);

var _RegionField2 = _interopRequireDefault(_RegionField);

var _style = __webpack_require__(983);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Fields = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_user2.default, "_handleNewData")],

  getInitialState: function getInitialState() {
    return {
      pendingCount: 0,
      requestPortalOpen: false,
      industryAuthorised: _user2.default.industryDataProvider || _user2.default.userAuthority <= 1,
      requestFields: undefined
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewData();
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      industryAuthorised: _user2.default.industryDataProvider || _user2.default.userAuthority <= 1
    });
  },
  checkFromTo: function checkFromTo(newValue, id) {

    var obj = _defineProperty({
      UserReportBulkComparisonId: this.props.fields.UserReportBulkComparisonId
    }, id, newValue);

    if (id === 'GrpFinYearFrom' && +this.props.fields.GrpFinYearFrom.Value === 1) {
      obj['GrpFinYearTo'] = newValue;
    }

    if (id === 'GrpFarmSizeFrom' && +this.props.fields.GrpFarmSizeFrom.Value === 1) {
      obj['GrpFarmSizeTo'] = newValue;
    }

    return obj;
  },
  _updateInput: function _updateInput(newValue, id) {
    var _newValue = newValue;

    var obj = this.checkFromTo(_newValue, id);

    return this.setState({
      requestFields: obj,
      requestPortalOpen: true
    });
  },
  _toggleRequestPortal: function _toggleRequestPortal() {
    this.setState({
      requestPortalOpen: !this.state.requestPortalOpen
    });
  },
  render: function render() {

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.onToggleFilterEditor }),
      _react2.default.createElement(
        'div',
        { className: _style2.default.col1 },
        _react2.default.createElement(
          'div',
          { className: _style2.default.group },
          this._renderSingleField('Name', 'Filter Name'),
          this._renderSingleField('Description', 'Description')
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.saveBtn, onClick: this.props.onToggleFilterEditor },
          'Save'
        )
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.col2 },
        _react2.default.createElement(
          'div',
          { className: _style2.default.group },
          _react2.default.createElement(
            'div',
            { className: _style2.default.headings },
            _react2.default.createElement(
              'h3',
              { className: _style2.default.title },
              'Industry Selection'
            ),
            _react2.default.createElement(
              'h3',
              { className: _style2.default.col },
              _react2.default.createElement(
                'div',
                { className: _style2.default.field },
                'Comparison Group'
              )
            )
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.fieldWrapper },
            _react2.default.createElement(
              'div',
              { className: _style2.default.label },
              _react2.default.createElement(_DescriptionLabel2.default, {
                label: this.props.fields['GrpCount'].Label,
                description: this.props.fields['GrpCount'].Description })
            ),
            _react2.default.createElement(
              'div',
              { className: _style2.default.col },
              _react2.default.createElement(
                'div',
                { className: _style2.default.field + ' ' + (this.props.fields.GrpCount.Value < 6 ? _style2.default.isError : '') },
                this.state.pendingCount > 0 ? _react2.default.createElement(
                  'span',
                  null,
                  'calculating...'
                ) : _react2.default.createElement(_OutputSimple2.default, { value: this.props.fields.GrpCount.Value })
              )
            )
          ),
          this._renderDoubleMultiField(['GrpDataSource'], 'Data Source'),
          this.renderIndustryField(),
          _react2.default.createElement('span', { id: 'test' }),
          this._renderDoubleField(['GrpAggregationMethod'], 'Aggregation Method'),
          this._renderDoubleField(['GrpStatistic'], 'Performance Group'),
          this._renderRegionTypeField(['GrpRegionType'], 'State or DFMP Region'),
          _react2.default.createElement(_RegionField2.default, {
            disabled: this.state.pendingCount > 0,
            emitUpdate: this._updateInput,
            fields: this.props.fields,
            typeValue: this.props.fields.GrpRegionType.Value,
            value: this.props.fields.GrpRegionSelect.Value }),
          this._renderFromToField([{
            from: 'GrpFarmSizeFrom',
            to: 'GrpFarmSizeTo'
          }], 'Farm Size - Million Litres'),
          this._renderFromToField([{
            from: 'GrpFinYearFrom',
            to: 'GrpFinYearTo'
          }], 'Financial Years'),
          this._renderDoubleField(['GrpIrrigation'], 'Irrigation Status'),
          this._renderDoubleField(['GrpGrazedFeed'], 'Grazed Feed Percentage'),
          this._renderDoubleField(['GrpConcentrate'], 'Grain Feeding Level'),
          this._renderDoubleField(['GrpCalvingPattern'], 'Calving Pattern')
        )
      ),
      this._renderRequestPortal()
    );
  },
  _renderRequestPortal: function _renderRequestPortal() {
    var _this = this;

    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.requestPortalOpen },
      _react2.default.createElement(_InvisibleRequestModal2.default, {
        onPending: function onPending() {
          return _this.setState({
            pendingCount: _this.state.pendingCount + 1
          });
        },
        onClearPending: function onClearPending() {
          return _this.setState({
            pendingCount: _this.state.pendingCount - 1
          });
        },
        successHandler: this._toggleRequestPortal,
        failHandler: this._toggleRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: 'UserReportBulkComparisons',
          Fields: this.state.requestFields
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        } })
    );
  },
  renderIndustryField: function renderIndustryField() {
    return !this.state.industryAuthorised ? null : this._renderDoubleMultiField(['GrpIndustryDataSelect'], 'Industry Data');
  },
  _renderSingleField: function _renderSingleField(fieldId, label) {
    var fieldValue = this.props.fields[fieldId].Value;
    var InputComponent = fieldId === 'Name' ? _TextInput2.default : _TextArea2.default;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.verticalField },
      _react2.default.createElement(
        'div',
        { className: _style2.default.label },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label,
          description: label })
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.field + ' ' + _style2.default.inCol1 },
        _react2.default.createElement(InputComponent, {
          id: fieldId,
          disabled: this.state.pendingCount > 0,
          value: fieldValue,
          onSubmit: this._updateInput })
      )
    );
  },
  _renderDoubleField: function _renderDoubleField(fieldIds, label) {
    var _this2 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: _style2.default.col, key: index },
        _react2.default.createElement(
          'div',
          { className: _style2.default.field },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            disabled: _this2.state.pendingCount > 0,
            value: _this2.props.fields[field].Value,
            options: _this2.props.fields[field].Options,
            onSubmit: _this2._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: _style2.default.fieldWrapper },
      _react2.default.createElement(
        'div',
        { className: _style2.default.label },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderDoubleMultiField: function _renderDoubleMultiField(fieldIds, label) {
    var _this3 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: _style2.default.col, key: index },
        _react2.default.createElement(
          'div',
          { className: _style2.default.field },
          _react2.default.createElement(_InputMultiSelect2.default, {
            id: field,
            disabled: _this3.state.pendingCount > 0,
            value: _this3.props.fields[field].Value,
            options: _this3.props.fields[field].Options,
            onSubmit: _this3._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: _style2.default.fieldWrapper },
      _react2.default.createElement(
        'div',
        { className: _style2.default.label },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderToField: function _renderToField(fields, index) {

    var fromValue = this.props.fields[fields.from];
    return fromValue < 2 ? null : _react2.default.createElement(
      'div',
      { className: _style2.default.to },
      _react2.default.createElement(
        'span',
        { className: _style2.default.text },
        ' - '
      ),
      _react2.default.createElement(_InputSelect2.default, {
        id: fields.to,
        disabled: this.state.pendingCount > 0,
        value: this.props.fields[fields.to].Value,
        options: this.props.fields[fields.to].Options,
        onSubmit: this._updateInput })
    );
  },
  _renderFromToField: function _renderFromToField(fieldIds, label) {
    var _this4 = this;

    var _cols = fieldIds.map(function (fields, index) {

      // fields: [[from, to], [from,to]]
      return _react2.default.createElement(
        'div',
        { className: _style2.default.col, key: index },
        _react2.default.createElement(
          'div',
          { className: _style2.default.from },
          _react2.default.createElement(_InputSelect2.default, {
            id: fields.from,
            disabled: _this4.state.pendingCount > 0,
            value: _this4.props.fields[fields.from].Value,
            options: _this4.props.fields[fields.from].Options,
            onSubmit: _this4._updateInput })
        ),
        _this4._renderToField(fields, index)
      );
    });

    var label = this.props.fields[fieldIds[0].from];

    return _react2.default.createElement(
      'div',
      { className: _style2.default.fieldWrapper },
      _react2.default.createElement(
        'div',
        { className: _style2.default.label },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderRegionTypeField: function _renderRegionTypeField(fieldIds, label) {
    var _this5 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: _style2.default.col, key: index },
        _react2.default.createElement(
          'div',
          { className: _style2.default.field },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            disabled: _this5.state.pendingCount > 0,
            value: _this5.props.fields[field].Value,
            options: _this5.props.fields[field].Options,
            onSubmit: _this5._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: _style2.default.fieldWrapper },
      _react2.default.createElement(
        'div',
        { className: _style2.default.label },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields, 'Fields', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/FilterEditorPortal/index.jsx');
}();

;

/***/ }),
/* 624 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

var _xchCheckBox = __webpack_require__(125);

var _xchCheckBox2 = _interopRequireDefault(_xchCheckBox);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _ConfirmationModal = __webpack_require__(109);

var _ConfirmationModal2 = _interopRequireDefault(_ConfirmationModal);

var _style = __webpack_require__(984);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FilterList = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      confirmPortal: false,
      filterToDelete: null
    };
  },
  _toggleConfirmPortal: function _toggleConfirmPortal(id) {
    return this.setState({
      confirmPortal: !this.state.confirmPortal,
      filterToDelete: id
    });
  },
  _handleDelete: function _handleDelete() {
    this.props.onDeleteFilter(this.state.filterToDelete);

    return this._toggleConfirmPortal(null);
  },
  render: function render() {
    var _this = this;

    var _props = this.props,
        filterList = _props.filterList,
        selectedFilters = _props.selectedFilters,
        onToggleEditPortal = _props.onToggleEditPortal,
        onSelectFilter = _props.onSelectFilter;


    var _orderedList = _.sortBy(filterList, 'UserReportBulkComparisonId');

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _orderedList.map(function (filter) {
        var UserReportBulkComparisonId = filter.UserReportBulkComparisonId,
            Name = filter.Name,
            GrpCount = filter.GrpCount;

        var isSelected = _.includes(selectedFilters, UserReportBulkComparisonId);

        return _react2.default.createElement(
          'div',
          { className: _style2.default.filter, key: UserReportBulkComparisonId },
          _react2.default.createElement(
            'div',
            {
              className: _style2.default.selectableArea + ' ' + (!isSelected ? '' : _style2.default.isSelected) },
            _react2.default.createElement(
              'div',
              { className: _style2.default.filterInfo },
              _react2.default.createElement(
                'div',
                { className: _style2.default.checkbox },
                _react2.default.createElement(_xchCheckBox2.default, {
                  value: isSelected,
                  onSubmit: function onSubmit() {
                    return onSelectFilter(UserReportBulkComparisonId);
                  }
                })
              ),
              _react2.default.createElement(
                'div',
                { className: _style2.default.filtertext },
                _react2.default.createElement(
                  'span',
                  { className: _style2.default.filtertextvalue },
                  Name.Value
                ),
                _react2.default.createElement(
                  'span',
                  {
                    className: _style2.default.count + ' ' + (GrpCount.Value < 6 ? _style2.default.error : '') },
                  'Dataset count: ',
                  GrpCount.Value
                )
              )
            ),
            _react2.default.createElement(
              'div',
              {
                className: _style2.default.editBtn,
                onClick: function onClick() {
                  return onToggleEditPortal(UserReportBulkComparisonId);
                } },
              _react2.default.createElement(_xchIcon2.default, { id: 'edit', classes: { icon: _style2.default.editIcon } })
            )
          ),
          _react2.default.createElement(
            'div',
            {
              className: _style2.default.deleteBtn,
              onClick: function onClick() {
                return _this._toggleConfirmPortal(UserReportBulkComparisonId);
              } },
            _react2.default.createElement(_xchIcon2.default, { id: 'close', classes: { icon: _style2.default.deleteIcon } })
          ),
          _react2.default.createElement(
            _Portal2.default,
            {
              context: document.body,
              isOpen: _this.state.confirmPortal,
              className: 'Overlay' },
            _react2.default.createElement(_ConfirmationModal2.default, {
              content: {
                title: 'Are you sure you want to delete?',
                text: 'Deleted filter cannot be restored. Be sure you really want to delete this filter.',
                btns: {
                  confirm: 'Delete',
                  cancel: 'Cancel'
                }
              },
              confirmHandler: _this._handleDelete,
              cancelHandler: function cancelHandler() {
                return _this._toggleConfirmPortal(null);
              }
            })
          )
        );
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FilterList, 'FilterList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_FilterList/index.jsx');
}();

;

/***/ }),
/* 625 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _index = __webpack_require__(1131);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDndCjs = __webpack_require__(84);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var ItemTypes = {
  CARD: 'card'
};

var cardSource = {
  beginDrag: function beginDrag(props) {
    return { id: props.id };
  },


  endDrag: function endDrag(props, monitor, component) {
    props.onDropCard();
  }
};

var cardTarget = {
  hover: function hover(props, monitor) {
    var draggedId = monitor.getItem().id;

    if (draggedId !== props.id) {
      props.moveCard(draggedId, props.id);
    }
  }
};

var Card = function (_Component) {
  _inherits(Card, _Component);

  function Card() {
    _classCallCheck(this, Card);

    return _possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).apply(this, arguments));
  }

  _createClass(Card, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          text = _props.text,
          isDragging = _props.isDragging,
          connectDragSource = _props.connectDragSource,
          connectDropTarget = _props.connectDropTarget,
          onDelete = _props.onDelete,
          DairyBaseId = _props.DairyBaseId,
          FinancialYear = _props.FinancialYear,
          Name = _props.Name;


      var opacity = isDragging ? 0 : 1;
      return connectDragSource(connectDropTarget(_react2.default.createElement(
        'div',
        {
          className: 'BulkComparison__ReportModalSelectedList__item',
          style: { cursor: 'move', opacity: opacity } },
        _react2.default.createElement(
          'div',
          { className: '_item' },
          _react2.default.createElement(
            'div',
            { className: '_text' },
            Name.Value
          ),
          _react2.default.createElement(
            'button',
            { className: '_delete', onClick: onDelete },
            _react2.default.createElement(_Icon2.default, { id: 'close', className: '_icon' })
          )
        )
      )));
    }
  }]);

  return Card;
}(_react.Component);

var _default = (0, _reactDndCjs.DropTarget)(ItemTypes.CARD, cardTarget, function (connect) {
  return {
    connectDropTarget: connect.dropTarget()
  };
})((0, _reactDndCjs.DragSource)(ItemTypes.CARD, cardSource, function (connect, monitor) {
  return {
    connectDragSource: connect.dragSource(),
    isDragging: monitor.isDragging()
  };
})(Card));

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ItemTypes, 'ItemTypes', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(cardSource, 'cardSource', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(cardTarget, 'cardTarget', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(Card, 'Card', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/Card/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 626 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _immutabilityHelper = __webpack_require__(243);

var _immutabilityHelper2 = _interopRequireDefault(_immutabilityHelper);

var _Card = __webpack_require__(625);

var _Card2 = _interopRequireDefault(_Card);

var _reactDndHtml5BackendCjs = __webpack_require__(250);

var _reactDndHtml5BackendCjs2 = _interopRequireDefault(_reactDndHtml5BackendCjs);

var _reactDndCjs = __webpack_require__(84);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var Container = function (_Component) {
  _inherits(Container, _Component);

  function Container(props) {
    _classCallCheck(this, Container);

    var _this = _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));

    _this.moveCard = _this.moveCard.bind(_this);
    _this.drawFrame = _this.drawFrame.bind(_this);
    _this.handleDelete = _this.handleDelete.bind(_this);
    _this.handleDropCard = _this.handleDropCard.bind(_this);

    var cardsById = {};
    var cardsByIndex = [];

    var loop = props.list.forEach(function (r, i) {
      var card = {
        id: r.Id,
        DairyBaseId: r.DairyBaseId,
        FinancialYear: r.FinancialYear,
        Name: r.Name
      };

      cardsById[r.Id] = card;
      cardsByIndex[i] = card;
    });

    _this.state = {
      cardsById: cardsById,
      cardsByIndex: cardsByIndex
    };
    return _this;
  }

  _createClass(Container, [{
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(newProps) {
      var _this2 = this;

      if (this.props.list.length !== newProps.list.length) {
        var cardsById = {};
        var cardsByIndex = [];

        var loop = newProps.list.forEach(function (r, i) {
          // if(i > 10) return;
          var card = {
            id: r.Id,
            DairyBaseId: r.DairyBaseId,
            FinancialYear: r.FinancialYear,
            Name: r.Name
          };

          cardsById[r.Id] = card;
          cardsByIndex[i] = card;
        });

        this.setState({
          cardsById: cardsById
        }, function () {
          return _this2.scheduleUpdate({
            cardsByIndex: {
              $set: cardsByIndex
            }
          });
        });
      }
    }
  }, {
    key: 'handleDelete',
    value: function handleDelete(index, id) {
      this.scheduleUpdate({
        cardsByIndex: {
          $splice: [[index, 1]]
        }
      });

      this.props.onDelete(id);
    }
  }, {
    key: 'handleDropCard',
    value: function handleDropCard() {
      var newState = this.state.cardsByIndex.map(function (card) {
        return card.id;
      });
      this.props.onReorder(newState);
    }
  }, {
    key: 'moveCard',
    value: function moveCard(id, afterId) {
      var _state = this.state,
          cardsById = _state.cardsById,
          cardsByIndex = _state.cardsByIndex;


      var card = cardsById[id];
      var afterCard = cardsById[afterId];

      var cardIndex = cardsByIndex.indexOf(card);
      var afterIndex = cardsByIndex.indexOf(afterCard);

      this.scheduleUpdate({
        cardsByIndex: {
          $splice: [[cardIndex, 1], [afterIndex, 0, card]]
        }
      });
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      cancelAnimationFrame(this.requestedFrame);
    }
  }, {
    key: 'scheduleUpdate',
    value: function scheduleUpdate(update) {
      this.pendingUpdate = update;

      if (!this.requestedFrame) {
        this.requestedFrame = requestAnimationFrame(this.drawFrame);
      }
    }
  }, {
    key: 'drawFrame',
    value: function drawFrame() {
      var nextState = (0, _immutabilityHelper2.default)(this.state, this.pendingUpdate);

      this.setState(nextState);

      this.pendingUpdate = null;
      this.requestedFrame = null;
    }
  }, {
    key: 'render',
    value: function render() {
      var _this3 = this;

      var cardsByIndex = this.state.cardsByIndex;

      return _react2.default.createElement(
        _reactDndCjs.DndProvider,
        { backend: _reactDndHtml5BackendCjs2.default },
        _react2.default.createElement(
          'div',
          null,
          cardsByIndex.map(function (card, index) {
            return _react2.default.createElement(_Card2.default, {
              key: card.id,
              id: card.id,
              DairyBaseId: card.DairyBaseId,
              FinancialYear: card.FinancialYear,
              Name: card.Name,
              moveCard: _this3.moveCard,
              onDropCard: function onDropCard() {
                return _this3.handleDropCard();
              },
              onDelete: function onDelete() {
                return _this3.handleDelete(index, card.id);
              }
            });
          })
        )
      );
    }
  }]);

  return Container;
}(_react.Component);

var _default = Container;
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Container, 'Container', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/index.jsx');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/DndList/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 627 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1132);

var _index2 = _interopRequireDefault(_index);

var _style2 = __webpack_require__(985);

var _style3 = _interopRequireDefault(_style2);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _DndList = __webpack_require__(626);

var _DndList2 = _interopRequireDefault(_DndList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SelectedList = module.exports = __webpack_require__(1)({
  _renderEmptySlots: function _renderEmptySlots() {
    return _react2.default.createElement(
      'div',
      { className: 'BulkComparison__ReportModalEmptyList' },
      _react2.default.createElement(
        'div',
        { className: '_item' },
        'Select Filter'
      )
    );
  },
  _renderSelectedList: function _renderSelectedList() {
    var _this = this;

    var selected = this.props.selected;

    var list = this.props.filterList.map(function (item) {
      return _extends({}, item, { Id: item.UserReportBulkComparisonId });
    }).filter(function (item) {
      return _.includes(selected, item.Id);
    });

    var selectedList = _.sortBy(list, function (item) {
      return _.indexOf(selected, item.Id);
    });

    if (selectedList.length === 0) return null;

    return _react2.default.createElement(
      'div',
      { className: 'BulkComparison__ReportModalSelectedList' },
      _react2.default.createElement(_DndList2.default, {
        list: selectedList,
        onReorder: function onReorder(arr) {
          return _this.props.reorder(arr);
        },
        onDelete: function onDelete(id) {
          return _this.props.emitRemoveFromSelected(id);
        } })
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style3.default["root"] },
      _react2.default.createElement(
        'div',
        { className: '_listContainer' },
        _react2.default.createElement(
          'h3',
          { className: '_title' },
          'Selected Filters:'
        ),
        this.props.selected.length < 1 ? this._renderEmptySlots() : this._renderSelectedList()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SelectedList, 'SelectedList', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/_SelectedList/index.jsx');
}();

;

/***/ }),
/* 628 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _xchIcon = __webpack_require__(15);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

var _FilterList = __webpack_require__(624);

var _FilterList2 = _interopRequireDefault(_FilterList);

var _FilterEditorPortal = __webpack_require__(623);

var _FilterEditorPortal2 = _interopRequireDefault(_FilterEditorPortal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _SelectedList = __webpack_require__(627);

var _SelectedList2 = _interopRequireDefault(_SelectedList);

var _reportFieldData = __webpack_require__(122);

var _reportFieldData2 = _interopRequireDefault(_reportFieldData);

var _POST__createData = __webpack_require__(189);

var _POST__createData2 = _interopRequireDefault(_POST__createData);

var _POST__deleteData = __webpack_require__(190);

var _POST__deleteData2 = _interopRequireDefault(_POST__deleteData);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _style = __webpack_require__(986);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Filter = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Reports',
    fields: _reportFieldData2.default
  }])],

  getInitialState: function getInitialState() {
    var selectedRatio = this.props.selectedRatio;

    return {
      createRequestPortalOpen: false,
      deleteRequestPortalOpen: false,
      deletedId: null,
      editingFilter: null,

      filterRequestPortalOpen: false,
      requestFields: _defineProperty({}, selectedRatio.FieldId, selectedRatio.Value)
    };
  },
  _updateInput: function _updateInput(newValue, id) {
    // this.props.emitFilterChange()

    _Actions2.default.OPTIMISICALLY_UPDATE_USER_PREFERENCE({
      "Element": id,
      "Value": newValue
    });

    this.setState({
      requestFields: _defineProperty({}, id, newValue),
      filterRequestPortalOpen: true
    });
  },
  _toggleFilterRequestPortal: function _toggleFilterRequestPortal() {
    this.setState({
      filterRequestPortalOpen: !this.state.filterRequestPortalOpen
    });
  },
  _renderRequestPortal: function _renderRequestPortal() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.filterRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._toggleFilterRequestPortal,
        failHandler: this._toggleFilterRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: 'UserPreference',
          Data: [{
            Fields: this.state.requestFields
          }]
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        } })
    );
  },
  componentDidMount: function componentDidMount() {
    this.validateSelectedFilters();
  },
  componentWillUpdate: function componentWillUpdate(newProps, newState) {
    var UserReportBulkComparisons = this.state.UserReportBulkComparisons;


    var oldIds = _.map(UserReportBulkComparisons, 'UserReportBulkComparisonId');
    var newIds = _.map(newState.UserReportBulkComparisons, 'UserReportBulkComparisonId');

    var newId = _.difference(newIds, oldIds)[0];

    if (typeof newId !== 'undefined') {
      return this._toggleFilterEditor(newId);
    }
  },
  validateSelectedFilters: function validateSelectedFilters() {
    var _props = this.props,
        selectedFilters = _props.selectedFilters,
        emitChangeFilters = _props.emitChangeFilters;
    var UserReportBulkComparisons = this.state.UserReportBulkComparisons;


    var existingFilters = _.map(UserReportBulkComparisons, 'UserReportBulkComparisonId');
    var validSelectedFilters = _.intersection(selectedFilters, existingFilters);

    return emitChangeFilters(validSelectedFilters);
  },
  _handleCreateFilter: function _handleCreateFilter() {
    return this.setState({
      createRequestPortalOpen: true
    });
  },
  _reorderSelected: function _reorderSelected(newList) {
    this.props.emitChangeFilters(newList);
  },
  _handleDeleteFilter: function _handleDeleteFilter(id) {
    var _this = this;

    return this.setState({
      deletedId: id,
      deleteRequestPortalOpen: true
    }, function () {
      var _props2 = _this.props,
          selectedFilters = _props2.selectedFilters,
          emitChangeFilters = _props2.emitChangeFilters;


      var newList = _.difference(selectedFilters, [id]);
      return emitChangeFilters(newList);
    });
  },
  _handleSelectFilter: function _handleSelectFilter(id) {
    var _props3 = this.props,
        selectedFilters = _props3.selectedFilters,
        emitChangeFilters = _props3.emitChangeFilters;


    var newList = [];

    if (_.includes(selectedFilters, id)) {
      newList = _.difference(selectedFilters, [id]);
      return emitChangeFilters(newList);
    }

    newList = _.union(selectedFilters, [id]);
    return emitChangeFilters(newList);
  },
  _toggleFilterEditor: function _toggleFilterEditor(id) {
    return this.setState({ editingFilter: id });
  },
  onClick: function onClick() {
    this.props.emitGenerateReport();
  },
  _toggleRequestPortal: function _toggleRequestPortal(portalKey) {
    return this.setState(_defineProperty({}, portalKey, !this.state[portalKey]));
  },
  render: function render() {
    var _this2 = this;

    var _state = this.state,
        UserReportBulkComparisons = _state.UserReportBulkComparisons,
        editingFilter = _state.editingFilter,
        requestFields = _state.requestFields;
    var _props4 = this.props,
        selectedDatasets = _props4.selectedDatasets,
        selectedFilters = _props4.selectedFilters,
        selectedRatio = _props4.selectedRatio;

    var disableReport = selectedDatasets.length === 0 && selectedFilters.length === 0;
    var editingFilterObj = _.find(UserReportBulkComparisons, { UserReportBulkComparisonId: editingFilter }) || {};

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.header },
        _react2.default.createElement(
          'div',
          { className: _style2.default.header_item },
          _react2.default.createElement(
            'button',
            {
              className: _style2.default.createBtn,
              onClick: this._handleCreateFilter },
            _react2.default.createElement(
              'div',
              { className: _style2.default.buttonWrapper },
              _react2.default.createElement(_xchIcon2.default, { id: 'plus', classes: { icon: _style2.default.plusIcon } }),
              'Add another filter'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.header_item },
          _react2.default.createElement(
            'div',
            { className: _style2.default.kpi },
            this._renderRequestPortal(),
            _react2.default.createElement(
              'div',
              { className: 'ReportFilter2__singleField' },
              _react2.default.createElement(
                'div',
                { className: '_label' },
                _react2.default.createElement(_DescriptionLabel2.default, {
                  label: 'Finance Ratio',
                  description: selectedRatio.Description })
              ),
              _react2.default.createElement(
                'div',
                { className: '_ratioField' },
                _react2.default.createElement(_InputSelect2.default, {
                  id: selectedRatio.FieldId,
                  value: requestFields[selectedRatio.FieldId],
                  options: selectedRatio.Options,
                  onSubmit: this._updateInput })
              )
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.header_item },
          _react2.default.createElement(
            'button',
            {
              className: _style2.default.generateBtn + ' ' + (disableReport ? _style2.default.disabled : ''),
              onClick: this.onClick },
            'Generate Report'
          )
        ),
        _react2.default.createElement(_SelectedList2.default, {
          filterList: UserReportBulkComparisons,
          selected: selectedFilters,
          emitRemoveFromSelected: this._handleSelectFilter,
          reorder: this._reorderSelected })
      ),
      _react2.default.createElement(_FilterList2.default, {
        filterList: UserReportBulkComparisons,
        selectedFilters: selectedFilters,
        onSelectFilter: this._handleSelectFilter,
        onToggleEditPortal: this._toggleFilterEditor,
        onDeleteFilter: this._handleDeleteFilter }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: editingFilter !== null,
          className: 'Overlay' },
        _react2.default.createElement(_FilterEditorPortal2.default, {
          fields: editingFilterObj,
          onToggleFilterEditor: function onToggleFilterEditor() {
            return _this2._toggleFilterEditor(null);
          } })
      ),
      this._renderCreateRequestPortal(),
      this._renderDeleteRequestPortal()
    );
  },
  _renderCreateRequestPortal: function _renderCreateRequestPortal() {
    var _this3 = this;

    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.createRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: function successHandler() {
          return _this3._toggleRequestPortal('createRequestPortalOpen');
        },
        failHandler: function failHandler() {
          return _this3._toggleRequestPortal('createRequestPortalOpen');
        },
        request: _POST__createData2.default,
        data: {
          Table: 'UserReportBulkComparisons',
          Fields: {}
        },
        pendingText: {
          title: 'Please wait',
          text: 'Creating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was created.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be created.'
        } })
    );
  },
  _renderDeleteRequestPortal: function _renderDeleteRequestPortal() {
    var _this4 = this;

    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.deleteRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: function successHandler() {
          return _this4._toggleRequestPortal('deleteRequestPortalOpen');
        },
        failHandler: function failHandler() {
          return _this4._toggleRequestPortal('deleteRequestPortalOpen');
        },
        request: _POST__deleteData2.default,
        data: {
          Table: 'UserReportBulkComparisons',
          RowId: this.state.deletedId
        },
        pendingText: {
          title: 'Please wait',
          text: 'Deleting filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was deleted.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be deleted.'
        } })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter, 'Filter', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Filter/index.jsx');
}();

;

/***/ }),
/* 629 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1133);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartHeader = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_user2.default, '_handleUserUpdate')],

  getInitialState: function getInitialState() {
    return {
      ratio: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleUserUpdate();
  },
  componentDidMount: function componentDidMount() {
    this._onHeadingHeightChange();
  },
  _handleUserUpdate: function _handleUserUpdate() {
    var ratio = _user2.default.store['BulkComparisonFinanceRatioId'] || {};

    this.setState({
      ratio: _.find(ratio.Options, { Id: ratio.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var _this = this;

    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    }, function () {
      _this._onHeadingHeightChange();
    });
  },
  _onHeadingHeightChange: function _onHeadingHeightChange() {
    var _this2 = this;

    setTimeout(function () {
      var headingHeight = _this2.TableHeader.offsetHeight;
      _this2.props.emitHeadingHeightChange(headingHeight);
    }, 0);
  },
  _onClick: function _onClick() {
    if (this.props.isPrinting) return;
    this.props.emitToggleMenu(this._onHeadingHeightChange);
  },
  render: function render() {
    var _this3 = this;

    var BulkReportHeaderTemplate = (0, _classnames2.default)({
      BulkReportHeaderTemplate: true,
      'menu-open': this.props.menuOpen,
      isPrinting: this.props.isPrinting,
      isSplit: this.props.isSplit
    });
    return _react2.default.createElement(
      'div',
      {
        className: BulkReportHeaderTemplate,
        ref: function ref(_ref) {
          return _this3.TableHeader = _ref;
        } },
      _react2.default.createElement(
        'div',
        { className: 'Legend__Header' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._onClick },
          this.props.menuOpen ? 'collapse' : 'expand'
        ),
        this.renderRation()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__content' },
        this.props.children
      )
    );
  },
  renderRation: function renderRation() {
    return this.props.ratio ? _react2.default.createElement(
      'div',
      { className: '_ratio', key: 1 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        ' Selected Financial Ratio: '
      ),
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this.state.ratio
      )
    ) : _react2.default.createElement(
      'div',
      { className: '_ratio', key: 2 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        'Report Detail'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartHeader, 'ChartHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Report/ReportHeaderTemplate/index.jsx');
}();

;

/***/ }),
/* 630 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1134);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _ReportHeaderTemplate = __webpack_require__(163);

var _ReportHeaderTemplate2 = _interopRequireDefault(_ReportHeaderTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      this._renderTabs()
    );
  },
  _renderTabs: function _renderTabs() {
    var _this = this;

    return this.props.printTabs.map(function (tab, index) {
      var TabHeader = tab.handlers.header;
      var TabBody = tab.handlers.body;
      var shutMenu = index > 0 && index < 5;

      return _react2.default.createElement(
        'div',
        { key: tab.id, className: 'ComparisonReport__printTab' },
        _react2.default.createElement(
          'div',
          { className: '_header' },
          _react2.default.createElement(
            'h1',
            { className: 'PrintableReport__title' },
            tab.title
          ),
          _react2.default.createElement(
            'div',
            {
              className: 'PrintLogo ' + (tab.id === 'cash' ? ' __smol__ ' : ' ') },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' })
          )
        ),
        _react2.default.createElement(TabBody, _extends({}, _this.props, { activeTab: tab, isPrinting: true })),
        _this._renderPageBreak(index, _this.props.tabs.length)
      );
    });
  },
  _renderPageBreak: function _renderPageBreak(index, length) {
    return index + 1 >= length ? null : _react2.default.createElement('div', { className: 'page-break' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Report/_PrintModal/index.jsx');
}();

;

/***/ }),
/* 631 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1136);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ReportTemplate = __webpack_require__(112);

var _ReportTemplate2 = _interopRequireDefault(_ReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport__Report = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      menuOpen: true,
      headingHeight: 38
    };
  },
  _setHeadingHeight: function _setHeadingHeight(newHeight) {
    this.setState({
      headingHeight: newHeight
    });
  },
  _toggleMenuOpen: function _toggleMenuOpen(callback) {
    this.setState({
      menuOpen: !this.state.menuOpen
    }, callback);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_ReportTemplate2.default, {
        reportId: 5,
        dynamicHeader: true,
        ratio: true,
        selectedDatasets: this.props.selectedDatasets,
        selectedFilters: this.props.selectedFilters,
        emitResetScroll: this.props.emitResetScroll,
        bannerDOMRef: this.props.bannerDOMRef,
        emitToggleMenu: this._toggleMenuOpen,
        emitHeadingHeightChange: this._setHeadingHeight,
        headingHeight: this.state.headingHeight,
        menuOpen: this.state.menuOpen,
        printModalhandler: __webpack_require__(630),
        tabs: [{
          id: 'summary',
          title: 'Summary Table',
          table: 'SummaryTable',
          handlers: {
            header: __webpack_require__(110),
            body: __webpack_require__(131)
          }
        }, {
          id: 'physical',
          title: 'Physical Table',
          table: 'PhysicalTable',
          handlers: {
            header: __webpack_require__(110),
            body: __webpack_require__(131)
          }
        }, {
          id: 'cash',
          title: 'Cash Table',
          table: 'CashTable',
          handlers: {
            header: __webpack_require__(110),
            body: __webpack_require__(131)
          }
        }, {
          id: 'profit',
          title: 'Profit Table',
          table: 'ProfitTable',
          handlers: {
            header: __webpack_require__(110),
            body: __webpack_require__(131)
          }
        }, {
          id: 'wealth',
          title: 'Wealth Table',
          table: 'WealthTable',
          handlers: {
            header: __webpack_require__(110),
            body: __webpack_require__(131)
          }
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport__Report, 'ComparisonReport__Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/_Report/index.jsx');
}();

;

/***/ }),
/* 632 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(987);

var _style2 = _interopRequireDefault(_style);

var _BulkReportTemplate = __webpack_require__(617);

var _BulkReportTemplate2 = _interopRequireDefault(_BulkReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var BulkComparisonReport = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(_BulkReportTemplate2.default, {
        reportId: 5,
        prefillDatasetIds: this.props.prefillDatasetIds,
        bannerDOMRef: this.props.bannerDOMRef,
        emitResetScroll: this.props.emitResetScroll,
        steps: [{
          id: 'datasets',
          title: 'Datasets',
          handler: __webpack_require__(621)
        }, {
          id: 'filter',
          title: 'Group Filters',
          handler: __webpack_require__(628)
        }, {
          id: 'report',
          title: 'Report',
          handler: __webpack_require__(631)
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(BulkComparisonReport, 'BulkComparisonReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_BulkComparisonReport/index.jsx');
}();

;

/***/ }),
/* 633 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fields__RegionField = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields['Grp1RegionSelect'].Label,
          description: this.props.fields['Grp1RegionSelect'].Description })
      ),
      this._renderCols()
    );
  },
  _renderCols: function _renderCols() {
    var _this = this;

    return ['Grp1RegionSelect', 'Grp2RegionSelect'].map(function (field, index) {
      var regionField = index === 0 ? 'Grp1RegionType' : 'Grp2RegionType';
      var options = _.find(_dataDefinition2.default.selectOptions.ReportRegionGroupId, { Id: _this.props.fields[regionField].Value }).Options;

      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            value: _this.props.fields[field].Value,
            options: options,
            onSubmit: _this.props.emitUpdate })
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields__RegionField, 'Fields__RegionField', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Filter/_Fields/_RegionField/index.jsx');
}();

;

/***/ }),
/* 634 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1137);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _InputMultiSelect = __webpack_require__(204);

var _InputMultiSelect2 = _interopRequireDefault(_InputMultiSelect);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _user = __webpack_require__(29);

var _user2 = _interopRequireDefault(_user);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _OutputSimple = __webpack_require__(36);

var _OutputSimple2 = _interopRequireDefault(_OutputSimple);

var _RegionField = __webpack_require__(633);

var _RegionField2 = _interopRequireDefault(_RegionField);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Fields = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_user2.default, "_handleNewData")],

  getInitialState: function getInitialState() {
    return {
      industryAuthorised: _user2.default.industryDataProvider || _user2.default.userAuthority <= 1,
      filterRequestPortalOpen: false,
      requestFields: undefined
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleNewData();
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      industryAuthorised: _user2.default.industryDataProvider || _user2.default.userAuthority <= 1
    });
  },
  _updateInput: function _updateInput(newValue, id) {
    this.props.emitFilterChange();
    var obj = this.checkFromTo(newValue, id);

    this.setState({
      requestFields: obj,
      filterRequestPortalOpen: true
    });
  },
  checkFromTo: function checkFromTo(newValue, id) {

    var obj = _defineProperty({}, id, newValue);

    if (id === 'Grp1FinYearFrom' && +this.props.fields.Grp1FinYearFrom.Value === 1) {
      obj['Grp1FinYearTo'] = newValue;
    }

    if (id === 'Grp2FinYearFrom' && +this.props.fields.Grp2FinYearFrom.Value === 1) {
      obj['Grp2FinYearTo'] = newValue;
    }

    if (id === 'Grp1FarmSizeFrom' && +this.props.fields.Grp1FarmSizeFrom.Value === 1) {
      obj['Grp1FarmSizeTo'] = newValue;
    }

    if (id === 'Grp2FarmSizeFrom' && +this.props.fields.Grp2FarmSizeFrom.Value === 1) {
      obj['Grp2FarmSizeTo'] = newValue;
    }

    return obj;
  },
  _toggleFilterRequestPortal: function _toggleFilterRequestPortal() {
    this.setState({
      filterRequestPortalOpen: !this.state.filterRequestPortalOpen
    });
  },
  render: function render() {

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2' },
      _react2.default.createElement(
        'div',
        { className: '_col1' },
        _react2.default.createElement(
          'div',
          { className: 'ReportFilter2__group' },
          _react2.default.createElement(
            'h3',
            { className: '_title' },
            'KPIs'
          ),
          this._renderSingleField('FinanceRatio', 'Financial Ratio')
        ),
        _react2.default.createElement(
          'div',
          { className: 'ReportFilter2__group' },
          _react2.default.createElement(
            'h3',
            { className: '_title' },
            'Chart Filter'
          ),
          this._renderSingleField('FinChartFilter', 'Chart Data Filter'),
          this._renderSingleField('FinChartAxis', 'Chart X Axis')
        )
      ),
      _react2.default.createElement(
        'div',
        { className: '_col2' },
        _react2.default.createElement(
          'div',
          { className: 'ReportFilter2__group' },
          _react2.default.createElement(
            'div',
            { className: '_colHeadings' },
            _react2.default.createElement(
              'h3',
              { className: '_title' },
              'Industry Selection'
            ),
            _react2.default.createElement(
              'h3',
              { className: '_col' },
              'Comparison Group 1'
            ),
            _react2.default.createElement(
              'h3',
              { className: '_col' },
              'Comparison Group 2'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: 'ReportFilter2__doubleField' },
            _react2.default.createElement(
              'div',
              { className: '_label' },
              _react2.default.createElement(_DescriptionLabel2.default, {
                label: this.props.fields['Grp1Count'].Label,
                description: this.props.fields['Grp1Count'].Description })
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: (0, _classnames2.default)({
                    '_field': true,
                    'is-error': this.props.fields['Grp1Count'].Value < 6
                  }) },
                _react2.default.createElement(_OutputSimple2.default, { value: this.props.fields['Grp1Count'].Value })
              )
            ),
            _react2.default.createElement(
              'div',
              { className: '_col' },
              _react2.default.createElement(
                'div',
                { className: (0, _classnames2.default)({
                    '_field': true,
                    'is-error': this.props.fields['Grp2Count'].Value < 6
                  }) },
                _react2.default.createElement(_OutputSimple2.default, { value: this.props.fields['Grp2Count'].Value })
              )
            )
          ),
          this._renderDoubleMultiField(['Grp1DataSource', 'Grp2DataSource'], 'Data Source'),
          this.renderIndustryField(),
          _react2.default.createElement('span', { id: 'test' }),
          this._renderDoubleField(['Grp1AggregationMethod', 'Grp2AggregationMethod'], 'Aggregation Method'),
          this._renderDoubleField(['Grp1Statistic', 'Grp2Statistic'], 'Performance Group'),
          this._renderRegionTypeField(['Grp1RegionType', 'Grp2RegionType'], 'State or DFMP Region'),
          _react2.default.createElement(_RegionField2.default, {
            emitUpdate: this._updateInput,
            fields: this.props.fields }),
          this._renderFromToField([{
            from: 'Grp1FarmSizeFrom',
            to: 'Grp1FarmSizeTo'
          }, {
            from: 'Grp2FarmSizeFrom',
            to: 'Grp2FarmSizeTo'
          }], 'Farm Size - Million Litres'),
          this._renderFromToField([{
            from: 'Grp1FinYearFrom',
            to: 'Grp1FinYearTo'
          }, {
            from: 'Grp2FinYearFrom',
            to: 'Grp2FinYearTo'
          }], 'Financial Years'),
          this._renderDoubleField(['Grp1Irrigation', 'Grp2Irrigation'], 'Irrigation Status'),
          this._renderDoubleField(['Grp1GrazedFeed', 'Grp2GrazedFeed'], 'Grazed Feed Percentage'),
          this._renderDoubleField(['Grp1Concentrate', 'Grp2Concentrate'], 'Grain Feeding Level'),
          this._renderDoubleField(['Grp1CalvingPattern', 'Grp2CalvingPattern'], 'Calving Pattern')
        )
      ),
      this._renderRequestPortal()
    );
  },
  renderIndustryField: function renderIndustryField() {
    return !this.state.industryAuthorised ? null : this._renderDoubleMultiField(['Grp1IndustryDataSelect', 'Grp2IndustryDataSelect'], 'Industry Data');
  },
  _renderRequestPortal: function _renderRequestPortal() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.filterRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._toggleFilterRequestPortal,
        failHandler: this._toggleFilterRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: 'UserReportComparisons',
          Fields: this.state.requestFields
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        } })
    );
  },
  _renderSingleField: function _renderSingleField(fieldId, label) {
    var field = this.props.fields[fieldId];
    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__singleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: field.Label,
          description: field.Description })
      ),
      _react2.default.createElement(
        'div',
        { className: '_field' },
        _react2.default.createElement(_InputSelect2.default, {
          id: fieldId,
          value: field.Value,
          options: field.Options,
          onSubmit: this._updateInput })
      )
    );
  },
  _renderDoubleField: function _renderDoubleField(fieldIds, label) {
    var _this = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            value: _this.props.fields[field].Value,
            options: _this.props.fields[field].Options,
            onSubmit: _this._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderDoubleMultiField: function _renderDoubleMultiField(fieldIds, label) {
    var _this2 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputMultiSelect2.default, {
            id: field,
            value: _this2.props.fields[field].Value,
            options: _this2.props.fields[field].Options,
            onSubmit: _this2._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderToField: function _renderToField(fields, index) {

    var fromValue = this.props.fields[fields.from].Value;
    return fromValue < 2 ? null : _react2.default.createElement(
      'div',
      { className: '_to' },
      _react2.default.createElement(
        'span',
        { className: '_text' },
        ' - '
      ),
      _react2.default.createElement(_InputSelect2.default, {
        id: fields.to,
        value: this.props.fields[fields.to].Value,
        options: this.props.fields[fields.to].Options,
        onSubmit: this._updateInput })
    );
  },
  _renderFromToField: function _renderFromToField(fieldIds, label) {
    var _this3 = this;

    var _cols = fieldIds.map(function (fields, index) {

      // fields: [[from, to], [from,to]]
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_from' },
          _react2.default.createElement(_InputSelect2.default, {
            id: fields.from,
            value: _this3.props.fields[fields.from].Value,
            options: _this3.props.fields[fields.from].Options,
            onSubmit: _this3._updateInput })
        ),
        _this3._renderToField(fields, index)
      );
    });

    var label = this.props.fields[fieldIds[0].from];

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__fromToField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  },
  _renderRegionTypeField: function _renderRegionTypeField(fieldIds, label) {
    var _this4 = this;

    var _cols = fieldIds.map(function (field, index) {
      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            value: _this4.props.fields[field].Value,
            options: _this4.props.fields[field].Options,
            onSubmit: _this4._updateInput })
        )
      );
    });

    var label = this.props.fields[fieldIds[0]];

    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: label.Label,
          description: label.Description })
      ),
      _cols
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields, 'Fields', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Filter/_Fields/index.jsx');
}();

;

/***/ }),
/* 635 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1138);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _Fields = __webpack_require__(634);

var _Fields2 = _interopRequireDefault(_Fields);

var _reportFieldData = __webpack_require__(122);

var _reportFieldData2 = _interopRequireDefault(_reportFieldData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Reports',
    fields: _reportFieldData2.default
  }])],

  onClick: function onClick() {
    this.props.emitGenerateReport();
  },
  render: function render() {

    return _react2.default.createElement(
      'div',
      { className: 'ReportModalFilter' },
      _react2.default.createElement(
        'button',
        {
          className: 'ReportStepTemplate__GenerateBtn',
          onClick: this.onClick },
        'Generate Report'
      ),
      _react2.default.createElement(_Fields2.default, {
        emitFilterChange: this.props.emitFilterChange,
        fields: this.state.UserReportComparisons[0] })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter, 'Filter', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Filter/index.jsx');
}();

;

/***/ }),
/* 636 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1139);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _Chart = __webpack_require__(205);

var _Chart2 = _interopRequireDefault(_Chart);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartItem = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      portalOpen: false
    };
  },
  togglePortal: function togglePortal() {
    this.setState({
      portalOpen: !this.state.portalOpen
    });
  },
  render: function render() {
    var Legend = this.props.activeTab.handlers.header;
    return typeof this.props.chart === 'undefined' ? null : _react2.default.createElement(
      'div',
      { className: 'ChartItem' },
      this.renderChart(false),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.portalOpen,
          className: "ChartItemPortal" },
        _react2.default.createElement(
          'div',
          { className: 'ChartItemPortal__content' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.togglePortal }),
          _react2.default.createElement(
            'div',
            { className: 'ChartItem__legend' },
            _react2.default.createElement(Legend, this.props)
          ),
          this.renderChart(true)
        )
      )
    );
  },
  renderChart: function renderChart(modal) {
    var ComparisonChartAxis = _reportFilters2.default.store.UserReportComparisons[0].FinChartAxis;
    var _chartAxisIndex = ComparisonChartAxis.Value - 1;
    var _chartAxis = ComparisonChartAxis.Options[_chartAxisIndex];
    return _react2.default.createElement(
      'div',
      { className: 'ChartItem__chart' },
      _react2.default.createElement(
        'div',
        { className: '_heading' },
        _react2.default.createElement(
          'h2',
          { className: '_title' },
          _react2.default.createElement(_DescriptionLabel2.default, {
            label: this.props.chart.Title,
            description: this.props.chart.Description }),
          _react2.default.createElement(
            'span',
            { className: '_unit' },
            this.props.chart.Unit
          )
        ),
        this.renderModalBtn(modal),
        _react2.default.createElement(
          'div',
          { className: '_axis' },
          this._renderAxisTitle(_chartAxis, modal)
        )
      ),
      _react2.default.createElement(_Chart2.default, {
        id: this.props.chartKey,
        data: this.props.chart,
        width: '100%',
        height: modal ? '400px' : this.props.chartHeight,
        preventUpdate: true,
        datasetList: this.props.selectedDatasets,
        emitLoaded: modal ? function () {
          return null;
        } : this.props.emitLoadNextChart })
    );
  },
  _renderAxisTitle: function _renderAxisTitle(_chartAxis, modal) {
    if (!modal) return null;
    return this.props.activeTab.id === 'SummaryCharts' ? null : _react2.default.createElement(
      'div',
      { className: '_xAxis' },
      _chartAxis.Title
    );
  },
  renderModalBtn: function renderModalBtn(modal) {
    return modal ? null : _react2.default.createElement(
      'button',
      { className: '_btn', onClick: this.togglePortal },
      'expand'
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartItem, 'ChartItem', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_ChartGrid/ChartItem/index.jsx');
}();

;

/***/ }),
/* 637 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _PopupButton = __webpack_require__(153);

var _PopupButton2 = _interopRequireDefault(_PopupButton);

var _hexToRgb2 = __webpack_require__(149);

var _hexToRgb3 = _interopRequireDefault(_hexToRgb2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_container' },
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'Comparison Groups:'
        ),
        this.renderComparisonGroups()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'User Selected Datasets:'
        ),
        this.renderUserDatasets()
      )
    );
  },
  renderComparisonGroups: function renderComparisonGroups() {
    var _this = this;

    var stingifiedNumbers = ['First', 'Second', 'Third', 'Fourth'];
    var legend = _dataDefinition2.default.chartSettings[4].JsonSetting.graphs;
    var comparisonGroups = legend.slice(0, 2);
    return _.map(comparisonGroups, function (dataset, index) {
      var shape = dataset.bullet;
      var color = (0, _hexToRgb3.default)(dataset.bulletColor);
      var id = dataset.id;
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        backgroundColor: 'rgba(' + color.rgb + ', ' + 0.2 + ')',
        border: '1px solid ' + dataset.bulletColor,
        width: 10,
        display: 'inline-block',
        height: 10,
        marginRight: 5
      };
      return _react2.default.createElement(
        'div',
        { key: index, className: 'Legend__unit' },
        _react2.default.createElement('span', { style: spanStyle }),
        _react2.default.createElement(
          'span',
          null,
          index === 0 ? _this.state.group1 : _this.state.group2
        )
      );
    });
  },
  renderUserDatasets: function renderUserDatasets() {
    var _this2 = this;

    var legend = _dataDefinition2.default.chartSettings[4].JsonSetting.graphs;
    var userSelectedDatasets = legend.slice(2);
    return _.map(userSelectedDatasets, function (dataset, index) {
      var datasetList = _this2.props.selectedDatasets;
      if (index + 1 > datasetList.length) return null;

      var shape = dataset.bullet;
      var color = (0, _hexToRgb3.default)(dataset.bulletColor);
      var id = dataset.id;
      var datasetDetail = _.find(_datasetList2.default.store, { Id: datasetList[index] });
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        border: '2px solid ' + dataset.bulletColor,
        backgroundColor: 'rgba(' + color.rgb + ', ' + 0.1 + ')',
        width: 15,
        display: 'inline-block',
        height: 15,
        marginRight: 5,
        opacity: 0.8
      };
      return _react2.default.createElement(
        _PopupButton2.default,
        {
          key: index,
          description: datasetDetail.Name + '\n            <br/>\n            ' + datasetDetail.DairyBaseId + ' \u2014 ' + datasetDetail.FinancialYear + '\n            <br/>' },
        _react2.default.createElement(
          'div',
          { key: index, className: 'Legend__unit' },
          _react2.default.createElement('span', { style: spanStyle }),
          _react2.default.createElement(
            'span',
            null,
            datasetDetail.Name
          )
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_KpiHeader/index.jsx');
}();

;

/***/ }),
/* 638 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1142);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _ReportHeaderTemplate = __webpack_require__(163);

var _ReportHeaderTemplate2 = _interopRequireDefault(_ReportHeaderTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      this._renderTabs()
    );
  },
  _renderTabs: function _renderTabs() {
    var _this = this;

    return this.props.printTabs.map(function (tab, index) {
      var TabHeader = tab.handlers.header;
      var TabBody = tab.handlers.body;
      var shutMenu = index > 0 && index < 5;

      return _react2.default.createElement(
        'div',
        { key: tab.id, className: 'ComparisonReport__printTab' },
        _react2.default.createElement(
          'div',
          { className: '_header' },
          _react2.default.createElement(
            'h1',
            { className: 'PrintableReport__title' },
            tab.title
          ),
          _react2.default.createElement(
            'div',
            {
              className: 'PrintLogo ' + (tab.id === 'cash' ? ' __smol__ ' : ' ') },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' })
          )
        ),
        _this.props.dynamicHeader ? _react2.default.createElement(
          _ReportHeaderTemplate2.default,
          _this.props,
          _react2.default.createElement(TabHeader, _extends({}, _this.props, {
            activeTab: tab,
            forceMenuShut: shutMenu,
            isPrinting: true
          }))
        ) : _react2.default.createElement(TabHeader, _extends({}, _this.props, {
          activeTab: tab,
          forceMenuShut: shutMenu,
          isPrinting: true
        })),
        _react2.default.createElement(TabBody, _extends({}, _this.props, { activeTab: tab, isPrinting: true })),
        _this._renderPageBreak(index, _this.props.tabs.length)
      );
    });
  },
  _renderPageBreak: function _renderPageBreak(index, length) {
    return index + 1 >= length ? null : _react2.default.createElement('div', { className: 'page-break' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/_PrintModal/index.jsx');
}();

;

/***/ }),
/* 639 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1144);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ReportTemplate = __webpack_require__(112);

var _ReportTemplate2 = _interopRequireDefault(_ReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport__Report = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      menuOpen: true,
      headingHeight: 38
    };
  },
  _setHeadingHeight: function _setHeadingHeight(newHeight) {
    this.setState({
      headingHeight: newHeight
    });
  },
  _toggleMenuOpen: function _toggleMenuOpen(callback) {
    this.setState({
      menuOpen: !this.state.menuOpen
    }, callback);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_ReportTemplate2.default, {
        reportId: 2,
        dynamicHeader: true,
        ratio: true,
        chartTabCount: 3,
        selectedDatasets: this.props.selectedDatasets,
        emitResetScroll: this.props.emitResetScroll,
        bannerDOMRef: this.props.bannerDOMRef,
        emitToggleMenu: this._toggleMenuOpen,
        emitHeadingHeightChange: this._setHeadingHeight,
        headingHeight: this.state.headingHeight,
        menuOpen: this.state.menuOpen,
        printModalhandler: __webpack_require__(638),
        tabs: [{
          id: 'summary',
          title: 'Summary Table',
          table: 'SummaryTable',
          handlers: {
            header: __webpack_require__(132),
            body: __webpack_require__(133)
          }
        }, {
          id: 'physical',
          title: 'Physical Table',
          table: 'PhysicalTable',
          handlers: {
            header: __webpack_require__(132),
            body: __webpack_require__(133)
          }
        }, {
          id: 'cash',
          title: 'Cash Table',
          table: 'CashTable',
          handlers: {
            header: __webpack_require__(132),
            body: __webpack_require__(133)
          }
        }, {
          id: 'profit',
          title: 'Profit Table',
          table: 'ProfitTable',
          handlers: {
            header: __webpack_require__(132),
            body: __webpack_require__(133)
          }
        }, {
          id: 'wealth',
          title: 'Wealth Table',
          table: 'WealthTable',
          handlers: {
            header: __webpack_require__(132),
            body: __webpack_require__(133)
          }
        }, {
          id: 'profitCharts',
          title: 'Profit Charts',
          settingsId: 10,
          chartList: ['MilkIncomePerKgMs', 'OtherIncomePerKgMs', 'VariableCostPerKgMs', 'OverheadCostPerKgMs', 'OperatingCostPerKgMs', 'EBITPerKgMs', 'LeaseCostPerKgMs', 'InterestCostPerKgMs'],
          handlers: {
            header: __webpack_require__(293),
            body: __webpack_require__(209)
          }
        }, {
          id: 'wealthCharts',
          title: 'Wealth Charts',
          settingsId: 11,
          chartList: ['LeaseRate', 'InterestRate', 'TotalAssetsManagedPerKgMs', 'ReturnOnTotalAssets', 'OwnedAssetsPerKgMs', 'ReturnOnOwnedAssets', 'EquityPerKgMs', 'ReturnOnEquity'],
          handlers: {
            header: __webpack_require__(293),
            body: __webpack_require__(209)
          }
        }, {
          id: 'SummaryCharts',
          title: 'Summary Charts',
          settingsId: 12,
          chartList: ['KpiCowNumber', 'KpiHomegrownFeedPercent', 'KpiExpenseTotalPeoplePerKgMs', 'KpiExpenseFarmWorkingPerKgMs', 'KpiOperatingCostPerKgMs', 'KpiEBITPerKgMs', 'KpiReturnOnTotalAssets', 'KpiEquityPercent'],
          handlers: {
            header: __webpack_require__(637),
            body: __webpack_require__(209)
          }
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport__Report, 'ComparisonReport__Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/_Report/index.jsx');
}();

;

/***/ }),
/* 640 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1145);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ComparisonReportTemplate = __webpack_require__(213);

var _ComparisonReportTemplate2 = _interopRequireDefault(_ComparisonReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ComparisonReport' },
      _react2.default.createElement(_ComparisonReportTemplate2.default, {
        reportId: 2,
        prefillDatasetIds: this.props.prefillDatasetIds,
        bannerDOMRef: this.props.bannerDOMRef,
        emitResetScroll: this.props.emitResetScroll,
        steps: [{
          id: 'datasets',
          title: 'Datasets',
          handler: __webpack_require__(212)
        }, {
          id: 'filter',
          title: 'Filter',
          handler: __webpack_require__(635)
        }, {
          id: 'report',
          title: 'Report',
          handler: __webpack_require__(639)
        }] })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport, 'ComparisonReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_ComparisonReport/index.jsx');
}();

;

/***/ }),
/* 641 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1146);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportStepTemplate = __webpack_require__(164);

var _ReportStepTemplate2 = _interopRequireDefault(_ReportStepTemplate);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__generateReport = __webpack_require__(146);

var _POST__generateReport2 = _interopRequireDefault(_POST__generateReport);

var _Actions = __webpack_require__(4);

var _Actions2 = _interopRequireDefault(_Actions);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportFilters2.default, '_handleReportFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      ratioField: {},
      reportRequestPortalOpen: false,
      reportLoaded: false,
      approvedStep: 1
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportFilterUpdate();
  },
  _handleReportFilterUpdate: function _handleReportFilterUpdate() {
    var store = _reportFilters2.default.store.UserReportFarmClients || {};
    var financeRatios = store[0] || {};
    this.setState({
      ratioField: financeRatios['FinanceRatioId'] || {}
    });
  },
  _toggleReportRequestPortal: function _toggleReportRequestPortal() {
    this.setState({
      reportRequestPortalOpen: !this.state.reportRequestPortalOpen
    });
  },
  _handleGenerateSuccess: function _handleGenerateSuccess() {
    return this._toggleReportRequestPortal();
  },
  _handleLoadReportSuccess: function _handleLoadReportSuccess() {
    var _this = this;

    this.setState({
      reportLoaded: true,
      approvedStep: 2
    }, function () {
      _this._toggleReportRequestPortal();
      _this.setState({
        reportLoaded: false
      });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ComparisonReport' },
      _react2.default.createElement(_ReportStepTemplate2.default, {
        initialStepId: 'farm',
        emitResetScroll: this.props.emitResetScroll,
        approvedStep: this.state.approvedStep,
        reportLoaded: this.state.reportLoaded,
        selectedDatasets: [],
        selectedFilters: [],
        emitGenerateReport: this._toggleReportRequestPortal,
        bannerDOMRef: this.props.bannerDOMRef,
        steps: this.props.steps,
        selectedRatio: this.state.ratioField
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.reportRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleLoadReportSuccess,
          failHandler: this._toggleReportRequestPortal,
          request: _POST__generateReport2.default,
          data: {
            ReportId: 6,
            FarmDataSetList: [],
            GroupFilterList: []
          },
          pendingText: {
            title: 'Please wait',
            text: 'Generating Report'
          },
          successText: {
            title: 'Success!',
            text: 'Report generated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Your report could not be generated.'
          }
        })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport, 'ComparisonReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_DFMPFarmClientReportTemplate/index.jsx');
}();

;

/***/ }),
/* 642 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _reportFieldData = __webpack_require__(122);

var _reportFieldData2 = _interopRequireDefault(_reportFieldData);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _style = __webpack_require__(988);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Filter = module.exports = __webpack_require__(1)({
  mixins: [(0, _dataMixin2.default)([{
    store: 'Reports',
    fields: _reportFieldData2.default
  }])],

  getInitialState: function getInitialState() {
    var selectedRatio = this.props.selectedRatio;

    return {
      filterRequestPortalOpen: false,
      requestFields: _defineProperty({}, selectedRatio.FieldId, selectedRatio.Value)
    };
  },
  _updateInput: function _updateInput(newValue, id) {
    // this.props.emitFilterChange()

    this.setState({
      requestFields: _defineProperty({}, id, newValue),
      filterRequestPortalOpen: true
    });
  },
  _toggleFilterRequestPortal: function _toggleFilterRequestPortal() {
    this.setState({
      filterRequestPortalOpen: !this.state.filterRequestPortalOpen
    });
  },
  _renderRequestPortal: function _renderRequestPortal() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.filterRequestPortalOpen },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._toggleFilterRequestPortal,
        failHandler: this._toggleFilterRequestPortal,
        request: _POST__editData2.default,
        data: {
          Table: 'UserReportFarmClients',
          Fields: this.state.requestFields
        },
        pendingText: {
          title: 'Please wait',
          text: 'Updating filter...'
        },
        successText: {
          title: 'Success!',
          text: 'Filter was updated.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The filter could not be updated.'
        }
      })
    );
  },
  onClick: function onClick() {
    this.props.emitGenerateReport();
  },
  _toggleRequestPortal: function _toggleRequestPortal(portalKey) {
    return this.setState(_defineProperty({}, portalKey, !this.state[portalKey]));
  },
  render: function render() {
    var _this = this;

    var UserReportFarmClients = this.state.UserReportFarmClients;
    var _UserReportFarmClient = UserReportFarmClients[0],
        DairyBaseId = _UserReportFarmClient.DairyBaseId,
        DataSourceId = _UserReportFarmClient.DataSourceId,
        FinanceRatioId = _UserReportFarmClient.FinanceRatioId,
        FinancialYearId = _UserReportFarmClient.FinancialYearId;


    var filteredOptionList = DairyBaseId.Options.filter(function (r) {
      return r.Id !== 1;
    });
    var filteredYearList = FinancialYearId.Options.filter(function (r) {
      return r.Id !== 1;
    });

    var DairyBaseIdOption = _.find(filteredOptionList, { Title: DairyBaseId.Value }) || filteredOptionList[0] || {};
    var DairyBaseIdValue = DairyBaseIdOption.Id;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      this._renderRequestPortal(),
      _react2.default.createElement(
        'div',
        { className: _style2.default.header },
        _react2.default.createElement(
          'div',
          { className: _style2.default.header_item },
          _react2.default.createElement(
            'div',
            { className: _style2.default.kpi },
            _react2.default.createElement(
              'div',
              { className: 'ReportFilter2__singleField' },
              _react2.default.createElement(
                'div',
                { className: '_label' },
                _react2.default.createElement(_DescriptionLabel2.default, {
                  label: 'Farm Business Id',
                  description: DairyBaseId.Description
                })
              ),
              _react2.default.createElement(
                'div',
                { className: '_ratioField' },
                _react2.default.createElement(_InputSelect2.default, {
                  id: DairyBaseId.FieldId,
                  value: DairyBaseIdValue,
                  options: filteredOptionList,
                  onSubmit: function onSubmit(newValue, id) {
                    return _this._updateInput(_.find(DairyBaseId.Options, { Id: newValue }).Title, id);
                  }
                })
              )
            )
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.kpi },
            _react2.default.createElement(
              'div',
              { className: 'ReportFilter2__singleField' },
              _react2.default.createElement(
                'div',
                { className: '_label' },
                _react2.default.createElement(_DescriptionLabel2.default, {
                  label: 'Financial Year',
                  description: FinancialYearId.Description
                })
              ),
              _react2.default.createElement(
                'div',
                { className: '_ratioField' },
                _react2.default.createElement(_InputSelect2.default, {
                  id: FinancialYearId.FieldId,
                  value: FinancialYearId.Value,
                  options: filteredYearList,
                  onSubmit: this._updateInput
                })
              )
            )
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.kpi },
            _react2.default.createElement(
              'div',
              { className: 'ReportFilter2__singleField' },
              _react2.default.createElement(
                'div',
                { className: '_label' },
                _react2.default.createElement(_DescriptionLabel2.default, {
                  label: 'Data Source',
                  description: DataSourceId.Description
                })
              ),
              _react2.default.createElement(
                'div',
                { className: '_ratioField' },
                _react2.default.createElement(_InputSelect2.default, {
                  id: DataSourceId.FieldId,
                  value: DataSourceId.Value,
                  options: DataSourceId.Options,
                  onSubmit: this._updateInput
                })
              )
            )
          ),
          _react2.default.createElement(
            'div',
            { className: _style2.default.kpi },
            _react2.default.createElement(
              'div',
              { className: 'ReportFilter2__singleField' },
              _react2.default.createElement(
                'div',
                { className: '_label' },
                _react2.default.createElement(_DescriptionLabel2.default, {
                  label: FinanceRatioId.Label,
                  description: FinanceRatioId.Description
                })
              ),
              _react2.default.createElement(
                'div',
                { className: '_ratioField' },
                _react2.default.createElement(_InputSelect2.default, {
                  id: FinanceRatioId.FieldId,
                  value: FinanceRatioId.Value,
                  options: FinanceRatioId.Options,
                  onSubmit: this._updateInput
                })
              )
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.header_item },
          _react2.default.createElement(
            'button',
            { className: '' + _style2.default.generateBtn, onClick: this.onClick },
            'Generate Report'
          )
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter, 'Filter', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Farm/index.jsx');
}();

;

/***/ }),
/* 643 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1148);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _CalculatedHeader = __webpack_require__(294);

var _CalculatedHeader2 = _interopRequireDefault(_CalculatedHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartHeader = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      ratio: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  componentDidMount: function componentDidMount() {
    this._onHeadingHeightChange();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportFarmClients[0];
    var ratio = filters.FinanceRatioId;
    this.setState({
      ratio: _.find(ratio.Options, { Id: ratio.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var _this = this;

    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    }, function () {
      _this._onHeadingHeightChange();
    });
  },
  _onHeadingHeightChange: function _onHeadingHeightChange() {
    var _this2 = this;

    setTimeout(function () {
      var headingHeight = _this2.TableHeader.offsetHeight;
      _this2.props.emitHeadingHeightChange(headingHeight);
    }, 0);
  },
  _onClick: function _onClick() {
    if (this.props.isPrinting) return;
    this.props.emitToggleMenu(this._onHeadingHeightChange);
  },
  render: function render() {
    var _this3 = this;

    var SingleHeaderTemplate = (0, _classnames2.default)({
      SingleHeaderTemplate: true,
      'menu-open': this.props.menuOpen,
      isPrinting: this.props.isPrinting
    });
    return _react2.default.createElement(
      'div',
      {
        className: SingleHeaderTemplate,
        ref: function ref(_ref) {
          return _this3.TableHeader = _ref;
        } },
      _react2.default.createElement(
        'div',
        { className: 'Legend__content' },
        _react2.default.createElement(_CalculatedHeader2.default, this.props)
      )
    );
  },
  renderRation: function renderRation() {
    return this.props.ratio ? _react2.default.createElement(
      'div',
      { className: '_ratio', key: 1 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        ' Selected Financial Ratio: '
      ),
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this.state.ratio
      )
    ) : _react2.default.createElement(
      'div',
      { className: '_ratio', key: 2 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        'Report Detail'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartHeader, 'ChartHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/SingleHeaderTemplate/index.jsx');
}();

;

/***/ }),
/* 644 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(989);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  calculateStep: function calculateStep(range) {
    if (range === 0) return 0;
    if (range === 1) return 1;

    if (range % 2 === 0) {
      var _factor = _.ceil(range / 2);

      if (_factor <= 10) return 2;
      if (_factor <= 20) return 4;
      if (_factor <= 30) return 6;
      if (_factor <= 40) return 8;

      return 10;
    }

    if (range % 3 === 0) {
      var _factor2 = _.ceil(range / 3);

      if (_factor2 <= 10) return 3;
      if (_factor2 <= 20) return 6;
      if (_factor2 <= 30) return 9;

      return 10;
    }

    if (range % 5 === 0) {
      var _factor3 = _.ceil(range / 5);

      if (_factor3 <= 10) return 5;

      return 10;
    }

    if (range % 7 === 0) {
      var _factor4 = _.ceil(range / 7);

      if (_factor4 <= 10) return 7;

      return 10;
    }

    var factor = _.ceil(range / 2);

    if (factor <= 10) return 2;
    if (factor <= 20) return 4;
    if (factor <= 30) return 6;
    if (factor <= 40) return 8;

    return 10;
  },
  render: function render() {
    var _props = this.props,
        axisMin = _props.axisMin,
        axisRange = _props.axisRange;

    var step = this.calculateStep(axisRange);

    var hasRange = axisRange !== 0;

    var zeroLine = hasRange ? (1 - Math.abs(axisMin) / axisRange) * 100 : 80;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      hasRange && _react2.default.createElement(
        'div',
        { className: _style2.default.area },
        this.renderAxis(step)
      ),
      _react2.default.createElement('div', {
        className: _style2.default.line,
        style: {
          top: zeroLine + '%'
        }
      }),
      _react2.default.createElement(
        'span',
        {
          className: _style2.default.tag,
          style: {
            top: zeroLine + '%'
          } },
        '0.0'
      )
    );
  },
  renderAxis: function renderAxis(step) {
    var _props2 = this.props,
        axisMax = _props2.axisMax,
        axisMin = _props2.axisMin,
        axisRange = _props2.axisRange;


    var axisNums = _.range(axisMin, axisMax, step).concat([axisMax]);

    return axisNums.map(function (tag) {
      if (tag === 0) return null;

      var percentage = (1 - (tag - axisMin) / axisRange) * 100;

      return _react2.default.createElement(
        'span',
        {
          key: tag,
          className: _style2.default.tag,
          style: {
            top: percentage + '%'
          } },
        tag.toFixed(1)
      );
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Charts/Axis/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 645 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _lodash = __webpack_require__(118);

var _lodash2 = _interopRequireDefault(_lodash);

var _UnitText = __webpack_require__(111);

var _UnitText2 = _interopRequireDefault(_UnitText);

var _HoverBox = __webpack_require__(656);

var _HoverBox2 = _interopRequireDefault(_HoverBox);

var _style = __webpack_require__(990);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var _props = this.props,
        data = _props.data,
        posSum = _props.posSum,
        negSum = _props.negSum,
        axisMax = _props.axisMax,
        axisRange = _props.axisRange,
        themeColor = _props.themeColor,
        TitleAttachment = _props.TitleAttachment;


    var netVal = posSum + negSum;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.areas },
        this.renderFields()
      ),
      netVal !== 0 && _react2.default.createElement('div', {
        className: _style2.default.line,
        style: {
          top: (axisMax - netVal) / axisRange * 350 + 'px',
          borderColor: themeColor
        }
      }),
      typeof TitleAttachment === 'undefined' ? _react2.default.createElement(
        'h2',
        { className: _style2.default.title },
        this.props.title
      ) : _react2.default.createElement(
        'div',
        { className: _style2.default.titleWrapper },
        _react2.default.createElement(
          'h2',
          { className: _style2.default.title },
          this.props.title
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.attachment },
          _react2.default.createElement(TitleAttachment, null)
        )
      ),
      _react2.default.createElement(_UnitText2.default, {
        classes: {
          unit: _style2.default.unit
        },
        unit: 'Net CO2e'
      }),
      _react2.default.createElement(
        'h2',
        { className: _style2.default.num, style: { color: themeColor } },
        netVal.toFixed(1),
        ' kg / kg MS'
      )
    );
  },
  renderFields: function renderFields() {
    var _props2 = this.props,
        data = _props2.data,
        posSum = _props2.posSum,
        valueKey = _props2.valueKey,
        axisMax = _props2.axisMax,
        axisRange = _props2.axisRange,
        hoverPos = _props2.hoverPos;


    var yOffset = (axisMax - posSum) / axisRange * 350;

    return data.map(function (dataRec) {
      var key = dataRec.key,
          Color = dataRec.Color;


      var value = dataRec[valueKey];

      var validValue = value != null && value !== 0;

      var segmentStyles = {
        height: Math.abs(value) / axisRange * 350 + 'px',
        backgroundColor: Color,
        transform: 'translateY(' + yOffset + 'px)'
      };

      return validValue && _react2.default.createElement(
        'div',
        { key: key, style: segmentStyles, className: _style2.default.segment },
        validValue && _react2.default.createElement(
          'div',
          {
            className: _style2.default.box,
            style: {
              left: hoverPos !== 'left' ? '130px' : '-330px'
            } },
          _react2.default.createElement(_HoverBox2.default, { hoverItem: dataRec })
        )
      );
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Charts/Chart/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 646 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _UnitText = __webpack_require__(111);

var _UnitText2 = _interopRequireDefault(_UnitText);

var _style = __webpack_require__(991);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.positiveArea },
        this.renderLabels()
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.item },
        _react2.default.createElement('div', { className: _style2.default.thisFarm }),
        _react2.default.createElement(
          'h3',
          { className: _style2.default.title },
          _react2.default.createElement(_UnitText2.default, {
            classes: { unit: _style2.default.title },
            unit: 'This Farm Net CO2e'
          })
        )
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.item },
        _react2.default.createElement('div', { className: _style2.default.baseline }),
        _react2.default.createElement(
          'h3',
          { className: _style2.default.title },
          _react2.default.createElement(_UnitText2.default, {
            classes: { unit: _style2.default.title },
            unit: 'Industry Average Net CO2e'
          })
        )
      )
    );
  },
  renderLabels: function renderLabels() {
    var _props = this.props,
        data = _props.data,
        Labels = _props.Labels;


    return data.map(function (r, i) {
      var Label = r.title;

      var blockStyle = {
        backgroundColor: r.color
      };

      return _react2.default.createElement(
        'div',
        { key: i, className: _style2.default.item },
        _react2.default.createElement('div', { style: blockStyle, className: _style2.default.block }),
        _react2.default.createElement(
          'h3',
          { className: _style2.default.title },
          Label
        )
      );
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Charts/Legend/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 647 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _lodash = __webpack_require__(118);

var _lodash2 = _interopRequireDefault(_lodash);

var _Chart = __webpack_require__(645);

var _Chart2 = _interopRequireDefault(_Chart);

var _Legend = __webpack_require__(646);

var _Legend2 = _interopRequireDefault(_Legend);

var _Axis = __webpack_require__(644);

var _Axis2 = _interopRequireDefault(_Axis);

var _HelpPortal = __webpack_require__(296);

var _HelpPortal2 = _interopRequireDefault(_HelpPortal);

var _reportData = __webpack_require__(210);

var _style = __webpack_require__(992);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
// import { connect } from 'react-redux'

var _default = __webpack_require__(1)({
  render: function render() {
    var CarbonTable = this.props.CarbonTable;


    var Record = CarbonTable;
    var dividerRecord = Record.MilkSolidsKgFarmTotal || {};
    var factorRecord = Record.MilkSolidsKgTypicalFarmTotal || {};

    var divider = dividerRecord.Value || 1;
    var factor = factorRecord.Value || 1;

    var chartData = _reportData.__chartData.reduce(function (__obj, data) {
      var col7 = Record[data.col7] || {};
      var col8 = Record[data.col8] || {};
      var col9 = Record[data.col9] || {};
      var col10 = Record[data.col10] || {};

      var value = col7.Value * 1000 / divider;
      var avgValue = col9.Value;

      __obj.data.push({
        key: data.title,
        tonnes: col7.Value,
        avgTonnes: col9.Value * factor / 1000,
        value: value,
        avgValue: avgValue,
        percentage: col8.Value,
        avgPercentage: col10.Value,
        Color: data.color,
        Title: data.title
      });

      if (value > 0) __obj.posSum += value;
      if (value < 0) __obj.negSum += value;

      if (avgValue > 0) __obj.posAvgSum += avgValue;
      if (avgValue < 0) __obj.negAvgSum += avgValue;

      return __obj;
    }, {
      data: [],
      posSum: 0,
      negSum: 0,
      posAvgSum: 0,
      negAvgSum: 0
    });

    var axisMax = _lodash2.default.ceil(_lodash2.default.max([chartData.posSum, chartData.posAvgSum]));
    var axisMin = _lodash2.default.floor(_lodash2.default.min([chartData.negSum, chartData.negAvgSum]));

    var axisRange = axisMax + Math.abs(axisMin);

    var industryHelpText = 'The Industry Average is based on the average of 41 dairy farms from throughout Australia that participated in the Accounting4Nutrients project. This work was published and [a link to the paper can be found here](http://dx.doi.org/10.1071/AN16286)';

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.axis },
        _react2.default.createElement(_Axis2.default, { axisMax: axisMax, axisMin: axisMin, axisRange: axisRange })
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.chart },
        _react2.default.createElement(_Chart2.default, {
          title: 'This Farm',
          data: chartData.data,
          posSum: chartData.posSum,
          negSum: chartData.negSum,
          valueKey: 'value',
          axisMax: axisMax,
          axisRange: axisRange,
          themeColor: '#B10004',
          hoverPos: 'left'
        })
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.chart },
        _react2.default.createElement(_Chart2.default, {
          title: 'Industry Average',
          data: chartData.data,
          posSum: chartData.posAvgSum,
          negSum: chartData.negAvgSum,
          valueKey: 'avgValue',
          axisMax: axisMax,
          axisRange: axisRange,
          themeColor: '#0A5AB2',
          hoverPos: 'right',
          TitleAttachment: function TitleAttachment() {
            return _react2.default.createElement(_HelpPortal2.default, { text: industryHelpText });
          }
        })
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.legend },
        _react2.default.createElement(_Legend2.default, { data: [].concat(_toConsumableArray(_reportData.__chartData)) })
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Charts/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 648 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reactRouter = __webpack_require__(185);

var _Modal = __webpack_require__(297);

var _Modal2 = _interopRequireDefault(_Modal);

var _reportData3 = __webpack_require__(210);

var _style = __webpack_require__(993);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// import { connect } from 'react-redux'
function getMissingInputs(props) {
  var Record = props.CarbonTable;

  var missingInputs = _reportData3.__data.reduce(function (__arr, row) {
    if (row.total) return __arr;

    var noData = ['col1', 'col2', 'col3', 'col4', 'col6', 'col7', 'col8'].reduce(function (__bool, col) {
      var FieldKey = row[col];

      if (typeof FieldKey === 'undefined') return __bool;

      var value = Record[FieldKey];

      return __bool && value == null;
    }, true);

    if (!noData) return __arr;

    __arr.push(row);
    return __arr;
  }, []);

  return missingInputs;
}

var _default = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      portalOpen: false
    };
  },
  componentDidMount: function componentDidMount() {
    return this.setState({
      portalOpen: getMissingInputs(this.props).length !== 0
    });
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (getMissingInputs(this.props) === 0 && getMissingInputs(newProps).length !== 0) {
      return this.setState({ portalOpen: true });
    }
  },
  togglePortal: function togglePortal() {
    return this.setState({ portalOpen: !this.state.portalOpen });
  },
  closePortal: function closePortal() {
    return this.setState({ portalOpen: false });
  },
  render: function render() {
    var missingInputs = getMissingInputs(this.props);
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      missingInputs.length === 0 ? null : _react2.default.createElement(
        'button',
        { className: _style2.default.button, onClick: this.togglePortal },
        'Data errors!'
      ),
      this.renderModal(missingInputs)
    );
  },
  renderModal: function renderModal(missingInputs) {
    return _react2.default.createElement(
      _Modal2.default,
      {
        classes: { modal: _style2.default.modal },
        isOpen: this.state.portalOpen,
        onTogglePortal: this.closePortal },
      _react2.default.createElement(
        'div',
        { className: _style2.default.root },
        _react2.default.createElement(
          'span',
          { className: _style2.default.title },
          'GHG emissions cannot be calculated because the following inputs have no data:'
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.list },
          missingInputs.map(function (input, index) {
            // href={`/dbcc/#/editor`}
            return _react2.default.createElement(
              'div',
              { className: _style2.default.linkWrapper },
              _react2.default.createElement(
                'span',
                { key: index, className: _style2.default.link },
                input.title
              )
            );
          })
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(getMissingInputs, 'getMissingInputs', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/DataMissingPortal/index.jsx');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/DataMissingPortal/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 649 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _UnitText = __webpack_require__(111);

var _UnitText2 = _interopRequireDefault(_UnitText);

var _HelpPortal = __webpack_require__(296);

var _HelpPortal2 = _interopRequireDefault(_HelpPortal);

var _style = __webpack_require__(994);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var _props = this.props,
        Input = _props.Input,
        backUnit = _props.backUnit;
    var _props2 = this.props,
        CarbonTable = _props2.CarbonTable,
        FieldKey = _props2.FieldKey;

    var Cell = CarbonTable[FieldKey] || {};
    var Decimal = Cell.Decimal,
        Description = Cell.Description,
        Dynamic = Cell.Dynamic,
        FieldId = Cell.FieldId,
        Label = Cell.Label,
        Percent = Cell.Percent,
        Text = Cell.Text,
        Unit = Cell.Unit,
        Value = Cell.Value;


    var hasLabel = typeof Label === 'string' && Label.length !== 0;

    var helpText = 'Typical emissions intensity should be around 0.8 to 1.3 kg CO2e / kg FPCM or between 10 and 18 CO2e / kg MS.\n\nIf your figures are vastly different to this, check your data entry for errors.\n\nFat and protein-corrected milk (FPCM) standardises all milk to 4.0% fat and 3.3% protein to allow comparison between farms with different breeds or feed regimes. The equation aligns to that reported by the International Dairy Federation “A common carbon footprint approach for the dairy sector” report and is: FPCM (kg/yr) = Production (kg/yr) x (0.1226xFat% + 0.776xProtein% + 0.2534)';

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      hasLabel ? _react2.default.createElement(
        'h2',
        { className: _style2.default.label },
        Label
      ) : _react2.default.createElement(
        'div',
        { className: _style2.default.help },
        _react2.default.createElement(_HelpPortal2.default, { text: helpText })
      ),
      this.renderUnit(),
      _react2.default.createElement(
        'div',
        { className: _style2.default.input },
        _react2.default.createElement(Input, _extends({}, this.props, {
          classes: { root: _style2.default.number },
          decimal: Decimal,
          percent: Percent,
          backUnit: Percent ? '%' : backUnit
        }))
      )
    );
  },
  renderUnit: function renderUnit() {
    var unit = this.props.unit;


    return !unit ? null : _react2.default.createElement(_UnitText2.default, { unit: unit, classes: { unit: _style2.default.unit } });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Info/GHGOutput/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 650 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _UnitText = __webpack_require__(111);

var _UnitText2 = _interopRequireDefault(_UnitText);

var _style = __webpack_require__(995);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var _props = this.props,
        CarbonTable = _props.CarbonTable,
        FieldKey = _props.FieldKey;

    var Cell = CarbonTable[FieldKey] || {};
    var Value = Cell.Value,
        Label = Cell.Label;


    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'h2',
        { className: _style2.default.label },
        Label
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.output },
        _react2.default.createElement(
          'span',
          null,
          Value
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Info/OutputField/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 651 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ConnectedField = __webpack_require__(295);

var _ConnectedField2 = _interopRequireDefault(_ConnectedField);

var _xchNumberField = __webpack_require__(299);

var _xchNumberField2 = _interopRequireDefault(_xchNumberField);

var _OutputField = __webpack_require__(650);

var _OutputField2 = _interopRequireDefault(_OutputField);

var _GHGOutput = __webpack_require__(649);

var _GHGOutput2 = _interopRequireDefault(_GHGOutput);

var _style = __webpack_require__(996);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      this.renderInfoFields(),
      this.renderCalculationFields()
    );
  },
  renderInfoFields: function renderInfoFields() {
    var CarbonTable = this.props.CarbonTable;


    return _react2.default.createElement(
      'div',
      { className: _style2.default.info },
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'DairyBaseId',
        TableKey: 'List',
        Component: _OutputField2.default
      }),
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'StateId',
        TableKey: 'Calculation',
        Component: _OutputField2.default
      }),
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'RegionId',
        TableKey: 'Calculation',
        Component: _OutputField2.default
      }),
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'FinancialYear',
        TableKey: 'List',
        Component: _OutputField2.default
      }),
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'Name',
        TableKey: 'List',
        Component: _OutputField2.default
      }),
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'Description',
        TableKey: 'List',
        Component: _OutputField2.default
      })
    );
  },
  renderCalculationFields: function renderCalculationFields() {
    var CarbonTable = this.props.CarbonTable;


    return _react2.default.createElement(
      'div',
      { className: _style2.default.calculation },
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'CooFarmTotalKgPerStdKgFcpm',
        TableKey: 'Calculation',
        Component: _GHGOutput2.default,
        Input: _xchNumberField2.default,
        unit: 'kg CO2e / kg FPCM'
      }),
      _react2.default.createElement(_ConnectedField2.default, {
        CarbonTable: CarbonTable,
        FieldKey: 'CooFarmTotalKgPerKgMilksolids',
        TableKey: 'Calculation',
        Component: _GHGOutput2.default,
        Input: _xchNumberField2.default,
        unit: 'kg CO2e / kg MS'
      })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Info/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 652 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchNumberField = __webpack_require__(299);

var _xchNumberField2 = _interopRequireDefault(_xchNumberField);

var _style = __webpack_require__(997);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var _props = this.props,
        fieldProps = _props.fieldProps,
        backUnit = _props.backUnit;
    var _props2 = this.props,
        CarbonTable = _props2.CarbonTable,
        FieldKey = _props2.FieldKey;

    var Cell = CarbonTable[FieldKey] || {};
    var Decimal = Cell.Decimal,
        Description = Cell.Description,
        Dynamic = Cell.Dynamic,
        FieldId = Cell.FieldId,
        Label = Cell.Label,
        Percent = Cell.Percent,
        Text = Cell.Text,
        Unit = Cell.Unit,
        Value = Cell.Value;


    return _react2.default.createElement(_xchNumberField2.default, _extends({}, this.props, {
      decimal: Decimal,
      percent: Percent,
      backUnit: Percent ? '%' : backUnit
    }));
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Table/Field/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 653 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames3 = __webpack_require__(7);

var _classnames4 = _interopRequireDefault(_classnames3);

var _ConnectedField = __webpack_require__(295);

var _ConnectedField2 = _interopRequireDefault(_ConnectedField);

var _Field = __webpack_require__(652);

var _Field2 = _interopRequireDefault(_Field);

var _UnitText = __webpack_require__(111);

var _UnitText2 = _interopRequireDefault(_UnitText);

var _reportData = __webpack_require__(210);

var _style = __webpack_require__(998);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _default = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      this.renderHeader(),
      this.renderRows()
    );
  },
  renderHeader: function renderHeader() {
    var headerCols = _reportData.__headerLabels.map(function (label, i) {
      return _react2.default.createElement(
        'div',
        {
          key: i,
          className: (0, _classnames4.default)(_style2.default.headerCol, _defineProperty({}, _style2.default.multiLine, label.Unit || label.SecondLine)) },
        label.Title,
        label.SecondLine && _react2.default.createElement(
          'span',
          null,
          label.SecondLine
        ),
        label.Unit && _react2.default.createElement(_UnitText2.default, { unit: label.Unit, classes: { unit: _style2.default.unit } })
      );
    });

    return _react2.default.createElement(
      'div',
      { key: 'header', className: _style2.default.row },
      _react2.default.createElement('div', { className: _style2.default.labels }),
      _react2.default.createElement(
        'div',
        { className: _style2.default.cols },
        headerCols
      )
    );
  },
  renderRows: function renderRows() {
    var _this = this;

    return _reportData.__data.map(function (row, i) {
      return _react2.default.createElement(
        'div',
        {
          key: i,
          className: (0, _classnames4.default)(_style2.default.row, _defineProperty({}, _style2.default.total, row.total)) },
        _react2.default.createElement(
          'div',
          { className: _style2.default.labels },
          _this.renderCategory(row),
          _this.renderTitle(row)
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.cols },
          _this.renderCols(row)
        )
      );
    });
  },
  renderCategory: function renderCategory(row) {
    if (row.total) return null;
    var category = row.category;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.category },
      category
    );
  },
  renderTitle: function renderTitle(row) {
    var title = row.title;

    return _react2.default.createElement(
      'div',
      { className: _style2.default.title },
      title
    );
  },
  renderCols: function renderCols(row) {
    var CarbonTable = this.props.CarbonTable;


    return ['col1', 'col2', 'col3', 'col4', 'col6', 'col7', 'col8'].map(function (key) {
      var FieldKey = row[key];
      var classes = _style2.default.field + ' ' + _style2.default[key];
      return typeof FieldKey === 'undefined' ? _react2.default.createElement('div', { key: key, className: classes }) : _react2.default.createElement(
        'div',
        { key: key, className: classes },
        _react2.default.createElement(_ConnectedField2.default, {
          CarbonTable: CarbonTable,
          FieldKey: FieldKey,
          TableKey: 'Calculation',
          Component: _Field2.default
        })
      );
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/Table/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 654 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(999);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var _props = this.props,
        Input = _props.Input,
        label = _props.label,
        fieldProps = _props.fieldProps,
        onSubmit = _props.onSubmit,
        backUnit = _props.backUnit,
        LabelAttachment = _props.LabelAttachment;


    var percent = fieldProps.Type === 'Percent';

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'div',
        { className: _style2.default.title },
        _react2.default.createElement(
          'h2',
          { className: _style2.default.label },
          label
        ),
        typeof LabelAttachment === 'undefined' ? null : _react2.default.createElement(LabelAttachment, null)
      ),
      _react2.default.createElement(Input, _extends({}, this.props, {
        decimal: fieldProps.Decimal,
        percent: percent,
        backUnit: percent ? '%' : backUnit,
        onSubmit: onSubmit
      }))
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/ConnectedField/DefaultComponent/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 655 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(1000);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _xchIcon = __webpack_require__(298);

var _xchIcon2 = _interopRequireDefault(_xchIcon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    var getClasses = this.getClasses;

    return _react2.default.createElement(
      'button',
      {
        className: getClasses('GenericCloseBtn'),
        onClick: this.props.onClick },
      _react2.default.createElement(
        'div',
        { className: getClasses('_content') },
        _react2.default.createElement(_xchIcon2.default, { classes: { icon: getClasses('_icon') }, id: 'close' }),
        _react2.default.createElement(
          'span',
          { className: getClasses('_text') },
          'close'
        )
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/GenericCloseBtn/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 656 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _UnitText = __webpack_require__(111);

var _UnitText2 = _interopRequireDefault(_UnitText);

var _style = __webpack_require__(1002);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  render: function render() {
    var hoverItem = this.props.hoverItem;
    var tonnes = hoverItem.tonnes,
        avgTonnes = hoverItem.avgTonnes,
        value = hoverItem.value,
        avgValue = hoverItem.avgValue,
        percentage = hoverItem.percentage,
        avgPercentage = hoverItem.avgPercentage,
        Color = hoverItem.Color,
        Title = hoverItem.Title;


    return _react2.default.createElement(
      'div',
      {
        className: _style2.default.root,
        style: {
          borderColor: Color
        } },
      _react2.default.createElement(
        'h2',
        { className: _style2.default.title },
        Title
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.headerRow },
        _react2.default.createElement(
          'div',
          { className: _style2.default.header },
          'This Farm'
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.header },
          'Industry Avg'
        )
      ),
      this.renderRow('Tonnes CO2: ', tonnes, avgTonnes),
      this.renderRow('Kg CO2 / Kg MS: ', value, avgValue),
      this.renderRow('% of Total: ', percentage, avgPercentage, true)
    );
  },
  renderRow: function renderRow(unit, val, avgVal, isPercent) {
    var hoverItem = this.props.hoverItem;


    return _react2.default.createElement(
      'div',
      { className: _style2.default.row },
      _react2.default.createElement(_UnitText2.default, { classes: { unit: _style2.default.unit }, unit: unit }),
      _react2.default.createElement(
        'span',
        { className: _style2.default.value, style: { color: '#B10004' } },
        typeof val !== 'number' ? '-' : val.toFixed(1),
        isPercent ? '%' : ''
      ),
      _react2.default.createElement(
        'span',
        { className: _style2.default.value, style: { color: '#0A5AB2' } },
        typeof avgVal !== 'number' ? '-' : avgVal.toFixed(1),
        isPercent ? '%' : ''
      )
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/HoverBox/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 657 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var _default = {
  navigateleft: __webpack_require__(1265),
  closei: __webpack_require__(1242),
  info: __webpack_require__(1260),
  sync: __webpack_require__(1270),
  home: __webpack_require__(1258),
  alert: __webpack_require__(1235),
  action: __webpack_require__(1234),
  back: __webpack_require__(1236),
  forward: __webpack_require__(1255),
  barchart: __webpack_require__(1237),
  downarrow: __webpack_require__(1250),
  uparrow: __webpack_require__(1273),
  leftarrow: __webpack_require__(1261),
  rightarrow: __webpack_require__(1269),
  cloudupload: __webpack_require__(1243),
  dairyaustralialogo: __webpack_require__(1248),
  close: __webpack_require__(1241),
  copy: __webpack_require__(1245),
  globe: __webpack_require__(1256),
  folder: __webpack_require__(1254),
  print: __webpack_require__(1268),
  mail: __webpack_require__(1264),
  help: __webpack_require__(1257),
  tick: __webpack_require__(1272),
  error: __webpack_require__(1253),
  edit: __webpack_require__(1252),
  inbox: __webpack_require__(1259),
  pin: __webpack_require__(1266),
  dollarsign: __webpack_require__(1249),
  cog: __webpack_require__(1244),
  plus: __webpack_require__(1267),
  tag: __webpack_require__(1271),
  user: __webpack_require__(1274),
  curvedtriangle: __webpack_require__(1246),
  curvedtriangledown: __webpack_require__(1247),
  lock: __webpack_require__(1263),
  loading: __webpack_require__(1262),
  download: __webpack_require__(1251),
  circle_number_1: __webpack_require__(1238),
  circle_number_2: __webpack_require__(1239),
  circle_number_3: __webpack_require__(1240)
};


// will need to inject icons dynamically once I go npm with this module

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, "default", "C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Icon/iconList.js");
}();

;
module.exports = exports["default"];

/***/ }),
/* 658 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _style = __webpack_require__(1006);

var _style2 = _interopRequireDefault(_style);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _marked = __webpack_require__(181);

var _marked2 = _interopRequireDefault(_marked);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = __webpack_require__(1)({
  formatText: function formatText(text) {
    return {
      __html: (0, _marked2.default)(text, {
        breaks: true,
        sanitize: true
      })
    };
  },
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  render: function render() {
    var text = this.props.text;
    return typeof text !== 'string' ? null : _react2.default.createElement('div', {
      className: this.getClasses('root'),
      dangerouslySetInnerHTML: this.formatText(text)
    });
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-MdOutput/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 659 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
var scrollDiv = document.createElement('div');
scrollDiv.setAttribute('style', 'width: 100px; height: 100px; overflow: scroll; position: absolute !important; top: -9999px;');
document.body.appendChild(scrollDiv);

// Get the scrollbar width
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;

// Delete the DIV
document.body.removeChild(scrollDiv);

var _default = function _default() {
  return scrollbarWidth;
};

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(scrollDiv, 'scrollDiv', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(scrollbarWidth, 'scrollbarWidth', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/getScrollbarWidth/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/getScrollbarWidth/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 660 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDom = __webpack_require__(141);

var _reactDom2 = _interopRequireDefault(_reactDom);

var _portalManager = __webpack_require__(661);

var _style = __webpack_require__(1008);

var _style2 = _interopRequireDefault(_style);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Portal = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      created: false
    };
  },
  componentWillMount: function componentWillMount() {
    this.tryRender(this.props);
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    this.tryRender(newProps);
  },
  componentWillUnmount: function componentWillUnmount() {
    if (this.props.isOpen || this.props.alwaysOpen) {
      this.destroyPortal(this.props);
    }
  },
  tryRender: function tryRender(props) {
    var _this = this;

    if (props.element === null || typeof props.element === 'undefined') return null; // props.onPortalReady()

    if (props.alwaysOpen) {
      if (this.state.created) return this.renderPortal(props);
      return this.setState({
        created: true
      }, function () {
        return _this.createPortal(props);
      });
    }

    if (props.isOpen === this.props.isOpen) {
      if (!this.state.created) return;
      return this.renderPortal(props);
    }
    // always open could impact perf?
    if (props.isOpen) {
      this.setState({
        created: true
      });
      this.createPortal(props);
    } else {
      this.setState({
        created: false
      });
      this.destroyPortal(props);
    }
  },
  getClasses: function getClasses(key) {
    var classes = this.props.classes;

    if (typeof classes === 'undefined' || typeof classes[key] === 'undefined') return _style2.default[key];
    return _style2.default[key] + ' ' + classes[key];
  },
  createPortal: function createPortal(props) {
    if (!props.allowScroll) this.portalId = (0, _portalManager.openPortal)();

    this.node = document.createElement('div');
    this.node.className = this.getClasses('root');
    props.element.appendChild(this.node);
    this.renderPortal(props);
  },
  destroyPortal: function destroyPortal(props) {
    if (typeof this.node === 'undefined') return;
    // remove portal id from manager
    if (!props.allowScroll) (0, _portalManager.closePortal)(this.portalId);
    // unmount the node in virtual dom
    _reactDom2.default.unmountComponentAtNode(this.node);
    // remove the node from real dom
    props.element.removeChild(this.node);
  },
  renderPortal: function renderPortal(props) {
    var compId = props.compId;


    (0, _reactDom.unstable_renderSubtreeIntoContainer)(this, _react2.default.createElement(
      'div',
      {
        id: compId || 'portalContent',
        className: this.getClasses('content') },
      props.children
    ), this.node);
  },
  render: function render() {
    return null;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Portal, 'Portal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/index.jsx');
}();

;

/***/ }),
/* 661 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.openPortal = openPortal;
exports.closePortal = closePortal;

var _getScrollbarWidth = __webpack_require__(659);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var counter = 0;
var list = [];

function openPortal() {
  var newId = counter + 1;
  counter++;

  if (list.length === 0) {
    document.getElementsByTagName('body')[0].style.paddingRight = (0, _getScrollbarWidth2.default)() + 'px';
    document.getElementsByTagName('body')[0].style.overflow = 'hidden';
  }

  list.push(newId);
  return newId;
}

function closePortal(portalId) {
  list = list.filter(function (id) {
    return id !== portalId;
  });
  if (list.length === 0) {
    document.getElementsByTagName('body')[0].style.paddingRight = 0;
    document.getElementsByTagName('body')[0].style.overflow = '';
  }
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(counter, 'counter', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/portal-manager.js');

  __REACT_HOT_LOADER__.register(list, 'list', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/portal-manager.js');

  __REACT_HOT_LOADER__.register(openPortal, 'openPortal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/portal-manager.js');

  __REACT_HOT_LOADER__.register(closePortal, 'closePortal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-Portal/portal-manager.js');
}();

;

/***/ }),
/* 662 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

exports.addCommas = addCommas;
exports.removeCommas = removeCommas;
function addCommas(num) {
  if (typeof num === "string" || typeof num === "number") {
    return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
  } else {
    return num;
  }
}

function removeCommas(num) {
  if ((typeof num === "undefined" ? "undefined" : _typeof(num)) === ("string" || "number")) {
    return num.toString().replace(/,/g, "");
  } else {
    return num;
  }
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(addCommas, "addCommas", "C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-commas/index.js");

  __REACT_HOT_LOADER__.register(removeCommas, "removeCommas", "C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-commas/index.js");
}();

;

/***/ }),
/* 663 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.parseIn = parseIn;
exports.parseOut = parseOut;
function parseIn(value, props) {
  if (value === null) return value;
  var _value = +value;
  // if(props.percent) _value = _value * 100
  return _value.toFixed(props.decimal);
}

function parseOut(value, props) {
  var _value = +value;
  // if(props.percent) _value = _value / 100
  return _value;
}
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(parseIn, "parseIn", "C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-numberParser/index.js");

  __REACT_HOT_LOADER__.register(parseOut, "parseOut", "C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/_shared/xch-numberParser/index.js");
}();

;

/***/ }),
/* 664 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _style = __webpack_require__(1009);

var _style2 = _interopRequireDefault(_style);

var _Info = __webpack_require__(651);

var _Info2 = _interopRequireDefault(_Info);

var _Charts = __webpack_require__(647);

var _Charts2 = _interopRequireDefault(_Charts);

var _Table = __webpack_require__(653);

var _Table2 = _interopRequireDefault(_Table);

var _DataMissingPortal = __webpack_require__(648);

var _DataMissingPortal2 = _interopRequireDefault(_DataMissingPortal);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var LabelMap = {
  DairyBaseId: {
    Label: 'DairyBase Farm Id',
    Unit: ''
  },
  StateId: {
    Label: 'State',
    Unit: ''
  },
  RegionId: {
    Label: 'DFMP Region',
    Unit: ''
  },
  FinancialYear: {
    Label: 'Financial Year',
    Unit: ''
  },
  Name: {
    Label: 'Dataset Name',
    Unit: ''
  },
  Description: {
    Label: 'Description',
    Unit: ''
  },

  CooFarmTotalKgPerStdKgFcpm: {
    Label: 'GHG emissions intensity',
    Unit: ''
  },
  CooFarmTotalKgPerKgMilksolids: {
    Label: '',
    Unit: ''
  }
};

var _default = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],
  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;

    var DatasetDetail = report.tables.SummaryTable[0].cols.reduce(function (__obj, col) {
      var FieldId = col.props.FieldId;

      var LabelObj = LabelMap[FieldId] || col.props;
      return _extends({}, __obj, _defineProperty({}, FieldId, _extends({}, col.props, {
        Label: LabelObj.Label,
        Unit: LabelObj.Unit,
        Value: col.value
      })));
    }, {});

    this.setState({
      DatasetDetail: DatasetDetail,
      report: report
    });
  },
  render: function render() {
    var _state = this.state,
        DatasetDetail = _state.DatasetDetail,
        report = _state.report;

    if (!report.hasData) return null;
    var CarbonTable = report.tables.CarbonTable.reduce(function (__obj, r) {
      var cell = r.cols[0];
      if (typeof cell === 'undefined') return __obj;
      var FieldId = cell.props.FieldId;
      var Value = cell.value;
      var LabelObj = LabelMap[FieldId] || cell.props;

      return _extends({}, __obj, _defineProperty({}, FieldId, _extends({}, cell.props, {
        Label: LabelObj.Label,
        Unit: LabelObj.Unit,
        Value: Value
      })));
    }, DatasetDetail);

    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(
        'h2',
        { className: _style2.default.heading },
        'Carbon Emissions Report'
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.top },
        _react2.default.createElement(
          'div',
          { className: _style2.default.outputs },
          _react2.default.createElement(_Info2.default, { CarbonTable: CarbonTable })
        ),
        _react2.default.createElement(
          'div',
          { className: _style2.default.chart_container },
          _react2.default.createElement(_Charts2.default, { CarbonTable: CarbonTable })
        )
      ),
      _react2.default.createElement(
        'div',
        { className: _style2.default.errorBar },
        _react2.default.createElement(_DataMissingPortal2.default, {
          report: report,
          CarbonTable: CarbonTable,
          DatasetDetail: DatasetDetail
        })
      ),
      _react2.default.createElement(_Table2.default, { CarbonTable: CarbonTable })
    );
  }
});

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(LabelMap, 'LabelMap', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_CarbonReport/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 665 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1150);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _BarChart = __webpack_require__(301);

var _BarChart2 = _interopRequireDefault(_BarChart);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var index = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    if (!this.state.report.hasData) return null;

    var _data = this.state.report.tables.ChartTable.reduce(function (__obj, row, i) {
      var FieldId = row.Props.Cols[0].FieldId;


      return _extends({}, __obj, _defineProperty({}, FieldId, _extends({}, row.Props, {
        data: row.cols.map(function (c) {
          return c.value;
        })
      })));
    }, {});

    var barMap = [{
      Colour: '#5B9BD5',
      RefKey: 0
    }, {
      Colour: '#ED7D31',
      RefKey: 1
    }, {
      Colour: '#ED7D31',
      RefKey: 2
    }];

    var barData = _data['Chart3Y1Value'].data.map(function (value, index) {
      return _extends({}, barMap[index], {
        Value: value
      });
    });

    return _react2.default.createElement(
      'div',
      { className: 'GraphPage' },
      _react2.default.createElement(_BarChart2.default, {
        title: 'Figure 1',
        xAxis: {
          rotate: true,
          data: _data['ChartLineXValue'].data
        },
        yAxis: {
          label: '% of homegrown feed fed',
          legendLabel: 'Proportion of Homegrown Feed',
          step: 20,
          maxSteps: 10,
          backUnit: '%',
          color: '#5B9BD5',
          data: _data['Chart1Y1Value'].data
        },
        yAxis2: {
          label: 'No. of cows milked',
          legendLabel: 'Cows Milked',
          step: 100,
          maxSteps: 10,
          color: '#ED7D31',
          data: _data['Chart1Y2Value'].data
        }
      }),
      _react2.default.createElement(_BarChart2.default, {
        title: 'Figure 2',
        xAxis: {
          rotate: true,
          data: _data['ChartLineXValue'].data
        },
        yAxis: {
          label: 'Annual milk solids (kg)',
          legendLabel: 'MilkSolids',
          step: 50000,
          maxSteps: 10,
          color: '#5B9BD5',
          data: _data['Chart2Y1Value'].data
        },
        yAxis2: {
          label: 'KgMS per Cow',
          legendLabel: 'Milksolids per Cow',
          step: 100,
          maxSteps: 10,
          color: '#ED7D31',
          data: _data['Chart2Y2Value'].data
        }
      }),
      _react2.default.createElement(_BarChart2.default, {
        title: 'Figure 3',
        xAxis: {
          data: _data['ChartColumnXValue'].data
        },
        yAxis: {
          label: '% of homegrown feed',
          step: 10,
          maxSteps: 10,
          backUnit: '%'
        },
        barData: barData
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_ChartTab1/index.jsx');
}();

;

/***/ }),
/* 666 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1151);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__editData = __webpack_require__(37);

var _POST__editData2 = _interopRequireDefault(_POST__editData);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _BarChart = __webpack_require__(301);

var _BarChart2 = _interopRequireDefault(_BarChart);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var index = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    if (!this.state.report.hasData) return null;

    var _data = this.state.report.tables.ChartTable.reduce(function (__obj, row, i) {
      var FieldId = row.Props.Cols[0].FieldId;


      return _extends({}, __obj, _defineProperty({}, FieldId, _extends({}, row.Props, {
        data: row.cols.map(function (c) {
          return c.value;
        })
      })));
    }, {});

    var barMap = [{
      Colour: '#FFC000',
      RefKey: 0
    }, {
      Colour: '#5B9BD5',
      RefKey: 1
    }, {
      Colour: '#5B9BD5',
      RefKey: 2
    }];

    var barData = _data['Chart6Y1Value'].data.map(function (value, index) {
      return _extends({}, barMap[index], {
        Value: value
      });
    });

    return _react2.default.createElement(
      'div',
      { className: 'GraphPage' },
      _react2.default.createElement(_BarChart2.default, {
        title: 'Figure 4',
        yLabel: 'Annual total dollars (nominal)',
        xAxis: {
          rotate: true,
          data: _data['ChartLineXValue'].data
        },
        yData: [{
          label: 'Earnings Before Interest & Tax',
          step: 500000,
          maxSteps: 10,
          frontUnit: '$',
          color: '#5B9BD5',
          data: _data['Chart4Y4Value'].data
        }, {
          label: 'Gross Farm Income',
          step: 500000,
          maxSteps: 10,
          frontUnit: '$',
          color: '#ED7D31',
          data: _data['Chart4Y1Value'].data
        }, {
          label: 'Total Variable Costs',
          step: 500000,
          maxSteps: 10,
          frontUnit: '$',
          color: '#A5A5A5',
          data: _data['Chart4Y2Value'].data
        }, {
          label: 'Total Overhead Costs',
          step: 500000,
          maxSteps: 10,
          frontUnit: '$',
          color: '#FFC000',
          data: _data['Chart4Y3Value'].data
        }]
      }),
      _react2.default.createElement(_BarChart2.default, {
        title: 'Figure 5',
        xAxis: {
          rotate: true,
          data: _data['ChartLineXValue'].data
        },
        yAxis: {
          label: 'Equity % of Owned Assets',
          legendLabel: 'Equity as % of Owned Assets',
          backUnit: '%',
          step: 10,
          decimal: 1,
          maxSteps: 10,
          color: '#5B9BD5',
          data: _data['Chart5Y1Value'].data
        },
        yAxis2: {
          label: 'Return on total assets (%)',
          legendLabel: 'Return on Total Assets (ROTA)',
          backUnit: '%',
          step: 5,
          decimal: 1,
          maxSteps: 10,
          color: '#ED7D31',
          data: _data['Chart5Y2Value'].data
        }
      }),
      _react2.default.createElement(_BarChart2.default, {
        title: 'Figure 6',
        xAxis: {
          data: _data['ChartColumnXValue'].data
        },
        yAxis: {
          label: 'Earnings before interest and tax ($/KgMS)',
          step: 0.25,
          decimal: 2,
          maxSteps: 10,
          frontUnit: '$'
        },
        barData: barData
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_ChartTab2/index.jsx');
}();

;

/***/ }),
/* 667 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ProfitMap = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;

    var reportWithMapOnly = {
      tables: {
        CashProfitMapTable: report.tables.CashProfitMapTable
      }
    };

    var flatFields = _.flatten(_.flatten(_.map(reportWithMapOnly.tables, function (value, key) {
      return _.flatten(value);
    })).map(function (item, index) {
      var cols = item.cols || [];
      return cols.map(function (col, index) {
        if (typeof col.props !== 'undefined') {
          col.props.Description = item.Props.Description;
          col.props.Label = item.Props.Label;
          col.props.Unit = item.Props.Unit;
        }
        return col;
      });
    })).reduce(function (previousValue, currentValue) {
      if ((typeof currentValue === 'undefined' ? 'undefined' : _typeof(currentValue)) === 'object') {
        previousValue[currentValue.props.FieldId] = currentValue;
      }
      return previousValue;
    }, {});

    this.setState({
      report: {
        hasData: true,
        flatFields: flatFields
      }
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      null,
      this.renderChildren()
    );
  },


  renderChildren: function renderChildren() {
    var _this = this;

    return _react2.default.Children.map(this.props.children, function (child) {
      return _react2.default.cloneElement(child, {
        report: _this.state.report
      });
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ProfitMap, 'ProfitMap', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_FlatFieldMap/index.jsx');
}();

;

/***/ }),
/* 668 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1152);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _ReportHeaderTemplate = __webpack_require__(163);

var _ReportHeaderTemplate2 = _interopRequireDefault(_ReportHeaderTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      this._renderTabs()
    );
  },
  _renderTabs: function _renderTabs() {
    var _this = this;

    return this.props.printTabs.map(function (tab, index) {
      var TabHeader = tab.handlers.header;
      var TabBody = tab.handlers.body;
      var shutMenu = index > 0 && index < 5;

      return _react2.default.createElement(
        'div',
        { key: tab.id, className: 'ComparisonReport__printTab' },
        _react2.default.createElement(
          'div',
          { className: '_header' },
          _react2.default.createElement(
            'h1',
            { className: 'PrintableReport__title' },
            tab.title
          ),
          _react2.default.createElement(
            'div',
            {
              className: 'PrintLogo ' + (tab.id === 'cash' ? ' __smol__ ' : ' ') },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' })
          )
        ),
        _this._renderHeader(tab, shutMenu),
        _react2.default.createElement(TabBody, _extends({}, _this.props, { activeTab: tab, isPrinting: true })),
        _this._renderPageBreak(index, _this.props.tabs.length)
      );
    });
  },
  _renderHeader: function _renderHeader() {
    if (this.props.reportId === 6) return null;

    return _react2.default.createElement(
      _react2.default.Fragment,
      null,
      this.props.dynamicHeader ? _react2.default.createElement(
        _ReportHeaderTemplate2.default,
        this.props,
        _react2.default.createElement(TabHeader, _extends({}, this.props, {
          activeTab: tab,
          forceMenuShut: shutMenu,
          isPrinting: true
        }))
      ) : _react2.default.createElement(TabHeader, _extends({}, this.props, {
        activeTab: tab,
        forceMenuShut: shutMenu,
        isPrinting: true
      }))
    );
  },
  _renderPageBreak: function _renderPageBreak(index, length) {
    return index + 1 >= length ? null : _react2.default.createElement('div', { className: 'page-break' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_PrintModal/index.jsx');
}();

;

/***/ }),
/* 669 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _index = __webpack_require__(1153);

var _index2 = _interopRequireDefault(_index);

var _ReportMapBox = __webpack_require__(673);

var _ReportMapBox2 = _interopRequireDefault(_ReportMapBox);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _NaNtoDash = __webpack_require__(147);

var _NaNtoDash2 = _interopRequireDefault(_NaNtoDash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fields = module.exports = __webpack_require__(1)({
  render: function render() {
    if (typeof this.props.report.flatFields.CowMilkerNumber === 'undefined') return _react2.default.createElement(
      'div',
      { className: 'DFMPSingleReport__tableWrapper' },
      'no data for this year'
    );

    return _react2.default.createElement(
      'div',
      { className: 'DFMPSingleReport__tableWrapper' },
      _react2.default.createElement(
        'div',
        { className: 'ProfitMap' },
        _react2.default.createElement(
          'div',
          { className: '_col1' },
          _react2.default.createElement(
            'span',
            { className: 'ProfitMap__line _line1' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
          ),
          _react2.default.createElement(
            'span',
            { className: 'ProfitMap__line _line2' },
            _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Total Cows',
              value: this.getFieldValue('CowMilkerNumber'),
              unit: this.getFieldUnit('CowMilkerNumber'),
              bg: 'dark_blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Milk Solids Sold',
              value: this.calculateDivideFields('MilkSolidsKgTotal', 'CowMilkerNumber'),
              unit: 'kg MS / Cow',
              bg: 'dark_blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('IncomeLivestockTrading'),
              value: this.getFieldValue('IncomeLivestockTrading'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'All Other Income',
              value: this.calculateSumFields(['IncomeFeedWaterSale', 'IncomeFarmOther']),
              dollars: true,
              bg: 'blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement('span', { className: 'ProfitMap__line _line1' }),
            _react2.default.createElement('span', { className: 'ProfitMap__line _line2' }),
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line3' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line4' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Assets Leased',
                value: this.getFieldValue('AssetsLeasedTotalAvg'),
                dollars: true,
                bg: 'orange'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Assets Owned',
                value: this.getFieldValue('AssetsOwnedTotalAvg'),
                dollars: true,
                bg: 'orange'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Assets Managed',
                value: this.getFieldValue('AssetsAllCapitalAvg'),
                dollars: true,
                bg: 'orange'
              })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Return on Total Assets',
              value: (0, _NaNtoDash2.default)(this.getFieldValue('ReturnOnCapitalExclAppreciation')),
              unit: this.getFieldUnit('ReturnOnCapitalExclAppreciation'),
              bg: 'yellow',
              decimal: 1
            })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_gutter' },
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Milk Solids Sold',
            value: this.getFieldValue('MilkSolidsKgTotal'),
            unit: 'kg MS',
            bg: 'border'
          }),
          _react2.default.createElement(
            'div',
            { className: '_subhead' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Other Income'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col2' },
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Milk Income (net)',
                value: this.getFieldValue('IncomeMilkTotal'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Gross Farm Income',
                value: this.getFieldValue('IncomeTotal'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Gross Margin',
                value: this.getFieldValue('OperatingGrossMargin'),
                dollars: true,
                bg: 'yellow'
              })
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Earnings Before Interest & Tax (EBIT)',
                value: this.getFieldValue('EBIT'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Net Farm Income',
                value: this.getFieldValue('NetProfitBeforeTax'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            this.renderEquityField()
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ReturnEquityExclAppreciation'),
              value: (0, _NaNtoDash2.default)(this.getFieldValue('ReturnEquityExclAppreciation').toFixed(1)),
              unit: '%',
              bg: 'yellow',
              decimal: 1
            })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_gutter' },
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Price Per Unit',
            value: this.calculateDivideFields('IncomeMilkTotal', 'MilkSolidsKgTotal', 2),
            unit: ' / kg MS',
            dollars: true,
            bg: 'border',
            decimal: 2
          }),
          _react2.default.createElement(
            'div',
            { className: '_subhead2' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Variable Costs'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_subhead3' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Overheads'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_subhead4' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Finance Costs'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col3' },
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseHerdTotal'),
              value: this.getFieldValue('ExpenseHerdTotal'),
              dollars: true,
              bg: 'green'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseShedTotal'),
              value: this.getFieldValue('ExpenseShedTotal'),
              dollars: true,
              bg: 'green'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Feed Costs (incl feed & water inventory change)',
              value: this.getFieldValue('ExpenseFeedTotal'),
              dollars: true,
              bg: 'green'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Cash Overheads',
              value: this.getFieldValue('ExpenseCashOverheadsTotal'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseImputedPeople'),
              value: this.getFieldValue('ExpenseImputedPeople'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseDepreciation'),
              value: this.getFieldValue('ExpenseDepreciation'),
              dollars: true,
              bg: 'blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Interest & Lease Costs',
              value: this.calculateSumFields(['ExpenseInterest', 'ExpenseLease']),
              dollars: true,
              bg: 'dark_blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group4' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Liabilities',
              value: this.getFieldValue('LiabilitiesTotalAvg'),
              dollars: true,
              bg: 'orange'
            }),
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'leftarrow' })
            )
          )
        )
      )
    );
  },
  renderBox: function renderBox(label, value, bg) {
    return _react2.default.createElement(_ReportMapBox2.default, {
      label: label,
      value: value,
      unit: this.getFieldUnit('CowMilkerNumber'),
      bg: bg
    });
  },
  renderEquityField: function renderEquityField() {
    return _react2.default.createElement(
      'div',
      { className: '_equityField' },
      _react2.default.createElement(_ReportMapBox2.default, {
        label: 'Equity',
        value: this.getFieldValue('EquityAvg'),
        dollars: true,
        subValue: (0, _NaNtoDash2.default)(this.getFieldValue('EquityPercentAvg')),
        subUnit: '%',
        bg: 'orange'
      })
    );
  },
  renderField: function renderField(fieldId) {
    var obj = this.props.report.flatFields[fieldId];
    return this.renderBox(obj.props.Label, obj.value);
  },
  calculateSumFields: function calculateSumFields(fieldIds) {
    var _this = this;

    return _.sum(fieldIds.map(function (id, index) {
      return +_this.props.report.flatFields[id].value;
    }));
  },
  calculateDivideFields: function calculateDivideFields(fieldId1, fieldId2, decimals) {
    var ref = this.props.report.flatFields;
    return (0, _NaNtoDash2.default)((+ref[fieldId1].value / +ref[fieldId2].value).toFixed(decimals || 0));
  },
  getFieldValue: function getFieldValue(fieldId) {
    return +this.props.report.flatFields[fieldId].value;
  },
  getFieldLabel: function getFieldLabel(fieldId) {
    return this.props.report.flatFields[fieldId].props.Label;
  },
  getFieldUnit: function getFieldUnit(fieldId) {
    return this.props.report.flatFields[fieldId].props.Unit;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields, 'Fields', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_ProfitMap/Fields/index.jsx');
}();

;

/***/ }),
/* 670 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FlatFieldMap = __webpack_require__(667);

var _FlatFieldMap2 = _interopRequireDefault(_FlatFieldMap);

var _Fields = __webpack_require__(669);

var _Fields2 = _interopRequireDefault(_Fields);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ProfitMap = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      _FlatFieldMap2.default,
      null,
      _react2.default.createElement(_Fields2.default, null)
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ProfitMap, 'ProfitMap', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_ProfitMap/index.jsx');
}();

;

/***/ }),
/* 671 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1154);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _commas = __webpack_require__(33);

var _financeCalculations = __webpack_require__(124);

var _financeCalculations2 = _interopRequireDefault(_financeCalculations);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _SingleHeaderTemplate = __webpack_require__(643);

var _SingleHeaderTemplate2 = _interopRequireDefault(_SingleHeaderTemplate);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Table = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      },
      year: {}
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleFilterUpdate();
    this._handleReportUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportFarmClients[0];
    var farm = filters.DairyBaseId;
    var year = filters.FinancialYearId;

    this.setState({
      farm: farm,
      year: year
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmClientReport;
    if (typeof report === 'undefined') return;
    this.setState({
      report: report
    });
  },
  getYearIndex: function getYearIndex() {
    // bit of a convoluted join linking the selected year to the report arrays
    var _state = this.state,
        year = _state.year,
        farm = _state.farm,
        report = _state.report;
    var Value = year.Value,
        _year$Options = year.Options,
        Options = _year$Options === undefined ? [] : _year$Options;


    var yearOption = _.find(Options, { Id: Value }) || {};

    var Title = yearOption.Title;
    var tables = report.tables;


    if (typeof tables === 'undefined') return undefined;

    var TextTable = tables.TextTable;

    var DairyBaseIdRow = TextTable[1];
    var YearRow = TextTable[2];

    var YearIndex = _.findIndex(YearRow.cols, { value: Title });
    var FarmCode = farm.Value;

    if (YearIndex === -1) return undefined;

    var DairyBaseIdCol = DairyBaseIdRow.cols[YearIndex];

    if (DairyBaseIdCol.value !== FarmCode) return undefined;

    return YearIndex;
  },
  render: function render() {
    var YearIndex = this.getYearIndex();

    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        className: 'DFMPSingleReport__tableWrapper\n          ' + (this.props.activeTab.id === 'cash' ? '__condenseRows__' : '') + '\n        ' },
      _react2.default.createElement(_SingleHeaderTemplate2.default, this.props),
      _react2.default.createElement(
        'div',
        { key: this.props.tabKey, className: 'SingleReportTable' },
        this._renderRows(YearIndex)
      )
    );
  },
  _renderRows: function _renderRows(YearIndex) {
    var _this = this;

    return this.state.report.tables[this.props.activeTab.table].map(function (row, index) {
      // isInline removed to avoid column stretching
      var _isFinancialRow = row.RowId > 11 && row.RowId !== 29 && row.RowId !== 30 && row.RowId !== 31 && row.RowId !== 33 && row.cols.length > 0;

      var Cols = row.Props.Cols || [];
      var firstCol = Cols[0] || {};
      var isText = firstCol.Text;

      var isHeading = row.Props.Hierachy === 1 && row.cols.length === 0;

      var SingleReportTable__row = (0, _classnames2.default)({
        SingleReportTable__row: true,
        'is-inline': false,
        'is-summary': index === 0,
        'is-total': row.Props.Hierachy === 5,
        'is-dfmp-row-heading': (isHeading || isText) && index !== 0
      });

      var SingleReportTable__data = (0, _classnames2.default)({
        SingleReportTable__data: true,
        'is-calculated-data': true,
        'is-summary': index === 0
      });

      var _colArr = [];

      if (isHeading) {
        var colLength = row.colLength;
        // const _maxColLength = this.props.isPrinting ? MAX_COLS : colLength

        for (var step = 0; step < colLength; step++) {
          // Runs 5 times, with values of step 0 through 4.
          _colArr.push(step);
        }
      }

      var noRatioLastRow = _this.props.activeTab.balanceSheet && index === _this.state.report.tables[_this.props.activeTab.table].length - 1;

      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: SingleReportTable__row + ' is-h' + row.Props.Hierachy },
        _react2.default.createElement(
          'div',
          { className: 'SingleReportTable__label' },
          _react2.default.createElement(
            'div',
            { className: '_hierachy' },
            row.Props.Hierachy
          ),
          _react2.default.createElement(
            'div',
            { className: '_label' },
            _react2.default.createElement(_DescriptionLabel2.default, {
              label: row.Props.Label,
              description: row.Props.Description
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_unit' },
            row.Props.Unit
          )
        ),
        _react2.default.createElement(
          'div',
          { className: SingleReportTable__data },
          isHeading && _colArr.map(function (c) {
            return _react2.default.createElement('div', { key: c, style: { width: '100px' } });
          }),
          row.cols.map(function (col, index) {
            if (col.props !== undefined) {
              var isAvg = index === row.cols.length - 1 && !noRatioLastRow;
              return _this._renderValueRatios(col, isAvg, index, YearIndex);
            } else {
              return _react2.default.createElement(
                'div',
                { key: index, className: '_col' },
                col
              );
            }
          })
        )
      );
    });
  },
  _renderValueRatios: function _renderValueRatios(baseValue, isAvg, index, YearIndex) {
    var _this2 = this;

    var baseColHTML = _react2.default.createElement(
      'div',
      { key: 'basevalue00_' + index, className: '_col' },
      baseValue.props.Text || typeof baseValue.value !== 'number' ? baseValue.value : (0, _commas.addCommas)(baseValue.value.toFixed(baseValue.props.Decimal)),
      baseValue.props.Percent ? '%' : null
    );

    if (!isAvg) return baseColHTML;
    var colHTML = ['PercentOfIncome', 'PerKgMS', 'PerCow', 'PerMilkingHa', 'PerUsableHa', 'CentsPerLitre'].map(function (fnId, index) {
      var modifiers = {};
      _.forOwn(_this2.state.report.ratios, function (value, key) {
        var singleCol = key === 'CowMilkerNumber' || key === 'IncomeTotal' || key === 'MilkSolidsKgTotal';
        var _colIndex = singleCol ? 0 : YearIndex;
        modifiers[key] = value[_colIndex];
      });

      var caculation = (0, _financeCalculations2.default)(fnId, modifiers);
      var value = caculation.fn(baseValue.value);
      return _react2.default.createElement(
        'div',
        { key: index, className: '_col' },
        value
      );
    });

    colHTML.unshift(baseColHTML);

    return baseValue.props.Dynamic ? colHTML : baseColHTML;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Table, 'Table', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_SingleTable/index.jsx');
}();

;

/***/ }),
/* 672 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.FullHeightDiv = exports.SVGContainer = exports.LegendLine = exports.LegendDot = exports.LegendKey = exports.Legend = exports.LegendBox = exports.ZeroLine = exports.Unit = exports.Label = exports.YAxisLabelText = exports.YAxisLabel = exports.YAxisValue = exports.NegativeYAxis = exports.PositiveYAxis = exports.YAxis = exports.XLabel = exports.XCol = exports.Bar = exports.BarGroup = exports.Dot = exports.Bars = exports.Chart = exports.Root = undefined;

var _styledComponents = __webpack_require__(17);

var _styledComponents2 = _interopRequireDefault(_styledComponents);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Root = exports.Root = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Root'
})(['position:relative;z-index:1;page-break-inside:avoid;width:800px;padding-top:50px;padding-bottom:50px;margin-left:60px;']);

var Chart = exports.Chart = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Chart'
})(['position:relative;z-index:1;height:300px;display:flex;']);

var Bars = exports.Bars = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Bars'
})(['position:relative;z-index:1;flex:1;']);

var Dot = exports.Dot = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Dot'
})(['position:absolute !important;z-index:2;left:', '%;top:', '%;transform:translateX(-5px) translateY(-5px);width:10px;height:10px;border-radius:50%;background:', ';'], function (props) {
  return props.leftPos;
}, function (props) {
  return props.topPos;
}, function (props) {
  return props.color;
});

var BarGroup = exports.BarGroup = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__BarGroup'
})(['position:relative;z-index:1;height:100%;padding-left:15px;padding-right:15px;border-left:1px solid #0e1249;']);

var Bar = exports.Bar = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Bar'
})(['position:absolute !important;z-index:1;left:', '%;bottom:', '%;width:', '%;background:', ';height:', '%;'], function (props) {
  return props.leftPos;
}, function (props) {
  return props.isPositive ? props.zeroPos : props.zeroPos - props.height;
}, function (props) {
  return props.width;
}, function (props) {
  return props.colour;
}, function (props) {
  return props.height;
});

var XCol = exports.XCol = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__XCol'
})(['position:absolute !important;z-index:1;left:', '%;bottom:-30px;width:', '%;height:20px;'], function (props) {
  return props.leftPos;
}, function (props) {
  return props.width;
});

var XLabel = exports.XLabel = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__XLabel'
})(['', ' font-size:14px;text-align:center;'], function (props) {
  return props['data-rotate'] && '\n    transform: translateX(-50px);\n    width: 100px;\n    position: absolute !important;\n    z-index: 1;\n    left: 0;\n  ';
});

var YAxis = exports.YAxis = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__YAxis'
})(['position:relative;z-index:1;width:30px;font-size:11px;']);

var PositiveYAxis = exports.PositiveYAxis = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__PositiveYAxis'
})(['position:absolute !important;z-index:1;top:0;right:0;bottom:', '%;'], function (props) {
  return props.bottom;
});

var NegativeYAxis = exports.NegativeYAxis = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__NegativeYAxis'
})(['position:absolute !important;z-index:1;top:', '%;bottom:0;right:0;'], function (props) {
  return props.top;
});

var YAxisValue = exports.YAxisValue = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__YAxisValue'
})(['position:absolute !important;z-index:1;bottom:', '%;top:', '%;', ':5px;transform:translateY(', '%);'], function (props) {
  return props.pos;
}, function (props) {
  return props.topPos;
}, function (props) {
  return props.isRight ? 'left' : 'right';
}, function (props) {
  return props.isNegative ? -50 : 50;
});

var YAxisLabel = exports.YAxisLabel = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__YAxisLabel'
})(['position:absolute !important;z-index:1;width:300px;top:44%;', ' ', ' transform:rotate(', 'deg);'], function (props) {
  return props.isRight && '\n    right: -245px;\n    ';
}, function (props) {
  return !props.isRight && '\n    left: -200px;\n    ';
}, function (props) {
  return props.isRight ? 90 : 270;
});

var YAxisLabelText = exports.YAxisLabelText = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__YAxisLabelText'
})(['text-align:center;font-size:14px;font-weight:bold;']);

var Label = exports.Label = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Label'
})(['font-size:13px;text-align:center;font-weight:bold;']);

var Unit = exports.Unit = _styledComponents2.default.span.withConfig({
  displayName: 'BarChart__Unit'
})(['display:block;padding-left:5px;color:#5398e6;']);

var ZeroLine = exports.ZeroLine = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__ZeroLine'
})(['position:absolute !important;z-index:1;left:30px;right:0;bottom:', '%;margin-bottom:-1px;height:1px;background:#0e1249;'], function (props) {
  return props.pos;
});

var LegendBox = exports.LegendBox = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__LegendBox'
})(['position:absolute !important;z-index:1;top:0;left:50%;transform:translateX(-50%);width:400px;']);

var Legend = exports.Legend = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__Legend'
})(['position:absolute !important;z-index:1;left:0;right:0;bottom:0;display:flex;flex-wrap:wrap;']);

var LegendKey = exports.LegendKey = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__LegendKey'
})(['width:200px;padding:5px;font-size:11px;display:flex;align-items:center;']);

var LegendDot = exports.LegendDot = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__LegendDot'
})(['position:relative;z-index:1;width:10px;height:10px;border-radius:50%;background:', ';margin-right:15px;'], function (props) {
  return props.color;
});

var LegendLine = exports.LegendLine = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__LegendLine'
})(['position:absolute !important;z-index:1;top:4px;left:-10px;width:30px;height:2px;background:', ';'], function (props) {
  return props.color;
});
var SVGContainer = exports.SVGContainer = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__SVGContainer'
})(['position:absolute !important;z-index:1;top:0;bottom:0;left:0;right:0;']);
var FullHeightDiv = exports.FullHeightDiv = _styledComponents2.default.div.withConfig({
  displayName: 'BarChart__FullHeightDiv'
})(['@media print{position:absolute !important;z-index:1;top:0;bottom:0;left:0;right:0;}']);
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Root, 'Root', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Chart, 'Chart', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Bars, 'Bars', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Dot, 'Dot', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(BarGroup, 'BarGroup', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Bar, 'Bar', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(XCol, 'XCol', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(XLabel, 'XLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(YAxis, 'YAxis', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(PositiveYAxis, 'PositiveYAxis', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(NegativeYAxis, 'NegativeYAxis', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(YAxisValue, 'YAxisValue', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(YAxisLabel, 'YAxisLabel', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(YAxisLabelText, 'YAxisLabelText', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Label, 'Label', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Unit, 'Unit', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(ZeroLine, 'ZeroLine', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(LegendBox, 'LegendBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(Legend, 'Legend', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(LegendKey, 'LegendKey', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(LegendDot, 'LegendDot', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(LegendLine, 'LegendLine', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(SVGContainer, 'SVGContainer', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');

  __REACT_HOT_LOADER__.register(FullHeightDiv, 'FullHeightDiv', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/BarChart/style.js');
}();

;

/***/ }),
/* 673 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _index = __webpack_require__(1157);

var _index2 = _interopRequireDefault(_index);

var _classnames2 = __webpack_require__(7);

var _classnames3 = _interopRequireDefault(_classnames2);

var _commas = __webpack_require__(33);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var ReportMapBox = module.exports = __webpack_require__(1)({
  render: function render() {
    var ReportMapBox = (0, _classnames3.default)(_defineProperty({
      ReportMapBox: true
    }, this.props.bg, typeof this.props.bg !== 'undefined'));
    return _react2.default.createElement(
      'div',
      { className: ReportMapBox },
      _react2.default.createElement(
        'h3',
        { className: '_label' },
        this.props.label
      ),
      this.renderValue(this.props.value, this.props.unit, this.props.dollars, this.props.decimal),
      this.renderSubValue()
    );
  },
  renderSubValue: function renderSubValue() {
    return typeof this.props.subValue === 'undefined' ? null : this.renderValue(this.props.subValue, this.props.subUnit, this.props.subDollars, this.props.subDecimal);
  },
  renderValue: function renderValue(value, unit, dollars, decimal) {
    var displayValue = typeof value === 'undefined' ? undefined : (0, _commas.addCommas)((+value).toFixed(decimal || 0));

    return _react2.default.createElement(
      'div',
      { className: '_value' },
      dollars ? '$' : null,
      displayValue,
      _react2.default.createElement(
        'span',
        { className: '_unit' },
        this.renderUnit(unit)
      )
    );
  },
  renderUnit: function renderUnit(unit) {
    if (unit === '$' || unit === null || unit === '' || unit === 'Number' || unit === undefined) {
      return null;
    }
    return unit;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportMapBox, 'ReportMapBox', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/ReportMapBox/index.jsx');
}();

;

/***/ }),
/* 674 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1158);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _CalculatedHeader = __webpack_require__(294);

var _CalculatedHeader2 = _interopRequireDefault(_CalculatedHeader);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ChartHeader = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      ratio: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  componentDidMount: function componentDidMount() {
    this._onHeadingHeightChange();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportComparisons[0];
    var ratio = filters.FinanceRatio;
    this.setState({
      ratio: _.find(ratio.Options, { Id: ratio.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var _this = this;

    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    }, function () {
      _this._onHeadingHeightChange();
    });
  },
  _onHeadingHeightChange: function _onHeadingHeightChange() {
    var _this2 = this;

    setTimeout(function () {
      var headingHeight = _this2.TableHeader.offsetHeight;
      _this2.props.emitHeadingHeightChange(headingHeight);
    }, 0);
  },
  _onClick: function _onClick() {
    if (this.props.isPrinting) return;
    this.props.emitToggleMenu(this._onHeadingHeightChange);
  },
  render: function render() {
    var _this3 = this;

    var ReportHeaderTemplate = (0, _classnames2.default)({
      ReportHeaderTemplate: true,
      'menu-open': this.props.menuOpen
    });
    return _react2.default.createElement(
      'div',
      {
        className: ReportHeaderTemplate,
        ref: function ref(_ref) {
          return _this3.TableHeader = _ref;
        } },
      _react2.default.createElement(
        'div',
        { className: 'Legend__Header' },
        _react2.default.createElement(
          'button',
          { className: '_btn', onClick: this._onClick },
          this.props.menuOpen ? 'collapse' : 'expand'
        ),
        this.renderRation()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__content' },
        _react2.default.createElement(_CalculatedHeader2.default, this.props)
      )
    );
  },
  renderRation: function renderRation() {
    return this.props.ratio ? _react2.default.createElement(
      'div',
      { className: '_ratio', key: 1 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        ' Selected Financial Ratio: '
      ),
      _react2.default.createElement(
        'span',
        { className: '_value' },
        this.state.ratio
      )
    ) : _react2.default.createElement(
      'div',
      { className: '_ratio', key: 2 },
      _react2.default.createElement(
        'span',
        { className: '_title' },
        'Report Detail'
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ChartHeader, 'ChartHeader', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/_shared/SingleHeaderTemplate/index.jsx');
}();

;

/***/ }),
/* 675 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1156);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportTemplate = __webpack_require__(112);

var _ReportTemplate2 = _interopRequireDefault(_ReportTemplate);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ComparisonReport__Report = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportFilters2.default, '_handleReportFilters')],

  getInitialState: function getInitialState() {
    return {
      menuOpen: true,
      headingHeight: 38,
      filters: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportFilters();
  },
  _handleReportFilters: function _handleReportFilters() {
    var financeRatios = _reportFilters2.default.store.UserReportSingles[0];
    this.setState({
      filters: [financeRatios['FinanceRatio1'], financeRatios['FinanceRatio2'], financeRatios['FinanceRatio3'], financeRatios['FinanceRatio4'], financeRatios['FinanceRatio5']]
    });
  },
  _setHeadingHeight: function _setHeadingHeight(newHeight) {
    this.setState({
      headingHeight: newHeight
    });
  },
  _toggleMenuOpen: function _toggleMenuOpen(callback) {
    this.setState({
      menuOpen: !this.state.menuOpen
    }, callback);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_ReportTemplate2.default, {
        reportId: 6,
        dynamicHeader: true,
        ratio: true,
        selectedDatasets: this.props.selectedDatasets,
        selectedFilters: this.props.selectedFilters,
        emitResetScroll: this.props.emitResetScroll,
        bannerDOMRef: this.props.bannerDOMRef,
        emitToggleMenu: this._toggleMenuOpen,
        emitHeadingHeightChange: this._setHeadingHeight,
        headingHeight: this.state.headingHeight,
        menuOpen: this.state.menuOpen,
        printModalhandler: __webpack_require__(668),
        filters: this.state.filters,
        tabs: [{
          id: 'profitMap',
          title: 'Profit Map',
          handlers: {
            header: __webpack_require__(160),
            body: __webpack_require__(670)
          }
        }, {
          id: 'summary',
          title: 'Summary Table',
          table: 'SummaryTable',
          handlers: {
            header: __webpack_require__(674),
            body: __webpack_require__(671)
          }
        }, {
          id: 'physical',
          title: 'Physical Table',
          table: 'PhysicalTable',
          handlers: {
            header: __webpack_require__(159),
            body: __webpack_require__(211)
          }
        }, {
          id: 'chart1',
          title: 'Graphs 1',
          table: 'Graphs',
          handlers: {
            header: __webpack_require__(160),
            body: __webpack_require__(665)
          }
        }, {
          id: 'profit',
          title: 'Profit Table',
          table: 'ProfitTable',
          handlers: {
            header: __webpack_require__(159),
            body: __webpack_require__(211)
          }
        }, {
          id: 'chart2',
          title: 'Graphs 2',
          table: 'Graphs',
          handlers: {
            header: __webpack_require__(160),
            body: __webpack_require__(666)
          }
        }, {
          id: 'wealth',
          title: 'Wealth Table',
          table: 'WealthTable',
          handlers: {
            header: __webpack_require__(159),
            body: __webpack_require__(211)
          }
        }, {
          id: 'carbon',
          title: 'Carbon Report',
          table: 'Carbon',
          handlers: {
            header: __webpack_require__(160),
            body: __webpack_require__(664)
          }
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ComparisonReport__Report, 'ComparisonReport__Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/_Report/index.jsx');
}();

;

/***/ }),
/* 676 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _style = __webpack_require__(1010);

var _style2 = _interopRequireDefault(_style);

var _DFMPFarmClientReportTemplate = __webpack_require__(641);

var _DFMPFarmClientReportTemplate2 = _interopRequireDefault(_DFMPFarmClientReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var DFMPFarmReport = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: _style2.default.root },
      _react2.default.createElement(_DFMPFarmClientReportTemplate2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        reportId: 6,
        bannerDOMRef: this.props.bannerDOMRef,
        emitResetScroll: this.props.emitResetScroll,
        steps: [{
          id: 'farm',
          title: 'Farm',
          handler: __webpack_require__(642)
        }, {
          id: 'report',
          title: 'Report',
          handler: __webpack_require__(675)
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(DFMPFarmReport, 'DFMPFarmReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_DFMPFarmClientReport/index.jsx');
}();

;

/***/ }),
/* 677 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1159);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _fields = __webpack_require__(307);

var _fields2 = _interopRequireDefault(_fields);

var _reportFieldData = __webpack_require__(122);

var _reportFieldData2 = _interopRequireDefault(_reportFieldData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Reports',
    fields: _reportFieldData2.default
  }])],

  onClick: function onClick() {
    this.props.emitGenerateReport();
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportModalFilter' },
      _react2.default.createElement(
        'button',
        {
          className: 'ReportStepTemplate__GenerateBtn',
          onClick: this.onClick },
        'Generate Report'
      ),
      _react2.default.createElement(_fields2.default, {
        emitFilterChange: this.props.emitFilterChange,
        fields: this.state.UserReportFarmHistories[0],
        table: 'UserReportFarmHistories' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter, 'Filter', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmHistoryReport/_filter/index.jsx');
}();

;

/***/ }),
/* 678 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1161);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Chart = __webpack_require__(205);

var _Chart2 = _interopRequireDefault(_Chart);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chartGrid = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmHistoryReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        key: this.props.activeTab.id,
        className: 'SingleChart__Body',
        style: { marginTop: this.props.headingHeight } },
      _react2.default.createElement(
        'div',
        null,
        this._renderChart()
      )
    );
  },
  _renderChart: function _renderChart() {
    var chartKey = 'FarmHistoryChart';
    var _chart = this.state.report.charts[chartKey];
    var title = _.find(this.props.filter.Options, {
      Id: this.props.filter.Value
    }).Title;
    var isPrintingLandscape = this.props.isPrinting && this.props.IsLandscape;
    var landscapeWidth = this.props.IsA3 ? '1600px' : '1000px';
    var landscapeHeight = this.props.IsA3 ? '800px' : '450px';

    return _react2.default.createElement(
      'div',
      { className: 'FarmSizeChart' },
      _react2.default.createElement(
        'h2',
        { className: '_title' },
        _react2.default.createElement(_DescriptionLabel2.default, { label: title, description: _chart.Description }),
        _react2.default.createElement(
          'span',
          { className: '_unit' },
          _chart.Unit
        )
      ),
      _react2.default.createElement(_Chart2.default, {
        id: chartKey,
        data: _chart,
        width: isPrintingLandscape ? landscapeWidth : '100%',
        height: isPrintingLandscape ? landscapeHeight : '450px',
        datasetList: this.props.selectedDatasets
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_chartGrid, '_chartGrid', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmHistoryReport/_report/_Chart/index.jsx');
}();

;

/***/ }),
/* 679 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _PopupButton = __webpack_require__(153);

var _PopupButton2 = _interopRequireDefault(_PopupButton);

var _hexToRgb = __webpack_require__(149);

var _hexToRgb2 = _interopRequireDefault(_hexToRgb);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportFarmHistories[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_container' },
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'Comparison Groups:'
        ),
        this.renderComparisonGroups()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'User Selected Datasets:'
        ),
        this.renderUserDatasets()
      )
    );
  },
  renderComparisonGroups: function renderComparisonGroups() {
    var _this = this;

    var stingifiedNumbers = ['First', 'Second', 'Third', 'Fourth'];
    var legend = _dataDefinition2.default.chartSettings[22].JsonSetting.graphs;
    var comparisonGroups = legend.slice(0, 2);
    return _.map(comparisonGroups, function (dataset, index) {
      var border = dataset.bulletBorderThickness;
      var alpha = dataset.bulletAlpha;
      var shape = dataset.bullet;
      var color = dataset.bulletColor;
      var id = dataset.id;
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        backgroundColor: 'rgba(' + (0, _hexToRgb2.default)(color).rgb + ', ' + alpha + ')',
        width: 10,
        display: 'inline-block',
        height: 10,
        marginRight: 5
      };
      return _react2.default.createElement(
        'div',
        { key: index, className: 'Legend__unit' },
        _react2.default.createElement('span', { style: spanStyle }),
        _react2.default.createElement(
          'span',
          null,
          index === 0 ? _this.state.group1 : _this.state.group2
        )
      );
    });
  },
  renderUserDatasets: function renderUserDatasets() {
    var _this2 = this;

    var legend = _dataDefinition2.default.chartSettings[22].JsonSetting.graphs;
    var userSelectedDatasets = legend.slice(2);
    return _.map(userSelectedDatasets, function (dataset, index) {
      var datasetList = _this2.props.selectedDatasets;
      if (index + 1 > datasetList.length) return null;

      var alpha = dataset.bulletAlpha;
      var shape = dataset.bullet;
      var color = dataset.bulletColor;
      var id = dataset.id;
      var datasetDetail = _.find(_datasetList2.default.store, { Id: datasetList[index] });
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        border: '2px solid ' + dataset.bulletColor,
        backgroundColor: 'rgba(' + (0, _hexToRgb2.default)(color).rgb + ', ' + alpha + ')',
        width: 15,
        display: 'inline-block',
        height: 15,
        marginRight: 5,
        opacity: 0.8
      };
      return _react2.default.createElement(
        _PopupButton2.default,
        {
          key: index,
          description: datasetDetail.Name + '\n            <br/>\n            ' + datasetDetail.DairyBaseId + ' \u2014 ' + datasetDetail.FinancialYear + '\n            <br/>' },
        _react2.default.createElement(
          'div',
          { className: 'Legend__unit' },
          _react2.default.createElement('span', { style: spanStyle }),
          _react2.default.createElement(
            'span',
            null,
            datasetDetail.Name
          )
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmHistoryReport/_report/_Chartheader/index.jsx');
}();

;

/***/ }),
/* 680 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1162);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportTemplate = __webpack_require__(112);

var _ReportTemplate2 = _interopRequireDefault(_ReportTemplate);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FarmSize__Report = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportFilters2.default, '_handleReportFilters')],

  getInitialState: function getInitialState() {
    return {
      filter: {},
      menuOpen: true,
      headingHeight: 38
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportFilters();
  },
  _handleReportFilters: function _handleReportFilters() {
    this.setState({
      filter: _reportFilters2.default.store.UserReportFarmHistories[0].ChartKpi
    });
  },
  _setHeadingHeight: function _setHeadingHeight(newHeight) {
    this.setState({
      headingHeight: newHeight
    });
  },
  _toggleMenuOpen: function _toggleMenuOpen(callback) {
    this.setState({
      menuOpen: !this.state.menuOpen
    }, callback);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_ReportTemplate2.default, {
        reportId: 4,
        dynamicHeader: true,
        selectedDatasets: this.props.selectedDatasets,
        emitResetScroll: this.props.emitResetScroll,
        bannerDOMRef: this.props.bannerDOMRef,
        emitToggleMenu: this._toggleMenuOpen,
        emitHeadingHeightChange: this._setHeadingHeight,
        headingHeight: this.state.headingHeight,
        menuOpen: this.state.menuOpen,
        filter: this.state.filter,
        printModalhandler: __webpack_require__(308),
        tabs: [{
          id: 'FarmHistoryChart',
          title: 'Farm History Chart',
          handlers: {
            header: __webpack_require__(679),
            body: __webpack_require__(678)
          }
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FarmSize__Report, 'FarmSize__Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmHistoryReport/_report/index.jsx');
}();

;

/***/ }),
/* 681 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1160);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ComparisonReportTemplate = __webpack_require__(213);

var _ComparisonReportTemplate2 = _interopRequireDefault(_ComparisonReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FarmHistoryReport = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'FarmSizeAnalysis' },
      _react2.default.createElement(_ComparisonReportTemplate2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        reportId: 4,
        bannerDOMRef: this.props.bannerDOMRef,
        emitResetScroll: this.props.emitResetScroll,
        steps: [{
          id: 'datasets',
          title: 'Datasets',
          handler: __webpack_require__(212)
        }, {
          id: 'filter',
          title: 'Filter',
          handler: __webpack_require__(677)
        }, {
          id: 'report',
          title: 'Report',
          handler: __webpack_require__(680)
        }] })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FarmHistoryReport, 'FarmHistoryReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmHistoryReport/index.jsx');
}();

;

/***/ }),
/* 682 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1163);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataMixin = __webpack_require__(28);

var _dataMixin2 = _interopRequireDefault(_dataMixin);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _fields = __webpack_require__(307);

var _fields2 = _interopRequireDefault(_fields);

var _reportFieldData = __webpack_require__(122);

var _reportFieldData2 = _interopRequireDefault(_reportFieldData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Filter = module.exports = __webpack_require__(1)({

  mixins: [(0, _dataMixin2.default)([{
    store: 'Reports',
    fields: _reportFieldData2.default
  }])],

  onClick: function onClick() {
    this.props.emitGenerateReport();
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportModalFilter' },
      _react2.default.createElement(
        'button',
        {
          className: 'ReportStepTemplate__GenerateBtn',
          onClick: this.onClick },
        'Generate Report'
      ),
      _react2.default.createElement(_fields2.default, {
        emitFilterChange: this.props.emitFilterChange,
        fields: this.state.UserReportFarmSizes[0],
        table: 'UserReportFarmSizes' })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Filter, 'Filter', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmSizeAnalysis/_Filter/index.jsx');
}();

;

/***/ }),
/* 683 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _PopupButton = __webpack_require__(153);

var _PopupButton2 = _interopRequireDefault(_PopupButton);

var _hexToRgb = __webpack_require__(149);

var _hexToRgb2 = _interopRequireDefault(_hexToRgb);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var index = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate'), _reflux2.default.listenTo(_reportFilters2.default, '_handleFilterUpdate')],

  getInitialState: function getInitialState() {
    return {
      group1: undefined,
      group2: undefined,
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
    this._handleFilterUpdate();
  },
  _handleFilterUpdate: function _handleFilterUpdate() {
    var filters = _reportFilters2.default.store.UserReportFarmSizes[0];
    var group1 = filters.Grp1Statistic;
    var group2 = filters.Grp2Statistic;
    this.setState({
      group1: _.find(group1.Options, { Id: group1.Value }).Title,
      group2: _.find(group2.Options, { Id: group2.Value }).Title
    });
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.ComparisonReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: '_container' },
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'Comparison Groups:'
        ),
        this.renderComparisonGroups()
      ),
      _react2.default.createElement(
        'div',
        { className: 'Legend__units' },
        _react2.default.createElement(
          'span',
          { className: 'Legend__label' },
          'User Selected Datasets:'
        ),
        this.renderUserDatasets()
      )
    );
  },
  renderComparisonGroups: function renderComparisonGroups() {
    var _this = this;

    var stingifiedNumbers = ['First', 'Second', 'Third', 'Fourth'];
    var legend = _dataDefinition2.default.chartSettings[17].JsonSetting.graphs;
    var comparisonGroups = legend.slice(0, 2);
    return _.map(comparisonGroups, function (dataset, index) {
      var border = dataset.bulletBorderThickness;
      var alpha = dataset.bulletAlpha;
      var shape = dataset.bullet;
      var color = dataset.bulletColor;
      var id = dataset.id;
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        backgroundColor: 'rgba(' + (0, _hexToRgb2.default)(color).rgb + ', ' + alpha + ')',
        width: 10,
        display: 'inline-block',
        height: 10,
        marginRight: 5
      };
      return _react2.default.createElement(
        'div',
        { key: index, className: 'Legend__unit' },
        _react2.default.createElement('span', { style: spanStyle }),
        _react2.default.createElement(
          'span',
          null,
          index === 0 ? _this.state.group1 : _this.state.group2
        )
      );
    });
  },
  renderUserDatasets: function renderUserDatasets() {
    var _this2 = this;

    var legend = _dataDefinition2.default.chartSettings[17].JsonSetting.graphs;
    var userSelectedDatasets = legend.slice(2);
    return _.map(userSelectedDatasets, function (dataset, index) {
      var datasetList = _this2.props.selectedDatasets;
      if (index + 1 > datasetList.length) return null;

      var shape = dataset.bullet;
      var alpha = dataset.bulletAlpha;
      var color = dataset.bulletColor;
      var id = dataset.id;
      var datasetDetail = _.find(_datasetList2.default.store, { Id: datasetList[index] });
      var spanStyle = {
        borderRadius: shape === 'round' ? '50%' : null,
        border: '2px solid ' + dataset.bulletColor,
        backgroundColor: 'rgba(' + (0, _hexToRgb2.default)(color).rgb + ', ' + alpha + ')',
        width: 15,
        display: 'inline-block',
        height: 15,
        marginRight: 5,
        opacity: 0.8
      };
      return _react2.default.createElement(
        _PopupButton2.default,
        {
          key: index,
          description: datasetDetail.Name + '\n            <br/>\n            ' + datasetDetail.DairyBaseId + ' \u2014 ' + datasetDetail.FinancialYear + '\n            <br/>' },
        _react2.default.createElement(
          'div',
          { key: index, className: 'Legend__unit' },
          _react2.default.createElement('span', { style: spanStyle }),
          _react2.default.createElement(
            'span',
            null,
            datasetDetail.Name
          )
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(index, 'index', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmSizeAnalysis/_Report/_ChartHeader/index.jsx');
}();

;

/***/ }),
/* 684 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1164);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _Chart = __webpack_require__(205);

var _Chart2 = _interopRequireDefault(_Chart);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

var _reportData = __webpack_require__(18);

var _reportData2 = _interopRequireDefault(_reportData);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chartGrid = module.exports = __webpack_require__(1)({
  mixins: [_reflux2.default.listenTo(_reportData2.default, '_handleReportUpdate')],

  getInitialState: function getInitialState() {
    return {
      report: {
        hasData: false
      }
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportUpdate();
  },
  _handleReportUpdate: function _handleReportUpdate() {
    var report = _reportData2.default.store.FarmSizeReport;
    if (typeof report === 'undefined') return;

    this.setState({
      report: report
    });
  },
  render: function render() {
    return !this.state.report.hasData ? null : _react2.default.createElement(
      'div',
      {
        key: this.props.activeTab.id,
        className: 'SingleChart__Body',
        style: { marginTop: this.props.headingHeight } },
      _react2.default.createElement(
        'div',
        null,
        this._renderChart()
      )
    );
  },
  _renderChart: function _renderChart() {
    var chartKey = 'FarmSizeChart';
    var _chart = this.state.report.charts[chartKey];
    var title = _.find(this.props.filter.Options, {
      Id: this.props.filter.Value
    }).Title;

    var isPrintingLandscape = this.props.isPrinting && this.props.IsLandscape;
    var landscapeWidth = this.props.IsA3 ? '1600px' : '1000px';
    var landscapeHeight = this.props.IsA3 ? '800px' : '450px';

    return _react2.default.createElement(
      'div',
      { className: 'FarmSizeChart' },
      _react2.default.createElement(
        'h2',
        { className: '_title' },
        _react2.default.createElement(_DescriptionLabel2.default, { label: title, description: _chart.Description }),
        _react2.default.createElement(
          'span',
          { className: '_unit' },
          _chart.Unit
        )
      ),
      _react2.default.createElement(_Chart2.default, {
        id: chartKey,
        data: _chart,
        width: isPrintingLandscape ? landscapeWidth : '100%',
        height: isPrintingLandscape ? landscapeHeight : '450px',
        datasetList: this.props.selectedDatasets
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(_chartGrid, '_chartGrid', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmSizeAnalysis/_Report/_Chart/index.jsx');
}();

;

/***/ }),
/* 685 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1165);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportTemplate = __webpack_require__(112);

var _ReportTemplate2 = _interopRequireDefault(_ReportTemplate);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FarmSize__Report = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportFilters2.default, '_handleReportFilters')],

  getInitialState: function getInitialState() {
    return {
      filter: {},
      menuOpen: true,
      headingHeight: 38
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportFilters();
  },
  _handleReportFilters: function _handleReportFilters() {
    this.setState({
      filter: _reportFilters2.default.store.UserReportFarmSizes[0].ChartKpi
    });
  },
  _setHeadingHeight: function _setHeadingHeight(newHeight) {
    this.setState({
      headingHeight: newHeight
    });
  },
  _toggleMenuOpen: function _toggleMenuOpen(callback) {
    this.setState({
      menuOpen: !this.state.menuOpen
    }, callback);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      _react2.default.createElement(_ReportTemplate2.default, {
        reportId: 3,
        dynamicHeader: true,
        selectedDatasets: this.props.selectedDatasets,
        emitResetScroll: this.props.emitResetScroll,
        bannerDOMRef: this.props.bannerDOMRef,
        emitToggleMenu: this._toggleMenuOpen,
        emitHeadingHeightChange: this._setHeadingHeight,
        headingHeight: this.state.headingHeight,
        menuOpen: this.state.menuOpen,
        filter: this.state.filter,
        printModalhandler: __webpack_require__(308),
        tabs: [{
          id: 'farmSizeChart',
          title: 'Farm Size Chart',
          settingsId: 10,
          handlers: {
            header: __webpack_require__(683),
            body: __webpack_require__(684)
          }
        }]
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FarmSize__Report, 'FarmSize__Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmSizeAnalysis/_Report/index.jsx');
}();

;

/***/ }),
/* 686 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1166);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ComparisonReportTemplate = __webpack_require__(213);

var _ComparisonReportTemplate2 = _interopRequireDefault(_ComparisonReportTemplate);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var FarmSizeAnalysis = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'FarmSizeAnalysis' },
      _react2.default.createElement(_ComparisonReportTemplate2.default, {
        prefillDatasetIds: this.props.prefillDatasetIds,
        reportId: 3,
        bannerDOMRef: this.props.bannerDOMRef,
        emitResetScroll: this.props.emitResetScroll,
        steps: [{
          id: 'datasets',
          title: 'Datasets',
          handler: __webpack_require__(212)
        }, {
          id: 'filter',
          title: 'Filter',
          handler: __webpack_require__(682)
        }, {
          id: 'report',
          title: 'Report',
          handler: __webpack_require__(685)
        }] })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(FarmSizeAnalysis, 'FarmSizeAnalysis', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_FarmSizeAnalysis/index.jsx');
}();

;

/***/ }),
/* 687 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1167);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _FilteringDatasetList = __webpack_require__(155);

var _FilteringDatasetList2 = _interopRequireDefault(_FilteringDatasetList);

var _filterVisibleDatasets = __webpack_require__(70);

var _filterVisibleDatasets2 = _interopRequireDefault(_filterVisibleDatasets);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _getScrollbarWidth = __webpack_require__(41);

var _getScrollbarWidth2 = _interopRequireDefault(_getScrollbarWidth);

var _FilterBar = __webpack_require__(289);

var _FilterBar2 = _interopRequireDefault(_FilterBar);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_datasetList2.default, "_handleNewData"), (0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      list: []
    };
  },
  componentWillMount: function componentWillMount() {
    if (_datasetList2.default.store.length >= 1) {
      this._handleNewData();
    }
  },
  _handleNewData: function _handleNewData() {
    this.setState({
      list: (0, _filterVisibleDatasets2.default)()
    });
  },
  _handleItemClick: function _handleItemClick(dataset) {
    this.props.emitDatasetSelection(dataset.Id);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'newSingleReport__Datasets' },
      _react2.default.createElement(_FilteringDatasetList2.default, {
        list: this.state.list,
        emitItemClick: this._handleItemClick }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: this.props.bannerDOMRef,
          isOpen: this.state.permaPortalOpen },
        _react2.default.createElement(_FilterBar2.default, null)
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Datasets/index.jsx');
}();

;

/***/ }),
/* 688 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _index = __webpack_require__(1169);

var _index2 = _interopRequireDefault(_index);

var _ReportMapBox = __webpack_require__(306);

var _ReportMapBox2 = _interopRequireDefault(_ReportMapBox);

var _commas = __webpack_require__(33);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fields = module.exports = __webpack_require__(1)({
  render: function render() {
    var IsLandscape = this.props.IsLandscape;

    return _react2.default.createElement(
      'div',
      { className: 'SingleReport__tableWrapper' },
      _react2.default.createElement(
        'div',
        { className: 'CashMap' },
        _react2.default.createElement(
          'div',
          { className: '_col1' },
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Milk Income (net)',
              value: this.getFieldValue('IncomeMilkTotal'),
              dollars: true,
              bg: 'dark_blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('IncomeFeedWaterSale'),
              value: this.getFieldValue('IncomeFeedWaterSale'),
              dollars: true,
              bg: 'dark_blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Livestock Sales - Purchases',
              value: this.getFieldValue('CashFlowLivestockNet'),
              dollars: true,
              bg: 'dark_blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Other Farm Cash Income',
              value: this.getFieldValue('IncomeFarmOther'),
              dollars: true,
              bg: 'dark_blue'
            })
          ),
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Net Non Farm Cash Income',
            value: this.getFieldValue('IncomeNonFarm'),
            dollars: true,
            bg: 'green'
          })
        ),
        _react2.default.createElement(
          'div',
          { className: '_gutter1' },
          _react2.default.createElement(
            'span',
            { className: 'ProfitMap__line _line' },
            _react2.default.createElement(_Icon2.default, { className: '_icon __cashBumpThisOne', id: 'rightarrow' })
          ),
          _react2.default.createElement(
            'span',
            { className: 'ProfitMap__line _line2' },
            _react2.default.createElement(_Icon2.default, { className: '_icon __cashBumpThisOne', id: 'rightarrow' })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col2' },
          _react2.default.createElement(
            'div',
            { className: '_fieldWithLine is-first' },
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Total Farm Cash Income',
              value: this.calculateSumFields(['IncomeMilkTotal', 'IncomeFeedWaterSale', 'IncomeFarmOther', 'CashFlowLivestockNet']),
              dollars: true,
              bg: 'yellow'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_fieldWithLine' },
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Farm Operating Cash Surplus',
              value: this.calculateOperationSurplus(),
              dollars: true,
              bg: 'yellow'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_fieldWithLine' },
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Net Cash Flow Before Tax & Drawings',
              value: this.calculateCashFlow(),
              dollars: true,
              bg: 'yellow'
            })
          ),
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Net Cash Flow Before Tax',
            value: this.calculateCashFlowBeforeTax(),
            dollars: true,
            bg: 'yellow'
          })
        ),
        _react2.default.createElement(
          'div',
          { className: '_gutter2' },
          _react2.default.createElement(
            'div',
            { className: '_subhead1' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Variable Costs'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_subhead2' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Cash Overheads'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_subhead3' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Finance & Capital Movements'
            )
          ),
          _react2.default.createElement(
            'div',
            {
              className: (0, _classnames2.default)({
                _subhead4: true,
                IsLandscape: _classnames2.default
              }) },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Personal Drawings'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col3' },
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseHerdTotal'),
              value: this.getFieldValue('ExpenseHerdTotal'),
              dollars: true,
              bg: 'green'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseShedTotal'),
              value: this.getFieldValue('ExpenseShedTotal'),
              dollars: true,
              bg: 'green'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseCashFeedTotal'),
              value: this.getFieldValue('ExpenseCashFeedTotal'),
              dollars: true,
              bg: 'green'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Cash Overheads',
              value: this.getFieldValue('ExpenseCashOverheadsTotal'),
              dollars: true,
              bg: 'dark_blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Lease Payments',
              value: this.getFieldValue('ExpenseLease'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Interest Payments',
              value: this.getFieldValue('ExpenseInterest'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('CashFlowPrincipalRepayment'),
              value: this.getFieldValue('CashFlowPrincipalRepayment'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Net Capital Expenditure',
              value: this.getFieldValue('CashFlowCapitalPurchase'),
              dollars: true,
              bg: 'blue'
            })
          ),
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Personal Drawings',
            value: this.getFieldValue('CashFlowOwnerDrawings'),
            dollars: true,
            bg: 'orange'
          })
        )
      )
    );
  },
  renderBox: function renderBox(label, value) {
    return _react2.default.createElement(_ReportMapBox2.default, { label: label, value: value });
  },
  renderSingleField: function renderSingleField(fieldId) {
    var obj = this.props.report.flatFields[fieldId];
    return this.renderBox(obj.props.Label, this.getFieldValue(fieldId));
  },
  getFieldLabel: function getFieldLabel(fieldId) {
    return this.props.report.flatFields[fieldId].props.Label;
  },
  getFieldValue: function getFieldValue(fieldId) {
    return +this.props.report.flatFields[fieldId].value;
  },
  getFieldUnit: function getFieldUnit(fieldId) {
    return this.props.report.flatFields[fieldId].props.Unit;
  },
  calculateSumFields: function calculateSumFields(fieldIds) {
    var _this = this;

    return _.sum(fieldIds.map(function (id, index) {
      return +_this.props.report.flatFields[id].value;
    }));
  },
  calculateReduceFields: function calculateReduceFields(fieldIds) {
    var _this2 = this;

    return fieldIds.reduce(function (a, b) {
      var ref = _this2.props.report.flatFields;
      return +ref[a].value - +ref[b].value;
    });
  },
  calculateReduceValues: function calculateReduceValues(values) {
    return values.reduce(function (a, b) {
      return a - b;
    });
  },
  calculateOperationSurplus: function calculateOperationSurplus() {
    return this.calculateReduceValues([this.calculateSumFields(['IncomeMilkTotal', 'IncomeFeedWaterSale', 'IncomeFarmOther', 'CashFlowLivestockNet']), this.getFieldValue('ExpenseHerdTotal'), this.getFieldValue('ExpenseShedTotal'), this.getFieldValue('ExpenseCashFeedTotal'), this.getFieldValue('ExpenseCashOverheadsTotal')]);
  },
  calculateCashFlow: function calculateCashFlow() {
    var initial = this.calculateReduceValues([this.calculateOperationSurplus(), this.getFieldValue('ExpenseLease'), this.getFieldValue('ExpenseInterest'), this.getFieldValue('CashFlowCapitalPurchase'), this.getFieldValue('CashFlowPrincipalRepayment')]);

    return initial;
  },
  calculateCashFlowBeforeTax: function calculateCashFlowBeforeTax() {
    var cashFlow = this.calculateCashFlow();

    var nonFarmCash = this.getFieldValue('IncomeNonFarm');
    var overdrawings = this.getFieldValue('CashFlowOwnerDrawings');

    return cashFlow + nonFarmCash - overdrawings;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields, 'Fields', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_CashMap/Fields/index.jsx');
}();

;

/***/ }),
/* 689 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FlatFieldMap = __webpack_require__(302);

var _FlatFieldMap2 = _interopRequireDefault(_FlatFieldMap);

var _Fields = __webpack_require__(688);

var _Fields2 = _interopRequireDefault(_Fields);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ProfitMap = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      _FlatFieldMap2.default,
      null,
      _react2.default.createElement(_Fields2.default, { IsLandscape: this.props.IsLandscape })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ProfitMap, 'ProfitMap', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_CashMap/index.jsx');
}();

;

/***/ }),
/* 690 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _index = __webpack_require__(1170);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      null,
      this._renderTabs()
    );
  },
  _renderTabs: function _renderTabs() {
    var _this = this;

    return this.props.printTabs.map(function (tab, index) {
      var TabHeader = tab.handlers.header;
      var TabBody = tab.handlers.body;
      return _react2.default.createElement(
        'div',
        { key: tab.id, className: 'SingleReport__PrintTab' },
        _react2.default.createElement(
          'div',
          { className: '_header' },
          _react2.default.createElement(
            'h1',
            { className: 'PrintableReport__title' },
            tab.title
          ),
          _react2.default.createElement(
            'div',
            { className: 'PrintLogo' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'dairyaustralialogo' })
          )
        ),
        _react2.default.createElement(TabHeader, _extends({}, _this.props, { activeTab: tab, isPrinting: true })),
        _react2.default.createElement(TabBody, _extends({}, _this.props, { activeTab: tab, isPrinting: true })),
        _this._renderPageBreak(index, _this.props.tabs.length)
      );
    });
  },
  _renderPageBreak: function _renderPageBreak(index, length) {
    return index + 1 >= length ? null : _react2.default.createElement('div', { className: 'page-break' });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_PrintModal/index.jsx');
}();

;

/***/ }),
/* 691 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _index = __webpack_require__(1171);

var _index2 = _interopRequireDefault(_index);

var _ReportMapBox = __webpack_require__(306);

var _ReportMapBox2 = _interopRequireDefault(_ReportMapBox);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _NaNtoDash = __webpack_require__(147);

var _NaNtoDash2 = _interopRequireDefault(_NaNtoDash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fields = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'SingleReport__tableWrapper' },
      _react2.default.createElement(
        'div',
        { className: 'ProfitMap' },
        _react2.default.createElement(
          'div',
          { className: '_col1' },
          _react2.default.createElement(
            'span',
            { className: 'ProfitMap__line _line1' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
          ),
          _react2.default.createElement(
            'span',
            { className: 'ProfitMap__line _line2' },
            _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Total Cows',
              value: this.getFieldValue('CowMilkerNumber'),
              unit: this.getFieldUnit('CowMilkerNumber'),
              bg: 'dark_blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Milk Solids Sold',
              value: this.calculateDivideFields('MilkSolidsKgTotal', 'CowMilkerNumber'),
              unit: 'kg MS / Cow',
              bg: 'dark_blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('IncomeLivestockTrading'),
              value: this.getFieldValue('IncomeLivestockTrading'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'All Other Income',
              value: this.calculateSumFields(['IncomeFeedWaterSale', 'IncomeFarmOther']),
              dollars: true,
              bg: 'blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement('span', { className: 'ProfitMap__line _line1' }),
            _react2.default.createElement('span', { className: 'ProfitMap__line _line2' }),
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line3' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line4' },
              _react2.default.createElement(_Icon2.default, { className: '_icon __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Assets Leased',
                value: this.getFieldValue('AssetsLeasedTotalAvg'),
                dollars: true,
                bg: 'orange'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Assets Owned',
                value: this.getFieldValue('AssetsOwnedTotalAvg'),
                dollars: true,
                bg: 'orange'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Assets Managed',
                value: this.getFieldValue('AssetsAllCapitalAvg'),
                dollars: true,
                bg: 'orange'
              })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Return on Total Assets',
              value: (0, _NaNtoDash2.default)(this.getFieldValue('ReturnOnCapitalExclAppreciation')),
              unit: this.getFieldUnit('ReturnOnCapitalExclAppreciation'),
              bg: 'yellow',
              decimal: 1
            })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_gutter' },
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Milk Solids Sold',
            value: this.getFieldValue('MilkSolidsKgTotal'),
            unit: 'kg MS',
            bg: 'border'
          }),
          _react2.default.createElement(
            'div',
            { className: '_subhead' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon  __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Other Income'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col2' },
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Milk Income (net)',
                value: this.getFieldValue('IncomeMilkTotal'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Gross Farm Income',
                value: this.getFieldValue('IncomeTotal'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Gross Margin',
                value: this.getFieldValue('OperatingGrossMargin'),
                dollars: true,
                bg: 'yellow'
              })
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Earnings Before Interest & Tax (EBIT)',
                value: this.getFieldValue('EBIT'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            _react2.default.createElement(
              'div',
              { className: '_fieldWithLine' },
              _react2.default.createElement(
                'span',
                { className: 'ProfitMap__line _line' },
                _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
              ),
              _react2.default.createElement(_ReportMapBox2.default, {
                label: 'Net Farm Income',
                value: this.getFieldValue('NetProfitBeforeTax'),
                dollars: true,
                bg: 'yellow'
              })
            ),
            this.renderEquityField()
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'downarrow' })
            ),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ReturnEquityExclAppreciation'),
              value: (0, _NaNtoDash2.default)(this.getFieldValue('ReturnEquityExclAppreciation').toFixed(1)),
              unit: '%',
              bg: 'yellow',
              decimal: 1
            })
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_gutter' },
          _react2.default.createElement(_ReportMapBox2.default, {
            label: 'Price Per Unit',
            value: this.calculateDivideFields('IncomeMilkTotal', 'MilkSolidsKgTotal', 2),
            unit: ' / kg MS',
            dollars: true,
            bg: 'border',
            decimal: 2
          }),
          _react2.default.createElement(
            'div',
            { className: '_subhead2' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon  __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Variable Costs'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_subhead3' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon  __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Overheads'
            )
          ),
          _react2.default.createElement(
            'div',
            { className: '_subhead4' },
            _react2.default.createElement('span', { className: '_line1' }),
            _react2.default.createElement(
              'span',
              { className: '_line2' },
              _react2.default.createElement(_Icon2.default, { className: '_icon  __profitBumpThisOne', id: 'rightarrow' })
            ),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Finance Costs'
            )
          )
        ),
        _react2.default.createElement(
          'div',
          { className: '_col3' },
          _react2.default.createElement(
            'div',
            { className: '_group1' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseHerdTotal'),
              value: this.getFieldValue('ExpenseHerdTotal'),
              dollars: true,
              bg: 'green'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseShedTotal'),
              value: this.getFieldValue('ExpenseShedTotal'),
              dollars: true,
              bg: 'green'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Feed Costs (incl feed & water inventory change)',
              value: this.getFieldValue('ExpenseFeedTotal'),
              dollars: true,
              bg: 'green'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group2' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Cash Overheads',
              value: this.getFieldValue('ExpenseCashOverheadsTotal'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseImputedPeople'),
              value: this.getFieldValue('ExpenseImputedPeople'),
              dollars: true,
              bg: 'blue'
            }),
            _react2.default.createElement(_ReportMapBox2.default, {
              label: this.getFieldLabel('ExpenseDepreciation'),
              value: this.getFieldValue('ExpenseDepreciation'),
              dollars: true,
              bg: 'blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group3' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Interest & Lease Costs',
              value: this.calculateSumFields(['ExpenseInterest', 'ExpenseLease']),
              dollars: true,
              bg: 'dark_blue'
            })
          ),
          _react2.default.createElement(
            'div',
            { className: '_group4' },
            _react2.default.createElement(_ReportMapBox2.default, {
              label: 'Liabilities',
              value: this.getFieldValue('LiabilitiesTotalAvg'),
              dollars: true,
              bg: 'orange'
            }),
            _react2.default.createElement(
              'span',
              { className: 'ProfitMap__line _line' },
              _react2.default.createElement(_Icon2.default, { className: '_icon  __profitBumpThisOne', id: 'leftarrow' })
            )
          )
        )
      )
    );
  },
  renderBox: function renderBox(label, value, bg) {
    return _react2.default.createElement(_ReportMapBox2.default, {
      label: label,
      value: value,
      unit: this.getFieldUnit('CowMilkerNumber'),
      bg: bg
    });
  },
  renderEquityField: function renderEquityField() {
    return _react2.default.createElement(
      'div',
      { className: '_equityField' },
      _react2.default.createElement(_ReportMapBox2.default, {
        label: 'Equity',
        value: this.getFieldValue('EquityAvg'),
        dollars: true,
        subValue: (0, _NaNtoDash2.default)(this.getFieldValue('EquityPercentAvg')),
        subUnit: '%',
        bg: 'orange'
      })
    );
  },
  renderField: function renderField(fieldId) {
    var obj = this.props.report.flatFields[fieldId];
    return this.renderBox(obj.props.Label, obj.value);
  },
  calculateSumFields: function calculateSumFields(fieldIds) {
    var _this = this;

    return _.sum(fieldIds.map(function (id, index) {
      return +_this.props.report.flatFields[id].value;
    }));
  },
  calculateDivideFields: function calculateDivideFields(fieldId1, fieldId2, decimals) {
    var ref = this.props.report.flatFields;
    return (0, _NaNtoDash2.default)((+ref[fieldId1].value / +ref[fieldId2].value).toFixed(decimals || 0));
  },
  getFieldValue: function getFieldValue(fieldId) {
    return +this.props.report.flatFields[fieldId].value;
  },
  getFieldLabel: function getFieldLabel(fieldId) {
    return this.props.report.flatFields[fieldId].props.Label;
  },
  getFieldUnit: function getFieldUnit(fieldId) {
    return this.props.report.flatFields[fieldId].props.Unit;
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields, 'Fields', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_ProfitMap/Fields/index.jsx');
}();

;

/***/ }),
/* 692 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _FlatFieldMap = __webpack_require__(302);

var _FlatFieldMap2 = _interopRequireDefault(_FlatFieldMap);

var _Fields = __webpack_require__(691);

var _Fields2 = _interopRequireDefault(_Fields);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ProfitMap = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      _FlatFieldMap2.default,
      null,
      _react2.default.createElement(_Fields2.default, null)
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ProfitMap, 'ProfitMap', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/_ProfitMap/index.jsx');
}();

;

/***/ }),
/* 693 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1172);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reflux = __webpack_require__(3);

var _reflux2 = _interopRequireDefault(_reflux);

var _ReportTemplate = __webpack_require__(112);

var _ReportTemplate2 = _interopRequireDefault(_ReportTemplate);

var _reportFilters = __webpack_require__(24);

var _reportFilters2 = _interopRequireDefault(_reportFilters);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TestReport__Report = module.exports = __webpack_require__(1)({

  mixins: [_reflux2.default.listenTo(_reportFilters2.default, '_handleReportFilters')],

  getInitialState: function getInitialState() {
    return {
      filters: []
    };
  },
  componentWillMount: function componentWillMount() {
    this._handleReportFilters();
  },
  _handleReportFilters: function _handleReportFilters() {
    var financeRatios = _reportFilters2.default.store.UserReportSingles[0];
    this.setState({
      filters: [financeRatios['FinanceRatio1'], financeRatios['FinanceRatio2'], financeRatios['FinanceRatio3'], financeRatios['FinanceRatio4'], financeRatios['FinanceRatio5']]
    });
  },
  render: function render() {
    return _react2.default.createElement(_ReportTemplate2.default, {
      reportId: 1,
      selectedDatasets: this.props.selectedDatasets,
      bannerDOMRef: this.props.bannerDOMRef,
      emitResetScroll: this.props.emitResetScroll,
      filters: this.state.filters,
      printModalhandler: __webpack_require__(690),
      tabs: [{
        id: 'summary',
        title: 'Summary Table',
        table: 'SummaryTable',
        summary: true,
        handlers: {
          header: __webpack_require__(161),
          body: __webpack_require__(162)
        }
      }, {
        id: 'physical',
        title: 'Physical Table',
        table: 'PhysicalTable',
        handlers: {
          header: __webpack_require__(304),
          body: __webpack_require__(305)
        }
      }, {
        id: 'energy',
        title: 'Energy Balance',
        table: 'EnergyBalanceTable',
        limitedAccess: true,
        accessLevel: 2,
        accessGroups: ['expert'],
        handlers: {
          header: __webpack_require__(304),
          body: __webpack_require__(305)
        }
      }, {
        id: 'cash',
        title: 'Cash Table',
        table: 'CashTable',
        handlers: {
          header: __webpack_require__(161),
          body: __webpack_require__(162)
        }
      }, {
        id: 'profit',
        title: 'Profit Table',
        table: 'ProfitTable',
        handlers: {
          header: __webpack_require__(161),
          body: __webpack_require__(162)
        }
      }, {
        id: 'wealth',
        title: 'Wealth Table',
        table: 'WealthTable',
        balanceSheet: true,
        handlers: {
          header: __webpack_require__(161),
          body: __webpack_require__(162)
        }
      }, {
        id: 'cashMap',
        title: 'Cash Map',
        classes: '__condense__',
        handlers: {
          header: __webpack_require__(303),
          body: __webpack_require__(689)
        }
      }, {
        id: 'profitMap',
        title: 'Profit Map',
        handlers: {
          header: __webpack_require__(303),
          body: __webpack_require__(692)
        }
      }]
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(TestReport__Report, 'TestReport__Report', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/_Report/index.jsx');
}();

;

/***/ }),
/* 694 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1174);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _ReportStepTemplate = __webpack_require__(164);

var _ReportStepTemplate2 = _interopRequireDefault(_ReportStepTemplate);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__generateReport = __webpack_require__(146);

var _POST__generateReport2 = _interopRequireDefault(_POST__generateReport);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SingleReport = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      selectedDatasets: [],
      reportLoaded: false,
      reportRequestPortalOpen: false,
      approvedStep: 0
    };
  },
  componentWillMount: function componentWillMount() {
    var prefillDatasetIds = this.props.prefillDatasetIds;

    if (prefillDatasetIds) {
      this._handleDatasetSelection(prefillDatasetIds[1]);
    }
  },
  _handleDatasetSelection: function _handleDatasetSelection(id) {
    var _this = this;

    this.setState({
      selectedDatasets: [id]
    }, function () {
      _this._toggleReportRequestPortal();
    });
  },
  _toggleReportRequestPortal: function _toggleReportRequestPortal() {
    this.setState({
      reportRequestPortalOpen: !this.state.reportRequestPortalOpen
    });
  },
  _handleLoadReportSuccess: function _handleLoadReportSuccess() {
    var _this2 = this;

    this.setState({
      reportLoaded: true,
      approvedStep: 1
    }, function () {
      _this2._toggleReportRequestPortal();
      _this2.setState({
        reportLoaded: false
      });
    });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'SingleReport' },
      _react2.default.createElement(_ReportStepTemplate2.default, {
        emitResetScroll: this.props.emitResetScroll,
        emitDatasetSelection: this._handleDatasetSelection,
        selectedDatasets: this.state.selectedDatasets,
        approvedStep: this.state.approvedStep,
        reportLoaded: this.state.reportLoaded,
        bannerDOMRef: this.props.bannerDOMRef,
        steps: [{
          id: 'datasets',
          title: 'Datasets',
          handler: __webpack_require__(687)
        }, {
          id: 'report',
          title: 'Report',
          handler: __webpack_require__(693)
        }]
      }),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.reportRequestPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._handleLoadReportSuccess,
          failHandler: this._toggleReportRequestPortal,
          request: _POST__generateReport2.default,
          data: {
            ReportId: 1,
            FarmDataSetList: this.state.selectedDatasets
          },
          pendingText: {
            title: 'Please wait',
            text: 'Generating Report'
          },
          successText: {
            title: 'Success!',
            text: 'Report generated.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'Your report could not be generated.'
          } })
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SingleReport, 'SingleReport', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_SingleReport/index.jsx');
}();

;

/***/ }),
/* 695 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _dataDefinition = __webpack_require__(9);

var _dataDefinition2 = _interopRequireDefault(_dataDefinition);

var _InputSelect = __webpack_require__(34);

var _InputSelect2 = _interopRequireDefault(_InputSelect);

var _DescriptionLabel = __webpack_require__(25);

var _DescriptionLabel2 = _interopRequireDefault(_DescriptionLabel);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Fields__RegionField = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportFilter2__doubleField' },
      _react2.default.createElement(
        'div',
        { className: '_label' },
        _react2.default.createElement(_DescriptionLabel2.default, {
          label: this.props.fields['Grp1RegionSelect'].Label,
          description: this.props.fields['Grp1RegionSelect'].Description
        })
      ),
      this._renderCols()
    );
  },
  _renderCols: function _renderCols() {
    var _this = this;

    return ['Grp1RegionSelect', 'Grp2RegionSelect'].map(function (field, index) {
      var regionField = index === 0 ? 'Grp1RegionType' : 'Grp2RegionType';
      var options = _.find(_dataDefinition2.default.selectOptions.ReportRegionGroupId, {
        Id: _this.props.fields[regionField].Value
      }).Options;

      return _react2.default.createElement(
        'div',
        { className: '_col', key: index },
        _react2.default.createElement(
          'div',
          { className: '_field' },
          _react2.default.createElement(_InputSelect2.default, {
            id: field,
            value: _this.props.fields[field].Value,
            options: options,
            onSubmit: _this.props.emitUpdate
          })
        )
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Fields__RegionField, 'Fields__RegionField', 'C:/_repos_windows/dairybase/Frontend/app/views/routes/reports/_shared/fields/region/index.jsx');
}();

;

/***/ }),
/* 696 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _index = __webpack_require__(1179);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _reactDndCjs = __webpack_require__(84);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var ItemTypes = {
  CARD: 'card2'
};

var cardSource = {
  beginDrag: function beginDrag(props) {
    return { id: props.id };
  },


  endDrag: function endDrag(props, monitor, component) {
    props.onDropCard();
  }
};

var cardTarget = {
  hover: function hover(props, monitor) {
    var draggedId = monitor.getItem().id;

    if (draggedId !== props.id) {
      props.moveCard(draggedId, props.id);
    }
  }
};

var Card = function (_Component) {
  _inherits(Card, _Component);

  function Card() {
    _classCallCheck(this, Card);

    return _possibleConstructorReturn(this, (Card.__proto__ || Object.getPrototypeOf(Card)).apply(this, arguments));
  }

  _createClass(Card, [{
    key: 'render',
    value: function render() {
      var _props = this.props,
          text = _props.text,
          isDragging = _props.isDragging,
          connectDragSource = _props.connectDragSource,
          connectDropTarget = _props.connectDropTarget,
          onDelete = _props.onDelete,
          DairyBaseId = _props.DairyBaseId,
          FinancialYear = _props.FinancialYear,
          Name = _props.Name;


      var opacity = isDragging ? 0 : 1;
      return connectDragSource(connectDropTarget(_react2.default.createElement(
        'div',
        {
          className: 'Comparison__ReportModalSelectedList__item',
          style: { cursor: 'move', opacity: opacity } },
        _react2.default.createElement(
          'button',
          { className: '_item', onClick: onDelete },
          DairyBaseId,
          ' ',
          FinancialYear,
          ' ',
          Name
        )
      )));
    }
  }]);

  return Card;
}(_react.Component);

var _default = (0, _reactDndCjs.DropTarget)(ItemTypes.CARD, cardTarget, function (connect) {
  return {
    connectDropTarget: connect.dropTarget()
  };
})((0, _reactDndCjs.DragSource)(ItemTypes.CARD, cardSource, function (connect, monitor) {
  return {
    connectDragSource: connect.dragSource(),
    isDragging: monitor.isDragging()
  };
})(Card));

exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ItemTypes, 'ItemTypes', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(cardSource, 'cardSource', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(cardTarget, 'cardTarget', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(Card, 'Card', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/Card/index.js');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/Card/index.js');
}();

;
module.exports = exports['default'];

/***/ }),
/* 697 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _immutabilityHelper = __webpack_require__(243);

var _immutabilityHelper2 = _interopRequireDefault(_immutabilityHelper);

var _Card = __webpack_require__(696);

var _Card2 = _interopRequireDefault(_Card);

var _reactDndHtml5BackendCjs = __webpack_require__(250);

var _reactDndHtml5BackendCjs2 = _interopRequireDefault(_reactDndHtml5BackendCjs);

var _reactDndCjs = __webpack_require__(84);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var Container = function (_Component) {
  _inherits(Container, _Component);

  function Container(props) {
    _classCallCheck(this, Container);

    var _this = _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));

    _this.moveCard = _this.moveCard.bind(_this);
    _this.drawFrame = _this.drawFrame.bind(_this);
    _this.handleDelete = _this.handleDelete.bind(_this);
    _this.handleDropCard = _this.handleDropCard.bind(_this);

    var cardsById = {};
    var cardsByIndex = [];

    var loop = props.list.forEach(function (r, i) {
      var card = {
        id: r.Id,
        DairyBaseId: r.DairyBaseId,
        FinancialYear: r.FinancialYear,
        Name: r.Name
      };

      cardsById[r.Id] = card;
      cardsByIndex[i] = card;
    });

    _this.state = {
      cardsById: cardsById,
      cardsByIndex: cardsByIndex
    };
    return _this;
  }

  _createClass(Container, [{
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(newProps) {
      var _this2 = this;

      if (this.props.list.length !== newProps.list.length) {
        var cardsById = {};
        var cardsByIndex = [];

        var loop = newProps.list.forEach(function (r, i) {
          // if(i > 10) return;
          var card = {
            id: r.Id,
            DairyBaseId: r.DairyBaseId,
            FinancialYear: r.FinancialYear,
            Name: r.Name
          };

          cardsById[r.Id] = card;
          cardsByIndex[i] = card;
        });

        this.setState({
          cardsById: cardsById
        }, function () {
          return _this2.scheduleUpdate({
            cardsByIndex: {
              $set: cardsByIndex
            }
          });
        });
      }
    }
  }, {
    key: 'handleDelete',
    value: function handleDelete(index, id) {
      this.scheduleUpdate({
        cardsByIndex: {
          $splice: [[index, 1]]
        }
      });

      this.props.onDelete(id);
    }
  }, {
    key: 'handleDropCard',
    value: function handleDropCard() {
      var newState = this.state.cardsByIndex.map(function (card) {
        return card.id;
      });
      this.props.onReorder(newState);
    }
  }, {
    key: 'moveCard',
    value: function moveCard(id, afterId) {
      var _state = this.state,
          cardsById = _state.cardsById,
          cardsByIndex = _state.cardsByIndex;


      var card = cardsById[id];
      var afterCard = cardsById[afterId];

      var cardIndex = cardsByIndex.indexOf(card);
      var afterIndex = cardsByIndex.indexOf(afterCard);

      this.scheduleUpdate({
        cardsByIndex: {
          $splice: [[cardIndex, 1], [afterIndex, 0, card]]
        }
      });
    }
  }, {
    key: 'componentWillUnmount',
    value: function componentWillUnmount() {
      cancelAnimationFrame(this.requestedFrame);
    }
  }, {
    key: 'scheduleUpdate',
    value: function scheduleUpdate(update) {
      this.pendingUpdate = update;

      if (!this.requestedFrame) {
        this.requestedFrame = requestAnimationFrame(this.drawFrame);
      }
    }
  }, {
    key: 'drawFrame',
    value: function drawFrame() {
      var nextState = (0, _immutabilityHelper2.default)(this.state, this.pendingUpdate);

      this.setState(nextState);

      this.pendingUpdate = null;
      this.requestedFrame = null;
    }
  }, {
    key: 'render',
    value: function render() {
      var _this3 = this;

      var cardsByIndex = this.state.cardsByIndex;

      return _react2.default.createElement(
        _reactDndCjs.DndProvider,
        { backend: _reactDndHtml5BackendCjs2.default },
        _react2.default.createElement(
          'div',
          null,
          cardsByIndex.map(function (card, index) {
            return _react2.default.createElement(_Card2.default, {
              key: card.id,
              id: card.id,
              DairyBaseId: card.DairyBaseId,
              FinancialYear: card.FinancialYear,
              Name: card.Name,
              moveCard: _this3.moveCard,
              onDropCard: function onDropCard() {
                return _this3.handleDropCard();
              },
              onDelete: function onDelete() {
                return _this3.handleDelete(index, card.id);
              }
            });
          })
        )
      );
    }
  }]);

  return Container;
}(_react.Component);

var _default = Container;
exports.default = _default;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Container, 'Container', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/index.jsx');

  __REACT_HOT_LOADER__.register(_default, 'default', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/DndList/index.jsx');
}();

;
module.exports = exports['default'];

/***/ }),
/* 698 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1180);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

var _DndList = __webpack_require__(697);

var _DndList2 = _interopRequireDefault(_DndList);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var SelectedList = module.exports = __webpack_require__(1)({
  _renderEmptySlots: function _renderEmptySlots() {

    var arr = [];
    var n = 0;

    while (n < this.props.maxDatasets) {
      n++;
      arr.push(n);
    }

    var _emptyItems = arr.map(function (item, index) {
      return _react2.default.createElement(
        'div',
        {
          key: index,
          className: '_item' },
        'Dataset ',
        index + 1
      );
    });

    return _react2.default.createElement(
      'div',
      { className: 'ReportModalEmptyList' },
      _emptyItems
    );
  },
  _handleClickSelected: function _handleClickSelected(id) {
    this.props.emitRemoveFromSelected(id);
  },
  _renderSelectedList: function _renderSelectedList() {
    var _this = this;

    var selected = this.props.selected;

    var list = this.props.datasetList.filter(function (item) {
      return _.includes(selected, item.Id);
    });

    var selectedList = _.sortBy(list, function (item) {
      return _.indexOf(selected, item.Id);
    });

    return _react2.default.createElement(
      'div',
      { className: 'ReportModalSelectedList' },
      _react2.default.createElement(_DndList2.default, {
        list: selectedList,
        onReorder: function onReorder(arr) {
          return _this.props.reorder(arr);
        },
        onDelete: function onDelete(id) {
          return _this.props.emitRemoveFromSelected(id);
        } })
    );
  },
  _renderSubmitBtn: function _renderSubmitBtn() {
    var onClick = this.props.selected.length < 1 ? null : this.props._emitTransitionToFilters;
    var pluralise = this.props.maxDatasets > 1 ? 's' : '';

    var ReportModalBody__submitBtn = (0, _classnames2.default)({
      'ReportModalDatasets__submitBtn': true,
      'is-clickable': this.props.selected.length >= 1
    });

    return _react2.default.createElement(
      'button',
      {
        className: ReportModalBody__submitBtn,
        onClick: onClick },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'span',
          { className: '_text' },
          'Set Report Filters'
        ),
        _react2.default.createElement(_Icon2.default, { id: 'forward', className: '_icon' })
      )
    );
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportModalSelectedDatasets' },
      _react2.default.createElement(
        'div',
        { className: '_listContainer' },
        _react2.default.createElement(
          'h3',
          { className: '_title' },
          'Selected Datasets:'
        ),
        _react2.default.createElement(
          'div',
          { className: 'ReportModalFloatingList' },
          this._renderSelectedList(),
          this._renderEmptySlots()
        ),
        this._renderSubmitBtn()
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(SelectedList, 'SelectedList', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ComparisonReportTemplate/_Datasets/_SelectedList/index.jsx');
}();

;

/***/ }),
/* 699 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1185);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ModalBoxTemplate = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ModalBoxTemplate' },
      _react2.default.createElement(
        'div',
        { className: '_container' },
        _react2.default.createElement(
          'div',
          { className: '_content' },
          _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.toggleModal }),
          this.props.children
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ModalBoxTemplate, 'ModalBoxTemplate', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ModalBoxTemplate/index.jsx');
}();

;

/***/ }),
/* 700 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1186);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var PrintableReport = module.exports = __webpack_require__(1)({
  shouldComponentUpdate: function shouldComponentUpdate() {
    return false;
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'PrintableReport' },
      this.props.children
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(PrintableReport, 'PrintableReport', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_PrintableReport/index.jsx');
}();

;

/***/ }),
/* 701 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1187);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTabNavigation = module.exports = __webpack_require__(1)({
  _onClick: function _onClick(id) {
    this.props.emitStepChange(id);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportTabNavigation' },
      this._renderSteps()
    );
  },
  _renderSteps: function _renderSteps() {
    var _this = this;

    return this.props.steps.map(function (step, index) {
      var ReportTabNavigation__link = (0, _classnames2.default)({
        "ReportTabNavigation__link": true,
        "is-active": step.id === _this.props.activeStepId
      });
      return index > _this.props.approvedStep ? null : _react2.default.createElement(
        'button',
        {
          key: index,
          className: ReportTabNavigation__link,
          onClick: _this._onClick.bind(_this, step.id) },
        step.title
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTabNavigation, 'ReportTabNavigation', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportStepTemplate/_Steps/index.jsx');
}();

;

/***/ }),
/* 702 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1189);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _server = __webpack_require__(378);

var _server2 = _interopRequireDefault(_server);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__createPrintPdf = __webpack_require__(259);

var _POST__createPrintPdf2 = _interopRequireDefault(_POST__createPrintPdf);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({
  mixins: [(0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      isDefinitelyOpen: false,
      HTML: ''
    };
  },
  componentWillReceiveProps: function componentWillReceiveProps(newProps) {
    if (!this.props.isOpen && newProps.isOpen) {
      var el = document.getElementById('__print_this__');
      var HTML = el.innerHTML;

      this.setState({
        isDefinitelyOpen: true,
        HTML: HTML
      });
    }
    if (this.props.isOpen && !newProps.isOpen) {
      this.setState({
        isDefinitelyOpen: false
      });
    }
  },
  __togglePDFPortal: function __togglePDFPortal() {
    this.props.onToggle();
  },
  _handleFinishPDF: function _handleFinishPDF() {
    this.props.onClose();
  },
  render: function render() {
    return _react2.default.createElement(
      _Portal2.default,
      {
        context: document.body,
        isOpen: this.state.isDefinitelyOpen,
        className: 'Overlay' },
      _react2.default.createElement(_RequestModal2.default, {
        successHandler: this._handleFinishPDF,
        failHandler: this.__togglePDFPortal,
        request: _POST__createPrintPdf2.default,
        data: {
          HtmlString: this.state.HTML,
          IsLandscape: this.props.IsLandscape,
          IsA3: this.props.IsA3,
          CSSString: this.props.CSSString
        },
        wait: true,
        pendingText: {
          title: 'Please wait',
          text: 'Generating PDF...'
        },
        successText: {
          title: 'PDF created!',
          text: 'The PDF file should be in your download folder.'
        },
        failText: {
          title: 'Oops, something went wrong.',
          text: 'The PDF was not generated.'
        }
      })
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/DownloadPortal/index.js');
}();

;

/***/ }),
/* 703 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1190);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _POST__downloadReport = __webpack_require__(417);

var _POST__downloadReport2 = _interopRequireDefault(_POST__downloadReport);

var _datasetList = __webpack_require__(10);

var _datasetList2 = _interopRequireDefault(_datasetList);

var _lodash = __webpack_require__(118);

var _lodash2 = _interopRequireDefault(_lodash);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__Actions = module.exports = __webpack_require__(1)({
  getInitialState: function getInitialState() {
    return {
      downloadSpreadsheetPortalOpen: false
    };
  },
  _toggleSpreadsheetPortal: function _toggleSpreadsheetPortal() {
    this.setState({
      downloadSpreadsheetPortalOpen: !this.state.downloadSpreadsheetPortalOpen
    });
  },
  _checkDatasetList: function _checkDatasetList() {
    var readList = this.props.selectedDatasets.filter(function (datasetId, index) {
      var Dataset = _lodash2.default.find(_datasetList2.default.store, { Id: datasetId });
      return Dataset.ReadOnlyAuthority && !Dataset.CopyAuthority;
    });

    return readList.length >= 1;
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportTemplate__actions' },
      this._renderDownloadBtn(),
      this._renderPrintBtn(),
      this._renderReadOnlyMessage(),
      _react2.default.createElement(
        _Portal2.default,
        {
          context: document.body,
          isOpen: this.state.downloadSpreadsheetPortalOpen },
        _react2.default.createElement(_RequestModal2.default, {
          successHandler: this._toggleSpreadsheetPortal,
          failHandler: this._toggleSpreadsheetPortal,
          request: _POST__downloadReport2.default,
          wait: true,
          data: {
            ReportId: this.props.reportId,
            FarmDataSetList: this.props.selectedDatasets
          },
          pendingText: {
            title: 'Please wait',
            text: 'Generating spreadsheet.'
          },
          successText: {
            title: 'Spreadsheet created!',
            text: 'The Excel file should be in your download folder. To use this in Excel you will need to Enable Editing at the top of the spreadsheet.'
          },
          failText: {
            title: 'Oops, something went wrong.',
            text: 'The spreadsheet was not generated.'
          }
        })
      )
    );
  },
  _renderDownloadBtn: function _renderDownloadBtn() {
    return this.props.reportId !== 1 && this.props.reportId !== 2 && this.props.reportId !== 3 && this.props.reportId !== 5 && this.props.reportId !== 6 || this._checkDatasetList() ? null : _react2.default.createElement(
      'button',
      { className: '_downloadBtn', onClick: this._toggleSpreadsheetPortal },
      'Download Spreadsheet'
    );
  },
  _renderPrintBtn: function _renderPrintBtn() {
    return this._checkDatasetList() ? null : _react2.default.createElement(
      'button',
      { className: '_printBtn', onClick: this.props.emitPrintReport },
      'Print Report'
    );
  },
  _renderReadOnlyMessage: function _renderReadOnlyMessage() {
    return !this._checkDatasetList() ? null : _react2.default.createElement(
      'h3',
      { className: '_readOnlyMessage' },
      'You have read only access on one or more datasets.'
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__Actions, 'ReportTemplate__Actions', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/_Actions/index.jsx');
}();

;

/***/ }),
/* 704 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1191);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _server = __webpack_require__(378);

var _server2 = _interopRequireDefault(_server);

var _Portal = __webpack_require__(5);

var _Portal2 = _interopRequireDefault(_Portal);

var _permaPortalMixin = __webpack_require__(45);

var _permaPortalMixin2 = _interopRequireDefault(_permaPortalMixin);

var _RequestModal = __webpack_require__(14);

var _RequestModal2 = _interopRequireDefault(_RequestModal);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _POST__createPrintPdf = __webpack_require__(259);

var _POST__createPrintPdf2 = _interopRequireDefault(_POST__createPrintPdf);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Datasets = module.exports = __webpack_require__(1)({
  mixins: [(0, _permaPortalMixin2.default)('bannerDOMRef')],

  getInitialState: function getInitialState() {
    return {
      PDFPortalOpen: false,
      HTML: ''
    };
  },
  _handlePDF: function _handlePDF() {
    var el = document.getElementById('__print_this__');
    var HTML = el.innerHTML;

    this.setState({
      PDFPortalOpen: !this.state.PDFPortalOpen,
      HTML: HTML
    });
  },
  __togglePDFPortal: function __togglePDFPortal() {
    this.setState({
      PDFPortalOpen: !this.state.PDFPortalOpen
    });
  },
  _handleFinishPDF: function _handleFinishPDF() {
    this.setState({ PDFPortalOpen: false });
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'DownloadPortal__ButtonGroup' },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(
          'button',
          { className: '_backBtn', onClick: this.props.emitCloseModal },
          _react2.default.createElement(
            'div',
            { className: '_content' },
            _react2.default.createElement(_Icon2.default, { className: '_icon', id: 'leftarrow' }),
            _react2.default.createElement(
              'span',
              { className: '_text' },
              'Back'
            )
          )
        ),
        _react2.default.createElement(
          'button',
          { className: '__PrintButton__', onClick: this._handlePDF },
          'Download PDF File'
        ),
        _react2.default.createElement('div', null),
        _react2.default.createElement(
          _Portal2.default,
          {
            context: document.body,
            isOpen: this.state.PDFPortalOpen,
            className: 'Overlay' },
          _react2.default.createElement(_RequestModal2.default, {
            successHandler: this._handleFinishPDF,
            failHandler: this.__togglePDFPortal,
            request: _POST__createPrintPdf2.default,
            data: {
              CSSString: this.props.CSSString,
              HtmlString: this.state.HTML,
              IsLandscape: this.props.IsLandscape,
              IsA3: this.props.IsA3
            },
            wait: true,
            pendingText: {
              title: 'Please wait',
              text: 'Generating PDF...'
            },
            successText: {
              title: 'PDF created!',
              text: 'The PDF file should be in your download folder.'
            },
            failText: {
              title: 'Oops, something went wrong.',
              text: 'The PDF was not generated.'
            }
          })
        )
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(Datasets, 'Datasets', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/_PrintModalTemplate/DownloadPortal/index.js');
}();

;

/***/ }),
/* 705 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1192);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _DownloadPortal = __webpack_require__(704);

var _DownloadPortal2 = _interopRequireDefault(_DownloadPortal);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    var _content = (0, _classnames2.default)({
      _content: true,
      IsLandscape: this.props.IsLandscape
    });

    return _react2.default.createElement(
      'div',
      { className: 'PrintModal' },
      _react2.default.createElement(
        'div',
        { className: _content },
        _react2.default.createElement(_DownloadPortal2.default, {
          emitCloseModal: this.props.emitCloseModal,
          CSSString: this.props.CSSString,
          IsLandscape: this.props.IsLandscape,
          IsA3: this.props.IsA3
        }),
        this.props.children
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/_PrintModalTemplate/index.jsx');
}();

;

/***/ }),
/* 706 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1193);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _Icon = __webpack_require__(6);

var _Icon2 = _interopRequireDefault(_Icon);

var _GenericCloseBtn = __webpack_require__(19);

var _GenericCloseBtn2 = _interopRequireDefault(_GenericCloseBtn);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTemplate__PrintModal = module.exports = __webpack_require__(1)({
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'PrintSelectModal' },
      _react2.default.createElement(
        'div',
        { className: '_content' },
        _react2.default.createElement(_GenericCloseBtn2.default, { onClick: this.props.emitCloseModal }),
        this.props.children
      )
    );
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTemplate__PrintModal, 'ReportTemplate__PrintModal', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/_PrintSelectModalTemplate/index.jsx');
}();

;

/***/ }),
/* 707 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _index = __webpack_require__(1194);

var _index2 = _interopRequireDefault(_index);

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _classnames = __webpack_require__(7);

var _classnames2 = _interopRequireDefault(_classnames);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var ReportTabNavigation = module.exports = __webpack_require__(1)({
  _onClick: function _onClick(id) {
    this.props.emitTabChange(id);
  },
  render: function render() {
    return _react2.default.createElement(
      'div',
      { className: 'ReportTabNavigation' },
      this._renderTabs()
    );
  },
  _renderTabs: function _renderTabs() {
    var _this = this;

    return this.props.tabs.map(function (tab, index) {
      var ReportTabNavigation__link = (0, _classnames2.default)({
        "ReportTabNavigation__link": true,
        "is-active": index === _this.props.activeTabIndex
      });
      return _react2.default.createElement(
        'button',
        {
          key: index,
          className: ReportTabNavigation__link,
          onClick: _this._onClick.bind(_this, index) },
        tab.title
      );
    });
  }
});
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(ReportTabNavigation, 'ReportTabNavigation', 'C:/_repos_windows/dairybase/Frontend/app/views/templates/_ReportTemplate/_Tabs/index.jsx');
}();

;

/***/ }),
/* 708 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var vars = {};

// font family - update these when external fonts are setup
vars['sans'] = 'sans-serif';
vars['Gilroy'] = 'Gilroy, sans-serif';
vars['serif'] = 'serif';

// font weights should be descriptive
vars['light'] = '300';
vars['roman'] = '400';
vars['medium'] = '500';
vars['semibold'] = '600';
vars['bold'] = '700';

// font sizes generally used on the html element and some mixins
vars['base_font_size'] = '16px';
vars['base_line_height'] = '1.5';

// Breakpoints
vars['portrait'] = '48em'; // based on ipad ~ 768px
vars['landscape'] = '64em'; // based on ipad ~ 1024px
vars['brand'] = '82em';
vars['laptop'] = '70em';

// literal colours
vars['black'] = '#060606';
vars['green'] = '#C3F3BF';
vars['orange'] = '#F3CFA3';
vars['blue'] = '#61BEE6';
vars['blue_opaque'] = '#6895B7';
vars['grey'] = '#8B949C';
vars['grey_light'] = '#CDCDD5';
vars['grey_dark'] = '#525263';
vars['light_grey'] = '#F8F7F7';
vars['medium_grey'] = '#b4b2ac';
vars['dark_grey'] = '#93918c';

// abstract colours
vars['foreground'] = vars['blue'];
vars['background'] = 'white';

// font family - update these when external fonts are setup
vars['sans'] = 'sans-serif';
vars['serif'] = 'serif';

// font weights should be descriptive
vars['light'] = 300;
vars['roman'] = 400;
vars['medium'] = 500;
vars['semibold'] = 600;
vars['bold'] = 700;

// font sizes generally used on the html element and some mixins
vars['base_font_size'] = '16px';
vars['base_line_height'] = 1.5;

// brand colours
vars['DA_blue'] = 'rgb(0, 103, 184)';
vars['DA_light_blue'] = 'rgb(183, 218, 245)';
vars['DA_medium_blue'] = 'rgb(0, 68, 132)';
vars['DA_navy'] = 'rgb(0, 58, 82)';
vars['DA_light_navy'] = 'rgba(0, 68, 132, 0.4)';

vars['DA_yellow'] = 'rgb(230, 176, 18)';
vars['DA_light_yellow'] = 'rgba(230, 176, 18, 0.4)';
vars['DA_off_yellow'] = 'rgb(227, 206, 76)';

vars['DA_red'] = 'rgb(212, 71, 15)';
vars['DA_light_red'] = 'rgba(212, 71, 15, 0.4)';

vars['DA_green'] = 'rgb(78, 118, 23)';
vars['DA_off_green'] = 'rgb(168, 181, 10)';
vars['DA_light_green'] = 'rgba(168, 181, 10, 0.4)';

// liberties...
vars['daves_green'] = '#80cf53';
vars['daves_orange'] = '#F6A83D';
vars['light_grey'] = '#F8F7F7';
vars['medium_grey'] = '#b4b2ac';
vars['dark_grey'] = '#93918c';

// abstract colours
vars['foreground'] = '#37383A';
vars['background'] = '#FFFFFF';
vars['focus_color'] = vars['DA_blue'];
vars['alert_color'] = vars['DA_light_red'];
vars['positive_highlight'] = vars['DA_medium_blue'];

vars['bronze'] = '#b89d7a';
vars['bronze--light'] = '#d9bea3';

vars['DA_sky_blue'] = '#B8DDE1';
vars['DA_Dairy_blue'] = '#0C2340';
vars['DA_Dairy_grey'] = '#EEEEED';
vars['DA_pasture_green'] = '#C3DC93';
vars['DA_sun_yellow'] = '#FBDB65';
vars['DA_Jersey_tan'] = '#DDCBA4';
vars['DA_dusk_pink'] = '#FCD2BF';
vars['DA_accent_blue'] = '#407EC9';
vars['DA_accent_green'] = '#6CC24A';
vars['DA_accent_yellow'] = '#EAAA00';
vars['DA_accent_pink'] = '#F09491';
vars['DA_white'] = '#FFFFFF';
vars['DA_black'] = '#000000';
vars['DA_hay_report_red'] = '#E73B3B';
vars['DA_text'] = 'rgba(0, 0, 0, 0.65)';

module.exports = vars;
;

var _temp = function () {
  if (typeof __REACT_HOT_LOADER__ === 'undefined') {
    return;
  }

  __REACT_HOT_LOADER__.register(vars, 'vars', 'C:/_repos_windows/dairybase/Frontend/assets/css/variables.js');
}();

;

/***/ }),
/* 709 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {

__webpack_require__(916);

__webpack_require__(1376);

__webpack_require__(717);

if (global._babelPolyfill) {
  throw new Error("only one instance of babel-polyfill is allowed");
}
global._babelPolyfill = true;

var DEFINE_PROPERTY = "defineProperty";
function define(O, key, value) {
  O[key] || Object[DEFINE_PROPERTY](O, key, {
    writable: true,
    configurable: true,
    value: value
  });
}

define(String.prototype, "padLeft", "".padStart);
define(String.prototype, "padRight", "".padEnd);

"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
  [][key] && define(Array, key, Function.call.bind([][key]));
});
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 710 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


exports.byteLength = byteLength
exports.toByteArray = toByteArray
exports.fromByteArray = fromByteArray

var lookup = []
var revLookup = []
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array

var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
for (var i = 0, len = code.length; i < len; ++i) {
  lookup[i] = code[i]
  revLookup[code.charCodeAt(i)] = i
}

// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup['-'.charCodeAt(0)] = 62
revLookup['_'.charCodeAt(0)] = 63

function getLens (b64) {
  var len = b64.length

  if (len % 4 > 0) {
    throw new Error('Invalid string. Length must be a multiple of 4')
  }

  // Trim off extra bytes after placeholder bytes are found
  // See: https://github.com/beatgammit/base64-js/issues/42
  var validLen = b64.indexOf('=')
  if (validLen === -1) validLen = len

  var placeHoldersLen = validLen === len
    ? 0
    : 4 - (validLen % 4)

  return [validLen, placeHoldersLen]
}

// base64 is 4/3 + up to two characters of the original data
function byteLength (b64) {
  var lens = getLens(b64)
  var validLen = lens[0]
  var placeHoldersLen = lens[1]
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}

function _byteLength (b64, validLen, placeHoldersLen) {
  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
}

function toByteArray (b64) {
  var tmp
  var lens = getLens(b64)
  var validLen = lens[0]
  var placeHoldersLen = lens[1]

  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))

  var curByte = 0

  // if there are placeholders, only get up to the last complete 4 chars
  var len = placeHoldersLen > 0
    ? validLen - 4
    : validLen

  for (var i = 0; i < len; i += 4) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 18) |
      (revLookup[b64.charCodeAt(i + 1)] << 12) |
      (revLookup[b64.charCodeAt(i + 2)] << 6) |
      revLookup[b64.charCodeAt(i + 3)]
    arr[curByte++] = (tmp >> 16) & 0xFF
    arr[curByte++] = (tmp >> 8) & 0xFF
    arr[curByte++] = tmp & 0xFF
  }

  if (placeHoldersLen === 2) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 2) |
      (revLookup[b64.charCodeAt(i + 1)] >> 4)
    arr[curByte++] = tmp & 0xFF
  }

  if (placeHoldersLen === 1) {
    tmp =
      (revLookup[b64.charCodeAt(i)] << 10) |
      (revLookup[b64.charCodeAt(i + 1)] << 4) |
      (revLookup[b64.charCodeAt(i + 2)] >> 2)
    arr[curByte++] = (tmp >> 8) & 0xFF
    arr[curByte++] = tmp & 0xFF
  }

  return arr
}

function tripletToBase64 (num) {
  return lookup[num >> 18 & 0x3F] +
    lookup[num >> 12 & 0x3F] +
    lookup[num >> 6 & 0x3F] +
    lookup[num & 0x3F]
}

function encodeChunk (uint8, start, end) {
  var tmp
  var output = []
  for (var i = start; i < end; i += 3) {
    tmp =
      ((uint8[i] << 16) & 0xFF0000) +
      ((uint8[i + 1] << 8) & 0xFF00) +
      (uint8[i + 2] & 0xFF)
    output.push(tripletToBase64(tmp))
  }
  return output.join('')
}

function fromByteArray (uint8) {
  var tmp
  var len = uint8.length
  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  var parts = []
  var maxChunkLength = 16383 // must be multiple of 3

  // go through the array every three bytes, we'll deal with trailing stuff later
  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
    parts.push(encodeChunk(
      uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
    ))
  }

  // pad the end with zeros, but make sure to not forget the extra bytes
  if (extraBytes === 1) {
    tmp = uint8[len - 1]
    parts.push(
      lookup[tmp >> 2] +
      lookup[(tmp << 4) & 0x3F] +
      '=='
    )
  } else if (extraBytes === 2) {
    tmp = (uint8[len - 2] << 8) + uint8[len - 1]
    parts.push(
      lookup[tmp >> 10] +
      lookup[(tmp >> 4) & 0x3F] +
      lookup[(tmp << 2) & 0x3F] +
      '='
    )
  }

  return parts.join('')
}


/***/ }),
/* 711 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(Buffer) {var clone = (function() {
'use strict';

/**
 * Clones (copies) an Object using deep copying.
 *
 * This function supports circular references by default, but if you are certain
 * there are no circular references in your object, you can save some CPU time
 * by calling clone(obj, false).
 *
 * Caution: if `circular` is false and `parent` contains circular references,
 * your program may enter an infinite loop and crash.
 *
 * @param `parent` - the object to be cloned
 * @param `circular` - set to true if the object to be cloned may contain
 *    circular references. (optional - true by default)
 * @param `depth` - set to a number if the object is only to be cloned to
 *    a particular depth. (optional - defaults to Infinity)
 * @param `prototype` - sets the prototype to be used when cloning an object.
 *    (optional - defaults to parent prototype).
*/
function clone(parent, circular, depth, prototype) {
  var filter;
  if (typeof circular === 'object') {
    depth = circular.depth;
    prototype = circular.prototype;
    filter = circular.filter;
    circular = circular.circular
  }
  // maintain two arrays for circular references, where corresponding parents
  // and children have the same index
  var allParents = [];
  var allChildren = [];

  var useBuffer = typeof Buffer != 'undefined';

  if (typeof circular == 'undefined')
    circular = true;

  if (typeof depth == 'undefined')
    depth = Infinity;

  // recurse this function so we don't reset allParents and allChildren
  function _clone(parent, depth) {
    // cloning null always returns null
    if (parent === null)
      return null;

    if (depth == 0)
      return parent;

    var child;
    var proto;
    if (typeof parent != 'object') {
      return parent;
    }

    if (clone.__isArray(parent)) {
      child = [];
    } else if (clone.__isRegExp(parent)) {
      child = new RegExp(parent.source, __getRegExpFlags(parent));
      if (parent.lastIndex) child.lastIndex = parent.lastIndex;
    } else if (clone.__isDate(parent)) {
      child = new Date(parent.getTime());
    } else if (useBuffer && Buffer.isBuffer(parent)) {
      if (Buffer.allocUnsafe) {
        // Node.js >= 4.5.0
        child = Buffer.allocUnsafe(parent.length);
      } else {
        // Older Node.js versions
        child = new Buffer(parent.length);
      }
      parent.copy(child);
      return child;
    } else {
      if (typeof prototype == 'undefined') {
        proto = Object.getPrototypeOf(parent);
        child = Object.create(proto);
      }
      else {
        child = Object.create(prototype);
        proto = prototype;
      }
    }

    if (circular) {
      var index = allParents.indexOf(parent);

      if (index != -1) {
        return allChildren[index];
      }
      allParents.push(parent);
      allChildren.push(child);
    }

    for (var i in parent) {
      var attrs;
      if (proto) {
        attrs = Object.getOwnPropertyDescriptor(proto, i);
      }

      if (attrs && attrs.set == null) {
        continue;
      }
      child[i] = _clone(parent[i], depth - 1);
    }

    return child;
  }

  return _clone(parent, depth);
}

/**
 * Simple flat clone using prototype, accepts only objects, usefull for property
 * override on FLAT configuration object (no nested props).
 *
 * USE WITH CAUTION! This may not behave as you wish if you do not know how this
 * works.
 */
clone.clonePrototype = function clonePrototype(parent) {
  if (parent === null)
    return null;

  var c = function () {};
  c.prototype = parent;
  return new c();
};

// private utility functions

function __objToStr(o) {
  return Object.prototype.toString.call(o);
};
clone.__objToStr = __objToStr;

function __isDate(o) {
  return typeof o === 'object' && __objToStr(o) === '[object Date]';
};
clone.__isDate = __isDate;

function __isArray(o) {
  return typeof o === 'object' && __objToStr(o) === '[object Array]';
};
clone.__isArray = __isArray;

function __isRegExp(o) {
  return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
};
clone.__isRegExp = __isRegExp;

function __getRegExpFlags(re) {
  var flags = '';
  if (re.global) flags += 'g';
  if (re.ignoreCase) flags += 'i';
  if (re.multiline) flags += 'm';
  return flags;
};
clone.__getRegExpFlags = __getRegExpFlags;

return clone;
})();

if (typeof module === 'object' && module.exports) {
  module.exports = clone;
}

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1220).Buffer))

/***/ }),
/* 712 */
/***/ (function(module, exports, __webpack_require__) {

var conversions = __webpack_require__(310);
var route = __webpack_require__(713);

var convert = {};

var models = Object.keys(conversions);

function wrapRaw(fn) {
	var wrappedFn = function (args) {
		if (args === undefined || args === null) {
			return args;
		}

		if (arguments.length > 1) {
			args = Array.prototype.slice.call(arguments);
		}

		return fn(args);
	};

	// preserve .conversion property if there is one
	if ('conversion' in fn) {
		wrappedFn.conversion = fn.conversion;
	}

	return wrappedFn;
}

function wrapRounded(fn) {
	var wrappedFn = function (args) {
		if (args === undefined || args === null) {
			return args;
		}

		if (arguments.length > 1) {
			args = Array.prototype.slice.call(arguments);
		}

		var result = fn(args);

		// we're assuming the result is an array here.
		// see notice in conversions.js; don't use box types
		// in conversion functions.
		if (typeof result === 'object') {
			for (var len = result.length, i = 0; i < len; i++) {
				result[i] = Math.round(result[i]);
			}
		}

		return result;
	};

	// preserve .conversion property if there is one
	if ('conversion' in fn) {
		wrappedFn.conversion = fn.conversion;
	}

	return wrappedFn;
}

models.forEach(function (fromModel) {
	convert[fromModel] = {};

	Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
	Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});

	var routes = route(fromModel);
	var routeModels = Object.keys(routes);

	routeModels.forEach(function (toModel) {
		var fn = routes[toModel];

		convert[fromModel][toModel] = wrapRounded(fn);
		convert[fromModel][toModel].raw = wrapRaw(fn);
	});
});

module.exports = convert;


/***/ }),
/* 713 */
/***/ (function(module, exports, __webpack_require__) {

var conversions = __webpack_require__(310);

/*
	this function routes a model to all other models.

	all functions that are routed have a property `.conversion` attached
	to the returned synthetic function. This property is an array
	of strings, each with the steps in between the 'from' and 'to'
	color models (inclusive).

	conversions that are not possible simply are not included.
*/

function buildGraph() {
	var graph = {};
	// https://jsperf.com/object-keys-vs-for-in-with-closure/3
	var models = Object.keys(conversions);

	for (var len = models.length, i = 0; i < len; i++) {
		graph[models[i]] = {
			// http://jsperf.com/1-vs-infinity
			// micro-opt, but this is simple.
			distance: -1,
			parent: null
		};
	}

	return graph;
}

// https://en.wikipedia.org/wiki/Breadth-first_search
function deriveBFS(fromModel) {
	var graph = buildGraph();
	var queue = [fromModel]; // unshift -> queue -> pop

	graph[fromModel].distance = 0;

	while (queue.length) {
		var current = queue.pop();
		var adjacents = Object.keys(conversions[current]);

		for (var len = adjacents.length, i = 0; i < len; i++) {
			var adjacent = adjacents[i];
			var node = graph[adjacent];

			if (node.distance === -1) {
				node.distance = graph[current].distance + 1;
				node.parent = current;
				queue.unshift(adjacent);
			}
		}
	}

	return graph;
}

function link(from, to) {
	return function (args) {
		return to(from(args));
	};
}

function wrapConversion(toModel, graph) {
	var path = [graph[toModel].parent, toModel];
	var fn = conversions[graph[toModel].parent][toModel];

	var cur = graph[toModel].parent;
	while (graph[cur].parent) {
		path.unshift(graph[cur].parent);
		fn = link(conversions[graph[cur].parent][cur], fn);
		cur = graph[cur].parent;
	}

	fn.conversion = path;
	return fn;
}

module.exports = function (fromModel) {
	var graph = deriveBFS(fromModel);
	var conversion = {};

	var models = Object.keys(graph);
	for (var len = models.length, i = 0; i < len; i++) {
		var toModel = models[i];
		var node = graph[toModel];

		if (node.parent === null) {
			// no possible conversion, or this node is the source model.
			continue;
		}

		conversion[toModel] = wrapConversion(toModel, graph);
	}

	return conversion;
};



/***/ }),
/* 714 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
	"aliceblue": [240, 248, 255],
	"antiquewhite": [250, 235, 215],
	"aqua": [0, 255, 255],
	"aquamarine": [127, 255, 212],
	"azure": [240, 255, 255],
	"beige": [245, 245, 220],
	"bisque": [255, 228, 196],
	"black": [0, 0, 0],
	"blanchedalmond": [255, 235, 205],
	"blue": [0, 0, 255],
	"blueviolet": [138, 43, 226],
	"brown": [165, 42, 42],
	"burlywood": [222, 184, 135],
	"cadetblue": [95, 158, 160],
	"chartreuse": [127, 255, 0],
	"chocolate": [210, 105, 30],
	"coral": [255, 127, 80],
	"cornflowerblue": [100, 149, 237],
	"cornsilk": [255, 248, 220],
	"crimson": [220, 20, 60],
	"cyan": [0, 255, 255],
	"darkblue": [0, 0, 139],
	"darkcyan": [0, 139, 139],
	"darkgoldenrod": [184, 134, 11],
	"darkgray": [169, 169, 169],
	"darkgreen": [0, 100, 0],
	"darkgrey": [169, 169, 169],
	"darkkhaki": [189, 183, 107],
	"darkmagenta": [139, 0, 139],
	"darkolivegreen": [85, 107, 47],
	"darkorange": [255, 140, 0],
	"darkorchid": [153, 50, 204],
	"darkred": [139, 0, 0],
	"darksalmon": [233, 150, 122],
	"darkseagreen": [143, 188, 143],
	"darkslateblue": [72, 61, 139],
	"darkslategray": [47, 79, 79],
	"darkslategrey": [47, 79, 79],
	"darkturquoise": [0, 206, 209],
	"darkviolet": [148, 0, 211],
	"deeppink": [255, 20, 147],
	"deepskyblue": [0, 191, 255],
	"dimgray": [105, 105, 105],
	"dimgrey": [105, 105, 105],
	"dodgerblue": [30, 144, 255],
	"firebrick": [178, 34, 34],
	"floralwhite": [255, 250, 240],
	"forestgreen": [34, 139, 34],
	"fuchsia": [255, 0, 255],
	"gainsboro": [220, 220, 220],
	"ghostwhite": [248, 248, 255],
	"gold": [255, 215, 0],
	"goldenrod": [218, 165, 32],
	"gray": [128, 128, 128],
	"green": [0, 128, 0],
	"greenyellow": [173, 255, 47],
	"grey": [128, 128, 128],
	"honeydew": [240, 255, 240],
	"hotpink": [255, 105, 180],
	"indianred": [205, 92, 92],
	"indigo": [75, 0, 130],
	"ivory": [255, 255, 240],
	"khaki": [240, 230, 140],
	"lavender": [230, 230, 250],
	"lavenderblush": [255, 240, 245],
	"lawngreen": [124, 252, 0],
	"lemonchiffon": [255, 250, 205],
	"lightblue": [173, 216, 230],
	"lightcoral": [240, 128, 128],
	"lightcyan": [224, 255, 255],
	"lightgoldenrodyellow": [250, 250, 210],
	"lightgray": [211, 211, 211],
	"lightgreen": [144, 238, 144],
	"lightgrey": [211, 211, 211],
	"lightpink": [255, 182, 193],
	"lightsalmon": [255, 160, 122],
	"lightseagreen": [32, 178, 170],
	"lightskyblue": [135, 206, 250],
	"lightslategray": [119, 136, 153],
	"lightslategrey": [119, 136, 153],
	"lightsteelblue": [176, 196, 222],
	"lightyellow": [255, 255, 224],
	"lime": [0, 255, 0],
	"limegreen": [50, 205, 50],
	"linen": [250, 240, 230],
	"magenta": [255, 0, 255],
	"maroon": [128, 0, 0],
	"mediumaquamarine": [102, 205, 170],
	"mediumblue": [0, 0, 205],
	"mediumorchid": [186, 85, 211],
	"mediumpurple": [147, 112, 219],
	"mediumseagreen": [60, 179, 113],
	"mediumslateblue": [123, 104, 238],
	"mediumspringgreen": [0, 250, 154],
	"mediumturquoise": [72, 209, 204],
	"mediumvioletred": [199, 21, 133],
	"midnightblue": [25, 25, 112],
	"mintcream": [245, 255, 250],
	"mistyrose": [255, 228, 225],
	"moccasin": [255, 228, 181],
	"navajowhite": [255, 222, 173],
	"navy": [0, 0, 128],
	"oldlace": [253, 245, 230],
	"olive": [128, 128, 0],
	"olivedrab": [107, 142, 35],
	"orange": [255, 165, 0],
	"orangered": [255, 69, 0],
	"orchid": [218, 112, 214],
	"palegoldenrod": [238, 232, 170],
	"palegreen": [152, 251, 152],
	"paleturquoise": [175, 238, 238],
	"palevioletred": [219, 112, 147],
	"papayawhip": [255, 239, 213],
	"peachpuff": [255, 218, 185],
	"peru": [205, 133, 63],
	"pink": [255, 192, 203],
	"plum": [221, 160, 221],
	"powderblue": [176, 224, 230],
	"purple": [128, 0, 128],
	"rebeccapurple": [102, 51, 153],
	"red": [255, 0, 0],
	"rosybrown": [188, 143, 143],
	"royalblue": [65, 105, 225],
	"saddlebrown": [139, 69, 19],
	"salmon": [250, 128, 114],
	"sandybrown": [244, 164, 96],
	"seagreen": [46, 139, 87],
	"seashell": [255, 245, 238],
	"sienna": [160, 82, 45],
	"silver": [192, 192, 192],
	"skyblue": [135, 206, 235],
	"slateblue": [106, 90, 205],
	"slategray": [112, 128, 144],
	"slategrey": [112, 128, 144],
	"snow": [255, 250, 250],
	"springgreen": [0, 255, 127],
	"steelblue": [70, 130, 180],
	"tan": [210, 180, 140],
	"teal": [0, 128, 128],
	"thistle": [216, 191, 216],
	"tomato": [255, 99, 71],
	"turquoise": [64, 224, 208],
	"violet": [238, 130, 238],
	"wheat": [245, 222, 179],
	"white": [255, 255, 255],
	"whitesmoke": [245, 245, 245],
	"yellow": [255, 255, 0],
	"yellowgreen": [154, 205, 50]
};


/***/ }),
/* 715 */
/***/ (function(module, exports, __webpack_require__) {

/* MIT license */
var colorNames = __webpack_require__(716);

module.exports = {
   getRgba: getRgba,
   getHsla: getHsla,
   getRgb: getRgb,
   getHsl: getHsl,
   getHwb: getHwb,
   getAlpha: getAlpha,

   hexString: hexString,
   rgbString: rgbString,
   rgbaString: rgbaString,
   percentString: percentString,
   percentaString: percentaString,
   hslString: hslString,
   hslaString: hslaString,
   hwbString: hwbString,
   keyword: keyword
}

function getRgba(string) {
   if (!string) {
      return;
   }
   var abbr =  /^#([a-fA-F0-9]{3})$/,
       hex =  /^#([a-fA-F0-9]{6})$/,
       rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
       per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/,
       keyword = /(\D+)/;

   var rgb = [0, 0, 0],
       a = 1,
       match = string.match(abbr);
   if (match) {
      match = match[1];
      for (var i = 0; i < rgb.length; i++) {
         rgb[i] = parseInt(match[i] + match[i], 16);
      }
   }
   else if (match = string.match(hex)) {
      match = match[1];
      for (var i = 0; i < rgb.length; i++) {
         rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);
      }
   }
   else if (match = string.match(rgba)) {
      for (var i = 0; i < rgb.length; i++) {
         rgb[i] = parseInt(match[i + 1]);
      }
      a = parseFloat(match[4]);
   }
   else if (match = string.match(per)) {
      for (var i = 0; i < rgb.length; i++) {
         rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
      }
      a = parseFloat(match[4]);
   }
   else if (match = string.match(keyword)) {
      if (match[1] == "transparent") {
         return [0, 0, 0, 0];
      }
      rgb = colorNames[match[1]];
      if (!rgb) {
         return;
      }
   }

   for (var i = 0; i < rgb.length; i++) {
      rgb[i] = scale(rgb[i], 0, 255);
   }
   if (!a && a != 0) {
      a = 1;
   }
   else {
      a = scale(a, 0, 1);
   }
   rgb[3] = a;
   return rgb;
}

function getHsla(string) {
   if (!string) {
      return;
   }
   var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
   var match = string.match(hsl);
   if (match) {
      var alpha = parseFloat(match[4]);
      var h = scale(parseInt(match[1]), 0, 360),
          s = scale(parseFloat(match[2]), 0, 100),
          l = scale(parseFloat(match[3]), 0, 100),
          a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
      return [h, s, l, a];
   }
}

function getHwb(string) {
   if (!string) {
      return;
   }
   var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
   var match = string.match(hwb);
   if (match) {
    var alpha = parseFloat(match[4]);
      var h = scale(parseInt(match[1]), 0, 360),
          w = scale(parseFloat(match[2]), 0, 100),
          b = scale(parseFloat(match[3]), 0, 100),
          a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
      return [h, w, b, a];
   }
}

function getRgb(string) {
   var rgba = getRgba(string);
   return rgba && rgba.slice(0, 3);
}

function getHsl(string) {
  var hsla = getHsla(string);
  return hsla && hsla.slice(0, 3);
}

function getAlpha(string) {
   var vals = getRgba(string);
   if (vals) {
      return vals[3];
   }
   else if (vals = getHsla(string)) {
      return vals[3];
   }
   else if (vals = getHwb(string)) {
      return vals[3];
   }
}

// generators
function hexString(rgb) {
   return "#" + hexDouble(rgb[0]) + hexDouble(rgb[1])
              + hexDouble(rgb[2]);
}

function rgbString(rgba, alpha) {
   if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
      return rgbaString(rgba, alpha);
   }
   return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")";
}

function rgbaString(rgba, alpha) {
   if (alpha === undefined) {
      alpha = (rgba[3] !== undefined ? rgba[3] : 1);
   }
   return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2]
           + ", " + alpha + ")";
}

function percentString(rgba, alpha) {
   if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
      return percentaString(rgba, alpha);
   }
   var r = Math.round(rgba[0]/255 * 100),
       g = Math.round(rgba[1]/255 * 100),
       b = Math.round(rgba[2]/255 * 100);

   return "rgb(" + r + "%, " + g + "%, " + b + "%)";
}

function percentaString(rgba, alpha) {
   var r = Math.round(rgba[0]/255 * 100),
       g = Math.round(rgba[1]/255 * 100),
       b = Math.round(rgba[2]/255 * 100);
   return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")";
}

function hslString(hsla, alpha) {
   if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {
      return hslaString(hsla, alpha);
   }
   return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
}

function hslaString(hsla, alpha) {
   if (alpha === undefined) {
      alpha = (hsla[3] !== undefined ? hsla[3] : 1);
   }
   return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, "
           + alpha + ")";
}

// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
// (hwb have alpha optional & 1 is default value)
function hwbString(hwb, alpha) {
   if (alpha === undefined) {
      alpha = (hwb[3] !== undefined ? hwb[3] : 1);
   }
   return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%"
           + (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")";
}

function keyword(rgb) {
  return reverseNames[rgb.slice(0, 3)];
}

// helpers
function scale(num, min, max) {
   return Math.min(Math.max(min, num), max);
}

function hexDouble(num) {
  var str = num.toString(16).toUpperCase();
  return (str.length < 2) ? "0" + str : str;
}


//create a list of reverse color names
var reverseNames = {};
for (var name in colorNames) {
   reverseNames[colorNames[name]] = name;
}


/***/ }),
/* 716 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


module.exports = {
	"aliceblue": [240, 248, 255],
	"antiquewhite": [250, 235, 215],
	"aqua": [0, 255, 255],
	"aquamarine": [127, 255, 212],
	"azure": [240, 255, 255],
	"beige": [245, 245, 220],
	"bisque": [255, 228, 196],
	"black": [0, 0, 0],
	"blanchedalmond": [255, 235, 205],
	"blue": [0, 0, 255],
	"blueviolet": [138, 43, 226],
	"brown": [165, 42, 42],
	"burlywood": [222, 184, 135],
	"cadetblue": [95, 158, 160],
	"chartreuse": [127, 255, 0],
	"chocolate": [210, 105, 30],
	"coral": [255, 127, 80],
	"cornflowerblue": [100, 149, 237],
	"cornsilk": [255, 248, 220],
	"crimson": [220, 20, 60],
	"cyan": [0, 255, 255],
	"darkblue": [0, 0, 139],
	"darkcyan": [0, 139, 139],
	"darkgoldenrod": [184, 134, 11],
	"darkgray": [169, 169, 169],
	"darkgreen": [0, 100, 0],
	"darkgrey": [169, 169, 169],
	"darkkhaki": [189, 183, 107],
	"darkmagenta": [139, 0, 139],
	"darkolivegreen": [85, 107, 47],
	"darkorange": [255, 140, 0],
	"darkorchid": [153, 50, 204],
	"darkred": [139, 0, 0],
	"darksalmon": [233, 150, 122],
	"darkseagreen": [143, 188, 143],
	"darkslateblue": [72, 61, 139],
	"darkslategray": [47, 79, 79],
	"darkslategrey": [47, 79, 79],
	"darkturquoise": [0, 206, 209],
	"darkviolet": [148, 0, 211],
	"deeppink": [255, 20, 147],
	"deepskyblue": [0, 191, 255],
	"dimgray": [105, 105, 105],
	"dimgrey": [105, 105, 105],
	"dodgerblue": [30, 144, 255],
	"firebrick": [178, 34, 34],
	"floralwhite": [255, 250, 240],
	"forestgreen": [34, 139, 34],
	"fuchsia": [255, 0, 255],
	"gainsboro": [220, 220, 220],
	"ghostwhite": [248, 248, 255],
	"gold": [255, 215, 0],
	"goldenrod": [218, 165, 32],
	"gray": [128, 128, 128],
	"green": [0, 128, 0],
	"greenyellow": [173, 255, 47],
	"grey": [128, 128, 128],
	"honeydew": [240, 255, 240],
	"hotpink": [255, 105, 180],
	"indianred": [205, 92, 92],
	"indigo": [75, 0, 130],
	"ivory": [255, 255, 240],
	"khaki": [240, 230, 140],
	"lavender": [230, 230, 250],
	"lavenderblush": [255, 240, 245],
	"lawngreen": [124, 252, 0],
	"lemonchiffon": [255, 250, 205],
	"lightblue": [173, 216, 230],
	"lightcoral": [240, 128, 128],
	"lightcyan": [224, 255, 255],
	"lightgoldenrodyellow": [250, 250, 210],
	"lightgray": [211, 211, 211],
	"lightgreen": [144, 238, 144],
	"lightgrey": [211, 211, 211],
	"lightpink": [255, 182, 193],
	"lightsalmon": [255, 160, 122],
	"lightseagreen": [32, 178, 170],
	"lightskyblue": [135, 206, 250],
	"lightslategray": [119, 136, 153],
	"lightslategrey": [119, 136, 153],
	"lightsteelblue": [176, 196, 222],
	"lightyellow": [255, 255, 224],
	"lime": [0, 255, 0],
	"limegreen": [50, 205, 50],
	"linen": [250, 240, 230],
	"magenta": [255, 0, 255],
	"maroon": [128, 0, 0],
	"mediumaquamarine": [102, 205, 170],
	"mediumblue": [0, 0, 205],
	"mediumorchid": [186, 85, 211],
	"mediumpurple": [147, 112, 219],
	"mediumseagreen": [60, 179, 113],
	"mediumslateblue": [123, 104, 238],
	"mediumspringgreen": [0, 250, 154],
	"mediumturquoise": [72, 209, 204],
	"mediumvioletred": [199, 21, 133],
	"midnightblue": [25, 25, 112],
	"mintcream": [245, 255, 250],
	"mistyrose": [255, 228, 225],
	"moccasin": [255, 228, 181],
	"navajowhite": [255, 222, 173],
	"navy": [0, 0, 128],
	"oldlace": [253, 245, 230],
	"olive": [128, 128, 0],
	"olivedrab": [107, 142, 35],
	"orange": [255, 165, 0],
	"orangered": [255, 69, 0],
	"orchid": [218, 112, 214],
	"palegoldenrod": [238, 232, 170],
	"palegreen": [152, 251, 152],
	"paleturquoise": [175, 238, 238],
	"palevioletred": [219, 112, 147],
	"papayawhip": [255, 239, 213],
	"peachpuff": [255, 218, 185],
	"peru": [205, 133, 63],
	"pink": [255, 192, 203],
	"plum": [221, 160, 221],
	"powderblue": [176, 224, 230],
	"purple": [128, 0, 128],
	"rebeccapurple": [102, 51, 153],
	"red": [255, 0, 0],
	"rosybrown": [188, 143, 143],
	"royalblue": [65, 105, 225],
	"saddlebrown": [139, 69, 19],
	"salmon": [250, 128, 114],
	"sandybrown": [244, 164, 96],
	"seagreen": [46, 139, 87],
	"seashell": [255, 245, 238],
	"sienna": [160, 82, 45],
	"silver": [192, 192, 192],
	"skyblue": [135, 206, 235],
	"slateblue": [106, 90, 205],
	"slategray": [112, 128, 144],
	"slategrey": [112, 128, 144],
	"snow": [255, 250, 250],
	"springgreen": [0, 255, 127],
	"steelblue": [70, 130, 180],
	"tan": [210, 180, 140],
	"teal": [0, 128, 128],
	"thistle": [216, 191, 216],
	"tomato": [255, 99, 71],
	"turquoise": [64, 224, 208],
	"violet": [238, 130, 238],
	"wheat": [245, 222, 179],
	"white": [255, 255, 255],
	"whitesmoke": [245, 245, 245],
	"yellow": [255, 255, 0],
	"yellowgreen": [154, 205, 50]
};


/***/ }),
/* 717 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(724);
module.exports = __webpack_require__(57).RegExp.escape;


/***/ }),
/* 718 */
/***/ (function(module, exports, __webpack_require__) {

var isObject = __webpack_require__(22);
var isArray = __webpack_require__(168);
var SPECIES = __webpack_require__(26)('species');

module.exports = function (original) {
  var C;
  if (isArray(original)) {
    C = original.constructor;
    // cross-realm fallback
    if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
    if (isObject(C)) {
      C = C[SPECIES];
      if (C === null) C = undefined;
    }
  } return C === undefined ? Array : C;
};


/***/ }),
/* 719 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var fails = __webpack_require__(20);
var getTime = Date.prototype.getTime;
var $toISOString = Date.prototype.toISOString;

var lz = function (num) {
  return num > 9 ? num : '0' + num;
};

// PhantomJS / old WebKit has a broken implementations
module.exports = (fails(function () {
  return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
  $toISOString.call(new Date(NaN));
})) ? function toISOString() {
  if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
  var d = this;
  var y = d.getUTCFullYear();
  var m = d.getUTCMilliseconds();
  var s = y < 0 ? '-' : y > 9999 ? '+' : '';
  return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
    '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
    'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
    ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
} : $toISOString;


/***/ }),
/* 720 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var anObject = __webpack_require__(11);
var toPrimitive = __webpack_require__(68);
var NUMBER = 'number';

module.exports = function (hint) {
  if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
  return toPrimitive(anObject(this), hint != NUMBER);
};


/***/ }),
/* 721 */
/***/ (function(module, exports, __webpack_require__) {

// all enumerable object keys, includes symbols
var getKeys = __webpack_require__(98);
var gOPS = __webpack_require__(172);
var pIE = __webpack_require__(137);
module.exports = function (it) {
  var result = getKeys(it);
  var getSymbols = gOPS.f;
  if (getSymbols) {
    var symbols = getSymbols(it);
    var isEnum = pIE.f;
    var i = 0;
    var key;
    while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  } return result;
};


/***/ }),
/* 722 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(138)('native-function-to-string', Function.toString);


/***/ }),
/* 723 */
/***/ (function(module, exports) {

module.exports = function (regExp, replace) {
  var replacer = replace === Object(replace) ? function (part) {
    return replace[part];
  } : replace;
  return function (it) {
    return String(it).replace(regExp, replacer);
  };
};


/***/ }),
/* 724 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/benjamingr/RexExp.escape
var $export = __webpack_require__(2);
var $re = __webpack_require__(723)(/[\\^$*+?.()|[\]{}]/g, '\\$&');

$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });


/***/ }),
/* 725 */
/***/ (function(module, exports, __webpack_require__) {

// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
var $export = __webpack_require__(2);

$export($export.P, 'Array', { copyWithin: __webpack_require__(313) });

__webpack_require__(80)('copyWithin');


/***/ }),
/* 726 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $every = __webpack_require__(65)(4);

$export($export.P + $export.F * !__webpack_require__(59)([].every, true), 'Array', {
  // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
  every: function every(callbackfn /* , thisArg */) {
    return $every(this, callbackfn, arguments[1]);
  }
});


/***/ }),
/* 727 */
/***/ (function(module, exports, __webpack_require__) {

// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
var $export = __webpack_require__(2);

$export($export.P, 'Array', { fill: __webpack_require__(215) });

__webpack_require__(80)('fill');


/***/ }),
/* 728 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $filter = __webpack_require__(65)(2);

$export($export.P + $export.F * !__webpack_require__(59)([].filter, true), 'Array', {
  // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
  filter: function filter(callbackfn /* , thisArg */) {
    return $filter(this, callbackfn, arguments[1]);
  }
});


/***/ }),
/* 729 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
var $export = __webpack_require__(2);
var $find = __webpack_require__(65)(6);
var KEY = 'findIndex';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
  findIndex: function findIndex(callbackfn /* , that = undefined */) {
    return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});
__webpack_require__(80)(KEY);


/***/ }),
/* 730 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
var $export = __webpack_require__(2);
var $find = __webpack_require__(65)(5);
var KEY = 'find';
var forced = true;
// Shouldn't skip holes
if (KEY in []) Array(1)[KEY](function () { forced = false; });
$export($export.P + $export.F * forced, 'Array', {
  find: function find(callbackfn /* , that = undefined */) {
    return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
  }
});
__webpack_require__(80)(KEY);


/***/ }),
/* 731 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $forEach = __webpack_require__(65)(0);
var STRICT = __webpack_require__(59)([].forEach, true);

$export($export.P + $export.F * !STRICT, 'Array', {
  // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
  forEach: function forEach(callbackfn /* , thisArg */) {
    return $forEach(this, callbackfn, arguments[1]);
  }
});


/***/ }),
/* 732 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var ctx = __webpack_require__(58);
var $export = __webpack_require__(2);
var toObject = __webpack_require__(35);
var call = __webpack_require__(324);
var isArrayIter = __webpack_require__(223);
var toLength = __webpack_require__(27);
var createProperty = __webpack_require__(217);
var getIterFn = __webpack_require__(239);

$export($export.S + $export.F * !__webpack_require__(170)(function (iter) { Array.from(iter); }), 'Array', {
  // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
    var O = toObject(arrayLike);
    var C = typeof this == 'function' ? this : Array;
    var aLen = arguments.length;
    var mapfn = aLen > 1 ? arguments[1] : undefined;
    var mapping = mapfn !== undefined;
    var index = 0;
    var iterFn = getIterFn(O);
    var length, result, step, iterator;
    if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
    // if object isn't iterable or it's array with default iterator - use simple case
    if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
      for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
        createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
      }
    } else {
      length = toLength(O.length);
      for (result = new C(length); length > index; index++) {
        createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
      }
    }
    result.length = index;
    return result;
  }
});


/***/ }),
/* 733 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $indexOf = __webpack_require__(165)(false);
var $native = [].indexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;

$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(59)($native)), 'Array', {
  // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
  indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
    return NEGATIVE_ZERO
      // convert -0 to +0
      ? $native.apply(this, arguments) || 0
      : $indexOf(this, searchElement, arguments[1]);
  }
});


/***/ }),
/* 734 */
/***/ (function(module, exports, __webpack_require__) {

// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
var $export = __webpack_require__(2);

$export($export.S, 'Array', { isArray: __webpack_require__(168) });


/***/ }),
/* 735 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 22.1.3.13 Array.prototype.join(separator)
var $export = __webpack_require__(2);
var toIObject = __webpack_require__(55);
var arrayJoin = [].join;

// fallback for not array-like strings
$export($export.P + $export.F * (__webpack_require__(136) != Object || !__webpack_require__(59)(arrayJoin)), 'Array', {
  join: function join(separator) {
    return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
  }
});


/***/ }),
/* 736 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toIObject = __webpack_require__(55);
var toInteger = __webpack_require__(60);
var toLength = __webpack_require__(27);
var $native = [].lastIndexOf;
var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;

$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(59)($native)), 'Array', {
  // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
  lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
    // convert -0 to +0
    if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
    var O = toIObject(this);
    var length = toLength(O.length);
    var index = length - 1;
    if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
    if (index < 0) index = length + index;
    for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
    return -1;
  }
});


/***/ }),
/* 737 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $map = __webpack_require__(65)(1);

$export($export.P + $export.F * !__webpack_require__(59)([].map, true), 'Array', {
  // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
  map: function map(callbackfn /* , thisArg */) {
    return $map(this, callbackfn, arguments[1]);
  }
});


/***/ }),
/* 738 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var createProperty = __webpack_require__(217);

// WebKit Array.of isn't generic
$export($export.S + $export.F * __webpack_require__(20)(function () {
  function F() { /* empty */ }
  return !(Array.of.call(F) instanceof F);
}), 'Array', {
  // 22.1.2.3 Array.of( ...items)
  of: function of(/* ...args */) {
    var index = 0;
    var aLen = arguments.length;
    var result = new (typeof this == 'function' ? this : Array)(aLen);
    while (aLen > index) createProperty(result, index, arguments[index++]);
    result.length = aLen;
    return result;
  }
});


/***/ }),
/* 739 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $reduce = __webpack_require__(315);

$export($export.P + $export.F * !__webpack_require__(59)([].reduceRight, true), 'Array', {
  // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
  reduceRight: function reduceRight(callbackfn /* , initialValue */) {
    return $reduce(this, callbackfn, arguments.length, arguments[1], true);
  }
});


/***/ }),
/* 740 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $reduce = __webpack_require__(315);

$export($export.P + $export.F * !__webpack_require__(59)([].reduce, true), 'Array', {
  // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
  reduce: function reduce(callbackfn /* , initialValue */) {
    return $reduce(this, callbackfn, arguments.length, arguments[1], false);
  }
});


/***/ }),
/* 741 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var html = __webpack_require__(221);
var cof = __webpack_require__(56);
var toAbsoluteIndex = __webpack_require__(102);
var toLength = __webpack_require__(27);
var arraySlice = [].slice;

// fallback for not array-like ES3 strings and DOM objects
$export($export.P + $export.F * __webpack_require__(20)(function () {
  if (html) arraySlice.call(html);
}), 'Array', {
  slice: function slice(begin, end) {
    var len = toLength(this.length);
    var klass = cof(this);
    end = end === undefined ? len : end;
    if (klass == 'Array') return arraySlice.call(this, begin, end);
    var start = toAbsoluteIndex(begin, len);
    var upTo = toAbsoluteIndex(end, len);
    var size = toLength(upTo - start);
    var cloned = new Array(size);
    var i = 0;
    for (; i < size; i++) cloned[i] = klass == 'String'
      ? this.charAt(start + i)
      : this[start + i];
    return cloned;
  }
});


/***/ }),
/* 742 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $some = __webpack_require__(65)(3);

$export($export.P + $export.F * !__webpack_require__(59)([].some, true), 'Array', {
  // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
  some: function some(callbackfn /* , thisArg */) {
    return $some(this, callbackfn, arguments[1]);
  }
});


/***/ }),
/* 743 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var aFunction = __webpack_require__(42);
var toObject = __webpack_require__(35);
var fails = __webpack_require__(20);
var $sort = [].sort;
var test = [1, 2, 3];

$export($export.P + $export.F * (fails(function () {
  // IE8-
  test.sort(undefined);
}) || !fails(function () {
  // V8 bug
  test.sort(null);
  // Old WebKit
}) || !__webpack_require__(59)($sort)), 'Array', {
  // 22.1.3.25 Array.prototype.sort(comparefn)
  sort: function sort(comparefn) {
    return comparefn === undefined
      ? $sort.call(toObject(this))
      : $sort.call(toObject(this), aFunction(comparefn));
  }
});


/***/ }),
/* 744 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(101)('Array');


/***/ }),
/* 745 */
/***/ (function(module, exports, __webpack_require__) {

// 20.3.3.1 / 15.9.4.4 Date.now()
var $export = __webpack_require__(2);

$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });


/***/ }),
/* 746 */
/***/ (function(module, exports, __webpack_require__) {

// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
var $export = __webpack_require__(2);
var toISOString = __webpack_require__(719);

// PhantomJS / old WebKit has a broken implementations
$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
  toISOString: toISOString
});


/***/ }),
/* 747 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toObject = __webpack_require__(35);
var toPrimitive = __webpack_require__(68);

$export($export.P + $export.F * __webpack_require__(20)(function () {
  return new Date(NaN).toJSON() !== null
    || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
}), 'Date', {
  // eslint-disable-next-line no-unused-vars
  toJSON: function toJSON(key) {
    var O = toObject(this);
    var pv = toPrimitive(O);
    return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
  }
});


/***/ }),
/* 748 */
/***/ (function(module, exports, __webpack_require__) {

var TO_PRIMITIVE = __webpack_require__(26)('toPrimitive');
var proto = Date.prototype;

if (!(TO_PRIMITIVE in proto)) __webpack_require__(48)(proto, TO_PRIMITIVE, __webpack_require__(720));


/***/ }),
/* 749 */
/***/ (function(module, exports, __webpack_require__) {

var DateProto = Date.prototype;
var INVALID_DATE = 'Invalid Date';
var TO_STRING = 'toString';
var $toString = DateProto[TO_STRING];
var getTime = DateProto.getTime;
if (new Date(NaN) + '' != INVALID_DATE) {
  __webpack_require__(49)(DateProto, TO_STRING, function toString() {
    var value = getTime.call(this);
    // eslint-disable-next-line no-self-compare
    return value === value ? $toString.call(this) : INVALID_DATE;
  });
}


/***/ }),
/* 750 */
/***/ (function(module, exports, __webpack_require__) {

// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
var $export = __webpack_require__(2);

$export($export.P, 'Function', { bind: __webpack_require__(316) });


/***/ }),
/* 751 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var isObject = __webpack_require__(22);
var getPrototypeOf = __webpack_require__(54);
var HAS_INSTANCE = __webpack_require__(26)('hasInstance');
var FunctionProto = Function.prototype;
// 19.2.3.6 Function.prototype[@@hasInstance](V)
if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(31).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
  if (typeof this != 'function' || !isObject(O)) return false;
  if (!isObject(this.prototype)) return O instanceof this;
  // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
  while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
  return false;
} });


/***/ }),
/* 752 */
/***/ (function(module, exports, __webpack_require__) {

var dP = __webpack_require__(31).f;
var FProto = Function.prototype;
var nameRE = /^\s*function ([^ (]*)/;
var NAME = 'name';

// 19.2.4.2 name
NAME in FProto || __webpack_require__(30) && dP(FProto, NAME, {
  configurable: true,
  get: function () {
    try {
      return ('' + this).match(nameRE)[1];
    } catch (e) {
      return '';
    }
  }
});


/***/ }),
/* 753 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.3 Math.acosh(x)
var $export = __webpack_require__(2);
var log1p = __webpack_require__(327);
var sqrt = Math.sqrt;
var $acosh = Math.acosh;

$export($export.S + $export.F * !($acosh
  // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
  && Math.floor($acosh(Number.MAX_VALUE)) == 710
  // Tor Browser bug: Math.acosh(Infinity) -> NaN
  && $acosh(Infinity) == Infinity
), 'Math', {
  acosh: function acosh(x) {
    return (x = +x) < 1 ? NaN : x > 94906265.62425156
      ? Math.log(x) + Math.LN2
      : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
  }
});


/***/ }),
/* 754 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.5 Math.asinh(x)
var $export = __webpack_require__(2);
var $asinh = Math.asinh;

function asinh(x) {
  return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
}

// Tor Browser bug: Math.asinh(0) -> -0
$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });


/***/ }),
/* 755 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.7 Math.atanh(x)
var $export = __webpack_require__(2);
var $atanh = Math.atanh;

// Tor Browser bug: Math.atanh(-0) -> 0
$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
  atanh: function atanh(x) {
    return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
  }
});


/***/ }),
/* 756 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.9 Math.cbrt(x)
var $export = __webpack_require__(2);
var sign = __webpack_require__(227);

$export($export.S, 'Math', {
  cbrt: function cbrt(x) {
    return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
  }
});


/***/ }),
/* 757 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.11 Math.clz32(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  clz32: function clz32(x) {
    return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
  }
});


/***/ }),
/* 758 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.12 Math.cosh(x)
var $export = __webpack_require__(2);
var exp = Math.exp;

$export($export.S, 'Math', {
  cosh: function cosh(x) {
    return (exp(x = +x) + exp(-x)) / 2;
  }
});


/***/ }),
/* 759 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.14 Math.expm1(x)
var $export = __webpack_require__(2);
var $expm1 = __webpack_require__(226);

$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });


/***/ }),
/* 760 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.16 Math.fround(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', { fround: __webpack_require__(326) });


/***/ }),
/* 761 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
var $export = __webpack_require__(2);
var abs = Math.abs;

$export($export.S, 'Math', {
  hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
    var sum = 0;
    var i = 0;
    var aLen = arguments.length;
    var larg = 0;
    var arg, div;
    while (i < aLen) {
      arg = abs(arguments[i++]);
      if (larg < arg) {
        div = larg / arg;
        sum = sum * div * div + 1;
        larg = arg;
      } else if (arg > 0) {
        div = arg / larg;
        sum += div * div;
      } else sum += arg;
    }
    return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
  }
});


/***/ }),
/* 762 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.18 Math.imul(x, y)
var $export = __webpack_require__(2);
var $imul = Math.imul;

// some WebKit versions fails with big numbers, some has wrong arity
$export($export.S + $export.F * __webpack_require__(20)(function () {
  return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
}), 'Math', {
  imul: function imul(x, y) {
    var UINT16 = 0xffff;
    var xn = +x;
    var yn = +y;
    var xl = UINT16 & xn;
    var yl = UINT16 & yn;
    return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
  }
});


/***/ }),
/* 763 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.21 Math.log10(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  log10: function log10(x) {
    return Math.log(x) * Math.LOG10E;
  }
});


/***/ }),
/* 764 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.20 Math.log1p(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', { log1p: __webpack_require__(327) });


/***/ }),
/* 765 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.22 Math.log2(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  log2: function log2(x) {
    return Math.log(x) / Math.LN2;
  }
});


/***/ }),
/* 766 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.28 Math.sign(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', { sign: __webpack_require__(227) });


/***/ }),
/* 767 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.30 Math.sinh(x)
var $export = __webpack_require__(2);
var expm1 = __webpack_require__(226);
var exp = Math.exp;

// V8 near Chromium 38 has a problem with very small numbers
$export($export.S + $export.F * __webpack_require__(20)(function () {
  return !Math.sinh(-2e-17) != -2e-17;
}), 'Math', {
  sinh: function sinh(x) {
    return Math.abs(x = +x) < 1
      ? (expm1(x) - expm1(-x)) / 2
      : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
  }
});


/***/ }),
/* 768 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.33 Math.tanh(x)
var $export = __webpack_require__(2);
var expm1 = __webpack_require__(226);
var exp = Math.exp;

$export($export.S, 'Math', {
  tanh: function tanh(x) {
    var a = expm1(x = +x);
    var b = expm1(-x);
    return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
  }
});


/***/ }),
/* 769 */
/***/ (function(module, exports, __webpack_require__) {

// 20.2.2.34 Math.trunc(x)
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  trunc: function trunc(it) {
    return (it > 0 ? Math.floor : Math.ceil)(it);
  }
});


/***/ }),
/* 770 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var global = __webpack_require__(16);
var has = __webpack_require__(52);
var cof = __webpack_require__(56);
var inheritIfRequired = __webpack_require__(222);
var toPrimitive = __webpack_require__(68);
var fails = __webpack_require__(20);
var gOPN = __webpack_require__(97).f;
var gOPD = __webpack_require__(53).f;
var dP = __webpack_require__(31).f;
var $trim = __webpack_require__(116).trim;
var NUMBER = 'Number';
var $Number = global[NUMBER];
var Base = $Number;
var proto = $Number.prototype;
// Opera ~12 has broken Object#toString
var BROKEN_COF = cof(__webpack_require__(96)(proto)) == NUMBER;
var TRIM = 'trim' in String.prototype;

// 7.1.3 ToNumber(argument)
var toNumber = function (argument) {
  var it = toPrimitive(argument, false);
  if (typeof it == 'string' && it.length > 2) {
    it = TRIM ? it.trim() : $trim(it, 3);
    var first = it.charCodeAt(0);
    var third, radix, maxCode;
    if (first === 43 || first === 45) {
      third = it.charCodeAt(2);
      if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
    } else if (first === 48) {
      switch (it.charCodeAt(1)) {
        case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
        case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
        default: return +it;
      }
      for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
        code = digits.charCodeAt(i);
        // parseInt parses a string to a first unavailable symbol
        // but ToNumber should return NaN if a string contains unavailable symbols
        if (code < 48 || code > maxCode) return NaN;
      } return parseInt(digits, radix);
    }
  } return +it;
};

if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
  $Number = function Number(value) {
    var it = arguments.length < 1 ? 0 : value;
    var that = this;
    return that instanceof $Number
      // check on 1..constructor(foo) case
      && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
        ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
  };
  for (var keys = __webpack_require__(30) ? gOPN(Base) : (
    // ES3:
    'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
    // ES6 (in case, if modules with ES6 Number statics required before):
    'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
    'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
  ).split(','), j = 0, key; keys.length > j; j++) {
    if (has(Base, key = keys[j]) && !has($Number, key)) {
      dP($Number, key, gOPD(Base, key));
    }
  }
  $Number.prototype = proto;
  proto.constructor = $Number;
  __webpack_require__(49)(global, NUMBER, $Number);
}


/***/ }),
/* 771 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.1 Number.EPSILON
var $export = __webpack_require__(2);

$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });


/***/ }),
/* 772 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.2 Number.isFinite(number)
var $export = __webpack_require__(2);
var _isFinite = __webpack_require__(16).isFinite;

$export($export.S, 'Number', {
  isFinite: function isFinite(it) {
    return typeof it == 'number' && _isFinite(it);
  }
});


/***/ }),
/* 773 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.3 Number.isInteger(number)
var $export = __webpack_require__(2);

$export($export.S, 'Number', { isInteger: __webpack_require__(323) });


/***/ }),
/* 774 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.4 Number.isNaN(number)
var $export = __webpack_require__(2);

$export($export.S, 'Number', {
  isNaN: function isNaN(number) {
    // eslint-disable-next-line no-self-compare
    return number != number;
  }
});


/***/ }),
/* 775 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.5 Number.isSafeInteger(number)
var $export = __webpack_require__(2);
var isInteger = __webpack_require__(323);
var abs = Math.abs;

$export($export.S, 'Number', {
  isSafeInteger: function isSafeInteger(number) {
    return isInteger(number) && abs(number) <= 0x1fffffffffffff;
  }
});


/***/ }),
/* 776 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.6 Number.MAX_SAFE_INTEGER
var $export = __webpack_require__(2);

$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });


/***/ }),
/* 777 */
/***/ (function(module, exports, __webpack_require__) {

// 20.1.2.10 Number.MIN_SAFE_INTEGER
var $export = __webpack_require__(2);

$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });


/***/ }),
/* 778 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var $parseFloat = __webpack_require__(335);
// 20.1.2.12 Number.parseFloat(string)
$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });


/***/ }),
/* 779 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var $parseInt = __webpack_require__(336);
// 20.1.2.13 Number.parseInt(string, radix)
$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });


/***/ }),
/* 780 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toInteger = __webpack_require__(60);
var aNumberValue = __webpack_require__(312);
var repeat = __webpack_require__(234);
var $toFixed = 1.0.toFixed;
var floor = Math.floor;
var data = [0, 0, 0, 0, 0, 0];
var ERROR = 'Number.toFixed: incorrect invocation!';
var ZERO = '0';

var multiply = function (n, c) {
  var i = -1;
  var c2 = c;
  while (++i < 6) {
    c2 += n * data[i];
    data[i] = c2 % 1e7;
    c2 = floor(c2 / 1e7);
  }
};
var divide = function (n) {
  var i = 6;
  var c = 0;
  while (--i >= 0) {
    c += data[i];
    data[i] = floor(c / n);
    c = (c % n) * 1e7;
  }
};
var numToString = function () {
  var i = 6;
  var s = '';
  while (--i >= 0) {
    if (s !== '' || i === 0 || data[i] !== 0) {
      var t = String(data[i]);
      s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
    }
  } return s;
};
var pow = function (x, n, acc) {
  return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
};
var log = function (x) {
  var n = 0;
  var x2 = x;
  while (x2 >= 4096) {
    n += 12;
    x2 /= 4096;
  }
  while (x2 >= 2) {
    n += 1;
    x2 /= 2;
  } return n;
};

$export($export.P + $export.F * (!!$toFixed && (
  0.00008.toFixed(3) !== '0.000' ||
  0.9.toFixed(0) !== '1' ||
  1.255.toFixed(2) !== '1.25' ||
  1000000000000000128.0.toFixed(0) !== '1000000000000000128'
) || !__webpack_require__(20)(function () {
  // V8 ~ Android 4.3-
  $toFixed.call({});
})), 'Number', {
  toFixed: function toFixed(fractionDigits) {
    var x = aNumberValue(this, ERROR);
    var f = toInteger(fractionDigits);
    var s = '';
    var m = ZERO;
    var e, z, j, k;
    if (f < 0 || f > 20) throw RangeError(ERROR);
    // eslint-disable-next-line no-self-compare
    if (x != x) return 'NaN';
    if (x <= -1e21 || x >= 1e21) return String(x);
    if (x < 0) {
      s = '-';
      x = -x;
    }
    if (x > 1e-21) {
      e = log(x * pow(2, 69, 1)) - 69;
      z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
      z *= 0x10000000000000;
      e = 52 - e;
      if (e > 0) {
        multiply(0, z);
        j = f;
        while (j >= 7) {
          multiply(1e7, 0);
          j -= 7;
        }
        multiply(pow(10, j, 1), 0);
        j = e - 1;
        while (j >= 23) {
          divide(1 << 23);
          j -= 23;
        }
        divide(1 << j);
        multiply(1, 1);
        divide(2);
        m = numToString();
      } else {
        multiply(0, z);
        multiply(1 << -e, 0);
        m = numToString() + repeat.call(ZERO, f);
      }
    }
    if (f > 0) {
      k = m.length;
      m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
    } else {
      m = s + m;
    } return m;
  }
});


/***/ }),
/* 781 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $fails = __webpack_require__(20);
var aNumberValue = __webpack_require__(312);
var $toPrecision = 1.0.toPrecision;

$export($export.P + $export.F * ($fails(function () {
  // IE7-
  return $toPrecision.call(1, undefined) !== '1';
}) || !$fails(function () {
  // V8 ~ Android 4.3-
  $toPrecision.call({});
})), 'Number', {
  toPrecision: function toPrecision(precision) {
    var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
    return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
  }
});


/***/ }),
/* 782 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.3.1 Object.assign(target, source)
var $export = __webpack_require__(2);

$export($export.S + $export.F, 'Object', { assign: __webpack_require__(329) });


/***/ }),
/* 783 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
$export($export.S, 'Object', { create: __webpack_require__(96) });


/***/ }),
/* 784 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
$export($export.S + $export.F * !__webpack_require__(30), 'Object', { defineProperties: __webpack_require__(330) });


/***/ }),
/* 785 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
$export($export.S + $export.F * !__webpack_require__(30), 'Object', { defineProperty: __webpack_require__(31).f });


/***/ }),
/* 786 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.5 Object.freeze(O)
var isObject = __webpack_require__(22);
var meta = __webpack_require__(82).onFreeze;

__webpack_require__(67)('freeze', function ($freeze) {
  return function freeze(it) {
    return $freeze && isObject(it) ? $freeze(meta(it)) : it;
  };
});


/***/ }),
/* 787 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
var toIObject = __webpack_require__(55);
var $getOwnPropertyDescriptor = __webpack_require__(53).f;

__webpack_require__(67)('getOwnPropertyDescriptor', function () {
  return function getOwnPropertyDescriptor(it, key) {
    return $getOwnPropertyDescriptor(toIObject(it), key);
  };
});


/***/ }),
/* 788 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.7 Object.getOwnPropertyNames(O)
__webpack_require__(67)('getOwnPropertyNames', function () {
  return __webpack_require__(331).f;
});


/***/ }),
/* 789 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.9 Object.getPrototypeOf(O)
var toObject = __webpack_require__(35);
var $getPrototypeOf = __webpack_require__(54);

__webpack_require__(67)('getPrototypeOf', function () {
  return function getPrototypeOf(it) {
    return $getPrototypeOf(toObject(it));
  };
});


/***/ }),
/* 790 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.11 Object.isExtensible(O)
var isObject = __webpack_require__(22);

__webpack_require__(67)('isExtensible', function ($isExtensible) {
  return function isExtensible(it) {
    return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
  };
});


/***/ }),
/* 791 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.12 Object.isFrozen(O)
var isObject = __webpack_require__(22);

__webpack_require__(67)('isFrozen', function ($isFrozen) {
  return function isFrozen(it) {
    return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
  };
});


/***/ }),
/* 792 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.13 Object.isSealed(O)
var isObject = __webpack_require__(22);

__webpack_require__(67)('isSealed', function ($isSealed) {
  return function isSealed(it) {
    return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
  };
});


/***/ }),
/* 793 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.3.10 Object.is(value1, value2)
var $export = __webpack_require__(2);
$export($export.S, 'Object', { is: __webpack_require__(339) });


/***/ }),
/* 794 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__(35);
var $keys = __webpack_require__(98);

__webpack_require__(67)('keys', function () {
  return function keys(it) {
    return $keys(toObject(it));
  };
});


/***/ }),
/* 795 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.15 Object.preventExtensions(O)
var isObject = __webpack_require__(22);
var meta = __webpack_require__(82).onFreeze;

__webpack_require__(67)('preventExtensions', function ($preventExtensions) {
  return function preventExtensions(it) {
    return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
  };
});


/***/ }),
/* 796 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.17 Object.seal(O)
var isObject = __webpack_require__(22);
var meta = __webpack_require__(82).onFreeze;

__webpack_require__(67)('seal', function ($seal) {
  return function seal(it) {
    return $seal && isObject(it) ? $seal(meta(it)) : it;
  };
});


/***/ }),
/* 797 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.3.19 Object.setPrototypeOf(O, proto)
var $export = __webpack_require__(2);
$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(231).set });


/***/ }),
/* 798 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 19.1.3.6 Object.prototype.toString()
var classof = __webpack_require__(113);
var test = {};
test[__webpack_require__(26)('toStringTag')] = 'z';
if (test + '' != '[object z]') {
  __webpack_require__(49)(Object.prototype, 'toString', function toString() {
    return '[object ' + classof(this) + ']';
  }, true);
}


/***/ }),
/* 799 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var $parseFloat = __webpack_require__(335);
// 18.2.4 parseFloat(string)
$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });


/***/ }),
/* 800 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var $parseInt = __webpack_require__(336);
// 18.2.5 parseInt(string, radix)
$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });


/***/ }),
/* 801 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var LIBRARY = __webpack_require__(81);
var global = __webpack_require__(16);
var ctx = __webpack_require__(58);
var classof = __webpack_require__(113);
var $export = __webpack_require__(2);
var isObject = __webpack_require__(22);
var aFunction = __webpack_require__(42);
var anInstance = __webpack_require__(94);
var forOf = __webpack_require__(95);
var speciesConstructor = __webpack_require__(139);
var task = __webpack_require__(236).set;
var microtask = __webpack_require__(228)();
var newPromiseCapabilityModule = __webpack_require__(229);
var perform = __webpack_require__(337);
var userAgent = __webpack_require__(178);
var promiseResolve = __webpack_require__(338);
var PROMISE = 'Promise';
var TypeError = global.TypeError;
var process = global.process;
var versions = process && process.versions;
var v8 = versions && versions.v8 || '';
var $Promise = global[PROMISE];
var isNode = classof(process) == 'process';
var empty = function () { /* empty */ };
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;

var USE_NATIVE = !!function () {
  try {
    // correct subclassing with @@species support
    var promise = $Promise.resolve(1);
    var FakePromise = (promise.constructor = {})[__webpack_require__(26)('species')] = function (exec) {
      exec(empty, empty);
    };
    // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
    return (isNode || typeof PromiseRejectionEvent == 'function')
      && promise.then(empty) instanceof FakePromise
      // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
      // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
      // we can't detect it synchronously, so just check versions
      && v8.indexOf('6.6') !== 0
      && userAgent.indexOf('Chrome/66') === -1;
  } catch (e) { /* empty */ }
}();

// helpers
var isThenable = function (it) {
  var then;
  return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, isReject) {
  if (promise._n) return;
  promise._n = true;
  var chain = promise._c;
  microtask(function () {
    var value = promise._v;
    var ok = promise._s == 1;
    var i = 0;
    var run = function (reaction) {
      var handler = ok ? reaction.ok : reaction.fail;
      var resolve = reaction.resolve;
      var reject = reaction.reject;
      var domain = reaction.domain;
      var result, then, exited;
      try {
        if (handler) {
          if (!ok) {
            if (promise._h == 2) onHandleUnhandled(promise);
            promise._h = 1;
          }
          if (handler === true) result = value;
          else {
            if (domain) domain.enter();
            result = handler(value); // may throw
            if (domain) {
              domain.exit();
              exited = true;
            }
          }
          if (result === reaction.promise) {
            reject(TypeError('Promise-chain cycle'));
          } else if (then = isThenable(result)) {
            then.call(result, resolve, reject);
          } else resolve(result);
        } else reject(value);
      } catch (e) {
        if (domain && !exited) domain.exit();
        reject(e);
      }
    };
    while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
    promise._c = [];
    promise._n = false;
    if (isReject && !promise._h) onUnhandled(promise);
  });
};
var onUnhandled = function (promise) {
  task.call(global, function () {
    var value = promise._v;
    var unhandled = isUnhandled(promise);
    var result, handler, console;
    if (unhandled) {
      result = perform(function () {
        if (isNode) {
          process.emit('unhandledRejection', value, promise);
        } else if (handler = global.onunhandledrejection) {
          handler({ promise: promise, reason: value });
        } else if ((console = global.console) && console.error) {
          console.error('Unhandled promise rejection', value);
        }
      });
      // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
      promise._h = isNode || isUnhandled(promise) ? 2 : 1;
    } promise._a = undefined;
    if (unhandled && result.e) throw result.v;
  });
};
var isUnhandled = function (promise) {
  return promise._h !== 1 && (promise._a || promise._c).length === 0;
};
var onHandleUnhandled = function (promise) {
  task.call(global, function () {
    var handler;
    if (isNode) {
      process.emit('rejectionHandled', promise);
    } else if (handler = global.onrejectionhandled) {
      handler({ promise: promise, reason: promise._v });
    }
  });
};
var $reject = function (value) {
  var promise = this;
  if (promise._d) return;
  promise._d = true;
  promise = promise._w || promise; // unwrap
  promise._v = value;
  promise._s = 2;
  if (!promise._a) promise._a = promise._c.slice();
  notify(promise, true);
};
var $resolve = function (value) {
  var promise = this;
  var then;
  if (promise._d) return;
  promise._d = true;
  promise = promise._w || promise; // unwrap
  try {
    if (promise === value) throw TypeError("Promise can't be resolved itself");
    if (then = isThenable(value)) {
      microtask(function () {
        var wrapper = { _w: promise, _d: false }; // wrap
        try {
          then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
        } catch (e) {
          $reject.call(wrapper, e);
        }
      });
    } else {
      promise._v = value;
      promise._s = 1;
      notify(promise, false);
    }
  } catch (e) {
    $reject.call({ _w: promise, _d: false }, e); // wrap
  }
};

// constructor polyfill
if (!USE_NATIVE) {
  // 25.4.3.1 Promise(executor)
  $Promise = function Promise(executor) {
    anInstance(this, $Promise, PROMISE, '_h');
    aFunction(executor);
    Internal.call(this);
    try {
      executor(ctx($resolve, this, 1), ctx($reject, this, 1));
    } catch (err) {
      $reject.call(this, err);
    }
  };
  // eslint-disable-next-line no-unused-vars
  Internal = function Promise(executor) {
    this._c = [];             // <- awaiting reactions
    this._a = undefined;      // <- checked in isUnhandled reactions
    this._s = 0;              // <- state
    this._d = false;          // <- done
    this._v = undefined;      // <- value
    this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
    this._n = false;          // <- notify
  };
  Internal.prototype = __webpack_require__(100)($Promise.prototype, {
    // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
    then: function then(onFulfilled, onRejected) {
      var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
      reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
      reaction.fail = typeof onRejected == 'function' && onRejected;
      reaction.domain = isNode ? process.domain : undefined;
      this._c.push(reaction);
      if (this._a) this._a.push(reaction);
      if (this._s) notify(this, false);
      return reaction.promise;
    },
    // 25.4.5.1 Promise.prototype.catch(onRejected)
    'catch': function (onRejected) {
      return this.then(undefined, onRejected);
    }
  });
  OwnPromiseCapability = function () {
    var promise = new Internal();
    this.promise = promise;
    this.resolve = ctx($resolve, promise, 1);
    this.reject = ctx($reject, promise, 1);
  };
  newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
    return C === $Promise || C === Wrapper
      ? new OwnPromiseCapability(C)
      : newGenericPromiseCapability(C);
  };
}

$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
__webpack_require__(115)($Promise, PROMISE);
__webpack_require__(101)(PROMISE);
Wrapper = __webpack_require__(57)[PROMISE];

// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  // 25.4.4.5 Promise.reject(r)
  reject: function reject(r) {
    var capability = newPromiseCapability(this);
    var $$reject = capability.reject;
    $$reject(r);
    return capability.promise;
  }
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  // 25.4.4.6 Promise.resolve(x)
  resolve: function resolve(x) {
    return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  }
});
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(170)(function (iter) {
  $Promise.all(iter)['catch'](empty);
})), PROMISE, {
  // 25.4.4.1 Promise.all(iterable)
  all: function all(iterable) {
    var C = this;
    var capability = newPromiseCapability(C);
    var resolve = capability.resolve;
    var reject = capability.reject;
    var result = perform(function () {
      var values = [];
      var index = 0;
      var remaining = 1;
      forOf(iterable, false, function (promise) {
        var $index = index++;
        var alreadyCalled = false;
        values.push(undefined);
        remaining++;
        C.resolve(promise).then(function (value) {
          if (alreadyCalled) return;
          alreadyCalled = true;
          values[$index] = value;
          --remaining || resolve(values);
        }, reject);
      });
      --remaining || resolve(values);
    });
    if (result.e) reject(result.v);
    return capability.promise;
  },
  // 25.4.4.4 Promise.race(iterable)
  race: function race(iterable) {
    var C = this;
    var capability = newPromiseCapability(C);
    var reject = capability.reject;
    var result = perform(function () {
      forOf(iterable, false, function (promise) {
        C.resolve(promise).then(capability.resolve, reject);
      });
    });
    if (result.e) reject(result.v);
    return capability.promise;
  }
});


/***/ }),
/* 802 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
var $export = __webpack_require__(2);
var aFunction = __webpack_require__(42);
var anObject = __webpack_require__(11);
var rApply = (__webpack_require__(16).Reflect || {}).apply;
var fApply = Function.apply;
// MS Edge argumentsList argument is optional
$export($export.S + $export.F * !__webpack_require__(20)(function () {
  rApply(function () { /* empty */ });
}), 'Reflect', {
  apply: function apply(target, thisArgument, argumentsList) {
    var T = aFunction(target);
    var L = anObject(argumentsList);
    return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
  }
});


/***/ }),
/* 803 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
var $export = __webpack_require__(2);
var create = __webpack_require__(96);
var aFunction = __webpack_require__(42);
var anObject = __webpack_require__(11);
var isObject = __webpack_require__(22);
var fails = __webpack_require__(20);
var bind = __webpack_require__(316);
var rConstruct = (__webpack_require__(16).Reflect || {}).construct;

// MS Edge supports only 2 arguments and argumentsList argument is optional
// FF Nightly sets third argument as `new.target`, but does not create `this` from it
var NEW_TARGET_BUG = fails(function () {
  function F() { /* empty */ }
  return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
});
var ARGS_BUG = !fails(function () {
  rConstruct(function () { /* empty */ });
});

$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
  construct: function construct(Target, args /* , newTarget */) {
    aFunction(Target);
    anObject(args);
    var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
    if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
    if (Target == newTarget) {
      // w/o altered newTarget, optimization for 0-4 arguments
      switch (args.length) {
        case 0: return new Target();
        case 1: return new Target(args[0]);
        case 2: return new Target(args[0], args[1]);
        case 3: return new Target(args[0], args[1], args[2]);
        case 4: return new Target(args[0], args[1], args[2], args[3]);
      }
      // w/o altered newTarget, lot of arguments case
      var $args = [null];
      $args.push.apply($args, args);
      return new (bind.apply(Target, $args))();
    }
    // with altered newTarget, not support built-in constructors
    var proto = newTarget.prototype;
    var instance = create(isObject(proto) ? proto : Object.prototype);
    var result = Function.apply.call(Target, instance, args);
    return isObject(result) ? result : instance;
  }
});


/***/ }),
/* 804 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
var dP = __webpack_require__(31);
var $export = __webpack_require__(2);
var anObject = __webpack_require__(11);
var toPrimitive = __webpack_require__(68);

// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
$export($export.S + $export.F * __webpack_require__(20)(function () {
  // eslint-disable-next-line no-undef
  Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
}), 'Reflect', {
  defineProperty: function defineProperty(target, propertyKey, attributes) {
    anObject(target);
    propertyKey = toPrimitive(propertyKey, true);
    anObject(attributes);
    try {
      dP.f(target, propertyKey, attributes);
      return true;
    } catch (e) {
      return false;
    }
  }
});


/***/ }),
/* 805 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.4 Reflect.deleteProperty(target, propertyKey)
var $export = __webpack_require__(2);
var gOPD = __webpack_require__(53).f;
var anObject = __webpack_require__(11);

$export($export.S, 'Reflect', {
  deleteProperty: function deleteProperty(target, propertyKey) {
    var desc = gOPD(anObject(target), propertyKey);
    return desc && !desc.configurable ? false : delete target[propertyKey];
  }
});


/***/ }),
/* 806 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 26.1.5 Reflect.enumerate(target)
var $export = __webpack_require__(2);
var anObject = __webpack_require__(11);
var Enumerate = function (iterated) {
  this._t = anObject(iterated); // target
  this._i = 0;                  // next index
  var keys = this._k = [];      // keys
  var key;
  for (key in iterated) keys.push(key);
};
__webpack_require__(224)(Enumerate, 'Object', function () {
  var that = this;
  var keys = that._k;
  var key;
  do {
    if (that._i >= keys.length) return { value: undefined, done: true };
  } while (!((key = keys[that._i++]) in that._t));
  return { value: key, done: false };
});

$export($export.S, 'Reflect', {
  enumerate: function enumerate(target) {
    return new Enumerate(target);
  }
});


/***/ }),
/* 807 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
var gOPD = __webpack_require__(53);
var $export = __webpack_require__(2);
var anObject = __webpack_require__(11);

$export($export.S, 'Reflect', {
  getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
    return gOPD.f(anObject(target), propertyKey);
  }
});


/***/ }),
/* 808 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.8 Reflect.getPrototypeOf(target)
var $export = __webpack_require__(2);
var getProto = __webpack_require__(54);
var anObject = __webpack_require__(11);

$export($export.S, 'Reflect', {
  getPrototypeOf: function getPrototypeOf(target) {
    return getProto(anObject(target));
  }
});


/***/ }),
/* 809 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.6 Reflect.get(target, propertyKey [, receiver])
var gOPD = __webpack_require__(53);
var getPrototypeOf = __webpack_require__(54);
var has = __webpack_require__(52);
var $export = __webpack_require__(2);
var isObject = __webpack_require__(22);
var anObject = __webpack_require__(11);

function get(target, propertyKey /* , receiver */) {
  var receiver = arguments.length < 3 ? target : arguments[2];
  var desc, proto;
  if (anObject(target) === receiver) return target[propertyKey];
  if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
    ? desc.value
    : desc.get !== undefined
      ? desc.get.call(receiver)
      : undefined;
  if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
}

$export($export.S, 'Reflect', { get: get });


/***/ }),
/* 810 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.9 Reflect.has(target, propertyKey)
var $export = __webpack_require__(2);

$export($export.S, 'Reflect', {
  has: function has(target, propertyKey) {
    return propertyKey in target;
  }
});


/***/ }),
/* 811 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.10 Reflect.isExtensible(target)
var $export = __webpack_require__(2);
var anObject = __webpack_require__(11);
var $isExtensible = Object.isExtensible;

$export($export.S, 'Reflect', {
  isExtensible: function isExtensible(target) {
    anObject(target);
    return $isExtensible ? $isExtensible(target) : true;
  }
});


/***/ }),
/* 812 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.11 Reflect.ownKeys(target)
var $export = __webpack_require__(2);

$export($export.S, 'Reflect', { ownKeys: __webpack_require__(334) });


/***/ }),
/* 813 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.12 Reflect.preventExtensions(target)
var $export = __webpack_require__(2);
var anObject = __webpack_require__(11);
var $preventExtensions = Object.preventExtensions;

$export($export.S, 'Reflect', {
  preventExtensions: function preventExtensions(target) {
    anObject(target);
    try {
      if ($preventExtensions) $preventExtensions(target);
      return true;
    } catch (e) {
      return false;
    }
  }
});


/***/ }),
/* 814 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.14 Reflect.setPrototypeOf(target, proto)
var $export = __webpack_require__(2);
var setProto = __webpack_require__(231);

if (setProto) $export($export.S, 'Reflect', {
  setPrototypeOf: function setPrototypeOf(target, proto) {
    setProto.check(target, proto);
    try {
      setProto.set(target, proto);
      return true;
    } catch (e) {
      return false;
    }
  }
});


/***/ }),
/* 815 */
/***/ (function(module, exports, __webpack_require__) {

// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
var dP = __webpack_require__(31);
var gOPD = __webpack_require__(53);
var getPrototypeOf = __webpack_require__(54);
var has = __webpack_require__(52);
var $export = __webpack_require__(2);
var createDesc = __webpack_require__(99);
var anObject = __webpack_require__(11);
var isObject = __webpack_require__(22);

function set(target, propertyKey, V /* , receiver */) {
  var receiver = arguments.length < 4 ? target : arguments[3];
  var ownDesc = gOPD.f(anObject(target), propertyKey);
  var existingDescriptor, proto;
  if (!ownDesc) {
    if (isObject(proto = getPrototypeOf(target))) {
      return set(proto, propertyKey, V, receiver);
    }
    ownDesc = createDesc(0);
  }
  if (has(ownDesc, 'value')) {
    if (ownDesc.writable === false || !isObject(receiver)) return false;
    if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
      if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
      existingDescriptor.value = V;
      dP.f(receiver, propertyKey, existingDescriptor);
    } else dP.f(receiver, propertyKey, createDesc(0, V));
    return true;
  }
  return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
}

$export($export.S, 'Reflect', { set: set });


/***/ }),
/* 816 */
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(16);
var inheritIfRequired = __webpack_require__(222);
var dP = __webpack_require__(31).f;
var gOPN = __webpack_require__(97).f;
var isRegExp = __webpack_require__(169);
var $flags = __webpack_require__(135);
var $RegExp = global.RegExp;
var Base = $RegExp;
var proto = $RegExp.prototype;
var re1 = /a/g;
var re2 = /a/g;
// "new" creates a new object, old webkit buggy here
var CORRECT_NEW = new $RegExp(re1) !== re1;

if (__webpack_require__(30) && (!CORRECT_NEW || __webpack_require__(20)(function () {
  re2[__webpack_require__(26)('match')] = false;
  // RegExp constructor can alter flags and IsRegExp works correct with @@match
  return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
}))) {
  $RegExp = function RegExp(p, f) {
    var tiRE = this instanceof $RegExp;
    var piRE = isRegExp(p);
    var fiU = f === undefined;
    return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
      : inheritIfRequired(CORRECT_NEW
        ? new Base(piRE && !fiU ? p.source : p, f)
        : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
      , tiRE ? this : proto, $RegExp);
  };
  var proxy = function (key) {
    key in $RegExp || dP($RegExp, key, {
      configurable: true,
      get: function () { return Base[key]; },
      set: function (it) { Base[key] = it; }
    });
  };
  for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
  proto.constructor = $RegExp;
  $RegExp.prototype = proto;
  __webpack_require__(49)(global, 'RegExp', $RegExp);
}

__webpack_require__(101)('RegExp');


/***/ }),
/* 817 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var anObject = __webpack_require__(11);
var toLength = __webpack_require__(27);
var advanceStringIndex = __webpack_require__(214);
var regExpExec = __webpack_require__(173);

// @@match logic
__webpack_require__(167)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
  return [
    // `String.prototype.match` method
    // https://tc39.github.io/ecma262/#sec-string.prototype.match
    function match(regexp) {
      var O = defined(this);
      var fn = regexp == undefined ? undefined : regexp[MATCH];
      return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
    },
    // `RegExp.prototype[@@match]` method
    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
    function (regexp) {
      var res = maybeCallNative($match, regexp, this);
      if (res.done) return res.value;
      var rx = anObject(regexp);
      var S = String(this);
      if (!rx.global) return regExpExec(rx, S);
      var fullUnicode = rx.unicode;
      rx.lastIndex = 0;
      var A = [];
      var n = 0;
      var result;
      while ((result = regExpExec(rx, S)) !== null) {
        var matchStr = String(result[0]);
        A[n] = matchStr;
        if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
        n++;
      }
      return n === 0 ? null : A;
    }
  ];
});


/***/ }),
/* 818 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var anObject = __webpack_require__(11);
var toObject = __webpack_require__(35);
var toLength = __webpack_require__(27);
var toInteger = __webpack_require__(60);
var advanceStringIndex = __webpack_require__(214);
var regExpExec = __webpack_require__(173);
var max = Math.max;
var min = Math.min;
var floor = Math.floor;
var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;

var maybeToString = function (it) {
  return it === undefined ? it : String(it);
};

// @@replace logic
__webpack_require__(167)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
  return [
    // `String.prototype.replace` method
    // https://tc39.github.io/ecma262/#sec-string.prototype.replace
    function replace(searchValue, replaceValue) {
      var O = defined(this);
      var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
      return fn !== undefined
        ? fn.call(searchValue, O, replaceValue)
        : $replace.call(String(O), searchValue, replaceValue);
    },
    // `RegExp.prototype[@@replace]` method
    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
    function (regexp, replaceValue) {
      var res = maybeCallNative($replace, regexp, this, replaceValue);
      if (res.done) return res.value;

      var rx = anObject(regexp);
      var S = String(this);
      var functionalReplace = typeof replaceValue === 'function';
      if (!functionalReplace) replaceValue = String(replaceValue);
      var global = rx.global;
      if (global) {
        var fullUnicode = rx.unicode;
        rx.lastIndex = 0;
      }
      var results = [];
      while (true) {
        var result = regExpExec(rx, S);
        if (result === null) break;
        results.push(result);
        if (!global) break;
        var matchStr = String(result[0]);
        if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
      }
      var accumulatedResult = '';
      var nextSourcePosition = 0;
      for (var i = 0; i < results.length; i++) {
        result = results[i];
        var matched = String(result[0]);
        var position = max(min(toInteger(result.index), S.length), 0);
        var captures = [];
        // NOTE: This is equivalent to
        //   captures = result.slice(1).map(maybeToString)
        // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
        // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
        // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
        for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
        var namedCaptures = result.groups;
        if (functionalReplace) {
          var replacerArgs = [matched].concat(captures, position, S);
          if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
          var replacement = String(replaceValue.apply(undefined, replacerArgs));
        } else {
          replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
        }
        if (position >= nextSourcePosition) {
          accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
          nextSourcePosition = position + matched.length;
        }
      }
      return accumulatedResult + S.slice(nextSourcePosition);
    }
  ];

    // https://tc39.github.io/ecma262/#sec-getsubstitution
  function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
    var tailPos = position + matched.length;
    var m = captures.length;
    var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
    if (namedCaptures !== undefined) {
      namedCaptures = toObject(namedCaptures);
      symbols = SUBSTITUTION_SYMBOLS;
    }
    return $replace.call(replacement, symbols, function (match, ch) {
      var capture;
      switch (ch.charAt(0)) {
        case '$': return '$';
        case '&': return matched;
        case '`': return str.slice(0, position);
        case "'": return str.slice(tailPos);
        case '<':
          capture = namedCaptures[ch.slice(1, -1)];
          break;
        default: // \d\d?
          var n = +ch;
          if (n === 0) return match;
          if (n > m) {
            var f = floor(n / 10);
            if (f === 0) return match;
            if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
            return match;
          }
          capture = captures[n - 1];
      }
      return capture === undefined ? '' : capture;
    });
  }
});


/***/ }),
/* 819 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var anObject = __webpack_require__(11);
var sameValue = __webpack_require__(339);
var regExpExec = __webpack_require__(173);

// @@search logic
__webpack_require__(167)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
  return [
    // `String.prototype.search` method
    // https://tc39.github.io/ecma262/#sec-string.prototype.search
    function search(regexp) {
      var O = defined(this);
      var fn = regexp == undefined ? undefined : regexp[SEARCH];
      return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
    },
    // `RegExp.prototype[@@search]` method
    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
    function (regexp) {
      var res = maybeCallNative($search, regexp, this);
      if (res.done) return res.value;
      var rx = anObject(regexp);
      var S = String(this);
      var previousLastIndex = rx.lastIndex;
      if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
      var result = regExpExec(rx, S);
      if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
      return result === null ? -1 : result.index;
    }
  ];
});


/***/ }),
/* 820 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var isRegExp = __webpack_require__(169);
var anObject = __webpack_require__(11);
var speciesConstructor = __webpack_require__(139);
var advanceStringIndex = __webpack_require__(214);
var toLength = __webpack_require__(27);
var callRegExpExec = __webpack_require__(173);
var regexpExec = __webpack_require__(230);
var fails = __webpack_require__(20);
var $min = Math.min;
var $push = [].push;
var $SPLIT = 'split';
var LENGTH = 'length';
var LAST_INDEX = 'lastIndex';
var MAX_UINT32 = 0xffffffff;

// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });

// @@split logic
__webpack_require__(167)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
  var internalSplit;
  if (
    'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
    'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
    'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
    '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
    '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
    ''[$SPLIT](/.?/)[LENGTH]
  ) {
    // based on es5-shim implementation, need to rework it
    internalSplit = function (separator, limit) {
      var string = String(this);
      if (separator === undefined && limit === 0) return [];
      // If `separator` is not a regex, use native split
      if (!isRegExp(separator)) return $split.call(string, separator, limit);
      var output = [];
      var flags = (separator.ignoreCase ? 'i' : '') +
                  (separator.multiline ? 'm' : '') +
                  (separator.unicode ? 'u' : '') +
                  (separator.sticky ? 'y' : '');
      var lastLastIndex = 0;
      var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
      // Make `global` and avoid `lastIndex` issues by working with a copy
      var separatorCopy = new RegExp(separator.source, flags + 'g');
      var match, lastIndex, lastLength;
      while (match = regexpExec.call(separatorCopy, string)) {
        lastIndex = separatorCopy[LAST_INDEX];
        if (lastIndex > lastLastIndex) {
          output.push(string.slice(lastLastIndex, match.index));
          if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
          lastLength = match[0][LENGTH];
          lastLastIndex = lastIndex;
          if (output[LENGTH] >= splitLimit) break;
        }
        if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
      }
      if (lastLastIndex === string[LENGTH]) {
        if (lastLength || !separatorCopy.test('')) output.push('');
      } else output.push(string.slice(lastLastIndex));
      return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
    };
  // Chakra, V8
  } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
    internalSplit = function (separator, limit) {
      return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
    };
  } else {
    internalSplit = $split;
  }

  return [
    // `String.prototype.split` method
    // https://tc39.github.io/ecma262/#sec-string.prototype.split
    function split(separator, limit) {
      var O = defined(this);
      var splitter = separator == undefined ? undefined : separator[SPLIT];
      return splitter !== undefined
        ? splitter.call(separator, O, limit)
        : internalSplit.call(String(O), separator, limit);
    },
    // `RegExp.prototype[@@split]` method
    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
    //
    // NOTE: This cannot be properly polyfilled in engines that don't support
    // the 'y' flag.
    function (regexp, limit) {
      var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
      if (res.done) return res.value;

      var rx = anObject(regexp);
      var S = String(this);
      var C = speciesConstructor(rx, RegExp);

      var unicodeMatching = rx.unicode;
      var flags = (rx.ignoreCase ? 'i' : '') +
                  (rx.multiline ? 'm' : '') +
                  (rx.unicode ? 'u' : '') +
                  (SUPPORTS_Y ? 'y' : 'g');

      // ^(? + rx + ) is needed, in combination with some S slicing, to
      // simulate the 'y' flag.
      var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
      var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
      if (lim === 0) return [];
      if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
      var p = 0;
      var q = 0;
      var A = [];
      while (q < S.length) {
        splitter.lastIndex = SUPPORTS_Y ? q : 0;
        var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
        var e;
        if (
          z === null ||
          (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
        ) {
          q = advanceStringIndex(S, q, unicodeMatching);
        } else {
          A.push(S.slice(p, q));
          if (A.length === lim) return A;
          for (var i = 1; i <= z.length - 1; i++) {
            A.push(z[i]);
            if (A.length === lim) return A;
          }
          q = p = e;
        }
      }
      A.push(S.slice(p));
      return A;
    }
  ];
});


/***/ }),
/* 821 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

__webpack_require__(345);
var anObject = __webpack_require__(11);
var $flags = __webpack_require__(135);
var DESCRIPTORS = __webpack_require__(30);
var TO_STRING = 'toString';
var $toString = /./[TO_STRING];

var define = function (fn) {
  __webpack_require__(49)(RegExp.prototype, TO_STRING, fn, true);
};

// 21.2.5.14 RegExp.prototype.toString()
if (__webpack_require__(20)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
  define(function toString() {
    var R = anObject(this);
    return '/'.concat(R.source, '/',
      'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
  });
// FF44- RegExp#toString has a wrong name
} else if ($toString.name != TO_STRING) {
  define(function toString() {
    return $toString.call(this);
  });
}


/***/ }),
/* 822 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.2 String.prototype.anchor(name)
__webpack_require__(50)('anchor', function (createHTML) {
  return function anchor(name) {
    return createHTML(this, 'a', 'name', name);
  };
});


/***/ }),
/* 823 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.3 String.prototype.big()
__webpack_require__(50)('big', function (createHTML) {
  return function big() {
    return createHTML(this, 'big', '', '');
  };
});


/***/ }),
/* 824 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.4 String.prototype.blink()
__webpack_require__(50)('blink', function (createHTML) {
  return function blink() {
    return createHTML(this, 'blink', '', '');
  };
});


/***/ }),
/* 825 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.5 String.prototype.bold()
__webpack_require__(50)('bold', function (createHTML) {
  return function bold() {
    return createHTML(this, 'b', '', '');
  };
});


/***/ }),
/* 826 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $at = __webpack_require__(176)(false);
$export($export.P, 'String', {
  // 21.1.3.3 String.prototype.codePointAt(pos)
  codePointAt: function codePointAt(pos) {
    return $at(this, pos);
  }
});


/***/ }),
/* 827 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])

var $export = __webpack_require__(2);
var toLength = __webpack_require__(27);
var context = __webpack_require__(233);
var ENDS_WITH = 'endsWith';
var $endsWith = ''[ENDS_WITH];

$export($export.P + $export.F * __webpack_require__(220)(ENDS_WITH), 'String', {
  endsWith: function endsWith(searchString /* , endPosition = @length */) {
    var that = context(this, searchString, ENDS_WITH);
    var endPosition = arguments.length > 1 ? arguments[1] : undefined;
    var len = toLength(that.length);
    var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
    var search = String(searchString);
    return $endsWith
      ? $endsWith.call(that, search, end)
      : that.slice(end - search.length, end) === search;
  }
});


/***/ }),
/* 828 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.6 String.prototype.fixed()
__webpack_require__(50)('fixed', function (createHTML) {
  return function fixed() {
    return createHTML(this, 'tt', '', '');
  };
});


/***/ }),
/* 829 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.7 String.prototype.fontcolor(color)
__webpack_require__(50)('fontcolor', function (createHTML) {
  return function fontcolor(color) {
    return createHTML(this, 'font', 'color', color);
  };
});


/***/ }),
/* 830 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.8 String.prototype.fontsize(size)
__webpack_require__(50)('fontsize', function (createHTML) {
  return function fontsize(size) {
    return createHTML(this, 'font', 'size', size);
  };
});


/***/ }),
/* 831 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var toAbsoluteIndex = __webpack_require__(102);
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;

// length should be 1, old FF problem
$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
  // 21.1.2.2 String.fromCodePoint(...codePoints)
  fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
    var res = [];
    var aLen = arguments.length;
    var i = 0;
    var code;
    while (aLen > i) {
      code = +arguments[i++];
      if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
      res.push(code < 0x10000
        ? fromCharCode(code)
        : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
      );
    } return res.join('');
  }
});


/***/ }),
/* 832 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// 21.1.3.7 String.prototype.includes(searchString, position = 0)

var $export = __webpack_require__(2);
var context = __webpack_require__(233);
var INCLUDES = 'includes';

$export($export.P + $export.F * __webpack_require__(220)(INCLUDES), 'String', {
  includes: function includes(searchString /* , position = 0 */) {
    return !!~context(this, searchString, INCLUDES)
      .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  }
});


/***/ }),
/* 833 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.9 String.prototype.italics()
__webpack_require__(50)('italics', function (createHTML) {
  return function italics() {
    return createHTML(this, 'i', '', '');
  };
});


/***/ }),
/* 834 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $at = __webpack_require__(176)(true);

// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(225)(String, 'String', function (iterated) {
  this._t = String(iterated); // target
  this._i = 0;                // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var index = this._i;
  var point;
  if (index >= O.length) return { value: undefined, done: true };
  point = $at(O, index);
  this._i += point.length;
  return { value: point, done: false };
});


/***/ }),
/* 835 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.10 String.prototype.link(url)
__webpack_require__(50)('link', function (createHTML) {
  return function link(url) {
    return createHTML(this, 'a', 'href', url);
  };
});


/***/ }),
/* 836 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var toIObject = __webpack_require__(55);
var toLength = __webpack_require__(27);

$export($export.S, 'String', {
  // 21.1.2.4 String.raw(callSite, ...substitutions)
  raw: function raw(callSite) {
    var tpl = toIObject(callSite.raw);
    var len = toLength(tpl.length);
    var aLen = arguments.length;
    var res = [];
    var i = 0;
    while (len > i) {
      res.push(String(tpl[i++]));
      if (i < aLen) res.push(String(arguments[i]));
    } return res.join('');
  }
});


/***/ }),
/* 837 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);

$export($export.P, 'String', {
  // 21.1.3.13 String.prototype.repeat(count)
  repeat: __webpack_require__(234)
});


/***/ }),
/* 838 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.11 String.prototype.small()
__webpack_require__(50)('small', function (createHTML) {
  return function small() {
    return createHTML(this, 'small', '', '');
  };
});


/***/ }),
/* 839 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// 21.1.3.18 String.prototype.startsWith(searchString [, position ])

var $export = __webpack_require__(2);
var toLength = __webpack_require__(27);
var context = __webpack_require__(233);
var STARTS_WITH = 'startsWith';
var $startsWith = ''[STARTS_WITH];

$export($export.P + $export.F * __webpack_require__(220)(STARTS_WITH), 'String', {
  startsWith: function startsWith(searchString /* , position = 0 */) {
    var that = context(this, searchString, STARTS_WITH);
    var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
    var search = String(searchString);
    return $startsWith
      ? $startsWith.call(that, search, index)
      : that.slice(index, index + search.length) === search;
  }
});


/***/ }),
/* 840 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.12 String.prototype.strike()
__webpack_require__(50)('strike', function (createHTML) {
  return function strike() {
    return createHTML(this, 'strike', '', '');
  };
});


/***/ }),
/* 841 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.13 String.prototype.sub()
__webpack_require__(50)('sub', function (createHTML) {
  return function sub() {
    return createHTML(this, 'sub', '', '');
  };
});


/***/ }),
/* 842 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// B.2.3.14 String.prototype.sup()
__webpack_require__(50)('sup', function (createHTML) {
  return function sup() {
    return createHTML(this, 'sup', '', '');
  };
});


/***/ }),
/* 843 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 21.1.3.25 String.prototype.trim()
__webpack_require__(116)('trim', function ($trim) {
  return function trim() {
    return $trim(this, 3);
  };
});


/***/ }),
/* 844 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// ECMAScript 6 symbols shim
var global = __webpack_require__(16);
var has = __webpack_require__(52);
var DESCRIPTORS = __webpack_require__(30);
var $export = __webpack_require__(2);
var redefine = __webpack_require__(49);
var META = __webpack_require__(82).KEY;
var $fails = __webpack_require__(20);
var shared = __webpack_require__(138);
var setToStringTag = __webpack_require__(115);
var uid = __webpack_require__(103);
var wks = __webpack_require__(26);
var wksExt = __webpack_require__(342);
var wksDefine = __webpack_require__(238);
var enumKeys = __webpack_require__(721);
var isArray = __webpack_require__(168);
var anObject = __webpack_require__(11);
var isObject = __webpack_require__(22);
var toObject = __webpack_require__(35);
var toIObject = __webpack_require__(55);
var toPrimitive = __webpack_require__(68);
var createDesc = __webpack_require__(99);
var _create = __webpack_require__(96);
var gOPNExt = __webpack_require__(331);
var $GOPD = __webpack_require__(53);
var $GOPS = __webpack_require__(172);
var $DP = __webpack_require__(31);
var $keys = __webpack_require__(98);
var gOPD = $GOPD.f;
var dP = $DP.f;
var gOPN = gOPNExt.f;
var $Symbol = global.Symbol;
var $JSON = global.JSON;
var _stringify = $JSON && $JSON.stringify;
var PROTOTYPE = 'prototype';
var HIDDEN = wks('_hidden');
var TO_PRIMITIVE = wks('toPrimitive');
var isEnum = {}.propertyIsEnumerable;
var SymbolRegistry = shared('symbol-registry');
var AllSymbols = shared('symbols');
var OPSymbols = shared('op-symbols');
var ObjectProto = Object[PROTOTYPE];
var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
var QObject = global.QObject;
// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;

// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
var setSymbolDesc = DESCRIPTORS && $fails(function () {
  return _create(dP({}, 'a', {
    get: function () { return dP(this, 'a', { value: 7 }).a; }
  })).a != 7;
}) ? function (it, key, D) {
  var protoDesc = gOPD(ObjectProto, key);
  if (protoDesc) delete ObjectProto[key];
  dP(it, key, D);
  if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
} : dP;

var wrap = function (tag) {
  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  sym._k = tag;
  return sym;
};

var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  return typeof it == 'symbol';
} : function (it) {
  return it instanceof $Symbol;
};

var $defineProperty = function defineProperty(it, key, D) {
  if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  anObject(it);
  key = toPrimitive(key, true);
  anObject(D);
  if (has(AllSymbols, key)) {
    if (!D.enumerable) {
      if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
      it[HIDDEN][key] = true;
    } else {
      if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
      D = _create(D, { enumerable: createDesc(0, false) });
    } return setSymbolDesc(it, key, D);
  } return dP(it, key, D);
};
var $defineProperties = function defineProperties(it, P) {
  anObject(it);
  var keys = enumKeys(P = toIObject(P));
  var i = 0;
  var l = keys.length;
  var key;
  while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  return it;
};
var $create = function create(it, P) {
  return P === undefined ? _create(it) : $defineProperties(_create(it), P);
};
var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  var E = isEnum.call(this, key = toPrimitive(key, true));
  if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  it = toIObject(it);
  key = toPrimitive(key, true);
  if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  var D = gOPD(it, key);
  if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  return D;
};
var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  var names = gOPN(toIObject(it));
  var result = [];
  var i = 0;
  var key;
  while (names.length > i) {
    if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  } return result;
};
var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  var IS_OP = it === ObjectProto;
  var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  var result = [];
  var i = 0;
  var key;
  while (names.length > i) {
    if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  } return result;
};

// 19.4.1.1 Symbol([description])
if (!USE_NATIVE) {
  $Symbol = function Symbol() {
    if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
    var $set = function (value) {
      if (this === ObjectProto) $set.call(OPSymbols, value);
      if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
      setSymbolDesc(this, tag, createDesc(1, value));
    };
    if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
    return wrap(tag);
  };
  redefine($Symbol[PROTOTYPE], 'toString', function toString() {
    return this._k;
  });

  $GOPD.f = $getOwnPropertyDescriptor;
  $DP.f = $defineProperty;
  __webpack_require__(97).f = gOPNExt.f = $getOwnPropertyNames;
  __webpack_require__(137).f = $propertyIsEnumerable;
  $GOPS.f = $getOwnPropertySymbols;

  if (DESCRIPTORS && !__webpack_require__(81)) {
    redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  }

  wksExt.f = function (name) {
    return wrap(wks(name));
  };
}

$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });

for (var es6Symbols = (
  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);

for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);

$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  // 19.4.2.1 Symbol.for(key)
  'for': function (key) {
    return has(SymbolRegistry, key += '')
      ? SymbolRegistry[key]
      : SymbolRegistry[key] = $Symbol(key);
  },
  // 19.4.2.5 Symbol.keyFor(sym)
  keyFor: function keyFor(sym) {
    if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
    for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  },
  useSetter: function () { setter = true; },
  useSimple: function () { setter = false; }
});

$export($export.S + $export.F * !USE_NATIVE, 'Object', {
  // 19.1.2.2 Object.create(O [, Properties])
  create: $create,
  // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  defineProperty: $defineProperty,
  // 19.1.2.3 Object.defineProperties(O, Properties)
  defineProperties: $defineProperties,
  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  // 19.1.2.7 Object.getOwnPropertyNames(O)
  getOwnPropertyNames: $getOwnPropertyNames,
  // 19.1.2.8 Object.getOwnPropertySymbols(O)
  getOwnPropertySymbols: $getOwnPropertySymbols
});

// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
// https://bugs.chromium.org/p/v8/issues/detail?id=3443
var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });

$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  getOwnPropertySymbols: function getOwnPropertySymbols(it) {
    return $GOPS.f(toObject(it));
  }
});

// 24.3.2 JSON.stringify(value [, replacer [, space]])
$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  var S = $Symbol();
  // MS Edge converts symbol values to JSON as {}
  // WebKit converts symbol values to JSON as null
  // V8 throws on boxed symbols
  return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
})), 'JSON', {
  stringify: function stringify(it) {
    var args = [it];
    var i = 1;
    var replacer, $replacer;
    while (arguments.length > i) args.push(arguments[i++]);
    $replacer = replacer = args[1];
    if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
    if (!isArray(replacer)) replacer = function (key, value) {
      if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
      if (!isSymbol(value)) return value;
    };
    args[1] = replacer;
    return _stringify.apply($JSON, args);
  }
});

// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(48)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
// 19.4.3.5 Symbol.prototype[@@toStringTag]
setToStringTag($Symbol, 'Symbol');
// 20.2.1.9 Math[@@toStringTag]
setToStringTag(Math, 'Math', true);
// 24.3.3 JSON[@@toStringTag]
setToStringTag(global.JSON, 'JSON', true);


/***/ }),
/* 845 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var $typed = __webpack_require__(177);
var buffer = __webpack_require__(237);
var anObject = __webpack_require__(11);
var toAbsoluteIndex = __webpack_require__(102);
var toLength = __webpack_require__(27);
var isObject = __webpack_require__(22);
var ArrayBuffer = __webpack_require__(16).ArrayBuffer;
var speciesConstructor = __webpack_require__(139);
var $ArrayBuffer = buffer.ArrayBuffer;
var $DataView = buffer.DataView;
var $isView = $typed.ABV && ArrayBuffer.isView;
var $slice = $ArrayBuffer.prototype.slice;
var VIEW = $typed.VIEW;
var ARRAY_BUFFER = 'ArrayBuffer';

$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });

$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
  // 24.1.3.1 ArrayBuffer.isView(arg)
  isView: function isView(it) {
    return $isView && $isView(it) || isObject(it) && VIEW in it;
  }
});

$export($export.P + $export.U + $export.F * __webpack_require__(20)(function () {
  return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
}), ARRAY_BUFFER, {
  // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
  slice: function slice(start, end) {
    if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
    var len = anObject(this).byteLength;
    var first = toAbsoluteIndex(start, len);
    var fin = toAbsoluteIndex(end === undefined ? len : end, len);
    var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
    var viewS = new $DataView(this);
    var viewT = new $DataView(result);
    var index = 0;
    while (first < fin) {
      viewT.setUint8(index++, viewS.getUint8(first++));
    } return result;
  }
});

__webpack_require__(101)(ARRAY_BUFFER);


/***/ }),
/* 846 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
$export($export.G + $export.W + $export.F * !__webpack_require__(177).ABV, {
  DataView: __webpack_require__(237).DataView
});


/***/ }),
/* 847 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Float32', 4, function (init) {
  return function Float32Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 848 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Float64', 8, function (init) {
  return function Float64Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 849 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Int16', 2, function (init) {
  return function Int16Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 850 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Int32', 4, function (init) {
  return function Int32Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 851 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Int8', 1, function (init) {
  return function Int8Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 852 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Uint16', 2, function (init) {
  return function Uint16Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 853 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Uint32', 4, function (init) {
  return function Uint32Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 854 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Uint8', 1, function (init) {
  return function Uint8Array(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
});


/***/ }),
/* 855 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(74)('Uint8', 1, function (init) {
  return function Uint8ClampedArray(data, byteOffset, length) {
    return init(this, data, byteOffset, length);
  };
}, true);


/***/ }),
/* 856 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var weak = __webpack_require__(319);
var validate = __webpack_require__(104);
var WEAK_SET = 'WeakSet';

// 23.4 WeakSet Objects
__webpack_require__(166)(WEAK_SET, function (get) {
  return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
  // 23.4.3.1 WeakSet.prototype.add(value)
  add: function add(value) {
    return weak.def(validate(this, WEAK_SET), value, true);
  }
}, weak, false, true);


/***/ }),
/* 857 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
var $export = __webpack_require__(2);
var flattenIntoArray = __webpack_require__(320);
var toObject = __webpack_require__(35);
var toLength = __webpack_require__(27);
var aFunction = __webpack_require__(42);
var arraySpeciesCreate = __webpack_require__(216);

$export($export.P, 'Array', {
  flatMap: function flatMap(callbackfn /* , thisArg */) {
    var O = toObject(this);
    var sourceLen, A;
    aFunction(callbackfn);
    sourceLen = toLength(O.length);
    A = arraySpeciesCreate(O, 0);
    flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
    return A;
  }
});

__webpack_require__(80)('flatMap');


/***/ }),
/* 858 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
var $export = __webpack_require__(2);
var flattenIntoArray = __webpack_require__(320);
var toObject = __webpack_require__(35);
var toLength = __webpack_require__(27);
var toInteger = __webpack_require__(60);
var arraySpeciesCreate = __webpack_require__(216);

$export($export.P, 'Array', {
  flatten: function flatten(/* depthArg = 1 */) {
    var depthArg = arguments[0];
    var O = toObject(this);
    var sourceLen = toLength(O.length);
    var A = arraySpeciesCreate(O, 0);
    flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
    return A;
  }
});

__webpack_require__(80)('flatten');


/***/ }),
/* 859 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/tc39/Array.prototype.includes
var $export = __webpack_require__(2);
var $includes = __webpack_require__(165)(true);

$export($export.P, 'Array', {
  includes: function includes(el /* , fromIndex = 0 */) {
    return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  }
});

__webpack_require__(80)('includes');


/***/ }),
/* 860 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
var $export = __webpack_require__(2);
var microtask = __webpack_require__(228)();
var process = __webpack_require__(16).process;
var isNode = __webpack_require__(56)(process) == 'process';

$export($export.G, {
  asap: function asap(fn) {
    var domain = isNode && process.domain;
    microtask(domain ? domain.bind(fn) : fn);
  }
});


/***/ }),
/* 861 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/ljharb/proposal-is-error
var $export = __webpack_require__(2);
var cof = __webpack_require__(56);

$export($export.S, 'Error', {
  isError: function isError(it) {
    return cof(it) === 'Error';
  }
});


/***/ }),
/* 862 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/tc39/proposal-global
var $export = __webpack_require__(2);

$export($export.G, { global: __webpack_require__(16) });


/***/ }),
/* 863 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
__webpack_require__(174)('Map');


/***/ }),
/* 864 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
__webpack_require__(175)('Map');


/***/ }),
/* 865 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(2);

$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(318)('Map') });


/***/ }),
/* 866 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  clamp: function clamp(x, lower, upper) {
    return Math.min(upper, Math.max(lower, x));
  }
});


/***/ }),
/* 867 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);

$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });


/***/ }),
/* 868 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);
var RAD_PER_DEG = 180 / Math.PI;

$export($export.S, 'Math', {
  degrees: function degrees(radians) {
    return radians * RAD_PER_DEG;
  }
});


/***/ }),
/* 869 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);
var scale = __webpack_require__(328);
var fround = __webpack_require__(326);

$export($export.S, 'Math', {
  fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
    return fround(scale(x, inLow, inHigh, outLow, outHigh));
  }
});


/***/ }),
/* 870 */
/***/ (function(module, exports, __webpack_require__) {

// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  iaddh: function iaddh(x0, x1, y0, y1) {
    var $x0 = x0 >>> 0;
    var $x1 = x1 >>> 0;
    var $y0 = y0 >>> 0;
    return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
  }
});


/***/ }),
/* 871 */
/***/ (function(module, exports, __webpack_require__) {

// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  imulh: function imulh(u, v) {
    var UINT16 = 0xffff;
    var $u = +u;
    var $v = +v;
    var u0 = $u & UINT16;
    var v0 = $v & UINT16;
    var u1 = $u >> 16;
    var v1 = $v >> 16;
    var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
    return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
  }
});


/***/ }),
/* 872 */
/***/ (function(module, exports, __webpack_require__) {

// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  isubh: function isubh(x0, x1, y0, y1) {
    var $x0 = x0 >>> 0;
    var $x1 = x1 >>> 0;
    var $y0 = y0 >>> 0;
    return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
  }
});


/***/ }),
/* 873 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);

$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });


/***/ }),
/* 874 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);
var DEG_PER_RAD = Math.PI / 180;

$export($export.S, 'Math', {
  radians: function radians(degrees) {
    return degrees * DEG_PER_RAD;
  }
});


/***/ }),
/* 875 */
/***/ (function(module, exports, __webpack_require__) {

// https://rwaldron.github.io/proposal-math-extensions/
var $export = __webpack_require__(2);

$export($export.S, 'Math', { scale: __webpack_require__(328) });


/***/ }),
/* 876 */
/***/ (function(module, exports, __webpack_require__) {

// http://jfbastien.github.io/papers/Math.signbit.html
var $export = __webpack_require__(2);

$export($export.S, 'Math', { signbit: function signbit(x) {
  // eslint-disable-next-line no-self-compare
  return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
} });


/***/ }),
/* 877 */
/***/ (function(module, exports, __webpack_require__) {

// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
var $export = __webpack_require__(2);

$export($export.S, 'Math', {
  umulh: function umulh(u, v) {
    var UINT16 = 0xffff;
    var $u = +u;
    var $v = +v;
    var u0 = $u & UINT16;
    var v0 = $v & UINT16;
    var u1 = $u >>> 16;
    var v1 = $v >>> 16;
    var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
    return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
  }
});


/***/ }),
/* 878 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toObject = __webpack_require__(35);
var aFunction = __webpack_require__(42);
var $defineProperty = __webpack_require__(31);

// B.2.2.2 Object.prototype.__defineGetter__(P, getter)
__webpack_require__(30) && $export($export.P + __webpack_require__(171), 'Object', {
  __defineGetter__: function __defineGetter__(P, getter) {
    $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
  }
});


/***/ }),
/* 879 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toObject = __webpack_require__(35);
var aFunction = __webpack_require__(42);
var $defineProperty = __webpack_require__(31);

// B.2.2.3 Object.prototype.__defineSetter__(P, setter)
__webpack_require__(30) && $export($export.P + __webpack_require__(171), 'Object', {
  __defineSetter__: function __defineSetter__(P, setter) {
    $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
  }
});


/***/ }),
/* 880 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(2);
var $entries = __webpack_require__(333)(true);

$export($export.S, 'Object', {
  entries: function entries(it) {
    return $entries(it);
  }
});


/***/ }),
/* 881 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/tc39/proposal-object-getownpropertydescriptors
var $export = __webpack_require__(2);
var ownKeys = __webpack_require__(334);
var toIObject = __webpack_require__(55);
var gOPD = __webpack_require__(53);
var createProperty = __webpack_require__(217);

$export($export.S, 'Object', {
  getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
    var O = toIObject(object);
    var getDesc = gOPD.f;
    var keys = ownKeys(O);
    var result = {};
    var i = 0;
    var key, desc;
    while (keys.length > i) {
      desc = getDesc(O, key = keys[i++]);
      if (desc !== undefined) createProperty(result, key, desc);
    }
    return result;
  }
});


/***/ }),
/* 882 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toObject = __webpack_require__(35);
var toPrimitive = __webpack_require__(68);
var getPrototypeOf = __webpack_require__(54);
var getOwnPropertyDescriptor = __webpack_require__(53).f;

// B.2.2.4 Object.prototype.__lookupGetter__(P)
__webpack_require__(30) && $export($export.P + __webpack_require__(171), 'Object', {
  __lookupGetter__: function __lookupGetter__(P) {
    var O = toObject(this);
    var K = toPrimitive(P, true);
    var D;
    do {
      if (D = getOwnPropertyDescriptor(O, K)) return D.get;
    } while (O = getPrototypeOf(O));
  }
});


/***/ }),
/* 883 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $export = __webpack_require__(2);
var toObject = __webpack_require__(35);
var toPrimitive = __webpack_require__(68);
var getPrototypeOf = __webpack_require__(54);
var getOwnPropertyDescriptor = __webpack_require__(53).f;

// B.2.2.5 Object.prototype.__lookupSetter__(P)
__webpack_require__(30) && $export($export.P + __webpack_require__(171), 'Object', {
  __lookupSetter__: function __lookupSetter__(P) {
    var O = toObject(this);
    var K = toPrimitive(P, true);
    var D;
    do {
      if (D = getOwnPropertyDescriptor(O, K)) return D.set;
    } while (O = getPrototypeOf(O));
  }
});


/***/ }),
/* 884 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/tc39/proposal-object-values-entries
var $export = __webpack_require__(2);
var $values = __webpack_require__(333)(false);

$export($export.S, 'Object', {
  values: function values(it) {
    return $values(it);
  }
});


/***/ }),
/* 885 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/zenparsing/es-observable
var $export = __webpack_require__(2);
var global = __webpack_require__(16);
var core = __webpack_require__(57);
var microtask = __webpack_require__(228)();
var OBSERVABLE = __webpack_require__(26)('observable');
var aFunction = __webpack_require__(42);
var anObject = __webpack_require__(11);
var anInstance = __webpack_require__(94);
var redefineAll = __webpack_require__(100);
var hide = __webpack_require__(48);
var forOf = __webpack_require__(95);
var RETURN = forOf.RETURN;

var getMethod = function (fn) {
  return fn == null ? undefined : aFunction(fn);
};

var cleanupSubscription = function (subscription) {
  var cleanup = subscription._c;
  if (cleanup) {
    subscription._c = undefined;
    cleanup();
  }
};

var subscriptionClosed = function (subscription) {
  return subscription._o === undefined;
};

var closeSubscription = function (subscription) {
  if (!subscriptionClosed(subscription)) {
    subscription._o = undefined;
    cleanupSubscription(subscription);
  }
};

var Subscription = function (observer, subscriber) {
  anObject(observer);
  this._c = undefined;
  this._o = observer;
  observer = new SubscriptionObserver(this);
  try {
    var cleanup = subscriber(observer);
    var subscription = cleanup;
    if (cleanup != null) {
      if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
      else aFunction(cleanup);
      this._c = cleanup;
    }
  } catch (e) {
    observer.error(e);
    return;
  } if (subscriptionClosed(this)) cleanupSubscription(this);
};

Subscription.prototype = redefineAll({}, {
  unsubscribe: function unsubscribe() { closeSubscription(this); }
});

var SubscriptionObserver = function (subscription) {
  this._s = subscription;
};

SubscriptionObserver.prototype = redefineAll({}, {
  next: function next(value) {
    var subscription = this._s;
    if (!subscriptionClosed(subscription)) {
      var observer = subscription._o;
      try {
        var m = getMethod(observer.next);
        if (m) return m.call(observer, value);
      } catch (e) {
        try {
          closeSubscription(subscription);
        } finally {
          throw e;
        }
      }
    }
  },
  error: function error(value) {
    var subscription = this._s;
    if (subscriptionClosed(subscription)) throw value;
    var observer = subscription._o;
    subscription._o = undefined;
    try {
      var m = getMethod(observer.error);
      if (!m) throw value;
      value = m.call(observer, value);
    } catch (e) {
      try {
        cleanupSubscription(subscription);
      } finally {
        throw e;
      }
    } cleanupSubscription(subscription);
    return value;
  },
  complete: function complete(value) {
    var subscription = this._s;
    if (!subscriptionClosed(subscription)) {
      var observer = subscription._o;
      subscription._o = undefined;
      try {
        var m = getMethod(observer.complete);
        value = m ? m.call(observer, value) : undefined;
      } catch (e) {
        try {
          cleanupSubscription(subscription);
        } finally {
          throw e;
        }
      } cleanupSubscription(subscription);
      return value;
    }
  }
});

var $Observable = function Observable(subscriber) {
  anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
};

redefineAll($Observable.prototype, {
  subscribe: function subscribe(observer) {
    return new Subscription(observer, this._f);
  },
  forEach: function forEach(fn) {
    var that = this;
    return new (core.Promise || global.Promise)(function (resolve, reject) {
      aFunction(fn);
      var subscription = that.subscribe({
        next: function (value) {
          try {
            return fn(value);
          } catch (e) {
            reject(e);
            subscription.unsubscribe();
          }
        },
        error: reject,
        complete: resolve
      });
    });
  }
});

redefineAll($Observable, {
  from: function from(x) {
    var C = typeof this === 'function' ? this : $Observable;
    var method = getMethod(anObject(x)[OBSERVABLE]);
    if (method) {
      var observable = anObject(method.call(x));
      return observable.constructor === C ? observable : new C(function (observer) {
        return observable.subscribe(observer);
      });
    }
    return new C(function (observer) {
      var done = false;
      microtask(function () {
        if (!done) {
          try {
            if (forOf(x, false, function (it) {
              observer.next(it);
              if (done) return RETURN;
            }) === RETURN) return;
          } catch (e) {
            if (done) throw e;
            observer.error(e);
            return;
          } observer.complete();
        }
      });
      return function () { done = true; };
    });
  },
  of: function of() {
    for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
    return new (typeof this === 'function' ? this : $Observable)(function (observer) {
      var done = false;
      microtask(function () {
        if (!done) {
          for (var j = 0; j < items.length; ++j) {
            observer.next(items[j]);
            if (done) return;
          } observer.complete();
        }
      });
      return function () { done = true; };
    });
  }
});

hide($Observable.prototype, OBSERVABLE, function () { return this; });

$export($export.G, { Observable: $Observable });

__webpack_require__(101)('Observable');


/***/ }),
/* 886 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// https://github.com/tc39/proposal-promise-finally

var $export = __webpack_require__(2);
var core = __webpack_require__(57);
var global = __webpack_require__(16);
var speciesConstructor = __webpack_require__(139);
var promiseResolve = __webpack_require__(338);

$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  var C = speciesConstructor(this, core.Promise || global.Promise);
  var isFunction = typeof onFinally == 'function';
  return this.then(
    isFunction ? function (x) {
      return promiseResolve(C, onFinally()).then(function () { return x; });
    } : onFinally,
    isFunction ? function (e) {
      return promiseResolve(C, onFinally()).then(function () { throw e; });
    } : onFinally
  );
} });


/***/ }),
/* 887 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/tc39/proposal-promise-try
var $export = __webpack_require__(2);
var newPromiseCapability = __webpack_require__(229);
var perform = __webpack_require__(337);

$export($export.S, 'Promise', { 'try': function (callbackfn) {
  var promiseCapability = newPromiseCapability.f(this);
  var result = perform(callbackfn);
  (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  return promiseCapability.promise;
} });


/***/ }),
/* 888 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var toMetaKey = metadata.key;
var ordinaryDefineOwnMetadata = metadata.set;

metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
  ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
} });


/***/ }),
/* 889 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var toMetaKey = metadata.key;
var getOrCreateMetadataMap = metadata.map;
var store = metadata.store;

metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
  var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
  var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
  if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
  if (metadataMap.size) return true;
  var targetMetadata = store.get(target);
  targetMetadata['delete'](targetKey);
  return !!targetMetadata.size || store['delete'](target);
} });


/***/ }),
/* 890 */
/***/ (function(module, exports, __webpack_require__) {

var Set = __webpack_require__(346);
var from = __webpack_require__(314);
var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var getPrototypeOf = __webpack_require__(54);
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;

var ordinaryMetadataKeys = function (O, P) {
  var oKeys = ordinaryOwnMetadataKeys(O, P);
  var parent = getPrototypeOf(O);
  if (parent === null) return oKeys;
  var pKeys = ordinaryMetadataKeys(parent, P);
  return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
};

metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
  return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });


/***/ }),
/* 891 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var getPrototypeOf = __webpack_require__(54);
var ordinaryHasOwnMetadata = metadata.has;
var ordinaryGetOwnMetadata = metadata.get;
var toMetaKey = metadata.key;

var ordinaryGetMetadata = function (MetadataKey, O, P) {
  var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
  var parent = getPrototypeOf(O);
  return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
};

metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
  return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });


/***/ }),
/* 892 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var ordinaryOwnMetadataKeys = metadata.keys;
var toMetaKey = metadata.key;

metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
  return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
} });


/***/ }),
/* 893 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var ordinaryGetOwnMetadata = metadata.get;
var toMetaKey = metadata.key;

metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
  return ordinaryGetOwnMetadata(metadataKey, anObject(target)
    , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });


/***/ }),
/* 894 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var getPrototypeOf = __webpack_require__(54);
var ordinaryHasOwnMetadata = metadata.has;
var toMetaKey = metadata.key;

var ordinaryHasMetadata = function (MetadataKey, O, P) {
  var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
  if (hasOwn) return true;
  var parent = getPrototypeOf(O);
  return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
};

metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
  return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });


/***/ }),
/* 895 */
/***/ (function(module, exports, __webpack_require__) {

var metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var ordinaryHasOwnMetadata = metadata.has;
var toMetaKey = metadata.key;

metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
  return ordinaryHasOwnMetadata(metadataKey, anObject(target)
    , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
} });


/***/ }),
/* 896 */
/***/ (function(module, exports, __webpack_require__) {

var $metadata = __webpack_require__(73);
var anObject = __webpack_require__(11);
var aFunction = __webpack_require__(42);
var toMetaKey = $metadata.key;
var ordinaryDefineOwnMetadata = $metadata.set;

$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
  return function decorator(target, targetKey) {
    ordinaryDefineOwnMetadata(
      metadataKey, metadataValue,
      (targetKey !== undefined ? anObject : aFunction)(target),
      toMetaKey(targetKey)
    );
  };
} });


/***/ }),
/* 897 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
__webpack_require__(174)('Set');


/***/ }),
/* 898 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
__webpack_require__(175)('Set');


/***/ }),
/* 899 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(2);

$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(318)('Set') });


/***/ }),
/* 900 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/mathiasbynens/String.prototype.at
var $export = __webpack_require__(2);
var $at = __webpack_require__(176)(true);

$export($export.P, 'String', {
  at: function at(pos) {
    return $at(this, pos);
  }
});


/***/ }),
/* 901 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://tc39.github.io/String.prototype.matchAll/
var $export = __webpack_require__(2);
var defined = __webpack_require__(66);
var toLength = __webpack_require__(27);
var isRegExp = __webpack_require__(169);
var getFlags = __webpack_require__(135);
var RegExpProto = RegExp.prototype;

var $RegExpStringIterator = function (regexp, string) {
  this._r = regexp;
  this._s = string;
};

__webpack_require__(224)($RegExpStringIterator, 'RegExp String', function next() {
  var match = this._r.exec(this._s);
  return { value: match, done: match === null };
});

$export($export.P, 'String', {
  matchAll: function matchAll(regexp) {
    defined(this);
    if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
    var S = String(this);
    var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
    var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
    rx.lastIndex = toLength(regexp.lastIndex);
    return new $RegExpStringIterator(rx, S);
  }
});


/***/ }),
/* 902 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(2);
var $pad = __webpack_require__(340);
var userAgent = __webpack_require__(178);

// https://github.com/zloirock/core-js/issues/280
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);

$export($export.P + $export.F * WEBKIT_BUG, 'String', {
  padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
    return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
  }
});


/***/ }),
/* 903 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/tc39/proposal-string-pad-start-end
var $export = __webpack_require__(2);
var $pad = __webpack_require__(340);
var userAgent = __webpack_require__(178);

// https://github.com/zloirock/core-js/issues/280
var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);

$export($export.P + $export.F * WEBKIT_BUG, 'String', {
  padStart: function padStart(maxLength /* , fillString = ' ' */) {
    return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
  }
});


/***/ }),
/* 904 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(116)('trimLeft', function ($trim) {
  return function trimLeft() {
    return $trim(this, 1);
  };
}, 'trimStart');


/***/ }),
/* 905 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
__webpack_require__(116)('trimRight', function ($trim) {
  return function trimRight() {
    return $trim(this, 2);
  };
}, 'trimEnd');


/***/ }),
/* 906 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(238)('asyncIterator');


/***/ }),
/* 907 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(238)('observable');


/***/ }),
/* 908 */
/***/ (function(module, exports, __webpack_require__) {

// https://github.com/tc39/proposal-global
var $export = __webpack_require__(2);

$export($export.S, 'System', { global: __webpack_require__(16) });


/***/ }),
/* 909 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
__webpack_require__(174)('WeakMap');


/***/ }),
/* 910 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
__webpack_require__(175)('WeakMap');


/***/ }),
/* 911 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
__webpack_require__(174)('WeakSet');


/***/ }),
/* 912 */
/***/ (function(module, exports, __webpack_require__) {

// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
__webpack_require__(175)('WeakSet');


/***/ }),
/* 913 */
/***/ (function(module, exports, __webpack_require__) {

var $iterators = __webpack_require__(240);
var getKeys = __webpack_require__(98);
var redefine = __webpack_require__(49);
var global = __webpack_require__(16);
var hide = __webpack_require__(48);
var Iterators = __webpack_require__(114);
var wks = __webpack_require__(26);
var ITERATOR = wks('iterator');
var TO_STRING_TAG = wks('toStringTag');
var ArrayValues = Iterators.Array;

var DOMIterables = {
  CSSRuleList: true, // TODO: Not spec compliant, should be false.
  CSSStyleDeclaration: false,
  CSSValueList: false,
  ClientRectList: false,
  DOMRectList: false,
  DOMStringList: false,
  DOMTokenList: true,
  DataTransferItemList: false,
  FileList: false,
  HTMLAllCollection: false,
  HTMLCollection: false,
  HTMLFormElement: false,
  HTMLSelectElement: false,
  MediaList: true, // TODO: Not spec compliant, should be false.
  MimeTypeArray: false,
  NamedNodeMap: false,
  NodeList: true,
  PaintRequestList: false,
  Plugin: false,
  PluginArray: false,
  SVGLengthList: false,
  SVGNumberList: false,
  SVGPathSegList: false,
  SVGPointList: false,
  SVGStringList: false,
  SVGTransformList: false,
  SourceBufferList: false,
  StyleSheetList: true, // TODO: Not spec compliant, should be false.
  TextTrackCueList: false,
  TextTrackList: false,
  TouchList: false
};

for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  var NAME = collections[i];
  var explicit = DOMIterables[NAME];
  var Collection = global[NAME];
  var proto = Collection && Collection.prototype;
  var key;
  if (proto) {
    if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
    if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
    Iterators[NAME] = ArrayValues;
    if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  }
}


/***/ }),
/* 914 */
/***/ (function(module, exports, __webpack_require__) {

var $export = __webpack_require__(2);
var $task = __webpack_require__(236);
$export($export.G + $export.B, {
  setImmediate: $task.set,
  clearImmediate: $task.clear
});


/***/ }),
/* 915 */
/***/ (function(module, exports, __webpack_require__) {

// ie9- setTimeout & setInterval additional parameters fix
var global = __webpack_require__(16);
var $export = __webpack_require__(2);
var userAgent = __webpack_require__(178);
var slice = [].slice;
var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
var wrap = function (set) {
  return function (fn, time /* , ...args */) {
    var boundArgs = arguments.length > 2;
    var args = boundArgs ? slice.call(arguments, 2) : false;
    return set(boundArgs ? function () {
      // eslint-disable-next-line no-new-func
      (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
    } : fn, time);
  };
};
$export($export.G + $export.B + $export.F * MSIE, {
  setTimeout: wrap(global.setTimeout),
  setInterval: wrap(global.setInterval)
});


/***/ }),
/* 916 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(844);
__webpack_require__(783);
__webpack_require__(785);
__webpack_require__(784);
__webpack_require__(787);
__webpack_require__(789);
__webpack_require__(794);
__webpack_require__(788);
__webpack_require__(786);
__webpack_require__(796);
__webpack_require__(795);
__webpack_require__(791);
__webpack_require__(792);
__webpack_require__(790);
__webpack_require__(782);
__webpack_require__(793);
__webpack_require__(797);
__webpack_require__(798);
__webpack_require__(750);
__webpack_require__(752);
__webpack_require__(751);
__webpack_require__(800);
__webpack_require__(799);
__webpack_require__(770);
__webpack_require__(780);
__webpack_require__(781);
__webpack_require__(771);
__webpack_require__(772);
__webpack_require__(773);
__webpack_require__(774);
__webpack_require__(775);
__webpack_require__(776);
__webpack_require__(777);
__webpack_require__(778);
__webpack_require__(779);
__webpack_require__(753);
__webpack_require__(754);
__webpack_require__(755);
__webpack_require__(756);
__webpack_require__(757);
__webpack_require__(758);
__webpack_require__(759);
__webpack_require__(760);
__webpack_require__(761);
__webpack_require__(762);
__webpack_require__(763);
__webpack_require__(764);
__webpack_require__(765);
__webpack_require__(766);
__webpack_require__(767);
__webpack_require__(768);
__webpack_require__(769);
__webpack_require__(831);
__webpack_require__(836);
__webpack_require__(843);
__webpack_require__(834);
__webpack_require__(826);
__webpack_require__(827);
__webpack_require__(832);
__webpack_require__(837);
__webpack_require__(839);
__webpack_require__(822);
__webpack_require__(823);
__webpack_require__(824);
__webpack_require__(825);
__webpack_require__(828);
__webpack_require__(829);
__webpack_require__(830);
__webpack_require__(833);
__webpack_require__(835);
__webpack_require__(838);
__webpack_require__(840);
__webpack_require__(841);
__webpack_require__(842);
__webpack_require__(745);
__webpack_require__(747);
__webpack_require__(746);
__webpack_require__(749);
__webpack_require__(748);
__webpack_require__(734);
__webpack_require__(732);
__webpack_require__(738);
__webpack_require__(735);
__webpack_require__(741);
__webpack_require__(743);
__webpack_require__(731);
__webpack_require__(737);
__webpack_require__(728);
__webpack_require__(742);
__webpack_require__(726);
__webpack_require__(740);
__webpack_require__(739);
__webpack_require__(733);
__webpack_require__(736);
__webpack_require__(725);
__webpack_require__(727);
__webpack_require__(730);
__webpack_require__(729);
__webpack_require__(744);
__webpack_require__(240);
__webpack_require__(816);
__webpack_require__(344);
__webpack_require__(821);
__webpack_require__(345);
__webpack_require__(817);
__webpack_require__(818);
__webpack_require__(819);
__webpack_require__(820);
__webpack_require__(801);
__webpack_require__(343);
__webpack_require__(346);
__webpack_require__(347);
__webpack_require__(856);
__webpack_require__(845);
__webpack_require__(846);
__webpack_require__(851);
__webpack_require__(854);
__webpack_require__(855);
__webpack_require__(849);
__webpack_require__(852);
__webpack_require__(850);
__webpack_require__(853);
__webpack_require__(847);
__webpack_require__(848);
__webpack_require__(802);
__webpack_require__(803);
__webpack_require__(804);
__webpack_require__(805);
__webpack_require__(806);
__webpack_require__(809);
__webpack_require__(807);
__webpack_require__(808);
__webpack_require__(810);
__webpack_require__(811);
__webpack_require__(812);
__webpack_require__(813);
__webpack_require__(815);
__webpack_require__(814);
__webpack_require__(859);
__webpack_require__(857);
__webpack_require__(858);
__webpack_require__(900);
__webpack_require__(903);
__webpack_require__(902);
__webpack_require__(904);
__webpack_require__(905);
__webpack_require__(901);
__webpack_require__(906);
__webpack_require__(907);
__webpack_require__(881);
__webpack_require__(884);
__webpack_require__(880);
__webpack_require__(878);
__webpack_require__(879);
__webpack_require__(882);
__webpack_require__(883);
__webpack_require__(865);
__webpack_require__(899);
__webpack_require__(864);
__webpack_require__(898);
__webpack_require__(910);
__webpack_require__(912);
__webpack_require__(863);
__webpack_require__(897);
__webpack_require__(909);
__webpack_require__(911);
__webpack_require__(862);
__webpack_require__(908);
__webpack_require__(861);
__webpack_require__(866);
__webpack_require__(867);
__webpack_require__(868);
__webpack_require__(869);
__webpack_require__(870);
__webpack_require__(872);
__webpack_require__(871);
__webpack_require__(873);
__webpack_require__(874);
__webpack_require__(875);
__webpack_require__(877);
__webpack_require__(876);
__webpack_require__(886);
__webpack_require__(887);
__webpack_require__(888);
__webpack_require__(889);
__webpack_require__(891);
__webpack_require__(890);
__webpack_require__(893);
__webpack_require__(892);
__webpack_require__(894);
__webpack_require__(895);
__webpack_require__(896);
__webpack_require__(860);
__webpack_require__(885);
__webpack_require__(915);
__webpack_require__(914);
__webpack_require__(913);
module.exports = __webpack_require__(57);


/***/ }),
/* 917 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */



var _assign = __webpack_require__(140);

var emptyObject = __webpack_require__(1210);
var _invariant = __webpack_require__(1213);

if (true) {
  var warning = __webpack_require__(356);
}

var MIXINS_KEY = 'mixins';

// Helper function to allow the creation of anonymous functions which do not
// have .name set to the name of the variable being assigned to.
function identity(fn) {
  return fn;
}

var ReactPropTypeLocationNames;
if (true) {
  ReactPropTypeLocationNames = {
    prop: 'prop',
    context: 'context',
    childContext: 'child context'
  };
} else {
  ReactPropTypeLocationNames = {};
}

function factory(ReactComponent, isValidElement, ReactNoopUpdateQueue) {
  /**
   * Policies that describe methods in `ReactClassInterface`.
   */

  var injectedMixins = [];

  /**
   * Composite components are higher-level components that compose other composite
   * or host components.
   *
   * To create a new type of `ReactClass`, pass a specification of
   * your new class to `React.createClass`. The only requirement of your class
   * specification is that you implement a `render` method.
   *
   *   var MyComponent = React.createClass({
   *     render: function() {
   *       return <div>Hello World</div>;
   *     }
   *   });
   *
   * The class specification supports a specific protocol of methods that have
   * special meaning (e.g. `render`). See `ReactClassInterface` for
   * more the comprehensive protocol. Any other properties and methods in the
   * class specification will be available on the prototype.
   *
   * @interface ReactClassInterface
   * @internal
   */
  var ReactClassInterface = {
    /**
     * An array of Mixin objects to include when defining your component.
     *
     * @type {array}
     * @optional
     */
    mixins: 'DEFINE_MANY',

    /**
     * An object containing properties and methods that should be defined on
     * the component's constructor instead of its prototype (static methods).
     *
     * @type {object}
     * @optional
     */
    statics: 'DEFINE_MANY',

    /**
     * Definition of prop types for this component.
     *
     * @type {object}
     * @optional
     */
    propTypes: 'DEFINE_MANY',

    /**
     * Definition of context types for this component.
     *
     * @type {object}
     * @optional
     */
    contextTypes: 'DEFINE_MANY',

    /**
     * Definition of context types this component sets for its children.
     *
     * @type {object}
     * @optional
     */
    childContextTypes: 'DEFINE_MANY',

    // ==== Definition methods ====

    /**
     * Invoked when the component is mounted. Values in the mapping will be set on
     * `this.props` if that prop is not specified (i.e. using an `in` check).
     *
     * This method is invoked before `getInitialState` and therefore cannot rely
     * on `this.state` or use `this.setState`.
     *
     * @return {object}
     * @optional
     */
    getDefaultProps: 'DEFINE_MANY_MERGED',

    /**
     * Invoked once before the component is mounted. The return value will be used
     * as the initial value of `this.state`.
     *
     *   getInitialState: function() {
     *     return {
     *       isOn: false,
     *       fooBaz: new BazFoo()
     *     }
     *   }
     *
     * @return {object}
     * @optional
     */
    getInitialState: 'DEFINE_MANY_MERGED',

    /**
     * @return {object}
     * @optional
     */
    getChildContext: 'DEFINE_MANY_MERGED',

    /**
     * Uses props from `this.props` and state from `this.state` to render the
     * structure of the component.
     *
     * No guarantees are made about when or how often this method is invoked, so
     * it must not have side effects.
     *
     *   render: function() {
     *     var name = this.props.name;
     *     return <div>Hello, {name}!</div>;
     *   }
     *
     * @return {ReactComponent}
     * @required
     */
    render: 'DEFINE_ONCE',

    // ==== Delegate methods ====

    /**
     * Invoked when the component is initially created and about to be mounted.
     * This may have side effects, but any external subscriptions or data created
     * by this method must be cleaned up in `componentWillUnmount`.
     *
     * @optional
     */
    componentWillMount: 'DEFINE_MANY',

    /**
     * Invoked when the component has been mounted and has a DOM representation.
     * However, there is no guarantee that the DOM node is in the document.
     *
     * Use this as an opportunity to operate on the DOM when the component has
     * been mounted (initialized and rendered) for the first time.
     *
     * @param {DOMElement} rootNode DOM element representing the component.
     * @optional
     */
    componentDidMount: 'DEFINE_MANY',

    /**
     * Invoked before the component receives new props.
     *
     * Use this as an opportunity to react to a prop transition by updating the
     * state using `this.setState`. Current props are accessed via `this.props`.
     *
     *   componentWillReceiveProps: function(nextProps, nextContext) {
     *     this.setState({
     *       likesIncreasing: nextProps.likeCount > this.props.likeCount
     *     });
     *   }
     *
     * NOTE: There is no equivalent `componentWillReceiveState`. An incoming prop
     * transition may cause a state change, but the opposite is not true. If you
     * need it, you are probably looking for `componentWillUpdate`.
     *
     * @param {object} nextProps
     * @optional
     */
    componentWillReceiveProps: 'DEFINE_MANY',

    /**
     * Invoked while deciding if the component should be updated as a result of
     * receiving new props, state and/or context.
     *
     * Use this as an opportunity to `return false` when you're certain that the
     * transition to the new props/state/context will not require a component
     * update.
     *
     *   shouldComponentUpdate: function(nextProps, nextState, nextContext) {
     *     return !equal(nextProps, this.props) ||
     *       !equal(nextState, this.state) ||
     *       !equal(nextContext, this.context);
     *   }
     *
     * @param {object} nextProps
     * @param {?object} nextState
     * @param {?object} nextContext
     * @return {boolean} True if the component should update.
     * @optional
     */
    shouldComponentUpdate: 'DEFINE_ONCE',

    /**
     * Invoked when the component is about to update due to a transition from
     * `this.props`, `this.state` and `this.context` to `nextProps`, `nextState`
     * and `nextContext`.
     *
     * Use this as an opportunity to perform preparation before an update occurs.
     *
     * NOTE: You **cannot** use `this.setState()` in this method.
     *
     * @param {object} nextProps
     * @param {?object} nextState
     * @param {?object} nextContext
     * @param {ReactReconcileTransaction} transaction
     * @optional
     */
    componentWillUpdate: 'DEFINE_MANY',

    /**
     * Invoked when the component's DOM representation has been updated.
     *
     * Use this as an opportunity to operate on the DOM when the component has
     * been updated.
     *
     * @param {object} prevProps
     * @param {?object} prevState
     * @param {?object} prevContext
     * @param {DOMElement} rootNode DOM element representing the component.
     * @optional
     */
    componentDidUpdate: 'DEFINE_MANY',

    /**
     * Invoked when the component is about to be removed from its parent and have
     * its DOM representation destroyed.
     *
     * Use this as an opportunity to deallocate any external resources.
     *
     * NOTE: There is no `componentDidUnmount` since your component will have been
     * destroyed by that point.
     *
     * @optional
     */
    componentWillUnmount: 'DEFINE_MANY',

    /**
     * Replacement for (deprecated) `componentWillMount`.
     *
     * @optional
     */
    UNSAFE_componentWillMount: 'DEFINE_MANY',

    /**
     * Replacement for (deprecated) `componentWillReceiveProps`.
     *
     * @optional
     */
    UNSAFE_componentWillReceiveProps: 'DEFINE_MANY',

    /**
     * Replacement for (deprecated) `componentWillUpdate`.
     *
     * @optional
     */
    UNSAFE_componentWillUpdate: 'DEFINE_MANY',

    // ==== Advanced methods ====

    /**
     * Updates the component's currently mounted DOM representation.
     *
     * By default, this implements React's rendering and reconciliation algorithm.
     * Sophisticated clients may wish to override this.
     *
     * @param {ReactReconcileTransaction} transaction
     * @internal
     * @overridable
     */
    updateComponent: 'OVERRIDE_BASE'
  };

  /**
   * Similar to ReactClassInterface but for static methods.
   */
  var ReactClassStaticInterface = {
    /**
     * This method is invoked after a component is instantiated and when it
     * receives new props. Return an object to update state in response to
     * prop changes. Return null to indicate no change to state.
     *
     * If an object is returned, its keys will be merged into the existing state.
     *
     * @return {object || null}
     * @optional
     */
    getDerivedStateFromProps: 'DEFINE_MANY_MERGED'
  };

  /**
   * Mapping from class specification keys to special processing functions.
   *
   * Although these are declared like instance properties in the specification
   * when defining classes using `React.createClass`, they are actually static
   * and are accessible on the constructor instead of the prototype. Despite
   * being static, they must be defined outside of the "statics" key under
   * which all other static methods are defined.
   */
  var RESERVED_SPEC_KEYS = {
    displayName: function(Constructor, displayName) {
      Constructor.displayName = displayName;
    },
    mixins: function(Constructor, mixins) {
      if (mixins) {
        for (var i = 0; i < mixins.length; i++) {
          mixSpecIntoComponent(Constructor, mixins[i]);
        }
      }
    },
    childContextTypes: function(Constructor, childContextTypes) {
      if (true) {
        validateTypeDef(Constructor, childContextTypes, 'childContext');
      }
      Constructor.childContextTypes = _assign(
        {},
        Constructor.childContextTypes,
        childContextTypes
      );
    },
    contextTypes: function(Constructor, contextTypes) {
      if (true) {
        validateTypeDef(Constructor, contextTypes, 'context');
      }
      Constructor.contextTypes = _assign(
        {},
        Constructor.contextTypes,
        contextTypes
      );
    },
    /**
     * Special case getDefaultProps which should move into statics but requires
     * automatic merging.
     */
    getDefaultProps: function(Constructor, getDefaultProps) {
      if (Constructor.getDefaultProps) {
        Constructor.getDefaultProps = createMergedResultFunction(
          Constructor.getDefaultProps,
          getDefaultProps
        );
      } else {
        Constructor.getDefaultProps = getDefaultProps;
      }
    },
    propTypes: function(Constructor, propTypes) {
      if (true) {
        validateTypeDef(Constructor, propTypes, 'prop');
      }
      Constructor.propTypes = _assign({}, Constructor.propTypes, propTypes);
    },
    statics: function(Constructor, statics) {
      mixStaticSpecIntoComponent(Constructor, statics);
    },
    autobind: function() {}
  };

  function validateTypeDef(Constructor, typeDef, location) {
    for (var propName in typeDef) {
      if (typeDef.hasOwnProperty(propName)) {
        // use a warning instead of an _invariant so components
        // don't show up in prod but only in __DEV__
        if (true) {
          warning(
            typeof typeDef[propName] === 'function',
            '%s: %s type `%s` is invalid; it must be a function, usually from ' +
              'React.PropTypes.',
            Constructor.displayName || 'ReactClass',
            ReactPropTypeLocationNames[location],
            propName
          );
        }
      }
    }
  }

  function validateMethodOverride(isAlreadyDefined, name) {
    var specPolicy = ReactClassInterface.hasOwnProperty(name)
      ? ReactClassInterface[name]
      : null;

    // Disallow overriding of base class methods unless explicitly allowed.
    if (ReactClassMixin.hasOwnProperty(name)) {
      _invariant(
        specPolicy === 'OVERRIDE_BASE',
        'ReactClassInterface: You are attempting to override ' +
          '`%s` from your class specification. Ensure that your method names ' +
          'do not overlap with React methods.',
        name
      );
    }

    // Disallow defining methods more than once unless explicitly allowed.
    if (isAlreadyDefined) {
      _invariant(
        specPolicy === 'DEFINE_MANY' || specPolicy === 'DEFINE_MANY_MERGED',
        'ReactClassInterface: You are attempting to define ' +
          '`%s` on your component more than once. This conflict may be due ' +
          'to a mixin.',
        name
      );
    }
  }

  /**
   * Mixin helper which handles policy validation and reserved
   * specification keys when building React classes.
   */
  function mixSpecIntoComponent(Constructor, spec) {
    if (!spec) {
      if (true) {
        var typeofSpec = typeof spec;
        var isMixinValid = typeofSpec === 'object' && spec !== null;

        if (true) {
          warning(
            isMixinValid,
            "%s: You're attempting to include a mixin that is either null " +
              'or not an object. Check the mixins included by the component, ' +
              'as well as any mixins they include themselves. ' +
              'Expected object but got %s.',
            Constructor.displayName || 'ReactClass',
            spec === null ? null : typeofSpec
          );
        }
      }

      return;
    }

    _invariant(
      typeof spec !== 'function',
      "ReactClass: You're attempting to " +
        'use a component class or function as a mixin. Instead, just use a ' +
        'regular object.'
    );
    _invariant(
      !isValidElement(spec),
      "ReactClass: You're attempting to " +
        'use a component as a mixin. Instead, just use a regular object.'
    );

    var proto = Constructor.prototype;
    var autoBindPairs = proto.__reactAutoBindPairs;

    // By handling mixins before any other properties, we ensure the same
    // chaining order is applied to methods with DEFINE_MANY policy, whether
    // mixins are listed before or after these methods in the spec.
    if (spec.hasOwnProperty(MIXINS_KEY)) {
      RESERVED_SPEC_KEYS.mixins(Constructor, spec.mixins);
    }

    for (var name in spec) {
      if (!spec.hasOwnProperty(name)) {
        continue;
      }

      if (name === MIXINS_KEY) {
        // We have already handled mixins in a special case above.
        continue;
      }

      var property = spec[name];
      var isAlreadyDefined = proto.hasOwnProperty(name);
      validateMethodOverride(isAlreadyDefined, name);

      if (RESERVED_SPEC_KEYS.hasOwnProperty(name)) {
        RESERVED_SPEC_KEYS[name](Constructor, property);
      } else {
        // Setup methods on prototype:
        // The following member methods should not be automatically bound:
        // 1. Expected ReactClass methods (in the "interface").
        // 2. Overridden methods (that were mixed in).
        var isReactClassMethod = ReactClassInterface.hasOwnProperty(name);
        var isFunction = typeof property === 'function';
        var shouldAutoBind =
          isFunction &&
          !isReactClassMethod &&
          !isAlreadyDefined &&
          spec.autobind !== false;

        if (shouldAutoBind) {
          autoBindPairs.push(name, property);
          proto[name] = property;
        } else {
          if (isAlreadyDefined) {
            var specPolicy = ReactClassInterface[name];

            // These cases should already be caught by validateMethodOverride.
            _invariant(
              isReactClassMethod &&
                (specPolicy === 'DEFINE_MANY_MERGED' ||
                  specPolicy === 'DEFINE_MANY'),
              'ReactClass: Unexpected spec policy %s for key %s ' +
                'when mixing in component specs.',
              specPolicy,
              name
            );

            // For methods which are defined more than once, call the existing
            // methods before calling the new property, merging if appropriate.
            if (specPolicy === 'DEFINE_MANY_MERGED') {
              proto[name] = createMergedResultFunction(proto[name], property);
            } else if (specPolicy === 'DEFINE_MANY') {
              proto[name] = createChainedFunction(proto[name], property);
            }
          } else {
            proto[name] = property;
            if (true) {
              // Add verbose displayName to the function, which helps when looking
              // at profiling tools.
              if (typeof property === 'function' && spec.displayName) {
                proto[name].displayName = spec.displayName + '_' + name;
              }
            }
          }
        }
      }
    }
  }

  function mixStaticSpecIntoComponent(Constructor, statics) {
    if (!statics) {
      return;
    }

    for (var name in statics) {
      var property = statics[name];
      if (!statics.hasOwnProperty(name)) {
        continue;
      }

      var isReserved = name in RESERVED_SPEC_KEYS;
      _invariant(
        !isReserved,
        'ReactClass: You are attempting to define a reserved ' +
          'property, `%s`, that shouldn\'t be on the "statics" key. Define it ' +
          'as an instance property instead; it will still be accessible on the ' +
          'constructor.',
        name
      );

      var isAlreadyDefined = name in Constructor;
      if (isAlreadyDefined) {
        var specPolicy = ReactClassStaticInterface.hasOwnProperty(name)
          ? ReactClassStaticInterface[name]
          : null;

        _invariant(
          specPolicy === 'DEFINE_MANY_MERGED',
          'ReactClass: You are attempting to define ' +
            '`%s` on your component more than once. This conflict may be ' +
            'due to a mixin.',
          name
        );

        Constructor[name] = createMergedResultFunction(Constructor[name], property);

        return;
      }

      Constructor[name] = property;
    }
  }

  /**
   * Merge two objects, but throw if both contain the same key.
   *
   * @param {object} one The first object, which is mutated.
   * @param {object} two The second object
   * @return {object} one after it has been mutated to contain everything in two.
   */
  function mergeIntoWithNoDuplicateKeys(one, two) {
    _invariant(
      one && two && typeof one === 'object' && typeof two === 'object',
      'mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.'
    );

    for (var key in two) {
      if (two.hasOwnProperty(key)) {
        _invariant(
          one[key] === undefined,
          'mergeIntoWithNoDuplicateKeys(): ' +
            'Tried to merge two objects with the same key: `%s`. This conflict ' +
            'may be due to a mixin; in particular, this may be caused by two ' +
            'getInitialState() or getDefaultProps() methods returning objects ' +
            'with clashing keys.',
          key
        );
        one[key] = two[key];
      }
    }
    return one;
  }

  /**
   * Creates a function that invokes two functions and merges their return values.
   *
   * @param {function} one Function to invoke first.
   * @param {function} two Function to invoke second.
   * @return {function} Function that invokes the two argument functions.
   * @private
   */
  function createMergedResultFunction(one, two) {
    return function mergedResult() {
      var a = one.apply(this, arguments);
      var b = two.apply(this, arguments);
      if (a == null) {
        return b;
      } else if (b == null) {
        return a;
      }
      var c = {};
      mergeIntoWithNoDuplicateKeys(c, a);
      mergeIntoWithNoDuplicateKeys(c, b);
      return c;
    };
  }

  /**
   * Creates a function that invokes two functions and ignores their return vales.
   *
   * @param {function} one Function to invoke first.
   * @param {function} two Function to invoke second.
   * @return {function} Function that invokes the two argument functions.
   * @private
   */
  function createChainedFunction(one, two) {
    return function chainedFunction() {
      one.apply(this, arguments);
      two.apply(this, arguments);
    };
  }

  /**
   * Binds a method to the component.
   *
   * @param {object} component Component whose method is going to be bound.
   * @param {function} method Method to be bound.
   * @return {function} The bound method.
   */
  function bindAutoBindMethod(component, method) {
    var boundMethod = method.bind(component);
    if (true) {
      boundMethod.__reactBoundContext = component;
      boundMethod.__reactBoundMethod = method;
      boundMethod.__reactBoundArguments = null;
      var componentName = component.constructor.displayName;
      var _bind = boundMethod.bind;
      boundMethod.bind = function(newThis) {
        for (
          var _len = arguments.length,
            args = Array(_len > 1 ? _len - 1 : 0),
            _key = 1;
          _key < _len;
          _key++
        ) {
          args[_key - 1] = arguments[_key];
        }

        // User is trying to bind() an autobound method; we effectively will
        // ignore the value of "this" that the user is trying to use, so
        // let's warn.
        if (newThis !== component && newThis !== null) {
          if (true) {
            warning(
              false,
              'bind(): React component methods may only be bound to the ' +
                'component instance. See %s',
              componentName
            );
          }
        } else if (!args.length) {
          if (true) {
            warning(
              false,
              'bind(): You are binding a component method to the component. ' +
                'React does this for you automatically in a high-performance ' +
                'way, so you can safely remove this call. See %s',
              componentName
            );
          }
          return boundMethod;
        }
        var reboundMethod = _bind.apply(boundMethod, arguments);
        reboundMethod.__reactBoundContext = component;
        reboundMethod.__reactBoundMethod = method;
        reboundMethod.__reactBoundArguments = args;
        return reboundMethod;
      };
    }
    return boundMethod;
  }

  /**
   * Binds all auto-bound methods in a component.
   *
   * @param {object} component Component whose method is going to be bound.
   */
  function bindAutoBindMethods(component) {
    var pairs = component.__reactAutoBindPairs;
    for (var i = 0; i < pairs.length; i += 2) {
      var autoBindKey = pairs[i];
      var method = pairs[i + 1];
      component[autoBindKey] = bindAutoBindMethod(component, method);
    }
  }

  var IsMountedPreMixin = {
    componentDidMount: function() {
      this.__isMounted = true;
    }
  };

  var IsMountedPostMixin = {
    componentWillUnmount: function() {
      this.__isMounted = false;
    }
  };

  /**
   * Add more to the ReactClass base class. These are all legacy features and
   * therefore not already part of the modern ReactComponent.
   */
  var ReactClassMixin = {
    /**
     * TODO: This will be deprecated because state should always keep a consistent
     * type signature and the only use case for this, is to avoid that.
     */
    replaceState: function(newState, callback) {
      this.updater.enqueueReplaceState(this, newState, callback);
    },

    /**
     * Checks whether or not this composite component is mounted.
     * @return {boolean} True if mounted, false otherwise.
     * @protected
     * @final
     */
    isMounted: function() {
      if (true) {
        warning(
          this.__didWarnIsMounted,
          '%s: isMounted is deprecated. Instead, make sure to clean up ' +
            'subscriptions and pending requests in componentWillUnmount to ' +
            'prevent memory leaks.',
          (this.constructor && this.constructor.displayName) ||
            this.name ||
            'Component'
        );
        this.__didWarnIsMounted = true;
      }
      return !!this.__isMounted;
    }
  };

  var ReactClassComponent = function() {};
  _assign(
    ReactClassComponent.prototype,
    ReactComponent.prototype,
    ReactClassMixin
  );

  /**
   * Creates a composite component class given a class specification.
   * See https://facebook.github.io/react/docs/top-level-api.html#react.createclass
   *
   * @param {object} spec Class specification (which must define `render`).
   * @return {function} Component constructor function.
   * @public
   */
  function createClass(spec) {
    // To keep our warnings more understandable, we'll use a little hack here to
    // ensure that Constructor.name !== 'Constructor'. This makes sure we don't
    // unnecessarily identify a class without displayName as 'Constructor'.
    var Constructor = identity(function(props, context, updater) {
      // This constructor gets overridden by mocks. The argument is used
      // by mocks to assert on what gets mounted.

      if (true) {
        warning(
          this instanceof Constructor,
          'Something is calling a React component directly. Use a factory or ' +
            'JSX instead. See: https://fb.me/react-legacyfactory'
        );
      }

      // Wire up auto-binding
      if (this.__reactAutoBindPairs.length) {
        bindAutoBindMethods(this);
      }

      this.props = props;
      this.context = context;
      this.refs = emptyObject;
      this.updater = updater || ReactNoopUpdateQueue;

      this.state = null;

      // ReactClasses doesn't have constructors. Instead, they use the
      // getInitialState and componentWillMount methods for initialization.

      var initialState = this.getInitialState ? this.getInitialState() : null;
      if (true) {
        // We allow auto-mocks to proceed as if they're returning null.
        if (
          initialState === undefined &&
          this.getInitialState._isMockFunction
        ) {
          // This is probably bad practice. Consider warning here and
          // deprecating this convenience.
          initialState = null;
        }
      }
      _invariant(
        typeof initialState === 'object' && !Array.isArray(initialState),
        '%s.getInitialState(): must return an object or null',
        Constructor.displayName || 'ReactCompositeComponent'
      );

      this.state = initialState;
    });
    Constructor.prototype = new ReactClassComponent();
    Constructor.prototype.constructor = Constructor;
    Constructor.prototype.__reactAutoBindPairs = [];

    injectedMixins.forEach(mixSpecIntoComponent.bind(null, Constructor));

    mixSpecIntoComponent(Constructor, IsMountedPreMixin);
    mixSpecIntoComponent(Constructor, spec);
    mixSpecIntoComponent(Constructor, IsMountedPostMixin);

    // Initialize the defaultProps property after all mixins have been merged.
    if (Constructor.getDefaultProps) {
      Constructor.defaultProps = Constructor.getDefaultProps();
    }

    if (true) {
      // This is a tag to indicate that the use of these method names is ok,
      // since it's used with createClass. If it's not, then it's likely a
      // mistake so we'll warn you to use the static property, property
      // initializer or constructor respectively.
      if (Constructor.getDefaultProps) {
        Constructor.getDefaultProps.isReactClassApproved = {};
      }
      if (Constructor.prototype.getInitialState) {
        Constructor.prototype.getInitialState.isReactClassApproved = {};
      }
    }

    _invariant(
      Constructor.prototype.render,
      'createClass(...): Class specification must implement a `render` method.'
    );

    if (true) {
      warning(
        !Constructor.prototype.componentShouldUpdate,
        '%s has a method called ' +
          'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' +
          'The name is phrased as a question because the function is ' +
          'expected to return a value.',
        spec.displayName || 'A component'
      );
      warning(
        !Constructor.prototype.componentWillRecieveProps,
        '%s has a method called ' +
          'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?',
        spec.displayName || 'A component'
      );
      warning(
        !Constructor.prototype.UNSAFE_componentWillRecieveProps,
        '%s has a method called UNSAFE_componentWillRecieveProps(). ' +
          'Did you mean UNSAFE_componentWillReceiveProps()?',
        spec.displayName || 'A component'
      );
    }

    // Reduce time spent doing lookups by setting these on the prototype.
    for (var methodName in ReactClassInterface) {
      if (!Constructor.prototype[methodName]) {
        Constructor.prototype[methodName] = null;
      }
    }

    return Constructor;
  }

  return createClass;
}

module.exports = factory;


/***/ }),
/* 918 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


exports.__esModule = true;

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _propTypes = __webpack_require__(183);

var _propTypes2 = _interopRequireDefault(_propTypes);

var _gud = __webpack_require__(1217);

var _gud2 = _interopRequireDefault(_gud);

var _warning = __webpack_require__(356);

var _warning2 = _interopRequireDefault(_warning);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var MAX_SIGNED_31_BIT_INT = 1073741823;

// Inlined Object.is polyfill.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
function objectIs(x, y) {
  if (x === y) {
    return x !== 0 || 1 / x === 1 / y;
  } else {
    return x !== x && y !== y;
  }
}

function createEventEmitter(value) {
  var handlers = [];
  return {
    on: function on(handler) {
      handlers.push(handler);
    },
    off: function off(handler) {
      handlers = handlers.filter(function (h) {
        return h !== handler;
      });
    },
    get: function get() {
      return value;
    },
    set: function set(newValue, changedBits) {
      value = newValue;
      handlers.forEach(function (handler) {
        return handler(value, changedBits);
      });
    }
  };
}

function onlyChild(children) {
  return Array.isArray(children) ? children[0] : children;
}

function createReactContext(defaultValue, calculateChangedBits) {
  var _Provider$childContex, _Consumer$contextType;

  var contextProp = '__create-react-context-' + (0, _gud2.default)() + '__';

  var Provider = function (_Component) {
    _inherits(Provider, _Component);

    function Provider() {
      var _temp, _this, _ret;

      _classCallCheck(this, Provider);

      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret);
    }

    Provider.prototype.getChildContext = function getChildContext() {
      var _ref;

      return _ref = {}, _ref[contextProp] = this.emitter, _ref;
    };

    Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
      if (this.props.value !== nextProps.value) {
        var oldValue = this.props.value;
        var newValue = nextProps.value;
        var changedBits = void 0;

        if (objectIs(oldValue, newValue)) {
          changedBits = 0; // No change
        } else {
          changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
          if (true) {
            (0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);
          }

          changedBits |= 0;

          if (changedBits !== 0) {
            this.emitter.set(nextProps.value, changedBits);
          }
        }
      }
    };

    Provider.prototype.render = function render() {
      return this.props.children;
    };

    return Provider;
  }(_react.Component);

  Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex);

  var Consumer = function (_Component2) {
    _inherits(Consumer, _Component2);

    function Consumer() {
      var _temp2, _this2, _ret2;

      _classCallCheck(this, Consumer);

      for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
        args[_key2] = arguments[_key2];
      }

      return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = {
        value: _this2.getValue()
      }, _this2.onUpdate = function (newValue, changedBits) {
        var observedBits = _this2.observedBits | 0;
        if ((observedBits & changedBits) !== 0) {
          _this2.setState({ value: _this2.getValue() });
        }
      }, _temp2), _possibleConstructorReturn(_this2, _ret2);
    }

    Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
      var observedBits = nextProps.observedBits;

      this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
      : observedBits;
    };

    Consumer.prototype.componentDidMount = function componentDidMount() {
      if (this.context[contextProp]) {
        this.context[contextProp].on(this.onUpdate);
      }
      var observedBits = this.props.observedBits;

      this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT // Subscribe to all changes by default
      : observedBits;
    };

    Consumer.prototype.componentWillUnmount = function componentWillUnmount() {
      if (this.context[contextProp]) {
        this.context[contextProp].off(this.onUpdate);
      }
    };

    Consumer.prototype.getValue = function getValue() {
      if (this.context[contextProp]) {
        return this.context[contextProp].get();
      } else {
        return defaultValue;
      }
    };

    Consumer.prototype.render = function render() {
      return onlyChild(this.props.children)(this.state.value);
    };

    return Consumer;
  }(_react.Component);

  Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType);


  return {
    Provider: Provider,
    Consumer: Consumer
  };
}

exports.default = createReactContext;
module.exports = exports['default'];

/***/ }),
/* 919 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


exports.__esModule = true;

var _react = __webpack_require__(0);

var _react2 = _interopRequireDefault(_react);

var _implementation = __webpack_require__(918);

var _implementation2 = _interopRequireDefault(_implementation);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = _react2.default.createContext || _implementation2.default;
module.exports = exports['default'];

/***/ }),
/* 920 */
/***/ (function(module, exports, __webpack_require__) {


var Color = __webpack_require__(311);

/**
 * Basic RGBA adjusters.
 */

exports.red = rgbaAdjuster('red');
exports.blue = rgbaAdjuster('blue');
exports.green = rgbaAdjuster('green');
exports.alpha = exports.a = rgbaAdjuster('alpha');

/**
 * RGB adjuster.
 */

exports.rgb = function () {
  // TODO
};

/**
 * Basic HSLWB adjusters.
 */

exports.hue = exports.h = hslwbAdjuster('hue');
exports.saturation = exports.s = hslwbAdjuster('saturation');
exports.lightness = exports.l = hslwbAdjuster('lightness');
exports.whiteness = exports.w = hslwbAdjuster('whiteness');
exports.blackness = exports.b = hslwbAdjuster('blackness');

/**
 * Blend adjuster.
 *
 * @param {Color} color
 * @param {Object} args
 */

exports.blend = function (color, args) {
  var targetAlpha = color.alpha();

  // Reset the alpha value to one. This is required because color.mix mixes
  // the alpha value as well as rgb values. For blend() purposes, that's not
  // what we want.
  color.alpha(1);

  var other = new Color(args[0].value);
  var percentage = 1 - parseInt(args[1].value, 10) / 100;

  // Finally set the alpha value of the mixed color to the target value.
  color.mix(other, percentage).alpha(targetAlpha);
};

/**
 * Tint adjuster.
 *
 * @param {Color} color
 * @param {Object} args
 */

exports.tint = function (color, args) {
  args.unshift({ type: 'argument', value: 'white' });
  exports.blend(color, args);
};

/**
 * Share adjuster.
 *
 * @param {Color} color
 * @param {Object} args
 */

exports.shade = function (color, args) {
  args.unshift({ type: 'argument', value: 'black' });
  exports.blend(color, args);
};

/**
 * Contrast adjuster.
 *
 * @param {Color} color
 * @param {Object} args
 */
exports.contrast = function (color, args) {
  if (args.length == 0) args.push({ type: 'argument', value: '100%' });
  var percentage = 1 - parseInt(args[0].value, 10) / 100;
  var max = color.luminosity() < .5 ? new Color({ h:color.hue(), w:100, b:0 }) : new Color({ h:color.hue(), w:0, b:100 });
  var min = max;
  var minRatio = 4.5;
  if (color.contrast(max) > minRatio) {
    var min = binarySearchBWContrast(minRatio, color, max);
    var targetMinAlpha = min.alpha();
    // Set the alpha to 1 to avoid mix()-ing the alpha value.
    min.alpha(1);
    // mixes the colors then sets the alpha back to the target alpha.
    min.mix(max, percentage).alpha(targetMinAlpha);
  }
  color.hwb(min.hwb());
};

/**
 * Generate a value or percentage of modifier.
 *
 * @param {String} prop
 * @return {Function}
 */

function rgbaAdjuster (prop) {
  return function (color, args) {
    var mod;
    if (args[0].type == 'modifier') mod = args.shift().value;

    var val = args[0].value;
    if (val.indexOf('%') != -1) {
      val = parseInt(val, 10) / 100;
      if (!mod) {
        val = val * (prop == 'alpha' ? 1 : 255);
      } else if (mod != '*') {
        val = color[prop]() * val;
      }
    } else {
      val = Number(val);
    }

    color[prop](modify(color[prop](), val, mod));
  };
}

/**
 * Generate a basic HSLWB adjuster.
 *
 * @param {String} prop
 * @return {Function}
 */

function hslwbAdjuster (prop) {
  return function (color, args) {
    var mod;
    if (args[0].type == 'modifier') mod = args.shift().value;
    var val = parseFloat(args[0].value, 10);
    color[prop](modify(color[prop](), val, mod));
  };
}

/**
 * Return the percentage of a `number` for a given percentage `string`.
 *
 * @param {Number} number
 * @param {String} string
 * @return {Number}
 */

function percentageOf (number, string) {
  var percent = parseInt(string, 10) / 100;
  return number * percent;
}

/**
 * Modify a `val` by an `amount` with an optional `modifier`.
 *
 * @param {Number} val
 * @param {Number} amount
 * @param {String} modifier (optional)
 */

function modify (val, amount, modifier) {
  switch (modifier) {
    case '+': return val + amount;
    case '-': return val - amount;
    case '*': return val * amount;
    default: return amount;
  }
}

/**
 * Return the color closest to `color` between `color` and `max` that has a contrast ratio higher than `minRatio`
 *  assumes `color` and `max` have identical hue
 *
 * @param {Number} minRatio
 * @param {Color} color
 * @param {Color} max
 **/

function binarySearchBWContrast (minRatio, color, max) {
  var hue = color.hue();
  var min = color.clone();
  var minW = color.whiteness();
  var minB = color.blackness();
  var maxW = max.whiteness();
  var maxB = max.blackness();
  while (Math.abs(minW - maxW) > 1 || Math.abs(minB - maxB) > 1) {
    var midW = Math.round((maxW + minW) / 2);
    var midB = Math.round((maxB + minB) / 2);
    min.whiteness(midW);
    min.blackness(midB);
    if (min.contrast(color) > minRatio) {
      maxW = midW;
      maxB = midB;
    } else {
      minW = midW;
      minB = midB;
    }
  }
  return min
}


/***/ }),
/* 921 */
/***/ (function(module, exports, __webpack_require__) {


var balanced = __webpack_require__(309);
var Color = __webpack_require__(311);
var parse = __webpack_require__(349);
var adjusters = __webpack_require__(920);

/**
 * Expose `convert`.
 */

module.exports = convert;

/**
 * Convert a color function CSS `string` into an RGB color string.
 *
 * @param {String} string
 * @return {String}
 */

function convert (string) {
  var index = string.indexOf('color(');
  if (index == -1) return string;

  string = string.slice(index);
  string = balanced('(', ')', string);
  if (!string) throw new SyntaxError('Missing closing parenthese for \'' + string + '\'');
  var ast = parse('color(' + string.body + ')');
  return toRGB(ast) + convert(string.post);
}

/**
 * Given a color `ast` return an RGB color string.
 *
 * @param {Object} ast
 * @return {String}
 */

function toRGB (ast) {
  var color = new Color(ast.arguments[0].type == "function" ? toRGB(ast.arguments[0]) : ast.arguments[0].value)
  var fns = ast.arguments.slice(1);

  fns.forEach(function (adjuster) {
    var name = adjuster.name;
    if (!adjusters[name]) throw new Error('Unknown <color-adjuster> \'' + name + '\'');

    // convert nested color functions
    adjuster.arguments.forEach(function (arg) {
      if (arg.type == 'function' && arg.name == 'color') {
        arg.value = toRGB(arg);
        arg.type = 'color';
        delete arg.name;
      }
    });

    // apply adjuster transformations
    adjusters[name](color, adjuster.arguments);
  });

  return color.rgbString();
}


/***/ }),
/* 922 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(process) {

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

/* eslint-env browser */

/**
 * This is the web browser implementation of `debug()`.
 */
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
/**
 * Colors.
 */

exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
/**
 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
 * and the Firebug extension (any Firefox version) are known
 * to support "%c" CSS customizations.
 *
 * TODO: add a `localStorage` variable to explicitly enable/disable colors
 */
// eslint-disable-next-line complexity

function useColors() {
  // NB: In an Electron preload script, document will be defined but not fully
  // initialized. Since we know we're in Chrome, we'll just detect this case
  // explicitly
  if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
    return true;
  } // Internet Explorer and Edge do not support colors.


  if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
    return false;
  } // Is webkit? http://stackoverflow.com/a/16459606/376773
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632


  return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
  typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
  typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
}
/**
 * Colorize log arguments if enabled.
 *
 * @api public
 */


function formatArgs(args) {
  args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);

  if (!this.useColors) {
    return;
  }

  var c = 'color: ' + this.color;
  args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
  // arguments passed either before or after the %c, so we need to
  // figure out the correct index to insert the CSS into

  var index = 0;
  var lastC = 0;
  args[0].replace(/%[a-zA-Z%]/g, function (match) {
    if (match === '%%') {
      return;
    }

    index++;

    if (match === '%c') {
      // We only are interested in the *last* %c
      // (the user may have provided their own)
      lastC = index;
    }
  });
  args.splice(lastC, 0, c);
}
/**
 * Invokes `console.log()` when available.
 * No-op when `console.log` is not a "function".
 *
 * @api public
 */


function log() {
  var _console;

  // This hackery is required for IE8/9, where
  // the `console.log` function doesn't have 'apply'
  return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
}
/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */


function save(namespaces) {
  try {
    if (namespaces) {
      exports.storage.setItem('debug', namespaces);
    } else {
      exports.storage.removeItem('debug');
    }
  } catch (error) {// Swallow
    // XXX (@Qix-) should we be logging these?
  }
}
/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */


function load() {
  var r;

  try {
    r = exports.storage.getItem('debug');
  } catch (error) {} // Swallow
  // XXX (@Qix-) should we be logging these?
  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG


  if (!r && typeof process !== 'undefined' && 'env' in process) {
    r = __webpack_require__.i({"NODE_ENV":"development"}).DEBUG;
  }

  return r;
}
/**
 * Localstorage attempts to return the localstorage.
 *
 * This is necessary because safari throws
 * when a user disables cookies/localstorage
 * and you attempt to access it.
 *
 * @return {LocalStorage}
 * @api private
 */


function localstorage() {
  try {
    // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
    // The Browser also has localStorage in the global context.
    return localStorage;
  } catch (error) {// Swallow
    // XXX (@Qix-) should we be logging these?
  }
}

module.exports = __webpack_require__(923)(exports);
var formatters = module.exports.formatters;
/**
 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
 */

formatters.j = function (v) {
  try {
    return JSON.stringify(v);
  } catch (error) {
    return '[UnexpectedJSONParseError]: ' + error.message;
  }
};


/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(246)))

/***/ }),
/* 923 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/**
 * This is the common logic for both the Node.js and web browser
 * implementations of `debug()`.
 */
function setup(env) {
  createDebug.debug = createDebug;
  createDebug.default = createDebug;
  createDebug.coerce = coerce;
  createDebug.disable = disable;
  createDebug.enable = enable;
  createDebug.enabled = enabled;
  createDebug.humanize = __webpack_require__(924);
  Object.keys(env).forEach(function (key) {
    createDebug[key] = env[key];
  });
  /**
  * Active `debug` instances.
  */

  createDebug.instances = [];
  /**
  * The currently active debug mode names, and names to skip.
  */

  createDebug.names = [];
  createDebug.skips = [];
  /**
  * Map of special "%n" handling functions, for the debug "format" argument.
  *
  * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  */

  createDebug.formatters = {};
  /**
  * Selects a color for a debug namespace
  * @param {String} namespace The namespace string for the for the debug instance to be colored
  * @return {Number|String} An ANSI color code for the given namespace
  * @api private
  */

  function selectColor(namespace) {
    var hash = 0;

    for (var i = 0; i < namespace.length; i++) {
      hash = (hash << 5) - hash + namespace.charCodeAt(i);
      hash |= 0; // Convert to 32bit integer
    }

    return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  }

  createDebug.selectColor = selectColor;
  /**
  * Create a debugger with the given `namespace`.
  *
  * @param {String} namespace
  * @return {Function}
  * @api public
  */

  function createDebug(namespace) {
    var prevTime;

    function debug() {
      // Disabled?
      if (!debug.enabled) {
        return;
      }

      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      var self = debug; // Set `diff` timestamp

      var curr = Number(new Date());
      var ms = curr - (prevTime || curr);
      self.diff = ms;
      self.prev = prevTime;
      self.curr = curr;
      prevTime = curr;
      args[0] = createDebug.coerce(args[0]);

      if (typeof args[0] !== 'string') {
        // Anything else let's inspect with %O
        args.unshift('%O');
      } // Apply any `formatters` transformations


      var index = 0;
      args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
        // If we encounter an escaped % then don't increase the array index
        if (match === '%%') {
          return match;
        }

        index++;
        var formatter = createDebug.formatters[format];

        if (typeof formatter === 'function') {
          var val = args[index];
          match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`

          args.splice(index, 1);
          index--;
        }

        return match;
      }); // Apply env-specific formatting (colors, etc.)

      createDebug.formatArgs.call(self, args);
      var logFn = self.log || createDebug.log;
      logFn.apply(self, args);
    }

    debug.namespace = namespace;
    debug.enabled = createDebug.enabled(namespace);
    debug.useColors = createDebug.useColors();
    debug.color = selectColor(namespace);
    debug.destroy = destroy;
    debug.extend = extend; // Debug.formatArgs = formatArgs;
    // debug.rawLog = rawLog;
    // env-specific initialization logic for debug instances

    if (typeof createDebug.init === 'function') {
      createDebug.init(debug);
    }

    createDebug.instances.push(debug);
    return debug;
  }

  function destroy() {
    var index = createDebug.instances.indexOf(this);

    if (index !== -1) {
      createDebug.instances.splice(index, 1);
      return true;
    }

    return false;
  }

  function extend(namespace, delimiter) {
    return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  }
  /**
  * Enables a debug mode by namespaces. This can include modes
  * separated by a colon and wildcards.
  *
  * @param {String} namespaces
  * @api public
  */


  function enable(namespaces) {
    createDebug.save(namespaces);
    createDebug.names = [];
    createDebug.skips = [];
    var i;
    var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
    var len = split.length;

    for (i = 0; i < len; i++) {
      if (!split[i]) {
        // ignore empty strings
        continue;
      }

      namespaces = split[i].replace(/\*/g, '.*?');

      if (namespaces[0] === '-') {
        createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
      } else {
        createDebug.names.push(new RegExp('^' + namespaces + '$'));
      }
    }

    for (i = 0; i < createDebug.instances.length; i++) {
      var instance = createDebug.instances[i];
      instance.enabled = createDebug.enabled(instance.namespace);
    }
  }
  /**
  * Disable debug output.
  *
  * @api public
  */


  function disable() {
    createDebug.enable('');
  }
  /**
  * Returns true if the given mode name is enabled, false otherwise.
  *
  * @param {String} name
  * @return {Boolean}
  * @api public
  */


  function enabled(name) {
    if (name[name.length - 1] === '*') {
      return true;
    }

    var i;
    var len;

    for (i = 0, len = createDebug.skips.length; i < len; i++) {
      if (createDebug.skips[i].test(name)) {
        return false;
      }
    }

    for (i = 0, len = createDebug.names.length; i < len; i++) {
      if (createDebug.names[i].test(name)) {
        return true;
      }
    }

    return false;
  }
  /**
  * Coerce `val`.
  *
  * @param {Mixed} val
  * @return {Mixed}
  * @api private
  */


  function coerce(val) {
    if (val instanceof Error) {
      return val.stack || val.message;
    }

    return val;
  }

  createDebug.enable(createDebug.load());
  return createDebug;
}

module.exports = setup;



/***/ }),
/* 924 */
/***/ (function(module, exports) {

/**
 * Helpers.
 */

var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;

/**
 * Parse or format the given `val`.
 *
 * Options:
 *
 *  - `long` verbose formatting [false]
 *
 * @param {String|Number} val
 * @param {Object} [options]
 * @throws {Error} throw an error if val is not a non-empty string or a number
 * @return {String|Number}
 * @api public
 */

module.exports = function(val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse(val);
  } else if (type === 'number' && isFinite(val)) {
    return options.long ? fmtLong(val) : fmtShort(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
};

/**
 * Parse the given `str` and return milliseconds.
 *
 * @param {String} str
 * @return {Number}
 * @api private
 */

function parse(str) {
  str = String(str);
  if (str.length > 100) {
    return;
  }
  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
    str
  );
  if (!match) {
    return;
  }
  var n = parseFloat(match[1]);
  var type = (match[2] || 'ms').toLowerCase();
  switch (type) {
    case 'years':
    case 'year':
    case 'yrs':
    case 'yr':
    case 'y':
      return n * y;
    case 'weeks':
    case 'week':
    case 'w':
      return n * w;
    case 'days':
    case 'day':
    case 'd':
      return n * d;
    case 'hours':
    case 'hour':
    case 'hrs':
    case 'hr':
    case 'h':
      return n * h;
    case 'minutes':
    case 'minute':
    case 'mins':
    case 'min':
    case 'm':
      return n * m;
    case 'seconds':
    case 'second':
    case 'secs':
    case 'sec':
    case 's':
      return n * s;
    case 'milliseconds':
    case 'millisecond':
    case 'msecs':
    case 'msec':
    case 'ms':
      return n;
    default:
      return undefined;
  }
}

/**
 * Short format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtShort(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return Math.round(ms / d) + 'd';
  }
  if (msAbs >= h) {
    return Math.round(ms / h) + 'h';
  }
  if (msAbs >= m) {
    return Math.round(ms / m) + 'm';
  }
  if (msAbs >= s) {
    return Math.round(ms / s) + 's';
  }
  return ms + 'ms';
}

/**
 * Long format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtLong(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return plural(ms, msAbs, d, 'day');
  }
  if (msAbs >= h) {
    return plural(ms, msAbs, h, 'hour');
  }
  if (msAbs >= m) {
    return plural(ms, msAbs, m, 'minute');
  }
  if (msAbs >= s) {
    return plural(ms, msAbs, s, 'second');
  }
  return ms + ' ms';
}

/**
 * Pluralization helper.
 */

function plural(ms, msAbs, n, name) {
  var isPlural = msAbs >= n * 1.5;
  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
}


/***/ }),
/* 925 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var redux_1 = __webpack_require__(1368);
var reducers_1 = __importDefault(__webpack_require__(940));
var dragDrop_1 = __importDefault(__webpack_require__(179));
var DragDropMonitorImpl_1 = __importDefault(__webpack_require__(926));
var HandlerRegistryImpl_1 = __importDefault(__webpack_require__(927));
function makeStoreInstance(debugMode) {
    // TODO: if we ever make a react-native version of this,
    // we'll need to consider how to pull off dev-tooling
    var reduxDevTools = typeof window !== 'undefined' &&
        window.__REDUX_DEVTOOLS_EXTENSION__;
    return redux_1.createStore(reducers_1.default, debugMode &&
        reduxDevTools &&
        reduxDevTools({
            name: 'dnd-core',
            instanceId: 'dnd-core',
        }));
}
var DragDropManagerImpl = /** @class */ (function () {
    function DragDropManagerImpl(debugMode) {
        var _this = this;
        if (debugMode === void 0) { debugMode = false; }
        this.isSetUp = false;
        this.handleRefCountChange = function () {
            var shouldSetUp = _this.store.getState().refCount > 0;
            if (_this.backend) {
                if (shouldSetUp && !_this.isSetUp) {
                    _this.backend.setup();
                    _this.isSetUp = true;
                }
                else if (!shouldSetUp && _this.isSetUp) {
                    _this.backend.teardown();
                    _this.isSetUp = false;
                }
            }
        };
        var store = makeStoreInstance(debugMode);
        this.store = store;
        this.monitor = new DragDropMonitorImpl_1.default(store, new HandlerRegistryImpl_1.default(store));
        store.subscribe(this.handleRefCountChange);
    }
    DragDropManagerImpl.prototype.receiveBackend = function (backend) {
        this.backend = backend;
    };
    DragDropManagerImpl.prototype.getMonitor = function () {
        return this.monitor;
    };
    DragDropManagerImpl.prototype.getBackend = function () {
        return this.backend;
    };
    DragDropManagerImpl.prototype.getRegistry = function () {
        return this.monitor.registry;
    };
    DragDropManagerImpl.prototype.getActions = function () {
        var manager = this;
        var dispatch = this.store.dispatch;
        function bindActionCreator(actionCreator) {
            return function () {
                var args = [];
                for (var _i = 0; _i < arguments.length; _i++) {
                    args[_i] = arguments[_i];
                }
                var action = actionCreator.apply(manager, args);
                if (typeof action !== 'undefined') {
                    dispatch(action);
                }
            };
        }
        var actions = dragDrop_1.default(this);
        return Object.keys(actions).reduce(function (boundActions, key) {
            var action = actions[key];
            boundActions[key] = bindActionCreator(action);
            return boundActions;
        }, {});
    };
    DragDropManagerImpl.prototype.dispatch = function (action) {
        this.store.dispatch(action);
    };
    return DragDropManagerImpl;
}());
exports.default = DragDropManagerImpl;


/***/ }),
/* 926 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var matchesType_1 = __importDefault(__webpack_require__(354));
var coords_1 = __webpack_require__(943);
var dirtiness_1 = __webpack_require__(352);
var DragDropMonitorImpl = /** @class */ (function () {
    function DragDropMonitorImpl(store, registry) {
        this.store = store;
        this.registry = registry;
    }
    DragDropMonitorImpl.prototype.subscribeToStateChange = function (listener, options) {
        var _this = this;
        if (options === void 0) { options = { handlerIds: undefined }; }
        var handlerIds = options.handlerIds;
        invariant_1.default(typeof listener === 'function', 'listener must be a function.');
        invariant_1.default(typeof handlerIds === 'undefined' || Array.isArray(handlerIds), 'handlerIds, when specified, must be an array of strings.');
        var prevStateId = this.store.getState().stateId;
        var handleChange = function () {
            var state = _this.store.getState();
            var currentStateId = state.stateId;
            try {
                var canSkipListener = currentStateId === prevStateId ||
                    (currentStateId === prevStateId + 1 &&
                        !dirtiness_1.areDirty(state.dirtyHandlerIds, handlerIds));
                if (!canSkipListener) {
                    listener();
                }
            }
            finally {
                prevStateId = currentStateId;
            }
        };
        return this.store.subscribe(handleChange);
    };
    DragDropMonitorImpl.prototype.subscribeToOffsetChange = function (listener) {
        var _this = this;
        invariant_1.default(typeof listener === 'function', 'listener must be a function.');
        var previousState = this.store.getState().dragOffset;
        var handleChange = function () {
            var nextState = _this.store.getState().dragOffset;
            if (nextState === previousState) {
                return;
            }
            previousState = nextState;
            listener();
        };
        return this.store.subscribe(handleChange);
    };
    DragDropMonitorImpl.prototype.canDragSource = function (sourceId) {
        if (!sourceId) {
            return false;
        }
        var source = this.registry.getSource(sourceId);
        invariant_1.default(source, 'Expected to find a valid source.');
        if (this.isDragging()) {
            return false;
        }
        return source.canDrag(this, sourceId);
    };
    DragDropMonitorImpl.prototype.canDropOnTarget = function (targetId) {
        // undefined on initial render
        if (!targetId) {
            return false;
        }
        var target = this.registry.getTarget(targetId);
        invariant_1.default(target, 'Expected to find a valid target.');
        if (!this.isDragging() || this.didDrop()) {
            return false;
        }
        var targetType = this.registry.getTargetType(targetId);
        var draggedItemType = this.getItemType();
        return (matchesType_1.default(targetType, draggedItemType) && target.canDrop(this, targetId));
    };
    DragDropMonitorImpl.prototype.isDragging = function () {
        return Boolean(this.getItemType());
    };
    DragDropMonitorImpl.prototype.isDraggingSource = function (sourceId) {
        // undefined on initial render
        if (!sourceId) {
            return false;
        }
        var source = this.registry.getSource(sourceId, true);
        invariant_1.default(source, 'Expected to find a valid source.');
        if (!this.isDragging() || !this.isSourcePublic()) {
            return false;
        }
        var sourceType = this.registry.getSourceType(sourceId);
        var draggedItemType = this.getItemType();
        if (sourceType !== draggedItemType) {
            return false;
        }
        return source.isDragging(this, sourceId);
    };
    DragDropMonitorImpl.prototype.isOverTarget = function (targetId, options) {
        if (options === void 0) { options = { shallow: false }; }
        // undefined on initial render
        if (!targetId) {
            return false;
        }
        var shallow = options.shallow;
        if (!this.isDragging()) {
            return false;
        }
        var targetType = this.registry.getTargetType(targetId);
        var draggedItemType = this.getItemType();
        if (draggedItemType && !matchesType_1.default(targetType, draggedItemType)) {
            return false;
        }
        var targetIds = this.getTargetIds();
        if (!targetIds.length) {
            return false;
        }
        var index = targetIds.indexOf(targetId);
        if (shallow) {
            return index === targetIds.length - 1;
        }
        else {
            return index > -1;
        }
    };
    DragDropMonitorImpl.prototype.getItemType = function () {
        return this.store.getState().dragOperation.itemType;
    };
    DragDropMonitorImpl.prototype.getItem = function () {
        return this.store.getState().dragOperation.item;
    };
    DragDropMonitorImpl.prototype.getSourceId = function () {
        return this.store.getState().dragOperation.sourceId;
    };
    DragDropMonitorImpl.prototype.getTargetIds = function () {
        return this.store.getState().dragOperation.targetIds;
    };
    DragDropMonitorImpl.prototype.getDropResult = function () {
        return this.store.getState().dragOperation.dropResult;
    };
    DragDropMonitorImpl.prototype.didDrop = function () {
        return this.store.getState().dragOperation.didDrop;
    };
    DragDropMonitorImpl.prototype.isSourcePublic = function () {
        return this.store.getState().dragOperation.isSourcePublic;
    };
    DragDropMonitorImpl.prototype.getInitialClientOffset = function () {
        return this.store.getState().dragOffset.initialClientOffset;
    };
    DragDropMonitorImpl.prototype.getInitialSourceClientOffset = function () {
        return this.store.getState().dragOffset.initialSourceClientOffset;
    };
    DragDropMonitorImpl.prototype.getClientOffset = function () {
        return this.store.getState().dragOffset.clientOffset;
    };
    DragDropMonitorImpl.prototype.getSourceClientOffset = function () {
        return coords_1.getSourceClientOffset(this.store.getState().dragOffset);
    };
    DragDropMonitorImpl.prototype.getDifferenceFromInitialOffset = function () {
        return coords_1.getDifferenceFromInitialOffset(this.store.getState().dragOffset);
    };
    return DragDropMonitorImpl;
}());
exports.default = DragDropMonitorImpl;


/***/ }),
/* 927 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var asap_1 = __importDefault(__webpack_require__(386));
var invariant_1 = __importDefault(__webpack_require__(32));
var registry_1 = __webpack_require__(180);
var getNextUniqueId_1 = __importDefault(__webpack_require__(944));
var interfaces_1 = __webpack_require__(351);
var contracts_1 = __webpack_require__(934);
function getNextHandlerId(role) {
    var id = getNextUniqueId_1.default().toString();
    switch (role) {
        case interfaces_1.HandlerRole.SOURCE:
            return "S" + id;
        case interfaces_1.HandlerRole.TARGET:
            return "T" + id;
        default:
            throw new Error("Unknown Handler Role: " + role);
    }
}
function parseRoleFromHandlerId(handlerId) {
    switch (handlerId[0]) {
        case 'S':
            return interfaces_1.HandlerRole.SOURCE;
        case 'T':
            return interfaces_1.HandlerRole.TARGET;
        default:
            invariant_1.default(false, "Cannot parse handler ID: " + handlerId);
    }
}
function mapContainsValue(map, searchValue) {
    var entries = map.entries();
    var isDone = false;
    do {
        var _a = entries.next(), done = _a.done, _b = _a.value, value = _b[1];
        if (value === searchValue) {
            return true;
        }
        isDone = done;
    } while (!isDone);
    return false;
}
var HandlerRegistryImpl = /** @class */ (function () {
    function HandlerRegistryImpl(store) {
        this.types = new Map();
        this.dragSources = new Map();
        this.dropTargets = new Map();
        this.pinnedSourceId = null;
        this.pinnedSource = null;
        this.store = store;
    }
    HandlerRegistryImpl.prototype.addSource = function (type, source) {
        contracts_1.validateType(type);
        contracts_1.validateSourceContract(source);
        var sourceId = this.addHandler(interfaces_1.HandlerRole.SOURCE, type, source);
        this.store.dispatch(registry_1.addSource(sourceId));
        return sourceId;
    };
    HandlerRegistryImpl.prototype.addTarget = function (type, target) {
        contracts_1.validateType(type, true);
        contracts_1.validateTargetContract(target);
        var targetId = this.addHandler(interfaces_1.HandlerRole.TARGET, type, target);
        this.store.dispatch(registry_1.addTarget(targetId));
        return targetId;
    };
    HandlerRegistryImpl.prototype.containsHandler = function (handler) {
        return (mapContainsValue(this.dragSources, handler) ||
            mapContainsValue(this.dropTargets, handler));
    };
    HandlerRegistryImpl.prototype.getSource = function (sourceId, includePinned) {
        if (includePinned === void 0) { includePinned = false; }
        invariant_1.default(this.isSourceId(sourceId), 'Expected a valid source ID.');
        var isPinned = includePinned && sourceId === this.pinnedSourceId;
        var source = isPinned ? this.pinnedSource : this.dragSources.get(sourceId);
        return source;
    };
    HandlerRegistryImpl.prototype.getTarget = function (targetId) {
        invariant_1.default(this.isTargetId(targetId), 'Expected a valid target ID.');
        return this.dropTargets.get(targetId);
    };
    HandlerRegistryImpl.prototype.getSourceType = function (sourceId) {
        invariant_1.default(this.isSourceId(sourceId), 'Expected a valid source ID.');
        return this.types.get(sourceId);
    };
    HandlerRegistryImpl.prototype.getTargetType = function (targetId) {
        invariant_1.default(this.isTargetId(targetId), 'Expected a valid target ID.');
        return this.types.get(targetId);
    };
    HandlerRegistryImpl.prototype.isSourceId = function (handlerId) {
        var role = parseRoleFromHandlerId(handlerId);
        return role === interfaces_1.HandlerRole.SOURCE;
    };
    HandlerRegistryImpl.prototype.isTargetId = function (handlerId) {
        var role = parseRoleFromHandlerId(handlerId);
        return role === interfaces_1.HandlerRole.TARGET;
    };
    HandlerRegistryImpl.prototype.removeSource = function (sourceId) {
        var _this = this;
        invariant_1.default(this.getSource(sourceId), 'Expected an existing source.');
        this.store.dispatch(registry_1.removeSource(sourceId));
        asap_1.default(function () {
            _this.dragSources.delete(sourceId);
            _this.types.delete(sourceId);
        });
    };
    HandlerRegistryImpl.prototype.removeTarget = function (targetId) {
        invariant_1.default(this.getTarget(targetId), 'Expected an existing target.');
        this.store.dispatch(registry_1.removeTarget(targetId));
        this.dropTargets.delete(targetId);
        this.types.delete(targetId);
    };
    HandlerRegistryImpl.prototype.pinSource = function (sourceId) {
        var source = this.getSource(sourceId);
        invariant_1.default(source, 'Expected an existing source.');
        this.pinnedSourceId = sourceId;
        this.pinnedSource = source;
    };
    HandlerRegistryImpl.prototype.unpinSource = function () {
        invariant_1.default(this.pinnedSource, 'No source is pinned at the time.');
        this.pinnedSourceId = null;
        this.pinnedSource = null;
    };
    HandlerRegistryImpl.prototype.addHandler = function (role, type, handler) {
        var id = getNextHandlerId(role);
        this.types.set(id, type);
        if (role === interfaces_1.HandlerRole.SOURCE) {
            this.dragSources.set(id, handler);
        }
        else if (role === interfaces_1.HandlerRole.TARGET) {
            this.dropTargets.set(id, handler);
        }
        return id;
    };
    return HandlerRegistryImpl;
}());
exports.default = HandlerRegistryImpl;


/***/ }),
/* 928 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var setClientOffset_1 = __webpack_require__(932);
var js_utils_1 = __webpack_require__(117);
var types_1 = __webpack_require__(105);
var ResetCoordinatesAction = {
    type: types_1.INIT_COORDS,
    payload: {
        clientOffset: null,
        sourceClientOffset: null,
    },
};
function createBeginDrag(manager) {
    return function beginDrag(sourceIds, options) {
        if (sourceIds === void 0) { sourceIds = []; }
        if (options === void 0) { options = {
            publishSource: true,
        }; }
        var _a = options.publishSource, publishSource = _a === void 0 ? true : _a, clientOffset = options.clientOffset, getSourceClientOffset = options.getSourceClientOffset;
        var monitor = manager.getMonitor();
        var registry = manager.getRegistry();
        // Initialize the coordinates using the client offset
        manager.dispatch(setClientOffset_1.setClientOffset(clientOffset));
        verifyInvariants(sourceIds, monitor, registry);
        // Get the draggable source
        var sourceId = getDraggableSource(sourceIds, monitor);
        if (sourceId === null) {
            manager.dispatch(ResetCoordinatesAction);
            return;
        }
        // Get the source client offset
        var sourceClientOffset = null;
        if (clientOffset) {
            verifyGetSourceClientOffsetIsFunction(getSourceClientOffset);
            sourceClientOffset = getSourceClientOffset(sourceId);
        }
        // Initialize the full coordinates
        manager.dispatch(setClientOffset_1.setClientOffset(clientOffset, sourceClientOffset));
        var source = registry.getSource(sourceId);
        var item = source.beginDrag(monitor, sourceId);
        verifyItemIsObject(item);
        registry.pinSource(sourceId);
        var itemType = registry.getSourceType(sourceId);
        return {
            type: types_1.BEGIN_DRAG,
            payload: {
                itemType: itemType,
                item: item,
                sourceId: sourceId,
                clientOffset: clientOffset || null,
                sourceClientOffset: sourceClientOffset || null,
                isSourcePublic: !!publishSource,
            },
        };
    };
}
exports.default = createBeginDrag;
function verifyInvariants(sourceIds, monitor, registry) {
    invariant_1.default(!monitor.isDragging(), 'Cannot call beginDrag while dragging.');
    sourceIds.forEach(function (sourceId) {
        invariant_1.default(registry.getSource(sourceId), 'Expected sourceIds to be registered.');
    });
}
function verifyGetSourceClientOffsetIsFunction(getSourceClientOffset) {
    invariant_1.default(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.');
}
function verifyItemIsObject(item) {
    invariant_1.default(js_utils_1.isObject(item), 'Item must be an object.');
}
function getDraggableSource(sourceIds, monitor) {
    var sourceId = null;
    for (var i = sourceIds.length - 1; i >= 0; i--) {
        if (monitor.canDragSource(sourceIds[i])) {
            sourceId = sourceIds[i];
            break;
        }
    }
    return sourceId;
}


/***/ }),
/* 929 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var types_1 = __webpack_require__(105);
var js_utils_1 = __webpack_require__(117);
function createDrop(manager) {
    return function drop(options) {
        if (options === void 0) { options = {}; }
        var monitor = manager.getMonitor();
        var registry = manager.getRegistry();
        verifyInvariants(monitor);
        var targetIds = getDroppableTargets(monitor);
        // Multiple actions are dispatched here, which is why this doesn't return an action
        targetIds.forEach(function (targetId, index) {
            var dropResult = determineDropResult(targetId, index, registry, monitor);
            var action = {
                type: types_1.DROP,
                payload: {
                    dropResult: __assign({}, options, dropResult),
                },
            };
            manager.dispatch(action);
        });
    };
}
exports.default = createDrop;
function verifyInvariants(monitor) {
    invariant_1.default(monitor.isDragging(), 'Cannot call drop while not dragging.');
    invariant_1.default(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.');
}
function determineDropResult(targetId, index, registry, monitor) {
    var target = registry.getTarget(targetId);
    var dropResult = target ? target.drop(monitor, targetId) : undefined;
    verifyDropResultType(dropResult);
    if (typeof dropResult === 'undefined') {
        dropResult = index === 0 ? {} : monitor.getDropResult();
    }
    return dropResult;
}
function verifyDropResultType(dropResult) {
    invariant_1.default(typeof dropResult === 'undefined' || js_utils_1.isObject(dropResult), 'Drop result must either be an object or undefined.');
}
function getDroppableTargets(monitor) {
    var targetIds = monitor
        .getTargetIds()
        .filter(monitor.canDropOnTarget, monitor);
    targetIds.reverse();
    return targetIds;
}


/***/ }),
/* 930 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var types_1 = __webpack_require__(105);
function createEndDrag(manager) {
    return function endDrag() {
        var monitor = manager.getMonitor();
        var registry = manager.getRegistry();
        verifyIsDragging(monitor);
        var sourceId = monitor.getSourceId();
        var source = registry.getSource(sourceId, true);
        source.endDrag(monitor, sourceId);
        registry.unpinSource();
        return { type: types_1.END_DRAG };
    };
}
exports.default = createEndDrag;
function verifyIsDragging(monitor) {
    invariant_1.default(monitor.isDragging(), 'Cannot call endDrag while not dragging.');
}


/***/ }),
/* 931 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var matchesType_1 = __importDefault(__webpack_require__(354));
var types_1 = __webpack_require__(105);
function createHover(manager) {
    return function hover(targetIdsArg, _a) {
        var clientOffset = (_a === void 0 ? {} : _a).clientOffset;
        verifyTargetIdsIsArray(targetIdsArg);
        var targetIds = targetIdsArg.slice(0);
        var monitor = manager.getMonitor();
        var registry = manager.getRegistry();
        checkInvariants(targetIds, monitor, registry);
        var draggedItemType = monitor.getItemType();
        removeNonMatchingTargetIds(targetIds, registry, draggedItemType);
        hoverAllTargets(targetIds, monitor, registry);
        return {
            type: types_1.HOVER,
            payload: {
                targetIds: targetIds,
                clientOffset: clientOffset || null,
            },
        };
    };
}
exports.default = createHover;
function verifyTargetIdsIsArray(targetIdsArg) {
    invariant_1.default(Array.isArray(targetIdsArg), 'Expected targetIds to be an array.');
}
function checkInvariants(targetIds, monitor, registry) {
    invariant_1.default(monitor.isDragging(), 'Cannot call hover while not dragging.');
    invariant_1.default(!monitor.didDrop(), 'Cannot call hover after drop.');
    for (var i = 0; i < targetIds.length; i++) {
        var targetId = targetIds[i];
        invariant_1.default(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.');
        var target = registry.getTarget(targetId);
        invariant_1.default(target, 'Expected targetIds to be registered.');
    }
}
function removeNonMatchingTargetIds(targetIds, registry, draggedItemType) {
    // Remove those targetIds that don't match the targetType.  This
    // fixes shallow isOver which would only be non-shallow because of
    // non-matching targets.
    for (var i = targetIds.length - 1; i >= 0; i--) {
        var targetId = targetIds[i];
        var targetType = registry.getTargetType(targetId);
        if (!matchesType_1.default(targetType, draggedItemType)) {
            targetIds.splice(i, 1);
        }
    }
}
function hoverAllTargets(targetIds, monitor, registry) {
    // Finally call hover on all matching targets.
    targetIds.forEach(function (targetId) {
        var target = registry.getTarget(targetId);
        target.hover(monitor, targetId);
    });
}


/***/ }),
/* 932 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var types_1 = __webpack_require__(105);
function setClientOffset(clientOffset, sourceClientOffset) {
    return {
        type: types_1.INIT_COORDS,
        payload: {
            sourceClientOffset: sourceClientOffset || null,
            clientOffset: clientOffset || null,
        },
    };
}
exports.setClientOffset = setClientOffset;


/***/ }),
/* 933 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var types_1 = __webpack_require__(105);
function createPublishDragSource(manager) {
    return function publishDragSource() {
        var monitor = manager.getMonitor();
        if (monitor.isDragging()) {
            return { type: types_1.PUBLISH_DRAG_SOURCE };
        }
    };
}
exports.default = createPublishDragSource;


/***/ }),
/* 934 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
function validateSourceContract(source) {
    invariant_1.default(typeof source.canDrag === 'function', 'Expected canDrag to be a function.');
    invariant_1.default(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.');
    invariant_1.default(typeof source.endDrag === 'function', 'Expected endDrag to be a function.');
}
exports.validateSourceContract = validateSourceContract;
function validateTargetContract(target) {
    invariant_1.default(typeof target.canDrop === 'function', 'Expected canDrop to be a function.');
    invariant_1.default(typeof target.hover === 'function', 'Expected hover to be a function.');
    invariant_1.default(typeof target.drop === 'function', 'Expected beginDrag to be a function.');
}
exports.validateTargetContract = validateTargetContract;
function validateType(type, allowArray) {
    if (allowArray && Array.isArray(type)) {
        type.forEach(function (t) { return validateType(t, false); });
        return;
    }
    invariant_1.default(typeof type === 'string' || typeof type === 'symbol', allowArray
        ? 'Type can only be a string, a symbol, or an array of either.'
        : 'Type can only be a string or a symbol.');
}
exports.validateType = validateType;


/***/ }),
/* 935 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var DragDropManagerImpl_1 = __importDefault(__webpack_require__(925));
function createDragDropManager(backendFactory, globalContext, backendOptions, debugMode) {
    var manager = new DragDropManagerImpl_1.default(debugMode);
    var backend = backendFactory(manager, globalContext, backendOptions);
    manager.receiveBackend(backend);
    return manager;
}
exports.createDragDropManager = createDragDropManager;


/***/ }),
/* 936 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(351));
__export(__webpack_require__(935));


/***/ }),
/* 937 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var dragDrop_1 = __webpack_require__(179);
var registry_1 = __webpack_require__(180);
var equality_1 = __webpack_require__(353);
var dirtiness_1 = __webpack_require__(352);
var js_utils_1 = __webpack_require__(117);
function dirtyHandlerIds(state, action) {
    if (state === void 0) { state = dirtiness_1.NONE; }
    switch (action.type) {
        case dragDrop_1.HOVER:
            break;
        case registry_1.ADD_SOURCE:
        case registry_1.ADD_TARGET:
        case registry_1.REMOVE_TARGET:
        case registry_1.REMOVE_SOURCE:
            return dirtiness_1.NONE;
        case dragDrop_1.BEGIN_DRAG:
        case dragDrop_1.PUBLISH_DRAG_SOURCE:
        case dragDrop_1.END_DRAG:
        case dragDrop_1.DROP:
        default:
            return dirtiness_1.ALL;
    }
    var _a = action.payload, _b = _a.targetIds, targetIds = _b === void 0 ? [] : _b, _c = _a.prevTargetIds, prevTargetIds = _c === void 0 ? [] : _c;
    var result = js_utils_1.xor(targetIds, prevTargetIds);
    var didChange = result.length > 0 || !equality_1.areArraysEqual(targetIds, prevTargetIds);
    if (!didChange) {
        return dirtiness_1.NONE;
    }
    // Check the target ids at the innermost position. If they are valid, add them
    // to the result
    var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1];
    var innermostTargetId = targetIds[targetIds.length - 1];
    if (prevInnermostTargetId !== innermostTargetId) {
        if (prevInnermostTargetId) {
            result.push(prevInnermostTargetId);
        }
        if (innermostTargetId) {
            result.push(innermostTargetId);
        }
    }
    return result;
}
exports.default = dirtyHandlerIds;


/***/ }),
/* 938 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var dragDrop_1 = __webpack_require__(179);
var equality_1 = __webpack_require__(353);
var initialState = {
    initialSourceClientOffset: null,
    initialClientOffset: null,
    clientOffset: null,
};
function dragOffset(state, action) {
    if (state === void 0) { state = initialState; }
    var payload = action.payload;
    switch (action.type) {
        case dragDrop_1.INIT_COORDS:
        case dragDrop_1.BEGIN_DRAG:
            return {
                initialSourceClientOffset: payload.sourceClientOffset,
                initialClientOffset: payload.clientOffset,
                clientOffset: payload.clientOffset,
            };
        case dragDrop_1.HOVER:
            if (equality_1.areCoordsEqual(state.clientOffset, payload.clientOffset)) {
                return state;
            }
            return __assign({}, state, { clientOffset: payload.clientOffset });
        case dragDrop_1.END_DRAG:
        case dragDrop_1.DROP:
            return initialState;
        default:
            return state;
    }
}
exports.default = dragOffset;


/***/ }),
/* 939 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });
var dragDrop_1 = __webpack_require__(179);
var registry_1 = __webpack_require__(180);
var js_utils_1 = __webpack_require__(117);
var initialState = {
    itemType: null,
    item: null,
    sourceId: null,
    targetIds: [],
    dropResult: null,
    didDrop: false,
    isSourcePublic: null,
};
function dragOperation(state, action) {
    if (state === void 0) { state = initialState; }
    var payload = action.payload;
    switch (action.type) {
        case dragDrop_1.BEGIN_DRAG:
            return __assign({}, state, { itemType: payload.itemType, item: payload.item, sourceId: payload.sourceId, isSourcePublic: payload.isSourcePublic, dropResult: null, didDrop: false });
        case dragDrop_1.PUBLISH_DRAG_SOURCE:
            return __assign({}, state, { isSourcePublic: true });
        case dragDrop_1.HOVER:
            return __assign({}, state, { targetIds: payload.targetIds });
        case registry_1.REMOVE_TARGET:
            if (state.targetIds.indexOf(payload.targetId) === -1) {
                return state;
            }
            return __assign({}, state, { targetIds: js_utils_1.without(state.targetIds, payload.targetId) });
        case dragDrop_1.DROP:
            return __assign({}, state, { dropResult: payload.dropResult, didDrop: true, targetIds: [] });
        case dragDrop_1.END_DRAG:
            return __assign({}, state, { itemType: null, item: null, sourceId: null, dropResult: null, didDrop: false, isSourcePublic: null, targetIds: [] });
        default:
            return state;
    }
}
exports.default = dragOperation;


/***/ }),
/* 940 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var dragOffset_1 = __importDefault(__webpack_require__(938));
var dragOperation_1 = __importDefault(__webpack_require__(939));
var refCount_1 = __importDefault(__webpack_require__(941));
var dirtyHandlerIds_1 = __importDefault(__webpack_require__(937));
var stateId_1 = __importDefault(__webpack_require__(942));
var js_utils_1 = __webpack_require__(117);
function reduce(state, action) {
    if (state === void 0) { state = {}; }
    return {
        dirtyHandlerIds: dirtyHandlerIds_1.default(state.dirtyHandlerIds, {
            type: action.type,
            payload: __assign({}, action.payload, { prevTargetIds: js_utils_1.get(state, 'dragOperation.targetIds', []) }),
        }),
        dragOffset: dragOffset_1.default(state.dragOffset, action),
        refCount: refCount_1.default(state.refCount, action),
        dragOperation: dragOperation_1.default(state.dragOperation, action),
        stateId: stateId_1.default(state.stateId),
    };
}
exports.default = reduce;


/***/ }),
/* 941 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var registry_1 = __webpack_require__(180);
function refCount(state, action) {
    if (state === void 0) { state = 0; }
    switch (action.type) {
        case registry_1.ADD_SOURCE:
        case registry_1.ADD_TARGET:
            return state + 1;
        case registry_1.REMOVE_SOURCE:
        case registry_1.REMOVE_TARGET:
            return state - 1;
        default:
            return state;
    }
}
exports.default = refCount;


/***/ }),
/* 942 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function stateId(state) {
    if (state === void 0) { state = 0; }
    return state + 1;
}
exports.default = stateId;


/***/ }),
/* 943 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Coordinate addition
 * @param a The first coordinate
 * @param b The second coordinate
 */
function add(a, b) {
    return {
        x: a.x + b.x,
        y: a.y + b.y,
    };
}
exports.add = add;
/**
 * Coordinate subtraction
 * @param a The first coordinate
 * @param b The second coordinate
 */
function subtract(a, b) {
    return {
        x: a.x - b.x,
        y: a.y - b.y,
    };
}
exports.subtract = subtract;
/**
 * Returns the cartesian distance of the drag source component's position, based on its position
 * at the time when the current drag operation has started, and the movement difference.
 *
 * Returns null if no item is being dragged.
 *
 * @param state The offset state to compute from
 */
function getSourceClientOffset(state) {
    var clientOffset = state.clientOffset, initialClientOffset = state.initialClientOffset, initialSourceClientOffset = state.initialSourceClientOffset;
    if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) {
        return null;
    }
    return subtract(add(clientOffset, initialSourceClientOffset), initialClientOffset);
}
exports.getSourceClientOffset = getSourceClientOffset;
/**
 * Determines the x,y offset between the client offset and the initial client offset
 *
 * @param state The offset state to compute from
 */
function getDifferenceFromInitialOffset(state) {
    var clientOffset = state.clientOffset, initialClientOffset = state.initialClientOffset;
    if (!clientOffset || !initialClientOffset) {
        return null;
    }
    return subtract(clientOffset, initialClientOffset);
}
exports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset;


/***/ }),
/* 944 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var nextUniqueId = 0;
function getNextUniqueId() {
    return nextUniqueId++;
}
exports.default = getNextUniqueId;


/***/ }),
/* 945 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(355);

var $Object = GetIntrinsic('%Object%');
var $TypeError = GetIntrinsic('%TypeError%');
var $String = GetIntrinsic('%String%');

var assertRecord = __webpack_require__(946);
var $isNaN = __webpack_require__(948);
var $isFinite = __webpack_require__(947);

var sign = __webpack_require__(950);
var mod = __webpack_require__(949);

var IsCallable = __webpack_require__(244);
var toPrimitive = __webpack_require__(951);

var has = __webpack_require__(357);

// https://es5.github.io/#x9
var ES5 = {
	ToPrimitive: toPrimitive,

	ToBoolean: function ToBoolean(value) {
		return !!value;
	},
	ToNumber: function ToNumber(value) {
		return +value; // eslint-disable-line no-implicit-coercion
	},
	ToInteger: function ToInteger(value) {
		var number = this.ToNumber(value);
		if ($isNaN(number)) { return 0; }
		if (number === 0 || !$isFinite(number)) { return number; }
		return sign(number) * Math.floor(Math.abs(number));
	},
	ToInt32: function ToInt32(x) {
		return this.ToNumber(x) >> 0;
	},
	ToUint32: function ToUint32(x) {
		return this.ToNumber(x) >>> 0;
	},
	ToUint16: function ToUint16(value) {
		var number = this.ToNumber(value);
		if ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }
		var posInt = sign(number) * Math.floor(Math.abs(number));
		return mod(posInt, 0x10000);
	},
	ToString: function ToString(value) {
		return $String(value);
	},
	ToObject: function ToObject(value) {
		this.CheckObjectCoercible(value);
		return $Object(value);
	},
	CheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {
		/* jshint eqnull:true */
		if (value == null) {
			throw new $TypeError(optMessage || 'Cannot call method on ' + value);
		}
		return value;
	},
	IsCallable: IsCallable,
	SameValue: function SameValue(x, y) {
		if (x === y) { // 0 === -0, but they are not identical.
			if (x === 0) { return 1 / x === 1 / y; }
			return true;
		}
		return $isNaN(x) && $isNaN(y);
	},

	// https://www.ecma-international.org/ecma-262/5.1/#sec-8
	Type: function Type(x) {
		if (x === null) {
			return 'Null';
		}
		if (typeof x === 'undefined') {
			return 'Undefined';
		}
		if (typeof x === 'function' || typeof x === 'object') {
			return 'Object';
		}
		if (typeof x === 'number') {
			return 'Number';
		}
		if (typeof x === 'boolean') {
			return 'Boolean';
		}
		if (typeof x === 'string') {
			return 'String';
		}
	},

	// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
	IsPropertyDescriptor: function IsPropertyDescriptor(Desc) {
		if (this.Type(Desc) !== 'Object') {
			return false;
		}
		var allowed = {
			'[[Configurable]]': true,
			'[[Enumerable]]': true,
			'[[Get]]': true,
			'[[Set]]': true,
			'[[Value]]': true,
			'[[Writable]]': true
		};

		for (var key in Desc) { // eslint-disable-line
			if (has(Desc, key) && !allowed[key]) {
				return false;
			}
		}

		var isData = has(Desc, '[[Value]]');
		var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
		if (isData && IsAccessor) {
			throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
		}
		return true;
	},

	// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1
	IsAccessorDescriptor: function IsAccessorDescriptor(Desc) {
		if (typeof Desc === 'undefined') {
			return false;
		}

		assertRecord(this, 'Property Descriptor', 'Desc', Desc);

		if (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {
			return false;
		}

		return true;
	},

	// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2
	IsDataDescriptor: function IsDataDescriptor(Desc) {
		if (typeof Desc === 'undefined') {
			return false;
		}

		assertRecord(this, 'Property Descriptor', 'Desc', Desc);

		if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
			return false;
		}

		return true;
	},

	// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3
	IsGenericDescriptor: function IsGenericDescriptor(Desc) {
		if (typeof Desc === 'undefined') {
			return false;
		}

		assertRecord(this, 'Property Descriptor', 'Desc', Desc);

		if (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {
			return true;
		}

		return false;
	},

	// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4
	FromPropertyDescriptor: function FromPropertyDescriptor(Desc) {
		if (typeof Desc === 'undefined') {
			return Desc;
		}

		assertRecord(this, 'Property Descriptor', 'Desc', Desc);

		if (this.IsDataDescriptor(Desc)) {
			return {
				value: Desc['[[Value]]'],
				writable: !!Desc['[[Writable]]'],
				enumerable: !!Desc['[[Enumerable]]'],
				configurable: !!Desc['[[Configurable]]']
			};
		} else if (this.IsAccessorDescriptor(Desc)) {
			return {
				get: Desc['[[Get]]'],
				set: Desc['[[Set]]'],
				enumerable: !!Desc['[[Enumerable]]'],
				configurable: !!Desc['[[Configurable]]']
			};
		} else {
			throw new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');
		}
	},

	// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
	ToPropertyDescriptor: function ToPropertyDescriptor(Obj) {
		if (this.Type(Obj) !== 'Object') {
			throw new $TypeError('ToPropertyDescriptor requires an object');
		}

		var desc = {};
		if (has(Obj, 'enumerable')) {
			desc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);
		}
		if (has(Obj, 'configurable')) {
			desc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);
		}
		if (has(Obj, 'value')) {
			desc['[[Value]]'] = Obj.value;
		}
		if (has(Obj, 'writable')) {
			desc['[[Writable]]'] = this.ToBoolean(Obj.writable);
		}
		if (has(Obj, 'get')) {
			var getter = Obj.get;
			if (typeof getter !== 'undefined' && !this.IsCallable(getter)) {
				throw new TypeError('getter must be a function');
			}
			desc['[[Get]]'] = getter;
		}
		if (has(Obj, 'set')) {
			var setter = Obj.set;
			if (typeof setter !== 'undefined' && !this.IsCallable(setter)) {
				throw new $TypeError('setter must be a function');
			}
			desc['[[Set]]'] = setter;
		}

		if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
			throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
		}
		return desc;
	}
};

module.exports = ES5;


/***/ }),
/* 946 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var GetIntrinsic = __webpack_require__(355);

var $TypeError = GetIntrinsic('%TypeError%');
var $SyntaxError = GetIntrinsic('%SyntaxError%');

var has = __webpack_require__(357);

var predicates = {
  // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
  'Property Descriptor': function isPropertyDescriptor(ES, Desc) {
    if (ES.Type(Desc) !== 'Object') {
      return false;
    }
    var allowed = {
      '[[Configurable]]': true,
      '[[Enumerable]]': true,
      '[[Get]]': true,
      '[[Set]]': true,
      '[[Value]]': true,
      '[[Writable]]': true
    };

    for (var key in Desc) { // eslint-disable-line
      if (has(Desc, key) && !allowed[key]) {
        return false;
      }
    }

    var isData = has(Desc, '[[Value]]');
    var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
    if (isData && IsAccessor) {
      throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
    }
    return true;
  }
};

module.exports = function assertRecord(ES, recordType, argumentName, value) {
  var predicate = predicates[recordType];
  if (typeof predicate !== 'function') {
    throw new $SyntaxError('unknown record type: ' + recordType);
  }
  if (!predicate(ES, value)) {
    throw new $TypeError(argumentName + ' must be a ' + recordType);
  }
  console.log(predicate(ES, value), value);
};


/***/ }),
/* 947 */
/***/ (function(module, exports) {

var $isNaN = Number.isNaN || function (a) { return a !== a; };

module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };


/***/ }),
/* 948 */
/***/ (function(module, exports) {

module.exports = Number.isNaN || function isNaN(a) {
	return a !== a;
};


/***/ }),
/* 949 */
/***/ (function(module, exports) {

module.exports = function mod(number, modulo) {
	var remain = number % modulo;
	return Math.floor(remain >= 0 ? remain : remain + modulo);
};


/***/ }),
/* 950 */
/***/ (function(module, exports) {

module.exports = function sign(number) {
	return number >= 0 ? 1 : -1;
};


/***/ }),
/* 951 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var toStr = Object.prototype.toString;

var isPrimitive = __webpack_require__(952);

var isCallable = __webpack_require__(244);

// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8
var ES5internalSlots = {
	'[[DefaultValue]]': function (O) {
		var actualHint;
		if (arguments.length > 1) {
			actualHint = arguments[1];
		} else {
			actualHint = toStr.call(O) === '[object Date]' ? String : Number;
		}

		if (actualHint === String || actualHint === Number) {
			var methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
			var value, i;
			for (i = 0; i < methods.length; ++i) {
				if (isCallable(O[methods[i]])) {
					value = O[methods[i]]();
					if (isPrimitive(value)) {
						return value;
					}
				}
			}
			throw new TypeError('No default value');
		}
		throw new TypeError('invalid [[DefaultValue]] hint supplied');
	}
};

// http://ecma-international.org/ecma-262/5.1/#sec-9.1
module.exports = function ToPrimitive(input) {
	if (isPrimitive(input)) {
		return input;
	}
	if (arguments.length > 1) {
		return ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);
	}
	return ES5internalSlots['[[DefaultValue]]'](input);
};


/***/ }),
/* 952 */
/***/ (function(module, exports) {

module.exports = function isPrimitive(value) {
	return value === null || (typeof value !== 'function' && typeof value !== 'object');
};


/***/ }),
/* 953 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/**
 * Representation of a single EventEmitter function.
 *
 * @param {Function} fn Event handler to be called.
 * @param {Mixed} context Context for function execution.
 * @param {Boolean} once Only emit once
 * @api private
 */
function EE(fn, context, once) {
  this.fn = fn;
  this.context = context;
  this.once = once || false;
}

/**
 * Minimal EventEmitter interface that is molded against the Node.js
 * EventEmitter interface.
 *
 * @constructor
 * @api public
 */
function EventEmitter() { /* Nothing to set */ }

/**
 * Holds the assigned EventEmitters by name.
 *
 * @type {Object}
 * @private
 */
EventEmitter.prototype._events = undefined;

/**
 * Return a list of assigned event listeners.
 *
 * @param {String} event The events that should be listed.
 * @returns {Array}
 * @api public
 */
EventEmitter.prototype.listeners = function listeners(event) {
  if (!this._events || !this._events[event]) return [];
  if (this._events[event].fn) return [this._events[event].fn];

  for (var i = 0, l = this._events[event].length, ee = new Array(l); i < l; i++) {
    ee[i] = this._events[event][i].fn;
  }

  return ee;
};

/**
 * Emit an event to all registered event listeners.
 *
 * @param {String} event The name of the event.
 * @returns {Boolean} Indication if we've emitted an event.
 * @api public
 */
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
  if (!this._events || !this._events[event]) return false;

  var listeners = this._events[event]
    , len = arguments.length
    , args
    , i;

  if ('function' === typeof listeners.fn) {
    if (listeners.once) this.removeListener(event, listeners.fn, true);

    switch (len) {
      case 1: return listeners.fn.call(listeners.context), true;
      case 2: return listeners.fn.call(listeners.context, a1), true;
      case 3: return listeners.fn.call(listeners.context, a1, a2), true;
      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
    }

    for (i = 1, args = new Array(len -1); i < len; i++) {
      args[i - 1] = arguments[i];
    }

    listeners.fn.apply(listeners.context, args);
  } else {
    var length = listeners.length
      , j;

    for (i = 0; i < length; i++) {
      if (listeners[i].once) this.removeListener(event, listeners[i].fn, true);

      switch (len) {
        case 1: listeners[i].fn.call(listeners[i].context); break;
        case 2: listeners[i].fn.call(listeners[i].context, a1); break;
        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
        default:
          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
            args[j - 1] = arguments[j];
          }

          listeners[i].fn.apply(listeners[i].context, args);
      }
    }
  }

  return true;
};

/**
 * Register a new EventListener for the given event.
 *
 * @param {String} event Name of the event.
 * @param {Functon} fn Callback function.
 * @param {Mixed} context The context of the function.
 * @api public
 */
EventEmitter.prototype.on = function on(event, fn, context) {
  var listener = new EE(fn, context || this);

  if (!this._events) this._events = {};
  if (!this._events[event]) this._events[event] = listener;
  else {
    if (!this._events[event].fn) this._events[event].push(listener);
    else this._events[event] = [
      this._events[event], listener
    ];
  }

  return this;
};

/**
 * Add an EventListener that's only called once.
 *
 * @param {String} event Name of the event.
 * @param {Function} fn Callback function.
 * @param {Mixed} context The context of the function.
 * @api public
 */
EventEmitter.prototype.once = function once(event, fn, context) {
  var listener = new EE(fn, context || this, true);

  if (!this._events) this._events = {};
  if (!this._events[event]) this._events[event] = listener;
  else {
    if (!this._events[event].fn) this._events[event].push(listener);
    else this._events[event] = [
      this._events[event], listener
    ];
  }

  return this;
};

/**
 * Remove event listeners.
 *
 * @param {String} event The event we want to remove.
 * @param {Function} fn The listener that we need to find.
 * @param {Boolean} once Only remove once listeners.
 * @api public
 */
EventEmitter.prototype.removeListener = function removeListener(event, fn, once) {
  if (!this._events || !this._events[event]) return this;

  var listeners = this._events[event]
    , events = [];

  if (fn) {
    if (listeners.fn && (listeners.fn !== fn || (once && !listeners.once))) {
      events.push(listeners);
    }
    if (!listeners.fn) for (var i = 0, length = listeners.length; i < length; i++) {
      if (listeners[i].fn !== fn || (once && !listeners[i].once)) {
        events.push(listeners[i]);
      }
    }
  }

  //
  // Reset the array, or remove it completely if we have no more listeners.
  //
  if (events.length) {
    this._events[event] = events.length === 1 ? events[0] : events;
  } else {
    delete this._events[event];
  }

  return this;
};

/**
 * Remove all listeners or only the listeners for the specified event.
 *
 * @param {String} event The event want to remove all listeners for.
 * @api public
 */
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
  if (!this._events) return this;

  if (event) delete this._events[event];
  else this._events = {};

  return this;
};

//
// Alias methods names because people roll like that.
//
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.addListener = EventEmitter.prototype.on;

//
// This function doesn't apply anymore.
//
EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
  return this;
};

//
// Expose the module.
//
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.EventEmitter2 = EventEmitter;
EventEmitter.EventEmitter3 = EventEmitter;

//
// Expose the module.
//
module.exports = EventEmitter;


/***/ }),
/* 954 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"row":"row__Dataset__2Mtvq","selected":"selected__Dataset__3jzlR","pending":"pending__Dataset__2QnAB","row_content":"row_content__Dataset__2YwHI","cell":"cell__Dataset__2TDLb","header":"header__Dataset__3m903","link":"link__Dataset__2RpIp","loading":"loading__Dataset__Z7Ffp","wrapper":"wrapper__Dataset__2pM8A","spinner":"spinner__Dataset__1MYf-"};

/***/ }),
/* 955 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"list":"list__List__2-peY","num":"num__List__2ZfsR","hidden":"hidden__List__1B63q","btn":"btn__List__3RO_z"};

/***/ }),
/* 956 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__SearchBox__3DKzy","input":"input__SearchBox__3jU42","inputWrapper":"inputWrapper__SearchBox__my9S8","cross":"cross__SearchBox__2HczX","icon":"icon__SearchBox__1IetQ","portal":"portal__SearchBox__20mqM","portalContent":"portalContent__SearchBox__2oVhO","list":"list__SearchBox__czk8K"};

/***/ }),
/* 957 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"icon":"icon__xch-Icon__3g7kl"};

/***/ }),
/* 958 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-InputText__1zI7o","output":"output__xch-InputText__2-1f0","disabled":"disabled__xch-InputText__38LEa","input":"input__xch-InputText__1ZeHt","focused":"focused__xch-InputText__tVYzf","error":"error__xch-InputText__1c0IZ","button":"button__xch-InputText__38oMa"};

/***/ }),
/* 959 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-Portal__24HCS","content":"content__xch-Portal__29rag"};

/***/ }),
/* 960 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"icon":"icon__xch-Icon__37X2R"};

/***/ }),
/* 961 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__GroupFilters__2K85i","title":"title__GroupFilters__36dIm","field":"field__GroupFilters__2nZG2","search":"search__GroupFilters__2yTvd","includes":"includes__GroupFilters__2S4k2"};

/***/ }),
/* 962 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__IconButton__1lf91","content":"content__IconButton__3bAJ0","icon":"icon__IconButton__3fRpQ"};

/***/ }),
/* 963 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"preview":"preview__NotesEditor__WyUgq","controls":"controls__NotesEditor__1SxdL","saveButton":"saveButton__NotesEditor__3SSUX"};

/***/ }),
/* 964 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__RecentlyOpen__23Lrl","title":"title__RecentlyOpen__3Rnjn","text":"text__RecentlyOpen__1V0bY","item":"item__RecentlyOpen__2PLda"};

/***/ }),
/* 965 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-CheckBox__2YHSv","_box":"_box__xch-CheckBox__3wHu1","_check":"_check__xch-CheckBox__Rw3n2","is-checked":"is-checked__xch-CheckBox__WYwqr","is-pending":"is-pending__xch-CheckBox__3E66p","is-disabled":"is-disabled__xch-CheckBox__mauMd","_title":"_title__xch-CheckBox__1mCDQ","is-error":"is-error__xch-CheckBox__21dmF","icon":"icon__xch-CheckBox__wkiMg","spinner":"spinner__xch-CheckBox__2y94Q"};

/***/ }),
/* 966 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-GenericCloseBtn__2PO_l","icon":"icon__xch-GenericCloseBtn__31g_1","text":"text__xch-GenericCloseBtn__UnDoa","content":"content__xch-GenericCloseBtn__qTEOJ"};

/***/ }),
/* 967 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-Spinner__1TAbE","rotateSpinner":"rotateSpinner__xch-Spinner__2Sujl","icon":"icon__xch-Spinner__DALSl"};

/***/ }),
/* 968 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"InputTextArea":"InputTextArea__xch-TextArea__3BGF0","_input":"_input__xch-TextArea__32F_f","_icon":"_icon__xch-TextArea__1Abvu"};

/***/ }),
/* 969 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"budget-border-box":"budget-border-box___Item__uzoXm","DatasetList__item":"DatasetList__item___Item__3nnZs","_button":"_button___Item__3owLg","_content":"_content___Item__1NkUz","is-selected":"is-selected___Item__3el8s","is-budget":"is-budget___Item__2Q7IY","is-orphan":"is-orphan___Item__2npa5","DatasetList__tagSwatch":"DatasetList__tagSwatch___Item__1SvdQ","DatasetList__column":"DatasetList__column___Item__2Tbq4","_owner":"_owner___Item__yOUVN","_icon":"_icon___Item__2Vi9z","_titleLink":"_titleLink___Item__j-jIX","first_child":"first_child___Item__1mfvl","is-ordered-by":"is-ordered-by___Item__2EVAt","is-reversed":"is-reversed___Item__8BwFX","DatasetList__checkbox":"DatasetList__checkbox___Item__18cYM"};

/***/ }),
/* 970 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"option":"option___InputMultiSelect__2_HqG","checkbox":"checkbox___InputMultiSelect__JArMW","is-disabled":"is-disabled___InputMultiSelect__3f13C"};

/***/ }),
/* 971 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__UserSettings__3tZD9","background":"background__UserSettings__T9I0l","container":"container__UserSettings__EK8Ty","mainCol":"mainCol__UserSettings__1BFl4","heading":"heading__UserSettings__7Zruo","title":"title__UserSettings__2IBTU","subtitle":"subtitle__UserSettings__3pL1f","logout":"logout__UserSettings__2pxnG","logoutError":"logoutError__UserSettings__20wca","logout_button":"logout_button__UserSettings__S1Pow","notesCol":"notesCol__UserSettings__kmk1H","notesContent":"notesContent__UserSettings__2KLy9"};

/***/ }),
/* 972 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Notes__3g7al","title":"title__Notes__2i_Mg"};

/***/ }),
/* 973 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__CheckBox__24dpR","_box":"_box__CheckBox__1ukg4","_check":"_check__CheckBox__10tp_","is-checked":"is-checked__CheckBox__3kpzC","is-pending":"is-pending__CheckBox__1dHDt","is-disabled":"is-disabled__CheckBox__1RkKw","_title":"_title__CheckBox__3r44Q","is-error":"is-error__CheckBox__3Ta9S","icon":"icon__CheckBox__2C_SJ","spinner":"spinner__CheckBox__2Tobl"};

/***/ }),
/* 974 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"CC_preview":"CC_preview__NotesEditor__3F76z","CC_controls":"CC_controls__NotesEditor__sYY-7","CC_saveButton":"CC_saveButton__NotesEditor__3AKXu"};

/***/ }),
/* 975 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"InputTextArea":"InputTextArea__xch-TextArea__2DHlR","_input":"_input__xch-TextArea__2b5db","_icon":"_icon__xch-TextArea__2lZuW"};

/***/ }),
/* 976 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__DoubleCheckbox__3_Uqx","spinner":"spinner__DoubleCheckbox__21aC8"};

/***/ }),
/* 977 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__SingleCheckbox__1sFJC","spinner":"spinner__SingleCheckbox__1MePk"};

/***/ }),
/* 978 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"InputSwitchbox":"InputSwitchbox__CheckBox__3nnHR","_box":"_box__CheckBox__3QaqG","_check":"_check__CheckBox__271_-","is-checked":"is-checked__CheckBox__1Xr-a","is-pending":"is-pending__CheckBox__1iTD1","is-disabled":"is-disabled__CheckBox__30n5M","_title":"_title__CheckBox__2Vji5","is-error":"is-error__CheckBox__66HN0","icon":"icon__CheckBox__kd6X5","spinner":"spinner__CheckBox__2ibxJ"};

/***/ }),
/* 979 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"DatasetList__item":"DatasetList__item__DatasetItem__1Qrpw","_button":"_button__DatasetItem__TUapl","_content":"_content__DatasetItem__27Nh_","is-selected":"is-selected__DatasetItem__230v1","name":"name__DatasetItem__m2hFr","DatasetList__tagSwatch":"DatasetList__tagSwatch__DatasetItem__2RTrN","DatasetList__column":"DatasetList__column__DatasetItem__loguw","_owner":"_owner__DatasetItem__hAaZd","_icon":"_icon__DatasetItem__2BCeH","_titleLink":"_titleLink__DatasetItem__2kdh8","is-ordered-by":"is-ordered-by__DatasetItem__13a1n","is-reversed":"is-reversed__DatasetItem__3lNj6","pendingText":"pendingText__DatasetItem__2y9AA"};

/***/ }),
/* 980 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___IndustryAuthority__cuL3T","banner":"banner___IndustryAuthority__N5qZr","banner_container":"banner_container___IndustryAuthority__2kmKi","header":"header___IndustryAuthority__3H-er","banner_content":"banner_content___IndustryAuthority__1l40o","col":"col___IndustryAuthority__1i_M0","scrollbox":"scrollbox___IndustryAuthority__22LtC","content":"content___IndustryAuthority__23BK-","list":"list___IndustryAuthority__2MaTl","select":"select___IndustryAuthority__2HSoM"};

/***/ }),
/* 981 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___Datasets__109JG","banner":"banner___Datasets__1mmXk","bannerContent":"bannerContent___Datasets__1cgcU","content":"content___Datasets__1N-ix","list":"list___Datasets__1_qBF","listTitle":"listTitle___Datasets__1kbSL","allButton":"allButton___Datasets__2cDwo","disabled":"disabled___Datasets__-BMvc"};

/***/ }),
/* 982 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"col":"col___RegionField__VmkXa","label":"label___RegionField__30Ltv","field":"field___RegionField__1NKW0","isError":"isError___RegionField__1Z7sF","_output":"_output___RegionField__xDNlY","fieldWrapper":"fieldWrapper___RegionField__3wEaJ"};

/***/ }),
/* 983 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__FilterEditorPortal__2hJ7D","col1":"col1__FilterEditorPortal__2BFfy","col2":"col2__FilterEditorPortal__348Tc","group":"group__FilterEditorPortal__XEGSB","headings":"headings__FilterEditorPortal__vCa15","saveBtn":"saveBtn__FilterEditorPortal__3MUWW","title":"title__FilterEditorPortal__IA0um","col":"col__FilterEditorPortal__3U97E","verticalField":"verticalField__FilterEditorPortal__3eyvh","label":"label__FilterEditorPortal__bOt1p","field":"field__FilterEditorPortal__3o2_P","isError":"isError__FilterEditorPortal__2MxjV","_output":"_output__FilterEditorPortal__3x5i9","inCol1":"inCol1__FilterEditorPortal__2Eswk","fieldWrapper":"fieldWrapper__FilterEditorPortal__3mOj0","from":"from__FilterEditorPortal__yWPN7","to":"to__FilterEditorPortal__7HSH0","SelectInput":"SelectInput__FilterEditorPortal__1sEwz","text":"text__FilterEditorPortal__3ecDA"};

/***/ }),
/* 984 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___FilterList__12Xwa","filter":"filter___FilterList__1C2wo","selectableArea":"selectableArea___FilterList__1f0vw","isSelected":"isSelected___FilterList__3-OuE","filterInfo":"filterInfo___FilterList__QmrgA","checkbox":"checkbox___FilterList__M1P0u","filtertext":"filtertext___FilterList__2EZMV","filtertextvalue":"filtertextvalue___FilterList__1JZjO","count":"count___FilterList__4ShWA","error":"error___FilterList__32b3V","editBtn":"editBtn___FilterList__1CbkG","editIcon":"editIcon___FilterList__1Axa5","deleteBtn":"deleteBtn___FilterList__1jylY","deleteIcon":"deleteIcon___FilterList__1kvz5"};

/***/ }),
/* 985 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___SelectedList__1uJJE"};

/***/ }),
/* 986 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___Filter__2fB6t","header":"header___Filter__2q71v","header_item":"header_item___Filter__1KFJJ","kpi":"kpi___Filter__1EzZJ","generateBtn":"generateBtn___Filter__2i8or","disabled":"disabled___Filter__1dfCv","createBtn":"createBtn___Filter__1rWQr","buttonWrapper":"buttonWrapper___Filter__1kwBj","plusIcon":"plusIcon___Filter__23bmd"};

/***/ }),
/* 987 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___BulkComparisonReport__1l3Nu"};

/***/ }),
/* 988 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___Farm__g4T9V","header":"header___Farm__jGdLa","header_item":"header_item___Farm__2v4Wu","kpi":"kpi___Farm__3k8C-","generateBtn":"generateBtn___Farm__2DhyN","disabled":"disabled___Farm__3Z7RI","createBtn":"createBtn___Farm__2nUl4","buttonWrapper":"buttonWrapper___Farm__3ISV3","plusIcon":"plusIcon___Farm__1D4vK"};

/***/ }),
/* 989 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Axis__2djCU","area":"area__Axis__2ZKl7","line":"line__Axis__7nAWG","tag":"tag__Axis__1QcC6"};

/***/ }),
/* 990 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Chart__iWJu8","areas":"areas__Chart__3Etzb","line":"line__Chart__2mONR","segment":"segment__Chart__1jNmM","box":"box__Chart__3Kd7P","titleWrapper":"titleWrapper__Chart__JLHDJ","title":"title__Chart__17y4Z","attachment":"attachment__Chart__bS5b_","unit":"unit__Chart__2Qc-f","num":"num__Chart__1I4mH"};

/***/ }),
/* 991 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Legend__2j6WP","item":"item__Legend__lPZoc","block":"block__Legend__21qaV","title":"title__Legend__dI3I6","thisFarm":"thisFarm__Legend__3WngE","baseline":"baseline__Legend__a7vCD"};

/***/ }),
/* 992 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Charts__2hDcK","axis":"axis__Charts__3qcKM","chart":"chart__Charts__29yQO"};

/***/ }),
/* 993 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__DataMissingPortal__3LEI9","button":"button__DataMissingPortal__1lw5M","modal":"modal__DataMissingPortal__sNjzj","title":"title__DataMissingPortal__2TJvp","list":"list__DataMissingPortal__1JFDp","linkWrapper":"linkWrapper__DataMissingPortal__U0t53","link":"link__DataMissingPortal__1xyqN"};

/***/ }),
/* 994 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__GHGOutput__2njXc","label":"label__GHGOutput__32jai","help":"help__GHGOutput__1SnK8","unit":"unit__GHGOutput__1Knfe","input":"input__GHGOutput__1wiDy","number":"number__GHGOutput__3YYxp"};

/***/ }),
/* 995 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__OutputField__281I2","label":"label__OutputField__1K1cf","output":"output__OutputField__3_XSf"};

/***/ }),
/* 996 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Info__2VeXc","info":"info__Info__2boSF","calculation":"calculation__Info__3gazz"};

/***/ }),
/* 997 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Field__1mc1M"};

/***/ }),
/* 998 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__Table__4WX7F","row":"row__Table__tMtzA","total":"total__Table__7F6zp","labels":"labels__Table__1UitB","category":"category__Table__2de2T","title":"title__Table__1C5-n","cols":"cols__Table__NxloV","headerCol":"headerCol__Table__3qrGt","multiLine":"multiLine__Table__3GeyZ","unit":"unit__Table__yH_mP","field":"field__Table__A-254"};

/***/ }),
/* 999 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__DefaultComponent__1h8qx","title":"title__DefaultComponent__2Zq-j","label":"label__DefaultComponent__2BLDq"};

/***/ }),
/* 1000 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"GenericCloseBtn":"GenericCloseBtn__GenericCloseBtn__146AV","_content":"_content__GenericCloseBtn__DBThK","_icon":"_icon__GenericCloseBtn__2WKFW","_text":"_text__GenericCloseBtn__2UPzw"};

/***/ }),
/* 1001 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"helpBtn":"helpBtn__HelpPortal__23e9M","helpBox":"helpBox__HelpPortal__3Jvqz","icon":"icon__HelpPortal__1PHsw","modal":"modal__HelpPortal__qW70v","text":"text__HelpPortal__2W9PD"};

/***/ }),
/* 1002 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__HoverBox__bz5E8","title":"title__HoverBox__26peR","unit":"unit__HoverBox__3hHxq","row":"row__HoverBox__2eJ-f","headerRow":"headerRow__HoverBox__3Sdx1","header":"header__HoverBox__1N_GO","value":"value__HoverBox__38tUk"};

/***/ }),
/* 1003 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"portal":"portal__Modal__lYU_o","portal__content":"portal__content__Modal__118ez","modal":"modal__Modal__1Z0BB"};

/***/ }),
/* 1004 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"unit":"unit__UnitText__1TV5y","sub":"sub__UnitText__26AFf"};

/***/ }),
/* 1005 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"icon":"icon__xch-Icon__12rSo"};

/***/ }),
/* 1006 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-MdOutput__33Oh3"};

/***/ }),
/* 1007 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-NumberField__lhStN","error":"error__xch-NumberField__2wRH-"};

/***/ }),
/* 1008 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root__xch-Portal__3oOYy","content":"content__xch-Portal__2nKcV"};

/***/ }),
/* 1009 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___CarbonReport__1sq2Q","heading":"heading___CarbonReport__2a_xq","top":"top___CarbonReport__3SeFM","outputs":"outputs___CarbonReport__1yXqm","chart_container":"chart_container___CarbonReport__2f_03","errorBar":"errorBar___CarbonReport__3rNXs"};

/***/ }),
/* 1010 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"root":"root___DFMPFarmClientReport__1wDFK"};

/***/ }),
/* 1011 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin
module.exports = {"allButton":"allButton___Datasets__20cPg","disabled":"disabled___Datasets__Q20tY"};

/***/ }),
/* 1012 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1013 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1014 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1015 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1016 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1017 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1018 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1019 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1020 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1021 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1022 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1023 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1024 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1025 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1026 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1027 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1028 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1029 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1030 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1031 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1032 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1033 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1034 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1035 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1036 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1037 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1038 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1039 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1040 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1041 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1042 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1043 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1044 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1045 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1046 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1047 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1048 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1049 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1050 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1051 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1052 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1053 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1054 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1055 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1056 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1057 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1058 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1059 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1060 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1061 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1062 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1063 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1064 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1065 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1066 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1067 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1068 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1069 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1070 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1071 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1072 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1073 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1074 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1075 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1076 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1077 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1078 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1079 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1080 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1081 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1082 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1083 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1084 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1085 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1086 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1087 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1088 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1089 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1090 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1091 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1092 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1093 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1094 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1095 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1096 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1097 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1098 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1099 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1100 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1101 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1102 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1103 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1104 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1105 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1106 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1107 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1108 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1109 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1110 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1111 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1112 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1113 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1114 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1115 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1116 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1117 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1118 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1119 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1120 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1121 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1122 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1123 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1124 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1125 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1126 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1127 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1128 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1129 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1130 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1131 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1132 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1133 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1134 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1135 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1136 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1137 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1138 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1139 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1140 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1141 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1142 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1143 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1144 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1145 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1146 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1147 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1148 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1149 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1150 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1151 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1152 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1153 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1154 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1155 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1156 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1157 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1158 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1159 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1160 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1161 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1162 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1163 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1164 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1165 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1166 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1167 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1168 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1169 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1170 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1171 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1172 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1173 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1174 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1175 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1176 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1177 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1178 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1179 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1180 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1181 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1182 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1183 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1184 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1185 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1186 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1187 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1188 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1189 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1190 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1191 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1192 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1193 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1194 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1195 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1196 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1197 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1198 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1199 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1200 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1201 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1202 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1203 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1204 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1205 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1206 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1207 */
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
/* 1208 */
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_RESULT__;;(function () {
	'use strict';

	/**
	 * @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
	 *
	 * @codingstandard ftlabs-jsv2
	 * @copyright The Financial Times Limited [All Rights Reserved]
	 * @license MIT License (see LICENSE.txt)
	 */

	/*jslint browser:true, node:true*/
	/*global define, Event, Node*/


	/**
	 * Instantiate fast-clicking listeners on the specified layer.
	 *
	 * @constructor
	 * @param {Element} layer The layer to listen on
	 * @param {Object} [options={}] The options to override the defaults
	 */
	function FastClick(layer, options) {
		var oldOnClick;

		options = options || {};

		/**
		 * Whether a click is currently being tracked.
		 *
		 * @type boolean
		 */
		this.trackingClick = false;


		/**
		 * Timestamp for when click tracking started.
		 *
		 * @type number
		 */
		this.trackingClickStart = 0;


		/**
		 * The element being tracked for a click.
		 *
		 * @type EventTarget
		 */
		this.targetElement = null;


		/**
		 * X-coordinate of touch start event.
		 *
		 * @type number
		 */
		this.touchStartX = 0;


		/**
		 * Y-coordinate of touch start event.
		 *
		 * @type number
		 */
		this.touchStartY = 0;


		/**
		 * ID of the last touch, retrieved from Touch.identifier.
		 *
		 * @type number
		 */
		this.lastTouchIdentifier = 0;


		/**
		 * Touchmove boundary, beyond which a click will be cancelled.
		 *
		 * @type number
		 */
		this.touchBoundary = options.touchBoundary || 10;


		/**
		 * The FastClick layer.
		 *
		 * @type Element
		 */
		this.layer = layer;

		/**
		 * The minimum time between tap(touchstart and touchend) events
		 *
		 * @type number
		 */
		this.tapDelay = options.tapDelay || 200;

		/**
		 * The maximum time for a tap
		 *
		 * @type number
		 */
		this.tapTimeout = options.tapTimeout || 700;

		if (FastClick.notNeeded(layer)) {
			return;
		}

		// Some old versions of Android don't have Function.prototype.bind
		function bind(method, context) {
			return function() { return method.apply(context, arguments); };
		}


		var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
		var context = this;
		for (var i = 0, l = methods.length; i < l; i++) {
			context[methods[i]] = bind(context[methods[i]], context);
		}

		// Set up event handlers as required
		if (deviceIsAndroid) {
			layer.addEventListener('mouseover', this.onMouse, true);
			layer.addEventListener('mousedown', this.onMouse, true);
			layer.addEventListener('mouseup', this.onMouse, true);
		}

		layer.addEventListener('click', this.onClick, true);
		layer.addEventListener('touchstart', this.onTouchStart, false);
		layer.addEventListener('touchmove', this.onTouchMove, false);
		layer.addEventListener('touchend', this.onTouchEnd, false);
		layer.addEventListener('touchcancel', this.onTouchCancel, false);

		// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
		// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
		// layer when they are cancelled.
		if (!Event.prototype.stopImmediatePropagation) {
			layer.removeEventListener = function(type, callback, capture) {
				var rmv = Node.prototype.removeEventListener;
				if (type === 'click') {
					rmv.call(layer, type, callback.hijacked || callback, capture);
				} else {
					rmv.call(layer, type, callback, capture);
				}
			};

			layer.addEventListener = function(type, callback, capture) {
				var adv = Node.prototype.addEventListener;
				if (type === 'click') {
					adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
						if (!event.propagationStopped) {
							callback(event);
						}
					}), capture);
				} else {
					adv.call(layer, type, callback, capture);
				}
			};
		}

		// If a handler is already declared in the element's onclick attribute, it will be fired before
		// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
		// adding it as listener.
		if (typeof layer.onclick === 'function') {

			// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
			// - the old one won't work if passed to addEventListener directly.
			oldOnClick = layer.onclick;
			layer.addEventListener('click', function(event) {
				oldOnClick(event);
			}, false);
			layer.onclick = null;
		}
	}

	/**
	* Windows Phone 8.1 fakes user agent string to look like Android and iPhone.
	*
	* @type boolean
	*/
	var deviceIsWindowsPhone = navigator.userAgent.indexOf("Windows Phone") >= 0;

	/**
	 * Android requires exceptions.
	 *
	 * @type boolean
	 */
	var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0 && !deviceIsWindowsPhone;


	/**
	 * iOS requires exceptions.
	 *
	 * @type boolean
	 */
	var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent) && !deviceIsWindowsPhone;


	/**
	 * iOS 4 requires an exception for select elements.
	 *
	 * @type boolean
	 */
	var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);


	/**
	 * iOS 6.0-7.* requires the target element to be manually derived
	 *
	 * @type boolean
	 */
	var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS [6-7]_\d/).test(navigator.userAgent);

	/**
	 * BlackBerry requires exceptions.
	 *
	 * @type boolean
	 */
	var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;

	/**
	 * Determine whether a given element requires a native click.
	 *
	 * @param {EventTarget|Element} target Target DOM element
	 * @returns {boolean} Returns true if the element needs a native click
	 */
	FastClick.prototype.needsClick = function(target) {
		switch (target.nodeName.toLowerCase()) {

		// Don't send a synthetic click to disabled inputs (issue #62)
		case 'button':
		case 'select':
		case 'textarea':
			if (target.disabled) {
				return true;
			}

			break;
		case 'input':

			// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
			if ((deviceIsIOS && target.type === 'file') || target.disabled) {
				return true;
			}

			break;
		case 'label':
		case 'iframe': // iOS8 homescreen apps can prevent events bubbling into frames
		case 'video':
			return true;
		}

		return (/\bneedsclick\b/).test(target.className);
	};


	/**
	 * Determine whether a given element requires a call to focus to simulate click into element.
	 *
	 * @param {EventTarget|Element} target Target DOM element
	 * @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
	 */
	FastClick.prototype.needsFocus = function(target) {
		switch (target.nodeName.toLowerCase()) {
		case 'textarea':
			return true;
		case 'select':
			return !deviceIsAndroid;
		case 'input':
			switch (target.type) {
			case 'button':
			case 'checkbox':
			case 'file':
			case 'image':
			case 'radio':
			case 'submit':
				return false;
			}

			// No point in attempting to focus disabled inputs
			return !target.disabled && !target.readOnly;
		default:
			return (/\bneedsfocus\b/).test(target.className);
		}
	};


	/**
	 * Send a click event to the specified element.
	 *
	 * @param {EventTarget|Element} targetElement
	 * @param {Event} event
	 */
	FastClick.prototype.sendClick = function(targetElement, event) {
		var clickEvent, touch;

		// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
		if (document.activeElement && document.activeElement !== targetElement) {
			document.activeElement.blur();
		}

		touch = event.changedTouches[0];

		// Synthesise a click event, with an extra attribute so it can be tracked
		clickEvent = document.createEvent('MouseEvents');
		clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
		clickEvent.forwardedTouchEvent = true;
		targetElement.dispatchEvent(clickEvent);
	};

	FastClick.prototype.determineEventType = function(targetElement) {

		//Issue #159: Android Chrome Select Box does not open with a synthetic click event
		if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
			return 'mousedown';
		}

		return 'click';
	};


	/**
	 * @param {EventTarget|Element} targetElement
	 */
	FastClick.prototype.focus = function(targetElement) {
		var length;

		// Issue #160: on iOS 7, some input elements (e.g. date datetime month) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
		if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time' && targetElement.type !== 'month') {
			length = targetElement.value.length;
			targetElement.setSelectionRange(length, length);
		} else {
			targetElement.focus();
		}
	};


	/**
	 * Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
	 *
	 * @param {EventTarget|Element} targetElement
	 */
	FastClick.prototype.updateScrollParent = function(targetElement) {
		var scrollParent, parentElement;

		scrollParent = targetElement.fastClickScrollParent;

		// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
		// target element was moved to another parent.
		if (!scrollParent || !scrollParent.contains(targetElement)) {
			parentElement = targetElement;
			do {
				if (parentElement.scrollHeight > parentElement.offsetHeight) {
					scrollParent = parentElement;
					targetElement.fastClickScrollParent = parentElement;
					break;
				}

				parentElement = parentElement.parentElement;
			} while (parentElement);
		}

		// Always update the scroll top tracker if possible.
		if (scrollParent) {
			scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
		}
	};


	/**
	 * @param {EventTarget} targetElement
	 * @returns {Element|EventTarget}
	 */
	FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {

		// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
		if (eventTarget.nodeType === Node.TEXT_NODE) {
			return eventTarget.parentNode;
		}

		return eventTarget;
	};


	/**
	 * On touch start, record the position and scroll offset.
	 *
	 * @param {Event} event
	 * @returns {boolean}
	 */
	FastClick.prototype.onTouchStart = function(event) {
		var targetElement, touch, selection;

		// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
		if (event.targetTouches.length > 1) {
			return true;
		}

		targetElement = this.getTargetElementFromEventTarget(event.target);
		touch = event.targetTouches[0];

		if (deviceIsIOS) {

			// Only trusted events will deselect text on iOS (issue #49)
			selection = window.getSelection();
			if (selection.rangeCount && !selection.isCollapsed) {
				return true;
			}

			if (!deviceIsIOS4) {

				// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
				// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
				// with the same identifier as the touch event that previously triggered the click that triggered the alert.
				// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
				// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
				// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
				// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
				// random integers, it's safe to to continue if the identifier is 0 here.
				if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
					event.preventDefault();
					return false;
				}

				this.lastTouchIdentifier = touch.identifier;

				// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
				// 1) the user does a fling scroll on the scrollable layer
				// 2) the user stops the fling scroll with another tap
				// then the event.target of the last 'touchend' event will be the element that was under the user's finger
				// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
				// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
				this.updateScrollParent(targetElement);
			}
		}

		this.trackingClick = true;
		this.trackingClickStart = event.timeStamp;
		this.targetElement = targetElement;

		this.touchStartX = touch.pageX;
		this.touchStartY = touch.pageY;

		// Prevent phantom clicks on fast double-tap (issue #36)
		if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
			event.preventDefault();
		}

		return true;
	};


	/**
	 * Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
	 *
	 * @param {Event} event
	 * @returns {boolean}
	 */
	FastClick.prototype.touchHasMoved = function(event) {
		var touch = event.changedTouches[0], boundary = this.touchBoundary;

		if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
			return true;
		}

		return false;
	};


	/**
	 * Update the last position.
	 *
	 * @param {Event} event
	 * @returns {boolean}
	 */
	FastClick.prototype.onTouchMove = function(event) {
		if (!this.trackingClick) {
			return true;
		}

		// If the touch has moved, cancel the click tracking
		if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
			this.trackingClick = false;
			this.targetElement = null;
		}

		return true;
	};


	/**
	 * Attempt to find the labelled control for the given label element.
	 *
	 * @param {EventTarget|HTMLLabelElement} labelElement
	 * @returns {Element|null}
	 */
	FastClick.prototype.findControl = function(labelElement) {

		// Fast path for newer browsers supporting the HTML5 control attribute
		if (labelElement.control !== undefined) {
			return labelElement.control;
		}

		// All browsers under test that support touch events also support the HTML5 htmlFor attribute
		if (labelElement.htmlFor) {
			return document.getElementById(labelElement.htmlFor);
		}

		// If no for attribute exists, attempt to retrieve the first labellable descendant element
		// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
		return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
	};


	/**
	 * On touch end, determine whether to send a click event at once.
	 *
	 * @param {Event} event
	 * @returns {boolean}
	 */
	FastClick.prototype.onTouchEnd = function(event) {
		var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;

		if (!this.trackingClick) {
			return true;
		}

		// Prevent phantom clicks on fast double-tap (issue #36)
		if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
			this.cancelNextClick = true;
			return true;
		}

		if ((event.timeStamp - this.trackingClickStart) > this.tapTimeout) {
			return true;
		}

		// Reset to prevent wrong click cancel on input (issue #156).
		this.cancelNextClick = false;

		this.lastClickTime = event.timeStamp;

		trackingClickStart = this.trackingClickStart;
		this.trackingClick = false;
		this.trackingClickStart = 0;

		// On some iOS devices, the targetElement supplied with the event is invalid if the layer
		// is performing a transition or scroll, and has to be re-detected manually. Note that
		// for this to function correctly, it must be called *after* the event target is checked!
		// See issue #57; also filed as rdar://13048589 .
		if (deviceIsIOSWithBadTarget) {
			touch = event.changedTouches[0];

			// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
			targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
			targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
		}

		targetTagName = targetElement.tagName.toLowerCase();
		if (targetTagName === 'label') {
			forElement = this.findControl(targetElement);
			if (forElement) {
				this.focus(targetElement);
				if (deviceIsAndroid) {
					return false;
				}

				targetElement = forElement;
			}
		} else if (this.needsFocus(targetElement)) {

			// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
			// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
			if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
				this.targetElement = null;
				return false;
			}

			this.focus(targetElement);
			this.sendClick(targetElement, event);

			// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
			// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
			if (!deviceIsIOS || targetTagName !== 'select') {
				this.targetElement = null;
				event.preventDefault();
			}

			return false;
		}

		if (deviceIsIOS && !deviceIsIOS4) {

			// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
			// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
			scrollParent = targetElement.fastClickScrollParent;
			if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
				return true;
			}
		}

		// Prevent the actual click from going though - unless the target node is marked as requiring
		// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
		if (!this.needsClick(targetElement)) {
			event.preventDefault();
			this.sendClick(targetElement, event);
		}

		return false;
	};


	/**
	 * On touch cancel, stop tracking the click.
	 *
	 * @returns {void}
	 */
	FastClick.prototype.onTouchCancel = function() {
		this.trackingClick = false;
		this.targetElement = null;
	};


	/**
	 * Determine mouse events which should be permitted.
	 *
	 * @param {Event} event
	 * @returns {boolean}
	 */
	FastClick.prototype.onMouse = function(event) {

		// If a target element was never set (because a touch event was never fired) allow the event
		if (!this.targetElement) {
			return true;
		}

		if (event.forwardedTouchEvent) {
			return true;
		}

		// Programmatically generated events targeting a specific element should be permitted
		if (!event.cancelable) {
			return true;
		}

		// Derive and check the target element to see whether the mouse event needs to be permitted;
		// unless explicitly enabled, prevent non-touch click events from triggering actions,
		// to prevent ghost/doubleclicks.
		if (!this.needsClick(this.targetElement) || this.cancelNextClick) {

			// Prevent any user-added listeners declared on FastClick element from being fired.
			if (event.stopImmediatePropagation) {
				event.stopImmediatePropagation();
			} else {

				// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
				event.propagationStopped = true;
			}

			// Cancel the event
			event.stopPropagation();
			event.preventDefault();

			return false;
		}

		// If the mouse event is permitted, return true for the action to go through.
		return true;
	};


	/**
	 * On actual clicks, determine whether this is a touch-generated click, a click action occurring
	 * naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
	 * an actual click which should be permitted.
	 *
	 * @param {Event} event
	 * @returns {boolean}
	 */
	FastClick.prototype.onClick = function(event) {
		var permitted;

		// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
		if (this.trackingClick) {
			this.targetElement = null;
			this.trackingClick = false;
			return true;
		}

		// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
		if (event.target.type === 'submit' && event.detail === 0) {
			return true;
		}

		permitted = this.onMouse(event);

		// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
		if (!permitted) {
			this.targetElement = null;
		}

		// If clicks are permitted, return true for the action to go through.
		return permitted;
	};


	/**
	 * Remove all FastClick's event listeners.
	 *
	 * @returns {void}
	 */
	FastClick.prototype.destroy = function() {
		var layer = this.layer;

		if (deviceIsAndroid) {
			layer.removeEventListener('mouseover', this.onMouse, true);
			layer.removeEventListener('mousedown', this.onMouse, true);
			layer.removeEventListener('mouseup', this.onMouse, true);
		}

		layer.removeEventListener('click', this.onClick, true);
		layer.removeEventListener('touchstart', this.onTouchStart, false);
		layer.removeEventListener('touchmove', this.onTouchMove, false);
		layer.removeEventListener('touchend', this.onTouchEnd, false);
		layer.removeEventListener('touchcancel', this.onTouchCancel, false);
	};


	/**
	 * Check whether FastClick is needed.
	 *
	 * @param {Element} layer The layer to listen on
	 */
	FastClick.notNeeded = function(layer) {
		var metaViewport;
		var chromeVersion;
		var blackberryVersion;
		var firefoxVersion;

		// Devices that don't support touch don't need FastClick
		if (typeof window.ontouchstart === 'undefined') {
			return true;
		}

		// Chrome version - zero for other browsers
		chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];

		if (chromeVersion) {

			if (deviceIsAndroid) {
				metaViewport = document.querySelector('meta[name=viewport]');

				if (metaViewport) {
					// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
					if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
						return true;
					}
					// Chrome 32 and above with width=device-width or less don't need FastClick
					if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
						return true;
					}
				}

			// Chrome desktop doesn't need FastClick (issue #15)
			} else {
				return true;
			}
		}

		if (deviceIsBlackBerry10) {
			blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);

			// BlackBerry 10.3+ does not require Fastclick library.
			// https://github.com/ftlabs/fastclick/issues/251
			if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
				metaViewport = document.querySelector('meta[name=viewport]');

				if (metaViewport) {
					// user-scalable=no eliminates click delay.
					if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
						return true;
					}
					// width=device-width (or less than device-width) eliminates click delay.
					if (document.documentElement.scrollWidth <= window.outerWidth) {
						return true;
					}
				}
			}
		}

		// IE10 with -ms-touch-action: none or manipulation, which disables double-tap-to-zoom (issue #97)
		if (layer.style.msTouchAction === 'none' || layer.style.touchAction === 'manipulation') {
			return true;
		}

		// Firefox version - zero for other browsers
		firefoxVersion = +(/Firefox\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];

		if (firefoxVersion >= 27) {
			// Firefox 27+ does not have tap delay if the content is not zoomable - https://bugzilla.mozilla.org/show_bug.cgi?id=922896

			metaViewport = document.querySelector('meta[name=viewport]');
			if (metaViewport && (metaViewport.content.indexOf('user-scalable=no') !== -1 || document.documentElement.scrollWidth <= window.outerWidth)) {
				return true;
			}
		}

		// IE11: prefixed -ms-touch-action is no longer supported and it's recomended to use non-prefixed version
		// http://msdn.microsoft.com/en-us/library/windows/apps/Hh767313.aspx
		if (layer.style.touchAction === 'none' || layer.style.touchAction === 'manipulation') {
			return true;
		}

		return false;
	};


	/**
	 * Factory method for creating a FastClick object
	 *
	 * @param {Element} layer The layer to listen on
	 * @param {Object} [options={}] The options to override the defaults
	 */
	FastClick.attach = function(layer, options) {
		return new FastClick(layer, options);
	};


	if (true) {

		// AMD. Register as an anonymous module.
		!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
			return FastClick;
		}.call(exports, __webpack_require__, exports, module),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else if (typeof module !== 'undefined' && module.exports) {
		module.exports = FastClick.attach;
		module.exports.FastClick = FastClick;
	} else {
		window.FastClick = FastClick;
	}
}());


/***/ }),
/* 1209 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * 
 */

function makeEmptyFunction(arg) {
  return function () {
    return arg;
  };
}

/**
 * This function accepts and discards inputs; it has no side effects. This is
 * primarily useful idiomatically for overridable function endpoints which
 * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
 */
var emptyFunction = function emptyFunction() {};

emptyFunction.thatReturns = makeEmptyFunction;
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
emptyFunction.thatReturnsThis = function () {
  return this;
};
emptyFunction.thatReturnsArgument = function (arg) {
  return arg;
};

module.exports = emptyFunction;

/***/ }),
/* 1210 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */



var emptyObject = {};

if (true) {
  Object.freeze(emptyObject);
}

module.exports = emptyObject;

/***/ }),
/* 1211 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @typechecks
 */

var _uppercasePattern = /([A-Z])/g;

/**
 * Hyphenates a camelcased string, for example:
 *
 *   > hyphenate('backgroundColor')
 *   < "background-color"
 *
 * For CSS style names, use `hyphenateStyleName` instead which works properly
 * with all vendor prefixes, including `ms`.
 *
 * @param {string} string
 * @return {string}
 */
function hyphenate(string) {
  return string.replace(_uppercasePattern, '-$1').toLowerCase();
}

module.exports = hyphenate;

/***/ }),
/* 1212 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @typechecks
 */



var hyphenate = __webpack_require__(1211);

var msPattern = /^ms-/;

/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 *
 * @param {string} string
 * @return {string}
 */
function hyphenateStyleName(string) {
  return hyphenate(string).replace(msPattern, '-ms-');
}

module.exports = hyphenateStyleName;

/***/ }),
/* 1213 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */



/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

var validateFormat = function validateFormat(format) {};

if (true) {
  validateFormat = function validateFormat(format) {
    if (format === undefined) {
      throw new Error('invariant requires an error message argument');
    }
  };
}

function invariant(condition, format, a, b, c, d, e, f) {
  validateFormat(format);

  if (!condition) {
    var error;
    if (format === undefined) {
      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
    } else {
      var args = [a, b, c, d, e, f];
      var argIndex = 0;
      error = new Error(format.replace(/%s/g, function () {
        return args[argIndex++];
      }));
      error.name = 'Invariant Violation';
    }

    error.framesToPop = 1; // we don't care about invariant's own frame
    throw error;
  }
}

module.exports = invariant;

/***/ }),
/* 1214 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var isCallable = __webpack_require__(244);

var toStr = Object.prototype.toString;
var hasOwnProperty = Object.prototype.hasOwnProperty;

var forEachArray = function forEachArray(array, iterator, receiver) {
    for (var i = 0, len = array.length; i < len; i++) {
        if (hasOwnProperty.call(array, i)) {
            if (receiver == null) {
                iterator(array[i], i, array);
            } else {
                iterator.call(receiver, array[i], i, array);
            }
        }
    }
};

var forEachString = function forEachString(string, iterator, receiver) {
    for (var i = 0, len = string.length; i < len; i++) {
        // no such thing as a sparse string.
        if (receiver == null) {
            iterator(string.charAt(i), i, string);
        } else {
            iterator.call(receiver, string.charAt(i), i, string);
        }
    }
};

var forEachObject = function forEachObject(object, iterator, receiver) {
    for (var k in object) {
        if (hasOwnProperty.call(object, k)) {
            if (receiver == null) {
                iterator(object[k], k, object);
            } else {
                iterator.call(receiver, object[k], k, object);
            }
        }
    }
};

var forEach = function forEach(list, iterator, thisArg) {
    if (!isCallable(iterator)) {
        throw new TypeError('iterator must be a function');
    }

    var receiver;
    if (arguments.length >= 3) {
        receiver = thisArg;
    }

    if (toStr.call(list) === '[object Array]') {
        forEachArray(list, iterator, receiver);
    } else if (typeof list === 'string') {
        forEachString(list, iterator, receiver);
    } else {
        forEachObject(list, iterator, receiver);
    }
};

module.exports = forEach;


/***/ }),
/* 1215 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/* eslint no-invalid-this: 1 */

var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';

module.exports = function bind(that) {
    var target = this;
    if (typeof target !== 'function' || toStr.call(target) !== funcType) {
        throw new TypeError(ERROR_MESSAGE + target);
    }
    var args = slice.call(arguments, 1);

    var bound;
    var binder = function () {
        if (this instanceof bound) {
            var result = target.apply(
                this,
                args.concat(slice.call(arguments))
            );
            if (Object(result) === result) {
                return result;
            }
            return this;
        } else {
            return target.apply(
                that,
                args.concat(slice.call(arguments))
            );
        }
    };

    var boundLength = Math.max(0, target.length - args.length);
    var boundArgs = [];
    for (var i = 0; i < boundLength; i++) {
        boundArgs.push('$' + i);
    }

    bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);

    if (target.prototype) {
        var Empty = function Empty() {};
        Empty.prototype = target.prototype;
        bound.prototype = new Empty();
        Empty.prototype = null;
    }

    return bound;
};


/***/ }),
/* 1216 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(setImmediate) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
WHAT: SublimeText-like Fuzzy Search

USAGE:
  require('fuzzysort').single('fs', 'Fuzzy Search')
  // {score: -16}

  require('fuzzysort').single('test', 'test')
  // {score: 0}

  require('fuzzysort').single('doesnt exist', 'target')
  // null
*/

// UMD (Universal Module Definition) for fuzzysort
;(function(root, UMD) {
  if(true) !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (UMD),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
  else if(typeof module === 'object' && module.exports) module.exports = UMD()
  else root.fuzzysort = UMD()
})(this, function UMD() { function fuzzysortNew(instanceOptions) {

  var fuzzysort = {

    single: function(search, target, options) {
      // search = fuzzysort.ensurePreparedSearch(search)
        if(typeof search !== 'object') {
          var searchPrepared = preparedSearchCache.get(search)
          if(searchPrepared !== undefined) search = searchPrepared
          else preparedSearchCache.set(search, search = fuzzysort.prepareSearch(search))
        }
      if(search.length === 0) return null

      // target = fuzzysort.ensurePrepared(target)
        if(typeof target !== 'object') {
          var targetPrepared = preparedCache.get(target)
          if(targetPrepared !== undefined) target = targetPrepared
          else preparedCache.set(target, target = fuzzysort.prepareFast(target))
        }
      if(target._targetLowerCodes.length === 0) return null

      return fuzzysort.algorithm(search, target, search[0])
    },

    go: function(search, targets, options) {
      // search = fuzzysort.ensurePreparedSearch(search)
        if(typeof search !== 'object') {
          var searchPrepared = preparedSearchCache.get(search)
          if(searchPrepared !== undefined) search = searchPrepared
          else preparedSearchCache.set(search, search = fuzzysort.prepareSearch(search))
        }
      if(search.length === 0) return noResults
      var searchLowerCode = search[0]

      var threshold = options && options.threshold || instanceOptions && instanceOptions.threshold || -Infinity
      var limit = options && options.limit || instanceOptions && instanceOptions.limit || Infinity
      var resultsLen = 0; var limitedCount = 0

      // This code is copy/pasted 3 times for performance reasons [options.keys, options.key, no keys]

      // options.keys
      if(options && options.keys) {
        var scoreFn = options.scoreFn || defaultScoreFn
        var keys = options.keys
        var keysLen = keys.length
        for(var i = targets.length - 1; i >= 0; --i) { var obj = targets[i]
          var objResults = new Array(keysLen)
          for (var keyI = keysLen - 1; keyI >= 0; --keyI) {
            var key = keys[keyI]
            var target = getValue(obj, key)

            // target = fuzzysort.ensurePrepared(target)
              if(typeof target !== 'object') {
                var targetPrepared = preparedCache.get(target)
                if(targetPrepared !== undefined) target = targetPrepared
                else preparedCache.set(target, target = fuzzysort.prepareFast(target))
              }
            if(target._targetLowerCodes.length === 0) { objResults[keyI] = null; continue }

            objResults[keyI] = fuzzysort.algorithm(search, target, searchLowerCode)
          }
          objResults.obj = obj // before scoreFn so scoreFn can use it
          var score = scoreFn(objResults)
          if(score === null) continue
          if(score < threshold) continue
          objResults.score = score
          if(resultsLen < limit) { q.add(objResults); ++resultsLen }
          else {
            ++limitedCount
            if(score > q.peek().score) q.replaceTop(objResults)
          }
        }

      // options.key
      } else if(options && options.key) {
        var key = options.key
        for(var i = targets.length - 1; i >= 0; --i) { var obj = targets[i]
          var target = getValue(obj, key)

          // target = fuzzysort.ensurePrepared(target)
            if(typeof target !== 'object') {
              var targetPrepared = preparedCache.get(target)
              if(targetPrepared !== undefined) target = targetPrepared
              else preparedCache.set(target, target = fuzzysort.prepareFast(target))
            }
          if(target._targetLowerCodes.length === 0) continue

          var result = fuzzysort.algorithm(search, target, searchLowerCode)
          if(result === null) continue
          if(result.score < threshold) continue
          // result = Object.create(result)
          // result = Object.assign({}, result)
          // result = {result:result}
          // result.obj = obj
          // result = {score:result.score, target:result.target, indexes:result.indexes, obj:obj} // hardcoded all public fields
          result = {target:result.target, _targetLowerCodes:null, _nextBeginningIndexes:null, score:result.score, indexes:result.indexes, obj:obj} // has to match hidden class
          if(resultsLen < limit) { q.add(result); ++resultsLen }
          else {
            ++limitedCount
            if(result.score > q.peek().score) q.replaceTop(result)
          }
        }

      // no keys
      } else {
        for(var i = targets.length - 1; i >= 0; --i) { var target = targets[i]
          // target = fuzzysort.ensurePrepared(target)
            if(typeof target !== 'object') {
              var targetPrepared = preparedCache.get(target)
              if(targetPrepared !== undefined) target = targetPrepared
              else preparedCache.set(target, target = fuzzysort.prepareFast(target))
            }
          if(target._targetLowerCodes.length === 0) continue

          var result = fuzzysort.algorithm(search, target, searchLowerCode)
          if(result === null) continue
          if(result.score < threshold) continue
          if(resultsLen < limit) { q.add(result); ++resultsLen }
          else {
            ++limitedCount
            if(result.score > q.peek().score) q.replaceTop(result)
          }
        }
      }

      if(resultsLen === 0) return noResults
      var results = new Array(resultsLen)
      for(var i = resultsLen - 1; i >= 0; --i) results[i] = q.poll()
      results.total = resultsLen + limitedCount
      return results
    },

    goAsync: function(search, targets, options) {
      var canceled = false
      var p = new Promise(function(resolve, reject) {
        // search = fuzzysort.ensurePreparedSearch(search)
          if(typeof search !== 'object') {
            var searchPrepared = preparedSearchCache.get(search)
            if(searchPrepared !== undefined) search = searchPrepared
            else preparedSearchCache.set(search, search = fuzzysort.prepareSearch(search))
          }
        if(search.length === 0) return resolve(noResults)
        var searchLowerCode = search[0]

        var itemsPerCheck = 1000
        var q = fastpriorityqueue()
        var iCurrent = targets.length - 1
        var threshold = options && options.threshold || instanceOptions && instanceOptions.threshold || -Infinity
        var limit = options && options.limit || instanceOptions && instanceOptions.limit || Infinity
        var resultsLen = 0; var limitedCount = 0
        function step() {
          if(canceled) return reject('canceled')

          var startMs = Date.now()

          // This code is copy/pasted 3 times for performance reasons [options.keys, options.key, no keys]

          // options.keys
          if(options && options.keys) {
            var scoreFn = options.scoreFn || defaultScoreFn
            var keys = options.keys
            var keysLen = keys.length
            for(var i = targets.length - 1; i >= 0; --i) { var obj = targets[i]
              var objResults = new Array(keysLen)
              for (var keyI = keysLen - 1; keyI >= 0; --keyI) {
                var key = keys[keyI]
                var target = getValue(obj, key)

                // target = fuzzysort.ensurePrepared(target)
                  if(typeof target !== 'object') {
                    var targetPrepared = preparedCache.get(target)
                    if(targetPrepared !== undefined) target = targetPrepared
                    else preparedCache.set(target, target = fuzzysort.prepareFast(target))
                  }
                if(target._targetLowerCodes.length === 0) { objResults[keyI] = null; continue }

                objResults[keyI] = fuzzysort.algorithm(search, target, searchLowerCode)
              }
              objResults.obj = obj // before scoreFn so scoreFn can use it
              var score = scoreFn(objResults)
              if(score === null) continue
              if(score < threshold) continue
              objResults.score = score
              if(resultsLen < limit) { q.add(objResults); ++resultsLen }
              else {
                ++limitedCount
                if(score > q.peek().score) q.replaceTop(objResults)
              }

              if(iCurrent%itemsPerCheck === 0) {
                if(Date.now() - startMs >= asyncInterval) {
                  isNode?setImmediate(step):setTimeout(step)
                  return
                }
              }
            }

          // options.key
          } else if(options && options.key) {
            var key = options.key
            for(; iCurrent >= 0; --iCurrent) { var obj = targets[iCurrent]
              var target = getValue(obj, key)

              // target = fuzzysort.ensurePrepared(target)
                if(typeof target !== 'object') {
                  var targetPrepared = preparedCache.get(target)
                  if(targetPrepared !== undefined) target = targetPrepared
                  else preparedCache.set(target, target = fuzzysort.prepareFast(target))
                }
              if(target._targetLowerCodes.length === 0) continue

              var result = fuzzysort.algorithm(search, target, searchLowerCode)
              if(result === null) continue
              if(result.score < threshold) continue
              // result = Object.create(result)
              // result = Object.assign({}, result)
              // result = {result:result}
              // result.obj = obj
              // result = {score:result.score, target:result.target, indexes:result.indexes, obj:obj} // hardcoded all public fields
              result = {target:result.target, _targetLowerCodes:null, _nextBeginningIndexes:null, score:result.score, indexes:result.indexes, obj:obj} // has to match hidden class
              if(resultsLen < limit) { q.add(result); ++resultsLen }
              else {
                ++limitedCount
                if(result.score > q.peek().score) q.replaceTop(result)
              }

              if(iCurrent%itemsPerCheck === 0) {
                if(Date.now() - startMs >= asyncInterval) {
                  isNode?setImmediate(step):setTimeout(step)
                  return
                }
              }
            }

          // no keys
          } else {
            for(; iCurrent >= 0; --iCurrent) { var target = targets[iCurrent]
              // target = fuzzysort.ensurePrepared(target)
                if(typeof target !== 'object') {
                  var targetPrepared = preparedCache.get(target)
                  if(targetPrepared !== undefined) target = targetPrepared
                  else preparedCache.set(target, target = fuzzysort.prepareFast(target))
                }
              if(target._targetLowerCodes.length === 0) continue

              var result = fuzzysort.algorithm(search, target, searchLowerCode)
              if(result === null) continue
              if(result.score < threshold) continue
              if(resultsLen < limit) { q.add(result); ++resultsLen }
              else {
                ++limitedCount
                if(result.score > q.peek().score) q.replaceTop(result)
              }

              if(iCurrent%itemsPerCheck === 0) {
                if(Date.now() - startMs >= asyncInterval) {
                  isNode?setImmediate(step):setTimeout(step)
                  return
                }
              }
            }
          }

          if(resultsLen === 0) return resolve(noResults)
          var results = new Array(resultsLen)
          for(var i = resultsLen - 1; i >= 0; --i) results[i] = q.poll()
          results.total = resultsLen + limitedCount
          resolve(results)
        }

        isNode?setImmediate(step):step()
      })
      p.cancel = function() { canceled = true }
      return p
    },

    highlight: function(result, hOpen, hClose) {
      if(result === null) return null
      if(hOpen === undefined) hOpen = '<b>'
      if(hClose === undefined) hClose = '</b>'
      var highlighted = ''
      var matchesIndex = 0
      var opened = false
      var target = result.target
      var targetLen = target.length
      var matchesBest = result.indexes
      for(var i = 0; i < targetLen; ++i) { var char = target[i]
        if(matchesBest[matchesIndex] === i) {
          ++matchesIndex
          if(!opened) { opened = true
            highlighted += hOpen
          }

          if(matchesIndex === matchesBest.length) {
            highlighted += char + hClose + target.substr(i+1)
            break
          }
        } else {
          if(opened) { opened = false
            highlighted += hClose
          }
        }
        highlighted += char
      }

      return highlighted
    },

    prepare: function(target) {
      return {target:target, _targetLowerCodes:fuzzysort.prepareLowerCodes(target), _nextBeginningIndexes:fuzzysort.prepareNextBeginningIndexes(target), score:null, indexes:null, obj:null}
    },
    prepareSearch: function(search) {
      return fuzzysort.prepareLowerCodes(search)
    },



    // Below this point is only internal code
    // Below this point is only internal code
    // Below this point is only internal code
    // Below this point is only internal code



    algorithm: function(searchLowerCodes, prepared, searchLowerCode) {
      var targetLowerCodes = prepared._targetLowerCodes
      var searchLen = searchLowerCodes.length
      var targetLen = targetLowerCodes.length
      var searchI = 0 // where we at
      var targetI = 0 // where you at
      var typoSimpleI = 0
      var matchesSimpleLen = 0

      // very basic fuzzy match; to remove non-matching targets ASAP!
      // walk through target. find sequential matches.
      // if all chars aren't found then exit
      for(;;) {
        var isMatch = searchLowerCode === targetLowerCodes[targetI]
        if(isMatch) {
          matchesSimple[matchesSimpleLen++] = targetI
          ++searchI; if(searchI === searchLen) break
          searchLowerCode = searchLowerCodes[typoSimpleI===0?searchI : (typoSimpleI===searchI?searchI+1 : (typoSimpleI===searchI-1?searchI-1 : searchI))]
        }

        ++targetI; if(targetI >= targetLen) { // Failed to find searchI
          // Check for typo or exit
          // we go as far as possible before trying to transpose
          // then we transpose backwards until we reach the beginning
          for(;;) {
            if(searchI <= 1) return null // not allowed to transpose first char
            if(typoSimpleI === 0) { // we haven't tried to transpose yet
              --searchI
              var searchLowerCodeNew = searchLowerCodes[searchI]
              if(searchLowerCode === searchLowerCodeNew) continue // doesn't make sense to transpose a repeat char
              typoSimpleI = searchI
            } else {
              if(typoSimpleI === 1) return null // reached the end of the line for transposing
              --typoSimpleI
              searchI = typoSimpleI
              searchLowerCode = searchLowerCodes[searchI + 1]
              var searchLowerCodeNew = searchLowerCodes[searchI]
              if(searchLowerCode === searchLowerCodeNew) continue // doesn't make sense to transpose a repeat char
            }
            matchesSimpleLen = searchI
            targetI = matchesSimple[matchesSimpleLen - 1] + 1
            break
          }
        }
      }

      var searchI = 0
      var typoStrictI = 0
      var successStrict = false
      var matchesStrictLen = 0

      var nextBeginningIndexes = prepared._nextBeginningIndexes
      if(nextBeginningIndexes === null) nextBeginningIndexes = prepared._nextBeginningIndexes = fuzzysort.prepareNextBeginningIndexes(prepared.target)
      var firstPossibleI = targetI = matchesSimple[0]===0 ? 0 : nextBeginningIndexes[matchesSimple[0]-1]

      // Our target string successfully matched all characters in sequence!
      // Let's try a more advanced and strict test to improve the score
      // only count it as a match if it's consecutive or a beginning character!
      if(targetI !== targetLen) for(;;) {
        if(targetI >= targetLen) {
          // We failed to find a good spot for this search char, go back to the previous search char and force it forward
          if(searchI <= 0) { // We failed to push chars forward for a better match
            // transpose, starting from the beginning
            ++typoStrictI; if(typoStrictI > searchLen-2) break
            if(searchLowerCodes[typoStrictI] === searchLowerCodes[typoStrictI+1]) continue // doesn't make sense to transpose a repeat char
            targetI = firstPossibleI
            continue
          }

          --searchI
          var lastMatch = matchesStrict[--matchesStrictLen]
          targetI = nextBeginningIndexes[lastMatch]

        } else {
          var isMatch = searchLowerCodes[typoStrictI===0?searchI : (typoStrictI===searchI?searchI+1 : (typoStrictI===searchI-1?searchI-1 : searchI))] === targetLowerCodes[targetI]
          if(isMatch) {
            matchesStrict[matchesStrictLen++] = targetI
            ++searchI; if(searchI === searchLen) { successStrict = true; break }
            ++targetI
          } else {
            targetI = nextBeginningIndexes[targetI]
          }
        }
      }

      { // tally up the score & keep track of matches for highlighting later
        if(successStrict) { var matchesBest = matchesStrict; var matchesBestLen = matchesStrictLen }
        else { var matchesBest = matchesSimple; var matchesBestLen = matchesSimpleLen }
        var score = 0
        var lastTargetI = -1
        for(var i = 0; i < searchLen; ++i) { var targetI = matchesBest[i]
          // score only goes down if they're not consecutive
          if(lastTargetI !== targetI - 1) score -= targetI
          lastTargetI = targetI
        }
        if(!successStrict) {
          score *= 1000
          if(typoSimpleI !== 0) score += typoPenalty
        } else {
          if(typoStrictI !== 0) score += typoPenalty
        }
        score -= targetLen - searchLen
        prepared.score = score
        prepared.indexes = new Array(matchesBestLen); for(var i = matchesBestLen - 1; i >= 0; --i) prepared.indexes[i] = matchesBest[i]

        return prepared
      }
    },

    prepareFast: function(target) {
      return {target:target, _targetLowerCodes:fuzzysort.prepareLowerCodes(target), _nextBeginningIndexes:null, score:null, indexes:null, obj:null}
    },

    prepareLowerCodes: function(str) {
      var lowerCodes = new Array(str.length)
      var lower = str.toLowerCase()
      var strLen = str.length
      for(var i = 0; i < strLen; ++i) lowerCodes[i] = lower.charCodeAt(i)
      return lowerCodes
    },
    prepareBeginningIndexes: function(target) {
      var targetLen = target.length
      var beginningIndexes = []; var beginningIndexesLen = 0
      var wasUpper = false
      var wasAlphanum = false
      for(var i = 0; i < targetLen; ++i) {
        var targetCode = target.charCodeAt(i)
        var isUpper = targetCode>=65&&targetCode<=90
        var isAlphanum = isUpper || targetCode>=97&&targetCode<=122 || targetCode>=48&&targetCode<=57
        var isBeginning = isUpper && !wasUpper || !wasAlphanum || !isAlphanum
        wasUpper = isUpper
        wasAlphanum = isAlphanum
        if(isBeginning) beginningIndexes[beginningIndexesLen++] = i
      }
      return beginningIndexes
    },
    prepareNextBeginningIndexes: function(target) {
      var targetLen = target.length
      var beginningIndexes = fuzzysort.prepareBeginningIndexes(target)
      var nextBeginningIndexes = new Array(targetLen)
      var lastIsBeginning = beginningIndexes[0]
      var lastIsBeginningI = 0
      for(var i = 0; i < targetLen; ++i) {
        if(lastIsBeginning > i) {
          nextBeginningIndexes[i] = lastIsBeginning
        } else {
          lastIsBeginning = beginningIndexes[++lastIsBeginningI]
          nextBeginningIndexes[i] = lastIsBeginning===undefined ? targetLen : lastIsBeginning
        }
      }
      return nextBeginningIndexes
    },

    // ensurePrepared: function(target) {
    //   if(typeof target === 'object') return target
    //   var targetPrepared = preparedCache.get(target)
    //   if(targetPrepared !== undefined) return targetPrepared
    //   preparedCache.set(target, targetPrepared = fuzzysort.prepareFast(target))
    //   return targetPrepared
    // },
    // ensurePreparedSearch: function(search) {
    //   if(typeof search === 'object') return search
    //   var searchPrepared = preparedSearchCache.get(search)
    //   if(searchPrepared !== undefined) return searchPrepared
    //   preparedSearchCache.set(search, searchPrepared = fuzzysort.prepareSearch(search))
    //   return searchPrepared
    // },

    cleanup: cleanup,
    new: fuzzysortNew,
  }
  return fuzzysort
} // fuzzysortNew

// This stuff is outside fuzzysortNew, because it's shared with instances of fuzzysort.new()
var isNode = "function" !== 'undefined' && typeof window === 'undefined'
// var MAX_INT = Number.MAX_SAFE_INTEGER
// var MIN_INT = Number.MIN_VALUE
var typoPenalty = -20
var asyncInterval = 32
var preparedCache = new Map()
var preparedSearchCache = new Map()
var noResults = []; noResults.total = 0
var matchesSimple = []; var matchesStrict = []
function cleanup() { preparedCache.clear(); preparedSearchCache.clear(); matchesSimple = []; matchesStrict = [] }
function defaultScoreFn(a) {
  var max = -Infinity
  for (var i = a.length - 1; i >= 0; --i) {
    var result = a[i]; if(result === null) continue
    var score = result.score
    if(score > max) max = score
  }
  if(max === -Infinity) return null
  return max
}

function getValue(obj, prop) {
  var tmp = obj[prop]; if(tmp !== undefined) return tmp
  var segs = prop
  if(!Array.isArray(prop)) segs = prop.split('.')
  var len = segs.length
  var i = -1
  while (obj && (++i < len)) obj = obj[segs[i]]
  return obj
}

// Hacked version of https://github.com/lemire/FastPriorityQueue.js
var fastpriorityqueue=function(){var r=[],o=0,e={};function n(){for(var e=0,n=r[e],c=1;c<o;){var f=c+1;e=c,f<o&&r[f].score<r[c].score&&(e=f),r[e-1>>1]=r[e],c=1+(e<<1)}for(var a=e-1>>1;e>0&&n.score<r[a].score;a=(e=a)-1>>1)r[e]=r[a];r[e]=n}return e.add=function(e){var n=o;r[o++]=e;for(var c=n-1>>1;n>0&&e.score<r[c].score;c=(n=c)-1>>1)r[n]=r[c];r[n]=e},e.poll=function(){if(0!==o){var e=r[0];return r[0]=r[--o],n(),e}},e.peek=function(e){if(0!==o)return r[0]},e.replaceTop=function(o){r[0]=o,n()},e};
var q = fastpriorityqueue()

return fuzzysortNew()
}) // UMD

// TODO: (performance) layout memory in an optimal way to go fast by avoiding cache misses

// TODO: (performance) preparedCache is a memory leak

// TODO: (like sublime) backslash === forwardslash

// TODO: (performance) i have no idea how well optizmied the allowing typos algorithm is

// TODO: (performance) search could assume to be lowercase?

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1390).setImmediate))

/***/ }),
/* 1217 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {// @flow


var key = '__global_unique_id__';

module.exports = function() {
  return global[key] = (global[key] || 0) + 1;
};

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1218 */
/***/ (function(module, exports) {

exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  var e, m
  var eLen = (nBytes * 8) - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var nBits = -7
  var i = isLE ? (nBytes - 1) : 0
  var d = isLE ? -1 : 1
  var s = buffer[offset + i]

  i += d

  e = s & ((1 << (-nBits)) - 1)
  s >>= (-nBits)
  nBits += eLen
  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}

  m = e & ((1 << (-nBits)) - 1)
  e >>= (-nBits)
  nBits += mLen
  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}

  if (e === 0) {
    e = 1 - eBias
  } else if (e === eMax) {
    return m ? NaN : ((s ? -1 : 1) * Infinity)
  } else {
    m = m + Math.pow(2, mLen)
    e = e - eBias
  }
  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
}

exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  var e, m, c
  var eLen = (nBytes * 8) - mLen - 1
  var eMax = (1 << eLen) - 1
  var eBias = eMax >> 1
  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  var i = isLE ? 0 : (nBytes - 1)
  var d = isLE ? 1 : -1
  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0

  value = Math.abs(value)

  if (isNaN(value) || value === Infinity) {
    m = isNaN(value) ? 1 : 0
    e = eMax
  } else {
    e = Math.floor(Math.log(value) / Math.LN2)
    if (value * (c = Math.pow(2, -e)) < 1) {
      e--
      c *= 2
    }
    if (e + eBias >= 1) {
      value += rt / c
    } else {
      value += rt * Math.pow(2, 1 - eBias)
    }
    if (value * c >= 2) {
      e++
      c /= 2
    }

    if (e + eBias >= eMax) {
      m = 0
      e = eMax
    } else if (e + eBias >= 1) {
      m = ((value * c) - 1) * Math.pow(2, mLen)
      e = e + eBias
    } else {
      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
      e = 0
    }
  }

  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}

  e = (e << mLen) | m
  eLen += mLen
  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}

  buffer[offset + i - d] |= s * 128
}


/***/ }),
/* 1219 */
/***/ (function(module, exports) {

var toString = {}.toString;

module.exports = Array.isArray || function (arr) {
  return toString.call(arr) == '[object Array]';
};


/***/ }),
/* 1220 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
/* eslint-disable no-proto */



var base64 = __webpack_require__(710)
var ieee754 = __webpack_require__(1218)
var isArray = __webpack_require__(1219)

exports.Buffer = Buffer
exports.SlowBuffer = SlowBuffer
exports.INSPECT_MAX_BYTES = 50

/**
 * If `Buffer.TYPED_ARRAY_SUPPORT`:
 *   === true    Use Uint8Array implementation (fastest)
 *   === false   Use Object implementation (most compatible, even IE6)
 *
 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
 * Opera 11.6+, iOS 4.2+.
 *
 * Due to various browser bugs, sometimes the Object implementation will be used even
 * when the browser supports typed arrays.
 *
 * Note:
 *
 *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
 *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
 *
 *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
 *
 *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
 *     incorrect length in some situations.

 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
 * get the Object implementation, which is slower but behaves correctly.
 */
Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  ? global.TYPED_ARRAY_SUPPORT
  : typedArraySupport()

/*
 * Export kMaxLength after typed array support is determined.
 */
exports.kMaxLength = kMaxLength()

function typedArraySupport () {
  try {
    var arr = new Uint8Array(1)
    arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
    return arr.foo() === 42 && // typed array instances can be augmented
        typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
        arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  } catch (e) {
    return false
  }
}

function kMaxLength () {
  return Buffer.TYPED_ARRAY_SUPPORT
    ? 0x7fffffff
    : 0x3fffffff
}

function createBuffer (that, length) {
  if (kMaxLength() < length) {
    throw new RangeError('Invalid typed array length')
  }
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    // Return an augmented `Uint8Array` instance, for best performance
    that = new Uint8Array(length)
    that.__proto__ = Buffer.prototype
  } else {
    // Fallback: Return an object instance of the Buffer class
    if (that === null) {
      that = new Buffer(length)
    }
    that.length = length
  }

  return that
}

/**
 * The Buffer constructor returns instances of `Uint8Array` that have their
 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
 * returns a single octet.
 *
 * The `Uint8Array` prototype remains unmodified.
 */

function Buffer (arg, encodingOrOffset, length) {
  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
    return new Buffer(arg, encodingOrOffset, length)
  }

  // Common case.
  if (typeof arg === 'number') {
    if (typeof encodingOrOffset === 'string') {
      throw new Error(
        'If encoding is specified then the first argument must be a string'
      )
    }
    return allocUnsafe(this, arg)
  }
  return from(this, arg, encodingOrOffset, length)
}

Buffer.poolSize = 8192 // not used by this implementation

// TODO: Legacy, not needed anymore. Remove in next major version.
Buffer._augment = function (arr) {
  arr.__proto__ = Buffer.prototype
  return arr
}

function from (that, value, encodingOrOffset, length) {
  if (typeof value === 'number') {
    throw new TypeError('"value" argument must not be a number')
  }

  if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
    return fromArrayBuffer(that, value, encodingOrOffset, length)
  }

  if (typeof value === 'string') {
    return fromString(that, value, encodingOrOffset)
  }

  return fromObject(that, value)
}

/**
 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
 * if value is a number.
 * Buffer.from(str[, encoding])
 * Buffer.from(array)
 * Buffer.from(buffer)
 * Buffer.from(arrayBuffer[, byteOffset[, length]])
 **/
Buffer.from = function (value, encodingOrOffset, length) {
  return from(null, value, encodingOrOffset, length)
}

if (Buffer.TYPED_ARRAY_SUPPORT) {
  Buffer.prototype.__proto__ = Uint8Array.prototype
  Buffer.__proto__ = Uint8Array
  if (typeof Symbol !== 'undefined' && Symbol.species &&
      Buffer[Symbol.species] === Buffer) {
    // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
    Object.defineProperty(Buffer, Symbol.species, {
      value: null,
      configurable: true
    })
  }
}

function assertSize (size) {
  if (typeof size !== 'number') {
    throw new TypeError('"size" argument must be a number')
  } else if (size < 0) {
    throw new RangeError('"size" argument must not be negative')
  }
}

function alloc (that, size, fill, encoding) {
  assertSize(size)
  if (size <= 0) {
    return createBuffer(that, size)
  }
  if (fill !== undefined) {
    // Only pay attention to encoding if it's a string. This
    // prevents accidentally sending in a number that would
    // be interpretted as a start offset.
    return typeof encoding === 'string'
      ? createBuffer(that, size).fill(fill, encoding)
      : createBuffer(that, size).fill(fill)
  }
  return createBuffer(that, size)
}

/**
 * Creates a new filled Buffer instance.
 * alloc(size[, fill[, encoding]])
 **/
Buffer.alloc = function (size, fill, encoding) {
  return alloc(null, size, fill, encoding)
}

function allocUnsafe (that, size) {
  assertSize(size)
  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  if (!Buffer.TYPED_ARRAY_SUPPORT) {
    for (var i = 0; i < size; ++i) {
      that[i] = 0
    }
  }
  return that
}

/**
 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
 * */
Buffer.allocUnsafe = function (size) {
  return allocUnsafe(null, size)
}
/**
 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
 */
Buffer.allocUnsafeSlow = function (size) {
  return allocUnsafe(null, size)
}

function fromString (that, string, encoding) {
  if (typeof encoding !== 'string' || encoding === '') {
    encoding = 'utf8'
  }

  if (!Buffer.isEncoding(encoding)) {
    throw new TypeError('"encoding" must be a valid string encoding')
  }

  var length = byteLength(string, encoding) | 0
  that = createBuffer(that, length)

  var actual = that.write(string, encoding)

  if (actual !== length) {
    // Writing a hex string, for example, that contains invalid characters will
    // cause everything after the first invalid character to be ignored. (e.g.
    // 'abxxcd' will be treated as 'ab')
    that = that.slice(0, actual)
  }

  return that
}

function fromArrayLike (that, array) {
  var length = array.length < 0 ? 0 : checked(array.length) | 0
  that = createBuffer(that, length)
  for (var i = 0; i < length; i += 1) {
    that[i] = array[i] & 255
  }
  return that
}

function fromArrayBuffer (that, array, byteOffset, length) {
  array.byteLength // this throws if `array` is not a valid ArrayBuffer

  if (byteOffset < 0 || array.byteLength < byteOffset) {
    throw new RangeError('\'offset\' is out of bounds')
  }

  if (array.byteLength < byteOffset + (length || 0)) {
    throw new RangeError('\'length\' is out of bounds')
  }

  if (byteOffset === undefined && length === undefined) {
    array = new Uint8Array(array)
  } else if (length === undefined) {
    array = new Uint8Array(array, byteOffset)
  } else {
    array = new Uint8Array(array, byteOffset, length)
  }

  if (Buffer.TYPED_ARRAY_SUPPORT) {
    // Return an augmented `Uint8Array` instance, for best performance
    that = array
    that.__proto__ = Buffer.prototype
  } else {
    // Fallback: Return an object instance of the Buffer class
    that = fromArrayLike(that, array)
  }
  return that
}

function fromObject (that, obj) {
  if (Buffer.isBuffer(obj)) {
    var len = checked(obj.length) | 0
    that = createBuffer(that, len)

    if (that.length === 0) {
      return that
    }

    obj.copy(that, 0, 0, len)
    return that
  }

  if (obj) {
    if ((typeof ArrayBuffer !== 'undefined' &&
        obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
      if (typeof obj.length !== 'number' || isnan(obj.length)) {
        return createBuffer(that, 0)
      }
      return fromArrayLike(that, obj)
    }

    if (obj.type === 'Buffer' && isArray(obj.data)) {
      return fromArrayLike(that, obj.data)
    }
  }

  throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
}

function checked (length) {
  // Note: cannot use `length < kMaxLength()` here because that fails when
  // length is NaN (which is otherwise coerced to zero.)
  if (length >= kMaxLength()) {
    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
                         'size: 0x' + kMaxLength().toString(16) + ' bytes')
  }
  return length | 0
}

function SlowBuffer (length) {
  if (+length != length) { // eslint-disable-line eqeqeq
    length = 0
  }
  return Buffer.alloc(+length)
}

Buffer.isBuffer = function isBuffer (b) {
  return !!(b != null && b._isBuffer)
}

Buffer.compare = function compare (a, b) {
  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
    throw new TypeError('Arguments must be Buffers')
  }

  if (a === b) return 0

  var x = a.length
  var y = b.length

  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
    if (a[i] !== b[i]) {
      x = a[i]
      y = b[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

Buffer.isEncoding = function isEncoding (encoding) {
  switch (String(encoding).toLowerCase()) {
    case 'hex':
    case 'utf8':
    case 'utf-8':
    case 'ascii':
    case 'latin1':
    case 'binary':
    case 'base64':
    case 'ucs2':
    case 'ucs-2':
    case 'utf16le':
    case 'utf-16le':
      return true
    default:
      return false
  }
}

Buffer.concat = function concat (list, length) {
  if (!isArray(list)) {
    throw new TypeError('"list" argument must be an Array of Buffers')
  }

  if (list.length === 0) {
    return Buffer.alloc(0)
  }

  var i
  if (length === undefined) {
    length = 0
    for (i = 0; i < list.length; ++i) {
      length += list[i].length
    }
  }

  var buffer = Buffer.allocUnsafe(length)
  var pos = 0
  for (i = 0; i < list.length; ++i) {
    var buf = list[i]
    if (!Buffer.isBuffer(buf)) {
      throw new TypeError('"list" argument must be an Array of Buffers')
    }
    buf.copy(buffer, pos)
    pos += buf.length
  }
  return buffer
}

function byteLength (string, encoding) {
  if (Buffer.isBuffer(string)) {
    return string.length
  }
  if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
    return string.byteLength
  }
  if (typeof string !== 'string') {
    string = '' + string
  }

  var len = string.length
  if (len === 0) return 0

  // Use a for loop to avoid recursion
  var loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'ascii':
      case 'latin1':
      case 'binary':
        return len
      case 'utf8':
      case 'utf-8':
      case undefined:
        return utf8ToBytes(string).length
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return len * 2
      case 'hex':
        return len >>> 1
      case 'base64':
        return base64ToBytes(string).length
      default:
        if (loweredCase) return utf8ToBytes(string).length // assume utf8
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}
Buffer.byteLength = byteLength

function slowToString (encoding, start, end) {
  var loweredCase = false

  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  // property of a typed array.

  // This behaves neither like String nor Uint8Array in that we set start/end
  // to their upper/lower bounds if the value passed is out of range.
  // undefined is handled specially as per ECMA-262 6th Edition,
  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  if (start === undefined || start < 0) {
    start = 0
  }
  // Return early if start > this.length. Done here to prevent potential uint32
  // coercion fail below.
  if (start > this.length) {
    return ''
  }

  if (end === undefined || end > this.length) {
    end = this.length
  }

  if (end <= 0) {
    return ''
  }

  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  end >>>= 0
  start >>>= 0

  if (end <= start) {
    return ''
  }

  if (!encoding) encoding = 'utf8'

  while (true) {
    switch (encoding) {
      case 'hex':
        return hexSlice(this, start, end)

      case 'utf8':
      case 'utf-8':
        return utf8Slice(this, start, end)

      case 'ascii':
        return asciiSlice(this, start, end)

      case 'latin1':
      case 'binary':
        return latin1Slice(this, start, end)

      case 'base64':
        return base64Slice(this, start, end)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return utf16leSlice(this, start, end)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = (encoding + '').toLowerCase()
        loweredCase = true
    }
  }
}

// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
// Buffer instances.
Buffer.prototype._isBuffer = true

function swap (b, n, m) {
  var i = b[n]
  b[n] = b[m]
  b[m] = i
}

Buffer.prototype.swap16 = function swap16 () {
  var len = this.length
  if (len % 2 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 16-bits')
  }
  for (var i = 0; i < len; i += 2) {
    swap(this, i, i + 1)
  }
  return this
}

Buffer.prototype.swap32 = function swap32 () {
  var len = this.length
  if (len % 4 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 32-bits')
  }
  for (var i = 0; i < len; i += 4) {
    swap(this, i, i + 3)
    swap(this, i + 1, i + 2)
  }
  return this
}

Buffer.prototype.swap64 = function swap64 () {
  var len = this.length
  if (len % 8 !== 0) {
    throw new RangeError('Buffer size must be a multiple of 64-bits')
  }
  for (var i = 0; i < len; i += 8) {
    swap(this, i, i + 7)
    swap(this, i + 1, i + 6)
    swap(this, i + 2, i + 5)
    swap(this, i + 3, i + 4)
  }
  return this
}

Buffer.prototype.toString = function toString () {
  var length = this.length | 0
  if (length === 0) return ''
  if (arguments.length === 0) return utf8Slice(this, 0, length)
  return slowToString.apply(this, arguments)
}

Buffer.prototype.equals = function equals (b) {
  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  if (this === b) return true
  return Buffer.compare(this, b) === 0
}

Buffer.prototype.inspect = function inspect () {
  var str = ''
  var max = exports.INSPECT_MAX_BYTES
  if (this.length > 0) {
    str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
    if (this.length > max) str += ' ... '
  }
  return '<Buffer ' + str + '>'
}

Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  if (!Buffer.isBuffer(target)) {
    throw new TypeError('Argument must be a Buffer')
  }

  if (start === undefined) {
    start = 0
  }
  if (end === undefined) {
    end = target ? target.length : 0
  }
  if (thisStart === undefined) {
    thisStart = 0
  }
  if (thisEnd === undefined) {
    thisEnd = this.length
  }

  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
    throw new RangeError('out of range index')
  }

  if (thisStart >= thisEnd && start >= end) {
    return 0
  }
  if (thisStart >= thisEnd) {
    return -1
  }
  if (start >= end) {
    return 1
  }

  start >>>= 0
  end >>>= 0
  thisStart >>>= 0
  thisEnd >>>= 0

  if (this === target) return 0

  var x = thisEnd - thisStart
  var y = end - start
  var len = Math.min(x, y)

  var thisCopy = this.slice(thisStart, thisEnd)
  var targetCopy = target.slice(start, end)

  for (var i = 0; i < len; ++i) {
    if (thisCopy[i] !== targetCopy[i]) {
      x = thisCopy[i]
      y = targetCopy[i]
      break
    }
  }

  if (x < y) return -1
  if (y < x) return 1
  return 0
}

// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
//
// Arguments:
// - buffer - a Buffer to search
// - val - a string, Buffer, or number
// - byteOffset - an index into `buffer`; will be clamped to an int32
// - encoding - an optional encoding, relevant is val is a string
// - dir - true for indexOf, false for lastIndexOf
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  // Empty buffer means no match
  if (buffer.length === 0) return -1

  // Normalize byteOffset
  if (typeof byteOffset === 'string') {
    encoding = byteOffset
    byteOffset = 0
  } else if (byteOffset > 0x7fffffff) {
    byteOffset = 0x7fffffff
  } else if (byteOffset < -0x80000000) {
    byteOffset = -0x80000000
  }
  byteOffset = +byteOffset  // Coerce to Number.
  if (isNaN(byteOffset)) {
    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
    byteOffset = dir ? 0 : (buffer.length - 1)
  }

  // Normalize byteOffset: negative offsets start from the end of the buffer
  if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  if (byteOffset >= buffer.length) {
    if (dir) return -1
    else byteOffset = buffer.length - 1
  } else if (byteOffset < 0) {
    if (dir) byteOffset = 0
    else return -1
  }

  // Normalize val
  if (typeof val === 'string') {
    val = Buffer.from(val, encoding)
  }

  // Finally, search either indexOf (if dir is true) or lastIndexOf
  if (Buffer.isBuffer(val)) {
    // Special case: looking for empty string/buffer always fails
    if (val.length === 0) {
      return -1
    }
    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  } else if (typeof val === 'number') {
    val = val & 0xFF // Search for a byte value [0-255]
    if (Buffer.TYPED_ARRAY_SUPPORT &&
        typeof Uint8Array.prototype.indexOf === 'function') {
      if (dir) {
        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
      } else {
        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
      }
    }
    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  }

  throw new TypeError('val must be string, number or Buffer')
}

function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  var indexSize = 1
  var arrLength = arr.length
  var valLength = val.length

  if (encoding !== undefined) {
    encoding = String(encoding).toLowerCase()
    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
        encoding === 'utf16le' || encoding === 'utf-16le') {
      if (arr.length < 2 || val.length < 2) {
        return -1
      }
      indexSize = 2
      arrLength /= 2
      valLength /= 2
      byteOffset /= 2
    }
  }

  function read (buf, i) {
    if (indexSize === 1) {
      return buf[i]
    } else {
      return buf.readUInt16BE(i * indexSize)
    }
  }

  var i
  if (dir) {
    var foundIndex = -1
    for (i = byteOffset; i < arrLength; i++) {
      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
        if (foundIndex === -1) foundIndex = i
        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
      } else {
        if (foundIndex !== -1) i -= i - foundIndex
        foundIndex = -1
      }
    }
  } else {
    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
    for (i = byteOffset; i >= 0; i--) {
      var found = true
      for (var j = 0; j < valLength; j++) {
        if (read(arr, i + j) !== read(val, j)) {
          found = false
          break
        }
      }
      if (found) return i
    }
  }

  return -1
}

Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  return this.indexOf(val, byteOffset, encoding) !== -1
}

Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
}

Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
}

function hexWrite (buf, string, offset, length) {
  offset = Number(offset) || 0
  var remaining = buf.length - offset
  if (!length) {
    length = remaining
  } else {
    length = Number(length)
    if (length > remaining) {
      length = remaining
    }
  }

  // must be an even number of digits
  var strLen = string.length
  if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')

  if (length > strLen / 2) {
    length = strLen / 2
  }
  for (var i = 0; i < length; ++i) {
    var parsed = parseInt(string.substr(i * 2, 2), 16)
    if (isNaN(parsed)) return i
    buf[offset + i] = parsed
  }
  return i
}

function utf8Write (buf, string, offset, length) {
  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
}

function asciiWrite (buf, string, offset, length) {
  return blitBuffer(asciiToBytes(string), buf, offset, length)
}

function latin1Write (buf, string, offset, length) {
  return asciiWrite(buf, string, offset, length)
}

function base64Write (buf, string, offset, length) {
  return blitBuffer(base64ToBytes(string), buf, offset, length)
}

function ucs2Write (buf, string, offset, length) {
  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
}

Buffer.prototype.write = function write (string, offset, length, encoding) {
  // Buffer#write(string)
  if (offset === undefined) {
    encoding = 'utf8'
    length = this.length
    offset = 0
  // Buffer#write(string, encoding)
  } else if (length === undefined && typeof offset === 'string') {
    encoding = offset
    length = this.length
    offset = 0
  // Buffer#write(string, offset[, length][, encoding])
  } else if (isFinite(offset)) {
    offset = offset | 0
    if (isFinite(length)) {
      length = length | 0
      if (encoding === undefined) encoding = 'utf8'
    } else {
      encoding = length
      length = undefined
    }
  // legacy write(string, encoding, offset, length) - remove in v0.13
  } else {
    throw new Error(
      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
    )
  }

  var remaining = this.length - offset
  if (length === undefined || length > remaining) length = remaining

  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
    throw new RangeError('Attempt to write outside buffer bounds')
  }

  if (!encoding) encoding = 'utf8'

  var loweredCase = false
  for (;;) {
    switch (encoding) {
      case 'hex':
        return hexWrite(this, string, offset, length)

      case 'utf8':
      case 'utf-8':
        return utf8Write(this, string, offset, length)

      case 'ascii':
        return asciiWrite(this, string, offset, length)

      case 'latin1':
      case 'binary':
        return latin1Write(this, string, offset, length)

      case 'base64':
        // Warning: maxLength not taken into account in base64Write
        return base64Write(this, string, offset, length)

      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return ucs2Write(this, string, offset, length)

      default:
        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
        encoding = ('' + encoding).toLowerCase()
        loweredCase = true
    }
  }
}

Buffer.prototype.toJSON = function toJSON () {
  return {
    type: 'Buffer',
    data: Array.prototype.slice.call(this._arr || this, 0)
  }
}

function base64Slice (buf, start, end) {
  if (start === 0 && end === buf.length) {
    return base64.fromByteArray(buf)
  } else {
    return base64.fromByteArray(buf.slice(start, end))
  }
}

function utf8Slice (buf, start, end) {
  end = Math.min(buf.length, end)
  var res = []

  var i = start
  while (i < end) {
    var firstByte = buf[i]
    var codePoint = null
    var bytesPerSequence = (firstByte > 0xEF) ? 4
      : (firstByte > 0xDF) ? 3
      : (firstByte > 0xBF) ? 2
      : 1

    if (i + bytesPerSequence <= end) {
      var secondByte, thirdByte, fourthByte, tempCodePoint

      switch (bytesPerSequence) {
        case 1:
          if (firstByte < 0x80) {
            codePoint = firstByte
          }
          break
        case 2:
          secondByte = buf[i + 1]
          if ((secondByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
            if (tempCodePoint > 0x7F) {
              codePoint = tempCodePoint
            }
          }
          break
        case 3:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
              codePoint = tempCodePoint
            }
          }
          break
        case 4:
          secondByte = buf[i + 1]
          thirdByte = buf[i + 2]
          fourthByte = buf[i + 3]
          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
              codePoint = tempCodePoint
            }
          }
      }
    }

    if (codePoint === null) {
      // we did not generate a valid codePoint so insert a
      // replacement char (U+FFFD) and advance only 1 byte
      codePoint = 0xFFFD
      bytesPerSequence = 1
    } else if (codePoint > 0xFFFF) {
      // encode to utf16 (surrogate pair dance)
      codePoint -= 0x10000
      res.push(codePoint >>> 10 & 0x3FF | 0xD800)
      codePoint = 0xDC00 | codePoint & 0x3FF
    }

    res.push(codePoint)
    i += bytesPerSequence
  }

  return decodeCodePointsArray(res)
}

// Based on http://stackoverflow.com/a/22747272/680742, the browser with
// the lowest limit is Chrome, with 0x10000 args.
// We go 1 magnitude less, for safety
var MAX_ARGUMENTS_LENGTH = 0x1000

function decodeCodePointsArray (codePoints) {
  var len = codePoints.length
  if (len <= MAX_ARGUMENTS_LENGTH) {
    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  }

  // Decode in chunks to avoid "call stack size exceeded".
  var res = ''
  var i = 0
  while (i < len) {
    res += String.fromCharCode.apply(
      String,
      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
    )
  }
  return res
}

function asciiSlice (buf, start, end) {
  var ret = ''
  end = Math.min(buf.length, end)

  for (var i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i] & 0x7F)
  }
  return ret
}

function latin1Slice (buf, start, end) {
  var ret = ''
  end = Math.min(buf.length, end)

  for (var i = start; i < end; ++i) {
    ret += String.fromCharCode(buf[i])
  }
  return ret
}

function hexSlice (buf, start, end) {
  var len = buf.length

  if (!start || start < 0) start = 0
  if (!end || end < 0 || end > len) end = len

  var out = ''
  for (var i = start; i < end; ++i) {
    out += toHex(buf[i])
  }
  return out
}

function utf16leSlice (buf, start, end) {
  var bytes = buf.slice(start, end)
  var res = ''
  for (var i = 0; i < bytes.length; i += 2) {
    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  }
  return res
}

Buffer.prototype.slice = function slice (start, end) {
  var len = this.length
  start = ~~start
  end = end === undefined ? len : ~~end

  if (start < 0) {
    start += len
    if (start < 0) start = 0
  } else if (start > len) {
    start = len
  }

  if (end < 0) {
    end += len
    if (end < 0) end = 0
  } else if (end > len) {
    end = len
  }

  if (end < start) end = start

  var newBuf
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    newBuf = this.subarray(start, end)
    newBuf.__proto__ = Buffer.prototype
  } else {
    var sliceLen = end - start
    newBuf = new Buffer(sliceLen, undefined)
    for (var i = 0; i < sliceLen; ++i) {
      newBuf[i] = this[i + start]
    }
  }

  return newBuf
}

/*
 * Need to make sure that buffer isn't trying to write out of bounds.
 */
function checkOffset (offset, ext, length) {
  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
}

Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  var val = this[offset]
  var mul = 1
  var i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }

  return val
}

Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) {
    checkOffset(offset, byteLength, this.length)
  }

  var val = this[offset + --byteLength]
  var mul = 1
  while (byteLength > 0 && (mul *= 0x100)) {
    val += this[offset + --byteLength] * mul
  }

  return val
}

Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 1, this.length)
  return this[offset]
}

Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  return this[offset] | (this[offset + 1] << 8)
}

Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  return (this[offset] << 8) | this[offset + 1]
}

Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return ((this[offset]) |
      (this[offset + 1] << 8) |
      (this[offset + 2] << 16)) +
      (this[offset + 3] * 0x1000000)
}

Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] * 0x1000000) +
    ((this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    this[offset + 3])
}

Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  var val = this[offset]
  var mul = 1
  var i = 0
  while (++i < byteLength && (mul *= 0x100)) {
    val += this[offset + i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) checkOffset(offset, byteLength, this.length)

  var i = byteLength
  var mul = 1
  var val = this[offset + --i]
  while (i > 0 && (mul *= 0x100)) {
    val += this[offset + --i] * mul
  }
  mul *= 0x80

  if (val >= mul) val -= Math.pow(2, 8 * byteLength)

  return val
}

Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 1, this.length)
  if (!(this[offset] & 0x80)) return (this[offset])
  return ((0xff - this[offset] + 1) * -1)
}

Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  var val = this[offset] | (this[offset + 1] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 2, this.length)
  var val = this[offset + 1] | (this[offset] << 8)
  return (val & 0x8000) ? val | 0xFFFF0000 : val
}

Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset]) |
    (this[offset + 1] << 8) |
    (this[offset + 2] << 16) |
    (this[offset + 3] << 24)
}

Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)

  return (this[offset] << 24) |
    (this[offset + 1] << 16) |
    (this[offset + 2] << 8) |
    (this[offset + 3])
}

Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, true, 23, 4)
}

Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 4, this.length)
  return ieee754.read(this, offset, false, 23, 4)
}

Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, true, 52, 8)
}

Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  if (!noAssert) checkOffset(offset, 8, this.length)
  return ieee754.read(this, offset, false, 52, 8)
}

function checkInt (buf, value, offset, ext, max, min) {
  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
}

Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) {
    var maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  var mul = 1
  var i = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  byteLength = byteLength | 0
  if (!noAssert) {
    var maxBytes = Math.pow(2, 8 * byteLength) - 1
    checkInt(this, value, offset, byteLength, maxBytes, 0)
  }

  var i = byteLength - 1
  var mul = 1
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    this[offset + i] = (value / mul) & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  this[offset] = (value & 0xff)
  return offset + 1
}

function objectWriteUInt16 (buf, value, offset, littleEndian) {
  if (value < 0) value = 0xffff + value + 1
  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
      (littleEndian ? i : 1 - i) * 8
  }
}

Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff)
    this[offset + 1] = (value >>> 8)
  } else {
    objectWriteUInt16(this, value, offset, true)
  }
  return offset + 2
}

Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 8)
    this[offset + 1] = (value & 0xff)
  } else {
    objectWriteUInt16(this, value, offset, false)
  }
  return offset + 2
}

function objectWriteUInt32 (buf, value, offset, littleEndian) {
  if (value < 0) value = 0xffffffff + value + 1
  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  }
}

Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset + 3] = (value >>> 24)
    this[offset + 2] = (value >>> 16)
    this[offset + 1] = (value >>> 8)
    this[offset] = (value & 0xff)
  } else {
    objectWriteUInt32(this, value, offset, true)
  }
  return offset + 4
}

Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 24)
    this[offset + 1] = (value >>> 16)
    this[offset + 2] = (value >>> 8)
    this[offset + 3] = (value & 0xff)
  } else {
    objectWriteUInt32(this, value, offset, false)
  }
  return offset + 4
}

Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  var i = 0
  var mul = 1
  var sub = 0
  this[offset] = value & 0xFF
  while (++i < byteLength && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) {
    var limit = Math.pow(2, 8 * byteLength - 1)

    checkInt(this, value, offset, byteLength, limit - 1, -limit)
  }

  var i = byteLength - 1
  var mul = 1
  var sub = 0
  this[offset + i] = value & 0xFF
  while (--i >= 0 && (mul *= 0x100)) {
    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
      sub = 1
    }
    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  }

  return offset + byteLength
}

Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  if (value < 0) value = 0xff + value + 1
  this[offset] = (value & 0xff)
  return offset + 1
}

Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff)
    this[offset + 1] = (value >>> 8)
  } else {
    objectWriteUInt16(this, value, offset, true)
  }
  return offset + 2
}

Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 8)
    this[offset + 1] = (value & 0xff)
  } else {
    objectWriteUInt16(this, value, offset, false)
  }
  return offset + 2
}

Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value & 0xff)
    this[offset + 1] = (value >>> 8)
    this[offset + 2] = (value >>> 16)
    this[offset + 3] = (value >>> 24)
  } else {
    objectWriteUInt32(this, value, offset, true)
  }
  return offset + 4
}

Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  value = +value
  offset = offset | 0
  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  if (value < 0) value = 0xffffffff + value + 1
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    this[offset] = (value >>> 24)
    this[offset + 1] = (value >>> 16)
    this[offset + 2] = (value >>> 8)
    this[offset + 3] = (value & 0xff)
  } else {
    objectWriteUInt32(this, value, offset, false)
  }
  return offset + 4
}

function checkIEEE754 (buf, value, offset, ext, max, min) {
  if (offset + ext > buf.length) throw new RangeError('Index out of range')
  if (offset < 0) throw new RangeError('Index out of range')
}

function writeFloat (buf, value, offset, littleEndian, noAssert) {
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  }
  ieee754.write(buf, value, offset, littleEndian, 23, 4)
  return offset + 4
}

Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  return writeFloat(this, value, offset, true, noAssert)
}

Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  return writeFloat(this, value, offset, false, noAssert)
}

function writeDouble (buf, value, offset, littleEndian, noAssert) {
  if (!noAssert) {
    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  }
  ieee754.write(buf, value, offset, littleEndian, 52, 8)
  return offset + 8
}

Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  return writeDouble(this, value, offset, true, noAssert)
}

Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  return writeDouble(this, value, offset, false, noAssert)
}

// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  if (!start) start = 0
  if (!end && end !== 0) end = this.length
  if (targetStart >= target.length) targetStart = target.length
  if (!targetStart) targetStart = 0
  if (end > 0 && end < start) end = start

  // Copy 0 bytes; we're done
  if (end === start) return 0
  if (target.length === 0 || this.length === 0) return 0

  // Fatal error conditions
  if (targetStart < 0) {
    throw new RangeError('targetStart out of bounds')
  }
  if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  if (end < 0) throw new RangeError('sourceEnd out of bounds')

  // Are we oob?
  if (end > this.length) end = this.length
  if (target.length - targetStart < end - start) {
    end = target.length - targetStart + start
  }

  var len = end - start
  var i

  if (this === target && start < targetStart && targetStart < end) {
    // descending copy from end
    for (i = len - 1; i >= 0; --i) {
      target[i + targetStart] = this[i + start]
    }
  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
    // ascending copy from start
    for (i = 0; i < len; ++i) {
      target[i + targetStart] = this[i + start]
    }
  } else {
    Uint8Array.prototype.set.call(
      target,
      this.subarray(start, start + len),
      targetStart
    )
  }

  return len
}

// Usage:
//    buffer.fill(number[, offset[, end]])
//    buffer.fill(buffer[, offset[, end]])
//    buffer.fill(string[, offset[, end]][, encoding])
Buffer.prototype.fill = function fill (val, start, end, encoding) {
  // Handle string cases:
  if (typeof val === 'string') {
    if (typeof start === 'string') {
      encoding = start
      start = 0
      end = this.length
    } else if (typeof end === 'string') {
      encoding = end
      end = this.length
    }
    if (val.length === 1) {
      var code = val.charCodeAt(0)
      if (code < 256) {
        val = code
      }
    }
    if (encoding !== undefined && typeof encoding !== 'string') {
      throw new TypeError('encoding must be a string')
    }
    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
      throw new TypeError('Unknown encoding: ' + encoding)
    }
  } else if (typeof val === 'number') {
    val = val & 255
  }

  // Invalid ranges are not set to a default, so can range check early.
  if (start < 0 || this.length < start || this.length < end) {
    throw new RangeError('Out of range index')
  }

  if (end <= start) {
    return this
  }

  start = start >>> 0
  end = end === undefined ? this.length : end >>> 0

  if (!val) val = 0

  var i
  if (typeof val === 'number') {
    for (i = start; i < end; ++i) {
      this[i] = val
    }
  } else {
    var bytes = Buffer.isBuffer(val)
      ? val
      : utf8ToBytes(new Buffer(val, encoding).toString())
    var len = bytes.length
    for (i = 0; i < end - start; ++i) {
      this[i + start] = bytes[i % len]
    }
  }

  return this
}

// HELPER FUNCTIONS
// ================

var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g

function base64clean (str) {
  // Node strips out invalid characters like \n and \t from the string, base64-js does not
  str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  // Node converts strings with length < 2 to ''
  if (str.length < 2) return ''
  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  while (str.length % 4 !== 0) {
    str = str + '='
  }
  return str
}

function stringtrim (str) {
  if (str.trim) return str.trim()
  return str.replace(/^\s+|\s+$/g, '')
}

function toHex (n) {
  if (n < 16) return '0' + n.toString(16)
  return n.toString(16)
}

function utf8ToBytes (string, units) {
  units = units || Infinity
  var codePoint
  var length = string.length
  var leadSurrogate = null
  var bytes = []

  for (var i = 0; i < length; ++i) {
    codePoint = string.charCodeAt(i)

    // is surrogate component
    if (codePoint > 0xD7FF && codePoint < 0xE000) {
      // last char was a lead
      if (!leadSurrogate) {
        // no lead yet
        if (codePoint > 0xDBFF) {
          // unexpected trail
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        } else if (i + 1 === length) {
          // unpaired lead
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
          continue
        }

        // valid lead
        leadSurrogate = codePoint

        continue
      }

      // 2 leads in a row
      if (codePoint < 0xDC00) {
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
        leadSurrogate = codePoint
        continue
      }

      // valid surrogate pair
      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
    } else if (leadSurrogate) {
      // valid bmp char, but last char was a lead
      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
    }

    leadSurrogate = null

    // encode utf8
    if (codePoint < 0x80) {
      if ((units -= 1) < 0) break
      bytes.push(codePoint)
    } else if (codePoint < 0x800) {
      if ((units -= 2) < 0) break
      bytes.push(
        codePoint >> 0x6 | 0xC0,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x10000) {
      if ((units -= 3) < 0) break
      bytes.push(
        codePoint >> 0xC | 0xE0,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else if (codePoint < 0x110000) {
      if ((units -= 4) < 0) break
      bytes.push(
        codePoint >> 0x12 | 0xF0,
        codePoint >> 0xC & 0x3F | 0x80,
        codePoint >> 0x6 & 0x3F | 0x80,
        codePoint & 0x3F | 0x80
      )
    } else {
      throw new Error('Invalid code point')
    }
  }

  return bytes
}

function asciiToBytes (str) {
  var byteArray = []
  for (var i = 0; i < str.length; ++i) {
    // Node's code seems to be doing this and not & 0x7F..
    byteArray.push(str.charCodeAt(i) & 0xFF)
  }
  return byteArray
}

function utf16leToBytes (str, units) {
  var c, hi, lo
  var byteArray = []
  for (var i = 0; i < str.length; ++i) {
    if ((units -= 2) < 0) break

    c = str.charCodeAt(i)
    hi = c >> 8
    lo = c % 256
    byteArray.push(lo)
    byteArray.push(hi)
  }

  return byteArray
}

function base64ToBytes (str) {
  return base64.toByteArray(base64clean(str))
}

function blitBuffer (src, dst, offset, length) {
  for (var i = 0; i < length; ++i) {
    if ((i + offset >= dst.length) || (i >= src.length)) break
    dst[i + offset] = src[i]
  }
  return i
}

function isnan (val) {
  return val !== val // eslint-disable-line no-self-compare
}

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1221 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var keysShim;
if (!Object.keys) {
	// modified from https://github.com/es-shims/es5-shim
	var has = Object.prototype.hasOwnProperty;
	var toStr = Object.prototype.toString;
	var isArgs = __webpack_require__(359); // eslint-disable-line global-require
	var isEnumerable = Object.prototype.propertyIsEnumerable;
	var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
	var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
	var dontEnums = [
		'toString',
		'toLocaleString',
		'valueOf',
		'hasOwnProperty',
		'isPrototypeOf',
		'propertyIsEnumerable',
		'constructor'
	];
	var equalsConstructorPrototype = function (o) {
		var ctor = o.constructor;
		return ctor && ctor.prototype === o;
	};
	var excludedKeys = {
		$applicationCache: true,
		$console: true,
		$external: true,
		$frame: true,
		$frameElement: true,
		$frames: true,
		$innerHeight: true,
		$innerWidth: true,
		$onmozfullscreenchange: true,
		$onmozfullscreenerror: true,
		$outerHeight: true,
		$outerWidth: true,
		$pageXOffset: true,
		$pageYOffset: true,
		$parent: true,
		$scrollLeft: true,
		$scrollTop: true,
		$scrollX: true,
		$scrollY: true,
		$self: true,
		$webkitIndexedDB: true,
		$webkitStorageInfo: true,
		$window: true
	};
	var hasAutomationEqualityBug = (function () {
		/* global window */
		if (typeof window === 'undefined') { return false; }
		for (var k in window) {
			try {
				if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
					try {
						equalsConstructorPrototype(window[k]);
					} catch (e) {
						return true;
					}
				}
			} catch (e) {
				return true;
			}
		}
		return false;
	}());
	var equalsConstructorPrototypeIfNotBuggy = function (o) {
		/* global window */
		if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
			return equalsConstructorPrototype(o);
		}
		try {
			return equalsConstructorPrototype(o);
		} catch (e) {
			return false;
		}
	};

	keysShim = function keys(object) {
		var isObject = object !== null && typeof object === 'object';
		var isFunction = toStr.call(object) === '[object Function]';
		var isArguments = isArgs(object);
		var isString = isObject && toStr.call(object) === '[object String]';
		var theKeys = [];

		if (!isObject && !isFunction && !isArguments) {
			throw new TypeError('Object.keys called on a non-object');
		}

		var skipProto = hasProtoEnumBug && isFunction;
		if (isString && object.length > 0 && !has.call(object, 0)) {
			for (var i = 0; i < object.length; ++i) {
				theKeys.push(String(i));
			}
		}

		if (isArguments && object.length > 0) {
			for (var j = 0; j < object.length; ++j) {
				theKeys.push(String(j));
			}
		} else {
			for (var name in object) {
				if (!(skipProto && name === 'prototype') && has.call(object, name)) {
					theKeys.push(String(name));
				}
			}
		}

		if (hasDontEnumBug) {
			var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);

			for (var k = 0; k < dontEnums.length; ++k) {
				if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
					theKeys.push(dontEnums[k]);
				}
			}
		}
		return theKeys;
	};
}
module.exports = keysShim;


/***/ }),
/* 1222 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var slice = Array.prototype.slice;
var isArgs = __webpack_require__(359);

var origKeys = Object.keys;
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(1221);

var originalKeys = Object.keys;

keysShim.shim = function shimObjectKeys() {
	if (Object.keys) {
		var keysWorksWithArguments = (function () {
			// Safari 5.0 bug
			var args = Object.keys(arguments);
			return args && args.length === arguments.length;
		}(1, 2));
		if (!keysWorksWithArguments) {
			Object.keys = function keys(object) { // eslint-disable-line func-name-matching
				if (isArgs(object)) {
					return originalKeys(slice.call(object));
				}
				return originalKeys(object);
			};
		}
	} else {
		Object.keys = keysShim;
	}
	return Object.keys || keysShim;
};

module.exports = keysShim;


/***/ }),
/* 1223 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// Top level file is just a mixin of submodules & constants


var assign    = __webpack_require__(83).assign;

var deflate   = __webpack_require__(1224);
var inflate   = __webpack_require__(1225);
var constants = __webpack_require__(362);

var pako = {};

assign(pako, deflate, inflate, constants);

module.exports = pako;


/***/ }),
/* 1224 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";



var zlib_deflate = __webpack_require__(1226);
var utils        = __webpack_require__(83);
var strings      = __webpack_require__(360);
var msg          = __webpack_require__(245);
var ZStream      = __webpack_require__(364);

var toString = Object.prototype.toString;

/* Public constants ==========================================================*/
/* ===========================================================================*/

var Z_NO_FLUSH      = 0;
var Z_FINISH        = 4;

var Z_OK            = 0;
var Z_STREAM_END    = 1;
var Z_SYNC_FLUSH    = 2;

var Z_DEFAULT_COMPRESSION = -1;

var Z_DEFAULT_STRATEGY    = 0;

var Z_DEFLATED  = 8;

/* ===========================================================================*/


/**
 * class Deflate
 *
 * Generic JS-style wrapper for zlib calls. If you don't need
 * streaming behaviour - use more simple functions: [[deflate]],
 * [[deflateRaw]] and [[gzip]].
 **/

/* internal
 * Deflate.chunks -> Array
 *
 * Chunks of output data, if [[Deflate#onData]] not overridden.
 **/

/**
 * Deflate.result -> Uint8Array|Array
 *
 * Compressed result, generated by default [[Deflate#onData]]
 * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
 * (call [[Deflate#push]] with `Z_FINISH` / `true` param)  or if you
 * push a chunk with explicit flush (call [[Deflate#push]] with
 * `Z_SYNC_FLUSH` param).
 **/

/**
 * Deflate.err -> Number
 *
 * Error code after deflate finished. 0 (Z_OK) on success.
 * You will not need it in real life, because deflate errors
 * are possible only on wrong options or bad `onData` / `onEnd`
 * custom handlers.
 **/

/**
 * Deflate.msg -> String
 *
 * Error message, if [[Deflate.err]] != 0
 **/


/**
 * new Deflate(options)
 * - options (Object): zlib deflate options.
 *
 * Creates new deflator instance with specified params. Throws exception
 * on bad params. Supported options:
 *
 * - `level`
 * - `windowBits`
 * - `memLevel`
 * - `strategy`
 * - `dictionary`
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Additional options, for internal needs:
 *
 * - `chunkSize` - size of generated data chunks (16K by default)
 * - `raw` (Boolean) - do raw deflate
 * - `gzip` (Boolean) - create gzip wrapper
 * - `to` (String) - if equal to 'string', then result will be "binary string"
 *    (each char code [0..255])
 * - `header` (Object) - custom header for gzip
 *   - `text` (Boolean) - true if compressed data believed to be text
 *   - `time` (Number) - modification time, unix timestamp
 *   - `os` (Number) - operation system code
 *   - `extra` (Array) - array of bytes with extra data (max 65536)
 *   - `name` (String) - file name (binary string)
 *   - `comment` (String) - comment (binary string)
 *   - `hcrc` (Boolean) - true if header crc should be added
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
 *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
 *
 * var deflate = new pako.Deflate({ level: 3});
 *
 * deflate.push(chunk1, false);
 * deflate.push(chunk2, true);  // true -> last chunk
 *
 * if (deflate.err) { throw new Error(deflate.err); }
 *
 * console.log(deflate.result);
 * ```
 **/
function Deflate(options) {
  if (!(this instanceof Deflate)) return new Deflate(options);

  this.options = utils.assign({
    level: Z_DEFAULT_COMPRESSION,
    method: Z_DEFLATED,
    chunkSize: 16384,
    windowBits: 15,
    memLevel: 8,
    strategy: Z_DEFAULT_STRATEGY,
    to: ''
  }, options || {});

  var opt = this.options;

  if (opt.raw && (opt.windowBits > 0)) {
    opt.windowBits = -opt.windowBits;
  }

  else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {
    opt.windowBits += 16;
  }

  this.err    = 0;      // error code, if happens (0 = Z_OK)
  this.msg    = '';     // error message
  this.ended  = false;  // used to avoid multiple onEnd() calls
  this.chunks = [];     // chunks of compressed data

  this.strm = new ZStream();
  this.strm.avail_out = 0;

  var status = zlib_deflate.deflateInit2(
    this.strm,
    opt.level,
    opt.method,
    opt.windowBits,
    opt.memLevel,
    opt.strategy
  );

  if (status !== Z_OK) {
    throw new Error(msg[status]);
  }

  if (opt.header) {
    zlib_deflate.deflateSetHeader(this.strm, opt.header);
  }

  if (opt.dictionary) {
    var dict;
    // Convert data if needed
    if (typeof opt.dictionary === 'string') {
      // If we need to compress text, change encoding to utf8.
      dict = strings.string2buf(opt.dictionary);
    } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
      dict = new Uint8Array(opt.dictionary);
    } else {
      dict = opt.dictionary;
    }

    status = zlib_deflate.deflateSetDictionary(this.strm, dict);

    if (status !== Z_OK) {
      throw new Error(msg[status]);
    }

    this._dict_set = true;
  }
}

/**
 * Deflate#push(data[, mode]) -> Boolean
 * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be
 *   converted to utf8 byte sequence.
 * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
 *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
 *
 * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
 * new compressed chunks. Returns `true` on success. The last data block must have
 * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
 * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you
 * can use mode Z_SYNC_FLUSH, keeping the compression context.
 *
 * On fail call [[Deflate#onEnd]] with error code and return false.
 *
 * We strongly recommend to use `Uint8Array` on input for best speed (output
 * array format is detected automatically). Also, don't skip last param and always
 * use the same type in your code (boolean or number). That will improve JS speed.
 *
 * For regular `Array`-s make sure all elements are [0..255].
 *
 * ##### Example
 *
 * ```javascript
 * push(chunk, false); // push one of data chunks
 * ...
 * push(chunk, true);  // push last chunk
 * ```
 **/
Deflate.prototype.push = function (data, mode) {
  var strm = this.strm;
  var chunkSize = this.options.chunkSize;
  var status, _mode;

  if (this.ended) { return false; }

  _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);

  // Convert data if needed
  if (typeof data === 'string') {
    // If we need to compress text, change encoding to utf8.
    strm.input = strings.string2buf(data);
  } else if (toString.call(data) === '[object ArrayBuffer]') {
    strm.input = new Uint8Array(data);
  } else {
    strm.input = data;
  }

  strm.next_in = 0;
  strm.avail_in = strm.input.length;

  do {
    if (strm.avail_out === 0) {
      strm.output = new utils.Buf8(chunkSize);
      strm.next_out = 0;
      strm.avail_out = chunkSize;
    }
    status = zlib_deflate.deflate(strm, _mode);    /* no bad return value */

    if (status !== Z_STREAM_END && status !== Z_OK) {
      this.onEnd(status);
      this.ended = true;
      return false;
    }
    if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {
      if (this.options.to === 'string') {
        this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));
      } else {
        this.onData(utils.shrinkBuf(strm.output, strm.next_out));
      }
    }
  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);

  // Finalize on the last chunk.
  if (_mode === Z_FINISH) {
    status = zlib_deflate.deflateEnd(this.strm);
    this.onEnd(status);
    this.ended = true;
    return status === Z_OK;
  }

  // callback interim results if Z_SYNC_FLUSH.
  if (_mode === Z_SYNC_FLUSH) {
    this.onEnd(Z_OK);
    strm.avail_out = 0;
    return true;
  }

  return true;
};


/**
 * Deflate#onData(chunk) -> Void
 * - chunk (Uint8Array|Array|String): output data. Type of array depends
 *   on js engine support. When string output requested, each chunk
 *   will be string.
 *
 * By default, stores data blocks in `chunks[]` property and glue
 * those in `onEnd`. Override this handler, if you need another behaviour.
 **/
Deflate.prototype.onData = function (chunk) {
  this.chunks.push(chunk);
};


/**
 * Deflate#onEnd(status) -> Void
 * - status (Number): deflate status. 0 (Z_OK) on success,
 *   other if not.
 *
 * Called once after you tell deflate that the input stream is
 * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
 * or if an error happened. By default - join collected chunks,
 * free memory and fill `results` / `err` properties.
 **/
Deflate.prototype.onEnd = function (status) {
  // On success - join
  if (status === Z_OK) {
    if (this.options.to === 'string') {
      this.result = this.chunks.join('');
    } else {
      this.result = utils.flattenChunks(this.chunks);
    }
  }
  this.chunks = [];
  this.err = status;
  this.msg = this.strm.msg;
};


/**
 * deflate(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * Compress `data` with deflate algorithm and `options`.
 *
 * Supported options are:
 *
 * - level
 * - windowBits
 * - memLevel
 * - strategy
 * - dictionary
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Sugar (options):
 *
 * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
 *   negative windowBits implicitly.
 * - `to` (String) - if equal to 'string', then result will be "binary string"
 *    (each char code [0..255])
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , data = Uint8Array([1,2,3,4,5,6,7,8,9]);
 *
 * console.log(pako.deflate(data));
 * ```
 **/
function deflate(input, options) {
  var deflator = new Deflate(options);

  deflator.push(input, true);

  // That will never happens, if you don't cheat with options :)
  if (deflator.err) { throw deflator.msg || msg[deflator.err]; }

  return deflator.result;
}


/**
 * deflateRaw(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * The same as [[deflate]], but creates raw data, without wrapper
 * (header and adler32 crc).
 **/
function deflateRaw(input, options) {
  options = options || {};
  options.raw = true;
  return deflate(input, options);
}


/**
 * gzip(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to compress.
 * - options (Object): zlib deflate options.
 *
 * The same as [[deflate]], but create gzip wrapper instead of
 * deflate one.
 **/
function gzip(input, options) {
  options = options || {};
  options.gzip = true;
  return deflate(input, options);
}


exports.Deflate = Deflate;
exports.deflate = deflate;
exports.deflateRaw = deflateRaw;
exports.gzip = gzip;


/***/ }),
/* 1225 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";



var zlib_inflate = __webpack_require__(1229);
var utils        = __webpack_require__(83);
var strings      = __webpack_require__(360);
var c            = __webpack_require__(362);
var msg          = __webpack_require__(245);
var ZStream      = __webpack_require__(364);
var GZheader     = __webpack_require__(1227);

var toString = Object.prototype.toString;

/**
 * class Inflate
 *
 * Generic JS-style wrapper for zlib calls. If you don't need
 * streaming behaviour - use more simple functions: [[inflate]]
 * and [[inflateRaw]].
 **/

/* internal
 * inflate.chunks -> Array
 *
 * Chunks of output data, if [[Inflate#onData]] not overridden.
 **/

/**
 * Inflate.result -> Uint8Array|Array|String
 *
 * Uncompressed result, generated by default [[Inflate#onData]]
 * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
 * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you
 * push a chunk with explicit flush (call [[Inflate#push]] with
 * `Z_SYNC_FLUSH` param).
 **/

/**
 * Inflate.err -> Number
 *
 * Error code after inflate finished. 0 (Z_OK) on success.
 * Should be checked if broken data possible.
 **/

/**
 * Inflate.msg -> String
 *
 * Error message, if [[Inflate.err]] != 0
 **/


/**
 * new Inflate(options)
 * - options (Object): zlib inflate options.
 *
 * Creates new inflator instance with specified params. Throws exception
 * on bad params. Supported options:
 *
 * - `windowBits`
 * - `dictionary`
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information on these.
 *
 * Additional options, for internal needs:
 *
 * - `chunkSize` - size of generated data chunks (16K by default)
 * - `raw` (Boolean) - do raw inflate
 * - `to` (String) - if equal to 'string', then result will be converted
 *   from utf8 to utf16 (javascript) string. When string output requested,
 *   chunk length can differ from `chunkSize`, depending on content.
 *
 * By default, when no options set, autodetect deflate/gzip data format via
 * wrapper header.
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])
 *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);
 *
 * var inflate = new pako.Inflate({ level: 3});
 *
 * inflate.push(chunk1, false);
 * inflate.push(chunk2, true);  // true -> last chunk
 *
 * if (inflate.err) { throw new Error(inflate.err); }
 *
 * console.log(inflate.result);
 * ```
 **/
function Inflate(options) {
  if (!(this instanceof Inflate)) return new Inflate(options);

  this.options = utils.assign({
    chunkSize: 16384,
    windowBits: 0,
    to: ''
  }, options || {});

  var opt = this.options;

  // Force window size for `raw` data, if not set directly,
  // because we have no header for autodetect.
  if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
    opt.windowBits = -opt.windowBits;
    if (opt.windowBits === 0) { opt.windowBits = -15; }
  }

  // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
  if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
      !(options && options.windowBits)) {
    opt.windowBits += 32;
  }

  // Gzip header has no info about windows size, we can do autodetect only
  // for deflate. So, if window size not set, force it to max when gzip possible
  if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
    // bit 3 (16) -> gzipped data
    // bit 4 (32) -> autodetect gzip/deflate
    if ((opt.windowBits & 15) === 0) {
      opt.windowBits |= 15;
    }
  }

  this.err    = 0;      // error code, if happens (0 = Z_OK)
  this.msg    = '';     // error message
  this.ended  = false;  // used to avoid multiple onEnd() calls
  this.chunks = [];     // chunks of compressed data

  this.strm   = new ZStream();
  this.strm.avail_out = 0;

  var status  = zlib_inflate.inflateInit2(
    this.strm,
    opt.windowBits
  );

  if (status !== c.Z_OK) {
    throw new Error(msg[status]);
  }

  this.header = new GZheader();

  zlib_inflate.inflateGetHeader(this.strm, this.header);

  // Setup dictionary
  if (opt.dictionary) {
    // Convert data if needed
    if (typeof opt.dictionary === 'string') {
      opt.dictionary = strings.string2buf(opt.dictionary);
    } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
      opt.dictionary = new Uint8Array(opt.dictionary);
    }
    if (opt.raw) { //In raw mode we need to set the dictionary early
      status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
      if (status !== c.Z_OK) {
        throw new Error(msg[status]);
      }
    }
  }
}

/**
 * Inflate#push(data[, mode]) -> Boolean
 * - data (Uint8Array|Array|ArrayBuffer|String): input data
 * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
 *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
 *
 * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
 * new output chunks. Returns `true` on success. The last data block must have
 * mode Z_FINISH (or `true`). That will flush internal pending buffers and call
 * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you
 * can use mode Z_SYNC_FLUSH, keeping the decompression context.
 *
 * On fail call [[Inflate#onEnd]] with error code and return false.
 *
 * We strongly recommend to use `Uint8Array` on input for best speed (output
 * format is detected automatically). Also, don't skip last param and always
 * use the same type in your code (boolean or number). That will improve JS speed.
 *
 * For regular `Array`-s make sure all elements are [0..255].
 *
 * ##### Example
 *
 * ```javascript
 * push(chunk, false); // push one of data chunks
 * ...
 * push(chunk, true);  // push last chunk
 * ```
 **/
Inflate.prototype.push = function (data, mode) {
  var strm = this.strm;
  var chunkSize = this.options.chunkSize;
  var dictionary = this.options.dictionary;
  var status, _mode;
  var next_out_utf8, tail, utf8str;

  // Flag to properly process Z_BUF_ERROR on testing inflate call
  // when we check that all output data was flushed.
  var allowBufError = false;

  if (this.ended) { return false; }
  _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);

  // Convert data if needed
  if (typeof data === 'string') {
    // Only binary strings can be decompressed on practice
    strm.input = strings.binstring2buf(data);
  } else if (toString.call(data) === '[object ArrayBuffer]') {
    strm.input = new Uint8Array(data);
  } else {
    strm.input = data;
  }

  strm.next_in = 0;
  strm.avail_in = strm.input.length;

  do {
    if (strm.avail_out === 0) {
      strm.output = new utils.Buf8(chunkSize);
      strm.next_out = 0;
      strm.avail_out = chunkSize;
    }

    status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH);    /* no bad return value */

    if (status === c.Z_NEED_DICT && dictionary) {
      status = zlib_inflate.inflateSetDictionary(this.strm, dictionary);
    }

    if (status === c.Z_BUF_ERROR && allowBufError === true) {
      status = c.Z_OK;
      allowBufError = false;
    }

    if (status !== c.Z_STREAM_END && status !== c.Z_OK) {
      this.onEnd(status);
      this.ended = true;
      return false;
    }

    if (strm.next_out) {
      if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {

        if (this.options.to === 'string') {

          next_out_utf8 = strings.utf8border(strm.output, strm.next_out);

          tail = strm.next_out - next_out_utf8;
          utf8str = strings.buf2string(strm.output, next_out_utf8);

          // move tail
          strm.next_out = tail;
          strm.avail_out = chunkSize - tail;
          if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }

          this.onData(utf8str);

        } else {
          this.onData(utils.shrinkBuf(strm.output, strm.next_out));
        }
      }
    }

    // When no more input data, we should check that internal inflate buffers
    // are flushed. The only way to do it when avail_out = 0 - run one more
    // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.
    // Here we set flag to process this error properly.
    //
    // NOTE. Deflate does not return error in this case and does not needs such
    // logic.
    if (strm.avail_in === 0 && strm.avail_out === 0) {
      allowBufError = true;
    }

  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);

  if (status === c.Z_STREAM_END) {
    _mode = c.Z_FINISH;
  }

  // Finalize on the last chunk.
  if (_mode === c.Z_FINISH) {
    status = zlib_inflate.inflateEnd(this.strm);
    this.onEnd(status);
    this.ended = true;
    return status === c.Z_OK;
  }

  // callback interim results if Z_SYNC_FLUSH.
  if (_mode === c.Z_SYNC_FLUSH) {
    this.onEnd(c.Z_OK);
    strm.avail_out = 0;
    return true;
  }

  return true;
};


/**
 * Inflate#onData(chunk) -> Void
 * - chunk (Uint8Array|Array|String): output data. Type of array depends
 *   on js engine support. When string output requested, each chunk
 *   will be string.
 *
 * By default, stores data blocks in `chunks[]` property and glue
 * those in `onEnd`. Override this handler, if you need another behaviour.
 **/
Inflate.prototype.onData = function (chunk) {
  this.chunks.push(chunk);
};


/**
 * Inflate#onEnd(status) -> Void
 * - status (Number): inflate status. 0 (Z_OK) on success,
 *   other if not.
 *
 * Called either after you tell inflate that the input stream is
 * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)
 * or if an error happened. By default - join collected chunks,
 * free memory and fill `results` / `err` properties.
 **/
Inflate.prototype.onEnd = function (status) {
  // On success - join
  if (status === c.Z_OK) {
    if (this.options.to === 'string') {
      // Glue & convert here, until we teach pako to send
      // utf8 aligned strings to onData
      this.result = this.chunks.join('');
    } else {
      this.result = utils.flattenChunks(this.chunks);
    }
  }
  this.chunks = [];
  this.err = status;
  this.msg = this.strm.msg;
};


/**
 * inflate(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to decompress.
 * - options (Object): zlib inflate options.
 *
 * Decompress `data` with inflate/ungzip and `options`. Autodetect
 * format via wrapper header by default. That's why we don't provide
 * separate `ungzip` method.
 *
 * Supported options are:
 *
 * - windowBits
 *
 * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
 * for more information.
 *
 * Sugar (options):
 *
 * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
 *   negative windowBits implicitly.
 * - `to` (String) - if equal to 'string', then result will be converted
 *   from utf8 to utf16 (javascript) string. When string output requested,
 *   chunk length can differ from `chunkSize`, depending on content.
 *
 *
 * ##### Example:
 *
 * ```javascript
 * var pako = require('pako')
 *   , input = pako.deflate([1,2,3,4,5,6,7,8,9])
 *   , output;
 *
 * try {
 *   output = pako.inflate(input);
 * } catch (err)
 *   console.log(err);
 * }
 * ```
 **/
function inflate(input, options) {
  var inflator = new Inflate(options);

  inflator.push(input, true);

  // That will never happens, if you don't cheat with options :)
  if (inflator.err) { throw inflator.msg || msg[inflator.err]; }

  return inflator.result;
}


/**
 * inflateRaw(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to decompress.
 * - options (Object): zlib inflate options.
 *
 * The same as [[inflate]], but creates raw data, without wrapper
 * (header and adler32 crc).
 **/
function inflateRaw(input, options) {
  options = options || {};
  options.raw = true;
  return inflate(input, options);
}


/**
 * ungzip(data[, options]) -> Uint8Array|Array|String
 * - data (Uint8Array|Array|String): input data to decompress.
 * - options (Object): zlib inflate options.
 *
 * Just shortcut to [[inflate]], because it autodetects format
 * by header.content. Done for convenience.
 **/


exports.Inflate = Inflate;
exports.inflate = inflate;
exports.inflateRaw = inflateRaw;
exports.ungzip  = inflate;


/***/ }),
/* 1226 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils   = __webpack_require__(83);
var trees   = __webpack_require__(1231);
var adler32 = __webpack_require__(361);
var crc32   = __webpack_require__(363);
var msg     = __webpack_require__(245);

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
var Z_NO_FLUSH      = 0;
var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
//var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
//var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
//var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;


/* compression levels */
//var Z_NO_COMPRESSION      = 0;
//var Z_BEST_SPEED          = 1;
//var Z_BEST_COMPRESSION    = 9;
var Z_DEFAULT_COMPRESSION = -1;


var Z_FILTERED            = 1;
var Z_HUFFMAN_ONLY        = 2;
var Z_RLE                 = 3;
var Z_FIXED               = 4;
var Z_DEFAULT_STRATEGY    = 0;

/* Possible values of the data_type field (though see inflate()) */
//var Z_BINARY              = 0;
//var Z_TEXT                = 1;
//var Z_ASCII               = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;


/* The deflate compression method */
var Z_DEFLATED  = 8;

/*============================================================================*/


var MAX_MEM_LEVEL = 9;
/* Maximum value for memLevel in deflateInit2 */
var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_MEM_LEVEL = 8;


var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */
var LITERALS      = 256;
/* number of literal bytes 0..255 */
var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */
var D_CODES       = 30;
/* number of distance codes */
var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */
var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */
var MAX_BITS  = 15;
/* All codes must not exceed MAX_BITS bits */

var MIN_MATCH = 3;
var MAX_MATCH = 258;
var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);

var PRESET_DICT = 0x20;

var INIT_STATE = 42;
var EXTRA_STATE = 69;
var NAME_STATE = 73;
var COMMENT_STATE = 91;
var HCRC_STATE = 103;
var BUSY_STATE = 113;
var FINISH_STATE = 666;

var BS_NEED_MORE      = 1; /* block not completed, need more input or more output */
var BS_BLOCK_DONE     = 2; /* block flush performed */
var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
var BS_FINISH_DONE    = 4; /* finish done, accept no more input or output */

var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.

function err(strm, errorCode) {
  strm.msg = msg[errorCode];
  return errorCode;
}

function rank(f) {
  return ((f) << 1) - ((f) > 4 ? 9 : 0);
}

function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }


/* =========================================================================
 * Flush as much pending output as possible. All deflate() output goes
 * through this function so some applications may wish to modify it
 * to avoid allocating a large strm->output buffer and copying into it.
 * (See also read_buf()).
 */
function flush_pending(strm) {
  var s = strm.state;

  //_tr_flush_bits(s);
  var len = s.pending;
  if (len > strm.avail_out) {
    len = strm.avail_out;
  }
  if (len === 0) { return; }

  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
  strm.next_out += len;
  s.pending_out += len;
  strm.total_out += len;
  strm.avail_out -= len;
  s.pending -= len;
  if (s.pending === 0) {
    s.pending_out = 0;
  }
}


function flush_block_only(s, last) {
  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
  s.block_start = s.strstart;
  flush_pending(s.strm);
}


function put_byte(s, b) {
  s.pending_buf[s.pending++] = b;
}


/* =========================================================================
 * Put a short in the pending buffer. The 16-bit value is put in MSB order.
 * IN assertion: the stream state is correct and there is enough room in
 * pending_buf.
 */
function putShortMSB(s, b) {
//  put_byte(s, (Byte)(b >> 8));
//  put_byte(s, (Byte)(b & 0xff));
  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
  s.pending_buf[s.pending++] = b & 0xff;
}


/* ===========================================================================
 * Read a new buffer from the current input stream, update the adler32
 * and total number of bytes read.  All deflate() input goes through
 * this function so some applications may wish to modify it to avoid
 * allocating a large strm->input buffer and copying from it.
 * (See also flush_pending()).
 */
function read_buf(strm, buf, start, size) {
  var len = strm.avail_in;

  if (len > size) { len = size; }
  if (len === 0) { return 0; }

  strm.avail_in -= len;

  // zmemcpy(buf, strm->next_in, len);
  utils.arraySet(buf, strm.input, strm.next_in, len, start);
  if (strm.state.wrap === 1) {
    strm.adler = adler32(strm.adler, buf, len, start);
  }

  else if (strm.state.wrap === 2) {
    strm.adler = crc32(strm.adler, buf, len, start);
  }

  strm.next_in += len;
  strm.total_in += len;

  return len;
}


/* ===========================================================================
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is
 * garbage.
 * IN assertions: cur_match is the head of the hash chain for the current
 *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
 * OUT assertion: the match length is not greater than s->lookahead.
 */
function longest_match(s, cur_match) {
  var chain_length = s.max_chain_length;      /* max hash chain length */
  var scan = s.strstart; /* current string */
  var match;                       /* matched string */
  var len;                           /* length of current match */
  var best_len = s.prev_length;              /* best match length so far */
  var nice_match = s.nice_match;             /* stop if match long enough */
  var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
      s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;

  var _win = s.window; // shortcut

  var wmask = s.w_mask;
  var prev  = s.prev;

  /* Stop when cur_match becomes <= limit. To simplify the code,
   * we prevent matches with the string of window index 0.
   */

  var strend = s.strstart + MAX_MATCH;
  var scan_end1  = _win[scan + best_len - 1];
  var scan_end   = _win[scan + best_len];

  /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
   * It is easy to get rid of this optimization if necessary.
   */
  // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

  /* Do not waste too much time if we already have a good match: */
  if (s.prev_length >= s.good_match) {
    chain_length >>= 2;
  }
  /* Do not look for matches beyond the end of the input. This is necessary
   * to make deflate deterministic.
   */
  if (nice_match > s.lookahead) { nice_match = s.lookahead; }

  // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");

  do {
    // Assert(cur_match < s->strstart, "no future");
    match = cur_match;

    /* Skip to next match if the match length cannot increase
     * or if the match length is less than 2.  Note that the checks below
     * for insufficient lookahead only occur occasionally for performance
     * reasons.  Therefore uninitialized memory will be accessed, and
     * conditional jumps will be made that depend on those values.
     * However the length of the match is limited to the lookahead, so
     * the output of deflate is not affected by the uninitialized values.
     */

    if (_win[match + best_len]     !== scan_end  ||
        _win[match + best_len - 1] !== scan_end1 ||
        _win[match]                !== _win[scan] ||
        _win[++match]              !== _win[scan + 1]) {
      continue;
    }

    /* The check at best_len-1 can be removed because it will be made
     * again later. (This heuristic is not always a win.)
     * It is not necessary to compare scan[2] and match[2] since they
     * are always equal when the other bytes match, given that
     * the hash keys are equal and that HASH_BITS >= 8.
     */
    scan += 2;
    match++;
    // Assert(*scan == *match, "match[2]?");

    /* We check for insufficient lookahead only every 8th comparison;
     * the 256th check will be made at strstart+258.
     */
    do {
      /*jshint noempty:false*/
    } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
             scan < strend);

    // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");

    len = MAX_MATCH - (strend - scan);
    scan = strend - MAX_MATCH;

    if (len > best_len) {
      s.match_start = cur_match;
      best_len = len;
      if (len >= nice_match) {
        break;
      }
      scan_end1  = _win[scan + best_len - 1];
      scan_end   = _win[scan + best_len];
    }
  } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);

  if (best_len <= s.lookahead) {
    return best_len;
  }
  return s.lookahead;
}


/* ===========================================================================
 * Fill the window when the lookahead becomes insufficient.
 * Updates strstart and lookahead.
 *
 * IN assertion: lookahead < MIN_LOOKAHEAD
 * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
 *    At least one byte has been read, or avail_in == 0; reads are
 *    performed for at least two bytes (required for the zip translate_eol
 *    option -- not supported here).
 */
function fill_window(s) {
  var _w_size = s.w_size;
  var p, n, m, more, str;

  //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");

  do {
    more = s.window_size - s.lookahead - s.strstart;

    // JS ints have 32 bit, block below not needed
    /* Deal with !@#$% 64K limit: */
    //if (sizeof(int) <= 2) {
    //    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
    //        more = wsize;
    //
    //  } else if (more == (unsigned)(-1)) {
    //        /* Very unlikely, but possible on 16 bit machine if
    //         * strstart == 0 && lookahead == 1 (input done a byte at time)
    //         */
    //        more--;
    //    }
    //}


    /* If the window is almost full and there is insufficient lookahead,
     * move the upper half to the lower one to make room in the upper half.
     */
    if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {

      utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
      s.match_start -= _w_size;
      s.strstart -= _w_size;
      /* we now have strstart >= MAX_DIST */
      s.block_start -= _w_size;

      /* Slide the hash table (could be avoided with 32 bit values
       at the expense of memory usage). We slide even when level == 0
       to keep the hash table consistent if we switch back to level > 0
       later. (Using level 0 permanently is not an optimal usage of
       zlib, so we don't care about this pathological case.)
       */

      n = s.hash_size;
      p = n;
      do {
        m = s.head[--p];
        s.head[p] = (m >= _w_size ? m - _w_size : 0);
      } while (--n);

      n = _w_size;
      p = n;
      do {
        m = s.prev[--p];
        s.prev[p] = (m >= _w_size ? m - _w_size : 0);
        /* If n is not on any hash chain, prev[n] is garbage but
         * its value will never be used.
         */
      } while (--n);

      more += _w_size;
    }
    if (s.strm.avail_in === 0) {
      break;
    }

    /* If there was no sliding:
     *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
     *    more == window_size - lookahead - strstart
     * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
     * => more >= window_size - 2*WSIZE + 2
     * In the BIG_MEM or MMAP case (not yet supported),
     *   window_size == input_size + MIN_LOOKAHEAD  &&
     *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
     * Otherwise, window_size == 2*WSIZE so more >= 2.
     * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
     */
    //Assert(more >= 2, "more < 2");
    n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
    s.lookahead += n;

    /* Initialize the hash value now that we have some input: */
    if (s.lookahead + s.insert >= MIN_MATCH) {
      str = s.strstart - s.insert;
      s.ins_h = s.window[str];

      /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
//#if MIN_MATCH != 3
//        Call update_hash() MIN_MATCH-3 more times
//#endif
      while (s.insert) {
        /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

        s.prev[str & s.w_mask] = s.head[s.ins_h];
        s.head[s.ins_h] = str;
        str++;
        s.insert--;
        if (s.lookahead + s.insert < MIN_MATCH) {
          break;
        }
      }
    }
    /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
     * but this is not important since only literal bytes will be emitted.
     */

  } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);

  /* If the WIN_INIT bytes after the end of the current data have never been
   * written, then zero those bytes in order to avoid memory check reports of
   * the use of uninitialized (or uninitialised as Julian writes) bytes by
   * the longest match routines.  Update the high water mark for the next
   * time through here.  WIN_INIT is set to MAX_MATCH since the longest match
   * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
   */
//  if (s.high_water < s.window_size) {
//    var curr = s.strstart + s.lookahead;
//    var init = 0;
//
//    if (s.high_water < curr) {
//      /* Previous high water mark below current data -- zero WIN_INIT
//       * bytes or up to end of window, whichever is less.
//       */
//      init = s.window_size - curr;
//      if (init > WIN_INIT)
//        init = WIN_INIT;
//      zmemzero(s->window + curr, (unsigned)init);
//      s->high_water = curr + init;
//    }
//    else if (s->high_water < (ulg)curr + WIN_INIT) {
//      /* High water mark at or above current data, but below current data
//       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
//       * to end of window, whichever is less.
//       */
//      init = (ulg)curr + WIN_INIT - s->high_water;
//      if (init > s->window_size - s->high_water)
//        init = s->window_size - s->high_water;
//      zmemzero(s->window + s->high_water, (unsigned)init);
//      s->high_water += init;
//    }
//  }
//
//  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
//    "not enough room for search");
}

/* ===========================================================================
 * Copy without compression as much as possible from the input stream, return
 * the current block state.
 * This function does not insert new strings in the dictionary since
 * uncompressible data is probably not useful. This function is used
 * only for the level=0 compression option.
 * NOTE: this function should be optimized to avoid extra copying from
 * window to pending_buf.
 */
function deflate_stored(s, flush) {
  /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
   * to pending_buf_size, and each stored block has a 5 byte header:
   */
  var max_block_size = 0xffff;

  if (max_block_size > s.pending_buf_size - 5) {
    max_block_size = s.pending_buf_size - 5;
  }

  /* Copy as much as possible from input to output: */
  for (;;) {
    /* Fill the window as much as possible: */
    if (s.lookahead <= 1) {

      //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
      //  s->block_start >= (long)s->w_size, "slide too late");
//      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
//        s.block_start >= s.w_size)) {
//        throw  new Error("slide too late");
//      }

      fill_window(s);
      if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }

      if (s.lookahead === 0) {
        break;
      }
      /* flush the current block */
    }
    //Assert(s->block_start >= 0L, "block gone");
//    if (s.block_start < 0) throw new Error("block gone");

    s.strstart += s.lookahead;
    s.lookahead = 0;

    /* Emit a stored block if pending_buf will be full: */
    var max_start = s.block_start + max_block_size;

    if (s.strstart === 0 || s.strstart >= max_start) {
      /* strstart == 0 is possible when wraparound on 16-bit machine */
      s.lookahead = s.strstart - max_start;
      s.strstart = max_start;
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/


    }
    /* Flush if we may have to slide, otherwise block_start may become
     * negative and the data will be gone:
     */
    if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }

  s.insert = 0;

  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }

  if (s.strstart > s.block_start) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_NEED_MORE;
}

/* ===========================================================================
 * Compress as much as possible from the input stream, return the current
 * block state.
 * This function does not perform lazy evaluation of matches and inserts
 * new strings in the dictionary only for unmatched strings or for short
 * matches. It is used only for the fast compression options.
 */
function deflate_fast(s, flush) {
  var hash_head;        /* head of the hash chain */
  var bflush;           /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) {
        break; /* flush the current block */
      }
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     * At this point we have always match_length < MIN_MATCH
     */
    if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */
    }
    if (s.match_length >= MIN_MATCH) {
      // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only

      /*** _tr_tally_dist(s, s.strstart - s.match_start,
                     s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;

      /* Insert new strings in the hash table only if the match length
       * is not too large. This saves time but degrades compression.
       */
      if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
        s.match_length--; /* string at strstart already in table */
        do {
          s.strstart++;
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
          /* strstart never exceeds WSIZE-MAX_MATCH, so there are
           * always MIN_MATCH bytes ahead.
           */
        } while (--s.match_length !== 0);
        s.strstart++;
      } else
      {
        s.strstart += s.match_length;
        s.match_length = 0;
        s.ins_h = s.window[s.strstart];
        /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;

//#if MIN_MATCH != 3
//                Call UPDATE_HASH() MIN_MATCH-3 more times
//#endif
        /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
         * matter since it will be recomputed at next deflate call.
         */
      }
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s.window[s.strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * Same as above, but achieves better compression. We use a lazy
 * evaluation for matches: a match is finally adopted only if there is
 * no better match at the next window position.
 */
function deflate_slow(s, flush) {
  var hash_head;          /* head of hash chain */
  var bflush;              /* set if current block must be flushed */

  var max_insert;

  /* Process the input block. */
  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the next match, plus MIN_MATCH bytes to insert the
     * string following the next match.
     */
    if (s.lookahead < MIN_LOOKAHEAD) {
      fill_window(s);
      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* Insert the string window[strstart .. strstart+2] in the
     * dictionary, and set hash_head to the head of the hash chain:
     */
    hash_head = 0/*NIL*/;
    if (s.lookahead >= MIN_MATCH) {
      /*** INSERT_STRING(s, s.strstart, hash_head); ***/
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
      s.head[s.ins_h] = s.strstart;
      /***/
    }

    /* Find the longest match, discarding those <= prev_length.
     */
    s.prev_length = s.match_length;
    s.prev_match = s.match_start;
    s.match_length = MIN_MATCH - 1;

    if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
        s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
      /* To simplify the code, we prevent matches with the string
       * of window index 0 (in particular we have to avoid a match
       * of the string with itself at the start of the input file).
       */
      s.match_length = longest_match(s, hash_head);
      /* longest_match() sets match_start */

      if (s.match_length <= 5 &&
         (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {

        /* If prev_match is also MIN_MATCH, match_start is garbage
         * but we will ignore the current match anyway.
         */
        s.match_length = MIN_MATCH - 1;
      }
    }
    /* If there was a match at the previous step and the current
     * match is not better, output the previous match:
     */
    if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
      max_insert = s.strstart + s.lookahead - MIN_MATCH;
      /* Do not insert strings in hash table beyond this. */

      //check_match(s, s.strstart-1, s.prev_match, s.prev_length);

      /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
                     s.prev_length - MIN_MATCH, bflush);***/
      bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
      /* Insert in hash table all strings up to the end of the match.
       * strstart-1 and strstart are already inserted. If there is not
       * enough lookahead, the last two strings are not inserted in
       * the hash table.
       */
      s.lookahead -= s.prev_length - 1;
      s.prev_length -= 2;
      do {
        if (++s.strstart <= max_insert) {
          /*** INSERT_STRING(s, s.strstart, hash_head); ***/
          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
          s.head[s.ins_h] = s.strstart;
          /***/
        }
      } while (--s.prev_length !== 0);
      s.match_available = 0;
      s.match_length = MIN_MATCH - 1;
      s.strstart++;

      if (bflush) {
        /*** FLUSH_BLOCK(s, 0); ***/
        flush_block_only(s, false);
        if (s.strm.avail_out === 0) {
          return BS_NEED_MORE;
        }
        /***/
      }

    } else if (s.match_available) {
      /* If there was no match at the previous position, output a
       * single literal. If there was a match but the current match
       * is longer, truncate the previous match to a single literal.
       */
      //Tracevv((stderr,"%c", s->window[s->strstart-1]));
      /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

      if (bflush) {
        /*** FLUSH_BLOCK_ONLY(s, 0) ***/
        flush_block_only(s, false);
        /***/
      }
      s.strstart++;
      s.lookahead--;
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
    } else {
      /* There is no previous match to compare with, wait for
       * the next step to decide.
       */
      s.match_available = 1;
      s.strstart++;
      s.lookahead--;
    }
  }
  //Assert (flush != Z_NO_FLUSH, "no flush?");
  if (s.match_available) {
    //Tracevv((stderr,"%c", s->window[s->strstart-1]));
    /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);

    s.match_available = 0;
  }
  s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }

  return BS_BLOCK_DONE;
}


/* ===========================================================================
 * For Z_RLE, simply look for runs of bytes, generate matches only of distance
 * one.  Do not maintain a hash table.  (It will be regenerated if this run of
 * deflate switches away from Z_RLE.)
 */
function deflate_rle(s, flush) {
  var bflush;            /* set if current block must be flushed */
  var prev;              /* byte at distance one to match */
  var scan, strend;      /* scan goes up to strend for length of run */

  var _win = s.window;

  for (;;) {
    /* Make sure that we always have enough lookahead, except
     * at the end of the input file. We need MAX_MATCH bytes
     * for the longest run, plus one for the unrolled loop.
     */
    if (s.lookahead <= MAX_MATCH) {
      fill_window(s);
      if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
        return BS_NEED_MORE;
      }
      if (s.lookahead === 0) { break; } /* flush the current block */
    }

    /* See how many times the previous byte repeats */
    s.match_length = 0;
    if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
      scan = s.strstart - 1;
      prev = _win[scan];
      if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
        strend = s.strstart + MAX_MATCH;
        do {
          /*jshint noempty:false*/
        } while (prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 prev === _win[++scan] && prev === _win[++scan] &&
                 scan < strend);
        s.match_length = MAX_MATCH - (strend - scan);
        if (s.match_length > s.lookahead) {
          s.match_length = s.lookahead;
        }
      }
      //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
    }

    /* Emit match if have run of MIN_MATCH or longer, else emit literal */
    if (s.match_length >= MIN_MATCH) {
      //check_match(s, s.strstart, s.strstart - 1, s.match_length);

      /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
      bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);

      s.lookahead -= s.match_length;
      s.strstart += s.match_length;
      s.match_length = 0;
    } else {
      /* No match, output a literal byte */
      //Tracevv((stderr,"%c", s->window[s->strstart]));
      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);

      s.lookahead--;
      s.strstart++;
    }
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* ===========================================================================
 * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.
 * (It will be regenerated if this run of deflate switches away from Huffman.)
 */
function deflate_huff(s, flush) {
  var bflush;             /* set if current block must be flushed */

  for (;;) {
    /* Make sure that we have a literal to write. */
    if (s.lookahead === 0) {
      fill_window(s);
      if (s.lookahead === 0) {
        if (flush === Z_NO_FLUSH) {
          return BS_NEED_MORE;
        }
        break;      /* flush the current block */
      }
    }

    /* Output a literal byte */
    s.match_length = 0;
    //Tracevv((stderr,"%c", s->window[s->strstart]));
    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
    bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
    s.lookahead--;
    s.strstart++;
    if (bflush) {
      /*** FLUSH_BLOCK(s, 0); ***/
      flush_block_only(s, false);
      if (s.strm.avail_out === 0) {
        return BS_NEED_MORE;
      }
      /***/
    }
  }
  s.insert = 0;
  if (flush === Z_FINISH) {
    /*** FLUSH_BLOCK(s, 1); ***/
    flush_block_only(s, true);
    if (s.strm.avail_out === 0) {
      return BS_FINISH_STARTED;
    }
    /***/
    return BS_FINISH_DONE;
  }
  if (s.last_lit) {
    /*** FLUSH_BLOCK(s, 0); ***/
    flush_block_only(s, false);
    if (s.strm.avail_out === 0) {
      return BS_NEED_MORE;
    }
    /***/
  }
  return BS_BLOCK_DONE;
}

/* Values for max_lazy_match, good_match and max_chain_length, depending on
 * the desired pack level (0..9). The values given below have been tuned to
 * exclude worst case performance for pathological files. Better values may be
 * found for specific files.
 */
function Config(good_length, max_lazy, nice_length, max_chain, func) {
  this.good_length = good_length;
  this.max_lazy = max_lazy;
  this.nice_length = nice_length;
  this.max_chain = max_chain;
  this.func = func;
}

var configuration_table;

configuration_table = [
  /*      good lazy nice chain */
  new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */
  new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */
  new Config(4, 5, 16, 8, deflate_fast),           /* 2 */
  new Config(4, 6, 32, 32, deflate_fast),          /* 3 */

  new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */
  new Config(8, 16, 32, 32, deflate_slow),         /* 5 */
  new Config(8, 16, 128, 128, deflate_slow),       /* 6 */
  new Config(8, 32, 128, 256, deflate_slow),       /* 7 */
  new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */
  new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */
];


/* ===========================================================================
 * Initialize the "longest match" routines for a new zlib stream
 */
function lm_init(s) {
  s.window_size = 2 * s.w_size;

  /*** CLEAR_HASH(s); ***/
  zero(s.head); // Fill with NIL (= 0);

  /* Set the default configuration parameters:
   */
  s.max_lazy_match = configuration_table[s.level].max_lazy;
  s.good_match = configuration_table[s.level].good_length;
  s.nice_match = configuration_table[s.level].nice_length;
  s.max_chain_length = configuration_table[s.level].max_chain;

  s.strstart = 0;
  s.block_start = 0;
  s.lookahead = 0;
  s.insert = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  s.ins_h = 0;
}


function DeflateState() {
  this.strm = null;            /* pointer back to this zlib stream */
  this.status = 0;            /* as the name implies */
  this.pending_buf = null;      /* output still pending */
  this.pending_buf_size = 0;  /* size of pending_buf */
  this.pending_out = 0;       /* next pending byte to output to the stream */
  this.pending = 0;           /* nb of bytes in the pending buffer */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.gzhead = null;         /* gzip header information to write */
  this.gzindex = 0;           /* where in extra, name, or comment */
  this.method = Z_DEFLATED; /* can only be DEFLATED */
  this.last_flush = -1;   /* value of flush param for previous deflate call */

  this.w_size = 0;  /* LZ77 window size (32K by default) */
  this.w_bits = 0;  /* log2(w_size)  (8..16) */
  this.w_mask = 0;  /* w_size - 1 */

  this.window = null;
  /* Sliding window. Input bytes are read into the second half of the window,
   * and move to the first half later to keep a dictionary of at least wSize
   * bytes. With this organization, matches are limited to a distance of
   * wSize-MAX_MATCH bytes, but this ensures that IO is always
   * performed with a length multiple of the block size.
   */

  this.window_size = 0;
  /* Actual size of window: 2*wSize, except when the user input buffer
   * is directly used as sliding window.
   */

  this.prev = null;
  /* Link to older string with same hash index. To limit the size of this
   * array to 64K, this link is maintained only for the last 32K strings.
   * An index in this array is thus a window index modulo 32K.
   */

  this.head = null;   /* Heads of the hash chains or NIL. */

  this.ins_h = 0;       /* hash index of string to be inserted */
  this.hash_size = 0;   /* number of elements in hash table */
  this.hash_bits = 0;   /* log2(hash_size) */
  this.hash_mask = 0;   /* hash_size-1 */

  this.hash_shift = 0;
  /* Number of bits by which ins_h must be shifted at each input
   * step. It must be such that after MIN_MATCH steps, the oldest
   * byte no longer takes part in the hash key, that is:
   *   hash_shift * MIN_MATCH >= hash_bits
   */

  this.block_start = 0;
  /* Window position at the beginning of the current output block. Gets
   * negative when the window is moved backwards.
   */

  this.match_length = 0;      /* length of best match */
  this.prev_match = 0;        /* previous match */
  this.match_available = 0;   /* set if previous match exists */
  this.strstart = 0;          /* start of string to insert */
  this.match_start = 0;       /* start of matching string */
  this.lookahead = 0;         /* number of valid bytes ahead in window */

  this.prev_length = 0;
  /* Length of the best match at previous step. Matches not greater than this
   * are discarded. This is used in the lazy match evaluation.
   */

  this.max_chain_length = 0;
  /* To speed up deflation, hash chains are never searched beyond this
   * length.  A higher limit improves compression ratio but degrades the
   * speed.
   */

  this.max_lazy_match = 0;
  /* Attempt to find a better match only when the current match is strictly
   * smaller than this value. This mechanism is used only for compression
   * levels >= 4.
   */
  // That's alias to max_lazy_match, don't use directly
  //this.max_insert_length = 0;
  /* Insert new strings in the hash table only if the match length is not
   * greater than this length. This saves time but degrades compression.
   * max_insert_length is used only for compression levels <= 3.
   */

  this.level = 0;     /* compression level (1..9) */
  this.strategy = 0;  /* favor or force Huffman coding*/

  this.good_match = 0;
  /* Use a faster search when the previous match is longer than this */

  this.nice_match = 0; /* Stop searching when current match exceeds this */

              /* used by trees.c: */

  /* Didn't use ct_data typedef below to suppress compiler warning */

  // struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */
  // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
  // struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */

  // Use flat array of DOUBLE size, with interleaved fata,
  // because JS does not support effective
  this.dyn_ltree  = new utils.Buf16(HEAP_SIZE * 2);
  this.dyn_dtree  = new utils.Buf16((2 * D_CODES + 1) * 2);
  this.bl_tree    = new utils.Buf16((2 * BL_CODES + 1) * 2);
  zero(this.dyn_ltree);
  zero(this.dyn_dtree);
  zero(this.bl_tree);

  this.l_desc   = null;         /* desc. for literal tree */
  this.d_desc   = null;         /* desc. for distance tree */
  this.bl_desc  = null;         /* desc. for bit length tree */

  //ush bl_count[MAX_BITS+1];
  this.bl_count = new utils.Buf16(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  //int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */
  this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */
  zero(this.heap);

  this.heap_len = 0;               /* number of elements in the heap */
  this.heap_max = 0;               /* element of largest frequency */
  /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
   * The same heap array is used to build all trees.
   */

  this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
  zero(this.depth);
  /* Depth of each subtree used as tie breaker for trees of equal frequency
   */

  this.l_buf = 0;          /* buffer index for literals or lengths */

  this.lit_bufsize = 0;
  /* Size of match buffer for literals/lengths.  There are 4 reasons for
   * limiting lit_bufsize to 64K:
   *   - frequencies can be kept in 16 bit counters
   *   - if compression is not successful for the first block, all input
   *     data is still in the window so we can still emit a stored block even
   *     when input comes from standard input.  (This can also be done for
   *     all blocks if lit_bufsize is not greater than 32K.)
   *   - if compression is not successful for a file smaller than 64K, we can
   *     even emit a stored file instead of a stored block (saving 5 bytes).
   *     This is applicable only for zip (not gzip or zlib).
   *   - creating new Huffman trees less frequently may not provide fast
   *     adaptation to changes in the input data statistics. (Take for
   *     example a binary file with poorly compressible code followed by
   *     a highly compressible string table.) Smaller buffer sizes give
   *     fast adaptation but have of course the overhead of transmitting
   *     trees more frequently.
   *   - I can't count above 4
   */

  this.last_lit = 0;      /* running index in l_buf */

  this.d_buf = 0;
  /* Buffer index for distances. To simplify the code, d_buf and l_buf have
   * the same number of elements. To use different lengths, an extra flag
   * array would be necessary.
   */

  this.opt_len = 0;       /* bit length of current block with optimal trees */
  this.static_len = 0;    /* bit length of current block with static trees */
  this.matches = 0;       /* number of string matches in current block */
  this.insert = 0;        /* bytes at end of window left to insert */


  this.bi_buf = 0;
  /* Output buffer. bits are inserted starting at the bottom (least
   * significant bits).
   */
  this.bi_valid = 0;
  /* Number of valid bits in bi_buf.  All bits above the last valid bit
   * are always zero.
   */

  // Used for window memory init. We safely ignore it for JS. That makes
  // sense only for pointers and memory check tools.
  //this.high_water = 0;
  /* High water mark offset in window for initialized bytes -- bytes above
   * this are set to zero in order to avoid memory check warnings when
   * longest match routines access bytes past the input.  This is then
   * updated to the new high water mark.
   */
}


function deflateResetKeep(strm) {
  var s;

  if (!strm || !strm.state) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.total_in = strm.total_out = 0;
  strm.data_type = Z_UNKNOWN;

  s = strm.state;
  s.pending = 0;
  s.pending_out = 0;

  if (s.wrap < 0) {
    s.wrap = -s.wrap;
    /* was made negative by deflate(..., Z_FINISH); */
  }
  s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
  strm.adler = (s.wrap === 2) ?
    0  // crc32(0, Z_NULL, 0)
  :
    1; // adler32(0, Z_NULL, 0)
  s.last_flush = Z_NO_FLUSH;
  trees._tr_init(s);
  return Z_OK;
}


function deflateReset(strm) {
  var ret = deflateResetKeep(strm);
  if (ret === Z_OK) {
    lm_init(strm.state);
  }
  return ret;
}


function deflateSetHeader(strm, head) {
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
  strm.state.gzhead = head;
  return Z_OK;
}


function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
  if (!strm) { // === Z_NULL
    return Z_STREAM_ERROR;
  }
  var wrap = 1;

  if (level === Z_DEFAULT_COMPRESSION) {
    level = 6;
  }

  if (windowBits < 0) { /* suppress zlib wrapper */
    wrap = 0;
    windowBits = -windowBits;
  }

  else if (windowBits > 15) {
    wrap = 2;           /* write gzip wrapper instead */
    windowBits -= 16;
  }


  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
    windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
    strategy < 0 || strategy > Z_FIXED) {
    return err(strm, Z_STREAM_ERROR);
  }


  if (windowBits === 8) {
    windowBits = 9;
  }
  /* until 256-byte window bug fixed */

  var s = new DeflateState();

  strm.state = s;
  s.strm = strm;

  s.wrap = wrap;
  s.gzhead = null;
  s.w_bits = windowBits;
  s.w_size = 1 << s.w_bits;
  s.w_mask = s.w_size - 1;

  s.hash_bits = memLevel + 7;
  s.hash_size = 1 << s.hash_bits;
  s.hash_mask = s.hash_size - 1;
  s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);

  s.window = new utils.Buf8(s.w_size * 2);
  s.head = new utils.Buf16(s.hash_size);
  s.prev = new utils.Buf16(s.w_size);

  // Don't need mem init magic for JS.
  //s.high_water = 0;  /* nothing written to s->window yet */

  s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */

  s.pending_buf_size = s.lit_bufsize * 4;

  //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
  //s->pending_buf = (uchf *) overlay;
  s.pending_buf = new utils.Buf8(s.pending_buf_size);

  // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
  //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
  s.d_buf = 1 * s.lit_bufsize;

  //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
  s.l_buf = (1 + 2) * s.lit_bufsize;

  s.level = level;
  s.strategy = strategy;
  s.method = method;

  return deflateReset(strm);
}

function deflateInit(strm, level) {
  return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
}


function deflate(strm, flush) {
  var old_flush, s;
  var beg, val; // for gzip header write only

  if (!strm || !strm.state ||
    flush > Z_BLOCK || flush < 0) {
    return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
  }

  s = strm.state;

  if (!strm.output ||
      (!strm.input && strm.avail_in !== 0) ||
      (s.status === FINISH_STATE && flush !== Z_FINISH)) {
    return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
  }

  s.strm = strm; /* just in case */
  old_flush = s.last_flush;
  s.last_flush = flush;

  /* Write the header */
  if (s.status === INIT_STATE) {

    if (s.wrap === 2) { // GZIP header
      strm.adler = 0;  //crc32(0L, Z_NULL, 0);
      put_byte(s, 31);
      put_byte(s, 139);
      put_byte(s, 8);
      if (!s.gzhead) { // s->gzhead == Z_NULL
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, 0);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, OS_CODE);
        s.status = BUSY_STATE;
      }
      else {
        put_byte(s, (s.gzhead.text ? 1 : 0) +
                    (s.gzhead.hcrc ? 2 : 0) +
                    (!s.gzhead.extra ? 0 : 4) +
                    (!s.gzhead.name ? 0 : 8) +
                    (!s.gzhead.comment ? 0 : 16)
        );
        put_byte(s, s.gzhead.time & 0xff);
        put_byte(s, (s.gzhead.time >> 8) & 0xff);
        put_byte(s, (s.gzhead.time >> 16) & 0xff);
        put_byte(s, (s.gzhead.time >> 24) & 0xff);
        put_byte(s, s.level === 9 ? 2 :
                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
                     4 : 0));
        put_byte(s, s.gzhead.os & 0xff);
        if (s.gzhead.extra && s.gzhead.extra.length) {
          put_byte(s, s.gzhead.extra.length & 0xff);
          put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
        }
        if (s.gzhead.hcrc) {
          strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
        }
        s.gzindex = 0;
        s.status = EXTRA_STATE;
      }
    }
    else // DEFLATE header
    {
      var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
      var level_flags = -1;

      if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
        level_flags = 0;
      } else if (s.level < 6) {
        level_flags = 1;
      } else if (s.level === 6) {
        level_flags = 2;
      } else {
        level_flags = 3;
      }
      header |= (level_flags << 6);
      if (s.strstart !== 0) { header |= PRESET_DICT; }
      header += 31 - (header % 31);

      s.status = BUSY_STATE;
      putShortMSB(s, header);

      /* Save the adler32 of the preset dictionary: */
      if (s.strstart !== 0) {
        putShortMSB(s, strm.adler >>> 16);
        putShortMSB(s, strm.adler & 0xffff);
      }
      strm.adler = 1; // adler32(0L, Z_NULL, 0);
    }
  }

//#ifdef GZIP
  if (s.status === EXTRA_STATE) {
    if (s.gzhead.extra/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */

      while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            break;
          }
        }
        put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
        s.gzindex++;
      }
      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (s.gzindex === s.gzhead.extra.length) {
        s.gzindex = 0;
        s.status = NAME_STATE;
      }
    }
    else {
      s.status = NAME_STATE;
    }
  }
  if (s.status === NAME_STATE) {
    if (s.gzhead.name/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.name.length) {
          val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.gzindex = 0;
        s.status = COMMENT_STATE;
      }
    }
    else {
      s.status = COMMENT_STATE;
    }
  }
  if (s.status === COMMENT_STATE) {
    if (s.gzhead.comment/* != Z_NULL*/) {
      beg = s.pending;  /* start of bytes to update crc */
      //int val;

      do {
        if (s.pending === s.pending_buf_size) {
          if (s.gzhead.hcrc && s.pending > beg) {
            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
          }
          flush_pending(strm);
          beg = s.pending;
          if (s.pending === s.pending_buf_size) {
            val = 1;
            break;
          }
        }
        // JS specific: little magic to add zero terminator to end of string
        if (s.gzindex < s.gzhead.comment.length) {
          val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
        } else {
          val = 0;
        }
        put_byte(s, val);
      } while (val !== 0);

      if (s.gzhead.hcrc && s.pending > beg) {
        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
      }
      if (val === 0) {
        s.status = HCRC_STATE;
      }
    }
    else {
      s.status = HCRC_STATE;
    }
  }
  if (s.status === HCRC_STATE) {
    if (s.gzhead.hcrc) {
      if (s.pending + 2 > s.pending_buf_size) {
        flush_pending(strm);
      }
      if (s.pending + 2 <= s.pending_buf_size) {
        put_byte(s, strm.adler & 0xff);
        put_byte(s, (strm.adler >> 8) & 0xff);
        strm.adler = 0; //crc32(0L, Z_NULL, 0);
        s.status = BUSY_STATE;
      }
    }
    else {
      s.status = BUSY_STATE;
    }
  }
//#endif

  /* Flush as much pending output as possible */
  if (s.pending !== 0) {
    flush_pending(strm);
    if (strm.avail_out === 0) {
      /* Since avail_out is 0, deflate will be called again with
       * more output space, but possibly with both pending and
       * avail_in equal to zero. There won't be anything to do,
       * but this is not an error situation so make sure we
       * return OK instead of BUF_ERROR at next call of deflate:
       */
      s.last_flush = -1;
      return Z_OK;
    }

    /* Make sure there is something to do and avoid duplicate consecutive
     * flushes. For repeated and useless calls with Z_FINISH, we keep
     * returning Z_STREAM_END instead of Z_BUF_ERROR.
     */
  } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
    flush !== Z_FINISH) {
    return err(strm, Z_BUF_ERROR);
  }

  /* User must not provide more input after the first FINISH: */
  if (s.status === FINISH_STATE && strm.avail_in !== 0) {
    return err(strm, Z_BUF_ERROR);
  }

  /* Start a new block or continue the current one.
   */
  if (strm.avail_in !== 0 || s.lookahead !== 0 ||
    (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
    var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
      (s.strategy === Z_RLE ? deflate_rle(s, flush) :
        configuration_table[s.level].func(s, flush));

    if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
      s.status = FINISH_STATE;
    }
    if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
      if (strm.avail_out === 0) {
        s.last_flush = -1;
        /* avoid BUF_ERROR next call, see above */
      }
      return Z_OK;
      /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
       * of deflate should use the same flush parameter to make sure
       * that the flush is complete. So we don't have to output an
       * empty block here, this will be done at next call. This also
       * ensures that for a very small output buffer, we emit at most
       * one empty block.
       */
    }
    if (bstate === BS_BLOCK_DONE) {
      if (flush === Z_PARTIAL_FLUSH) {
        trees._tr_align(s);
      }
      else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */

        trees._tr_stored_block(s, 0, 0, false);
        /* For a full flush, this empty block will be recognized
         * as a special marker by inflate_sync().
         */
        if (flush === Z_FULL_FLUSH) {
          /*** CLEAR_HASH(s); ***/             /* forget history */
          zero(s.head); // Fill with NIL (= 0);

          if (s.lookahead === 0) {
            s.strstart = 0;
            s.block_start = 0;
            s.insert = 0;
          }
        }
      }
      flush_pending(strm);
      if (strm.avail_out === 0) {
        s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
        return Z_OK;
      }
    }
  }
  //Assert(strm->avail_out > 0, "bug2");
  //if (strm.avail_out <= 0) { throw new Error("bug2");}

  if (flush !== Z_FINISH) { return Z_OK; }
  if (s.wrap <= 0) { return Z_STREAM_END; }

  /* Write the trailer */
  if (s.wrap === 2) {
    put_byte(s, strm.adler & 0xff);
    put_byte(s, (strm.adler >> 8) & 0xff);
    put_byte(s, (strm.adler >> 16) & 0xff);
    put_byte(s, (strm.adler >> 24) & 0xff);
    put_byte(s, strm.total_in & 0xff);
    put_byte(s, (strm.total_in >> 8) & 0xff);
    put_byte(s, (strm.total_in >> 16) & 0xff);
    put_byte(s, (strm.total_in >> 24) & 0xff);
  }
  else
  {
    putShortMSB(s, strm.adler >>> 16);
    putShortMSB(s, strm.adler & 0xffff);
  }

  flush_pending(strm);
  /* If avail_out is zero, the application will call deflate again
   * to flush the rest.
   */
  if (s.wrap > 0) { s.wrap = -s.wrap; }
  /* write the trailer only once! */
  return s.pending !== 0 ? Z_OK : Z_STREAM_END;
}

function deflateEnd(strm) {
  var status;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  status = strm.state.status;
  if (status !== INIT_STATE &&
    status !== EXTRA_STATE &&
    status !== NAME_STATE &&
    status !== COMMENT_STATE &&
    status !== HCRC_STATE &&
    status !== BUSY_STATE &&
    status !== FINISH_STATE
  ) {
    return err(strm, Z_STREAM_ERROR);
  }

  strm.state = null;

  return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
}


/* =========================================================================
 * Initializes the compression dictionary from the given byte
 * sequence without producing any compressed output.
 */
function deflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var s;
  var str, n;
  var wrap;
  var avail;
  var next;
  var input;
  var tmpDict;

  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
    return Z_STREAM_ERROR;
  }

  s = strm.state;
  wrap = s.wrap;

  if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
    return Z_STREAM_ERROR;
  }

  /* when using zlib wrappers, compute Adler-32 for provided dictionary */
  if (wrap === 1) {
    /* adler32(strm->adler, dictionary, dictLength); */
    strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
  }

  s.wrap = 0;   /* avoid computing Adler-32 in read_buf */

  /* if dictionary would fill window, just replace the history */
  if (dictLength >= s.w_size) {
    if (wrap === 0) {            /* already empty otherwise */
      /*** CLEAR_HASH(s); ***/
      zero(s.head); // Fill with NIL (= 0);
      s.strstart = 0;
      s.block_start = 0;
      s.insert = 0;
    }
    /* use the tail */
    // dictionary = dictionary.slice(dictLength - s.w_size);
    tmpDict = new utils.Buf8(s.w_size);
    utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
    dictionary = tmpDict;
    dictLength = s.w_size;
  }
  /* insert dictionary into window and hash */
  avail = strm.avail_in;
  next = strm.next_in;
  input = strm.input;
  strm.avail_in = dictLength;
  strm.next_in = 0;
  strm.input = dictionary;
  fill_window(s);
  while (s.lookahead >= MIN_MATCH) {
    str = s.strstart;
    n = s.lookahead - (MIN_MATCH - 1);
    do {
      /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;

      s.prev[str & s.w_mask] = s.head[s.ins_h];

      s.head[s.ins_h] = str;
      str++;
    } while (--n);
    s.strstart = str;
    s.lookahead = MIN_MATCH - 1;
    fill_window(s);
  }
  s.strstart += s.lookahead;
  s.block_start = s.strstart;
  s.insert = s.lookahead;
  s.lookahead = 0;
  s.match_length = s.prev_length = MIN_MATCH - 1;
  s.match_available = 0;
  strm.next_in = next;
  strm.input = input;
  strm.avail_in = avail;
  s.wrap = wrap;
  return Z_OK;
}


exports.deflateInit = deflateInit;
exports.deflateInit2 = deflateInit2;
exports.deflateReset = deflateReset;
exports.deflateResetKeep = deflateResetKeep;
exports.deflateSetHeader = deflateSetHeader;
exports.deflate = deflate;
exports.deflateEnd = deflateEnd;
exports.deflateSetDictionary = deflateSetDictionary;
exports.deflateInfo = 'pako deflate (from Nodeca project)';

/* Not implemented
exports.deflateBound = deflateBound;
exports.deflateCopy = deflateCopy;
exports.deflateParams = deflateParams;
exports.deflatePending = deflatePending;
exports.deflatePrime = deflatePrime;
exports.deflateTune = deflateTune;
*/


/***/ }),
/* 1227 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

function GZheader() {
  /* true if compressed data believed to be text */
  this.text       = 0;
  /* modification time */
  this.time       = 0;
  /* extra flags (not used when writing a gzip file) */
  this.xflags     = 0;
  /* operating system */
  this.os         = 0;
  /* pointer to extra field or Z_NULL if none */
  this.extra      = null;
  /* extra field length (valid if extra != Z_NULL) */
  this.extra_len  = 0; // Actually, we don't need it in JS,
                       // but leave for few code modifications

  //
  // Setup limits is not necessary because in js we should not preallocate memory
  // for inflate use constant limit in 65536 bytes
  //

  /* space at extra (only when reading header) */
  // this.extra_max  = 0;
  /* pointer to zero-terminated file name or Z_NULL */
  this.name       = '';
  /* space at name (only when reading header) */
  // this.name_max   = 0;
  /* pointer to zero-terminated comment or Z_NULL */
  this.comment    = '';
  /* space at comment (only when reading header) */
  // this.comm_max   = 0;
  /* true if there was or will be a header crc */
  this.hcrc       = 0;
  /* true when done reading gzip header (not used when writing a gzip file) */
  this.done       = false;
}

module.exports = GZheader;


/***/ }),
/* 1228 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

// See state defs from inflate.js
var BAD = 30;       /* got a data error -- remain here until reset */
var TYPE = 12;      /* i: waiting for type bits, including last-flag bit */

/*
   Decode literal, length, and distance codes and write out the resulting
   literal and match bytes until either not enough input or output is
   available, an end-of-block is encountered, or a data error is encountered.
   When large enough input and output buffers are supplied to inflate(), for
   example, a 16K input buffer and a 64K output buffer, more than 95% of the
   inflate execution time is spent in this routine.

   Entry assumptions:

        state.mode === LEN
        strm.avail_in >= 6
        strm.avail_out >= 258
        start >= strm.avail_out
        state.bits < 8

   On return, state.mode is one of:

        LEN -- ran out of enough output space or enough available input
        TYPE -- reached end of block code, inflate() to interpret next block
        BAD -- error in block data

   Notes:

    - The maximum input bits used by a length/distance pair is 15 bits for the
      length code, 5 bits for the length extra, 15 bits for the distance code,
      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
      Therefore if strm.avail_in >= 6, then there is enough input to avoid
      checking for available input while decoding.

    - The maximum bytes that a single length/distance pair can output is 258
      bytes, which is the maximum length that can be coded.  inflate_fast()
      requires strm.avail_out >= 258 for each loop to avoid checking for
      output space.
 */
module.exports = function inflate_fast(strm, start) {
  var state;
  var _in;                    /* local strm.input */
  var last;                   /* have enough input while in < last */
  var _out;                   /* local strm.output */
  var beg;                    /* inflate()'s initial strm.output */
  var end;                    /* while out < end, enough space available */
//#ifdef INFLATE_STRICT
  var dmax;                   /* maximum distance from zlib header */
//#endif
  var wsize;                  /* window size or zero if not using window */
  var whave;                  /* valid bytes in the window */
  var wnext;                  /* window write index */
  // Use `s_window` instead `window`, avoid conflict with instrumentation tools
  var s_window;               /* allocated sliding window, if wsize != 0 */
  var hold;                   /* local strm.hold */
  var bits;                   /* local strm.bits */
  var lcode;                  /* local strm.lencode */
  var dcode;                  /* local strm.distcode */
  var lmask;                  /* mask for first level of length codes */
  var dmask;                  /* mask for first level of distance codes */
  var here;                   /* retrieved table entry */
  var op;                     /* code bits, operation, extra bits, or */
                              /*  window position, window bytes to copy */
  var len;                    /* match length, unused bytes */
  var dist;                   /* match distance */
  var from;                   /* where to copy match from */
  var from_source;


  var input, output; // JS specific, because we have no pointers

  /* copy state to local variables */
  state = strm.state;
  //here = state.here;
  _in = strm.next_in;
  input = strm.input;
  last = _in + (strm.avail_in - 5);
  _out = strm.next_out;
  output = strm.output;
  beg = _out - (start - strm.avail_out);
  end = _out + (strm.avail_out - 257);
//#ifdef INFLATE_STRICT
  dmax = state.dmax;
//#endif
  wsize = state.wsize;
  whave = state.whave;
  wnext = state.wnext;
  s_window = state.window;
  hold = state.hold;
  bits = state.bits;
  lcode = state.lencode;
  dcode = state.distcode;
  lmask = (1 << state.lenbits) - 1;
  dmask = (1 << state.distbits) - 1;


  /* decode literals and length/distances until end-of-block or not enough
     input data or output space */

  top:
  do {
    if (bits < 15) {
      hold += input[_in++] << bits;
      bits += 8;
      hold += input[_in++] << bits;
      bits += 8;
    }

    here = lcode[hold & lmask];

    dolen:
    for (;;) { // Goto emulation
      op = here >>> 24/*here.bits*/;
      hold >>>= op;
      bits -= op;
      op = (here >>> 16) & 0xff/*here.op*/;
      if (op === 0) {                          /* literal */
        //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
        //        "inflate:         literal '%c'\n" :
        //        "inflate:         literal 0x%02x\n", here.val));
        output[_out++] = here & 0xffff/*here.val*/;
      }
      else if (op & 16) {                     /* length base */
        len = here & 0xffff/*here.val*/;
        op &= 15;                           /* number of extra bits */
        if (op) {
          if (bits < op) {
            hold += input[_in++] << bits;
            bits += 8;
          }
          len += hold & ((1 << op) - 1);
          hold >>>= op;
          bits -= op;
        }
        //Tracevv((stderr, "inflate:         length %u\n", len));
        if (bits < 15) {
          hold += input[_in++] << bits;
          bits += 8;
          hold += input[_in++] << bits;
          bits += 8;
        }
        here = dcode[hold & dmask];

        dodist:
        for (;;) { // goto emulation
          op = here >>> 24/*here.bits*/;
          hold >>>= op;
          bits -= op;
          op = (here >>> 16) & 0xff/*here.op*/;

          if (op & 16) {                      /* distance base */
            dist = here & 0xffff/*here.val*/;
            op &= 15;                       /* number of extra bits */
            if (bits < op) {
              hold += input[_in++] << bits;
              bits += 8;
              if (bits < op) {
                hold += input[_in++] << bits;
                bits += 8;
              }
            }
            dist += hold & ((1 << op) - 1);
//#ifdef INFLATE_STRICT
            if (dist > dmax) {
              strm.msg = 'invalid distance too far back';
              state.mode = BAD;
              break top;
            }
//#endif
            hold >>>= op;
            bits -= op;
            //Tracevv((stderr, "inflate:         distance %u\n", dist));
            op = _out - beg;                /* max distance in output */
            if (dist > op) {                /* see if copy from window */
              op = dist - op;               /* distance back in window */
              if (op > whave) {
                if (state.sane) {
                  strm.msg = 'invalid distance too far back';
                  state.mode = BAD;
                  break top;
                }

// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
//                if (len <= op - whave) {
//                  do {
//                    output[_out++] = 0;
//                  } while (--len);
//                  continue top;
//                }
//                len -= op - whave;
//                do {
//                  output[_out++] = 0;
//                } while (--op > whave);
//                if (op === 0) {
//                  from = _out - dist;
//                  do {
//                    output[_out++] = output[from++];
//                  } while (--len);
//                  continue top;
//                }
//#endif
              }
              from = 0; // window index
              from_source = s_window;
              if (wnext === 0) {           /* very common case */
                from += wsize - op;
                if (op < len) {         /* some from window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = _out - dist;  /* rest from output */
                  from_source = output;
                }
              }
              else if (wnext < op) {      /* wrap around window */
                from += wsize + wnext - op;
                op -= wnext;
                if (op < len) {         /* some from end of window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = 0;
                  if (wnext < len) {  /* some from start of window */
                    op = wnext;
                    len -= op;
                    do {
                      output[_out++] = s_window[from++];
                    } while (--op);
                    from = _out - dist;      /* rest from output */
                    from_source = output;
                  }
                }
              }
              else {                      /* contiguous in window */
                from += wnext - op;
                if (op < len) {         /* some from window */
                  len -= op;
                  do {
                    output[_out++] = s_window[from++];
                  } while (--op);
                  from = _out - dist;  /* rest from output */
                  from_source = output;
                }
              }
              while (len > 2) {
                output[_out++] = from_source[from++];
                output[_out++] = from_source[from++];
                output[_out++] = from_source[from++];
                len -= 3;
              }
              if (len) {
                output[_out++] = from_source[from++];
                if (len > 1) {
                  output[_out++] = from_source[from++];
                }
              }
            }
            else {
              from = _out - dist;          /* copy direct from output */
              do {                        /* minimum length is three */
                output[_out++] = output[from++];
                output[_out++] = output[from++];
                output[_out++] = output[from++];
                len -= 3;
              } while (len > 2);
              if (len) {
                output[_out++] = output[from++];
                if (len > 1) {
                  output[_out++] = output[from++];
                }
              }
            }
          }
          else if ((op & 64) === 0) {          /* 2nd level distance code */
            here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
            continue dodist;
          }
          else {
            strm.msg = 'invalid distance code';
            state.mode = BAD;
            break top;
          }

          break; // need to emulate goto via "continue"
        }
      }
      else if ((op & 64) === 0) {              /* 2nd level length code */
        here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
        continue dolen;
      }
      else if (op & 32) {                     /* end-of-block */
        //Tracevv((stderr, "inflate:         end of block\n"));
        state.mode = TYPE;
        break top;
      }
      else {
        strm.msg = 'invalid literal/length code';
        state.mode = BAD;
        break top;
      }

      break; // need to emulate goto via "continue"
    }
  } while (_in < last && _out < end);

  /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
  len = bits >> 3;
  _in -= len;
  bits -= len << 3;
  hold &= (1 << bits) - 1;

  /* update state and return */
  strm.next_in = _in;
  strm.next_out = _out;
  strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
  strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
  state.hold = hold;
  state.bits = bits;
  return;
};


/***/ }),
/* 1229 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils         = __webpack_require__(83);
var adler32       = __webpack_require__(361);
var crc32         = __webpack_require__(363);
var inflate_fast  = __webpack_require__(1228);
var inflate_table = __webpack_require__(1230);

var CODES = 0;
var LENS = 1;
var DISTS = 2;

/* Public constants ==========================================================*/
/* ===========================================================================*/


/* Allowed flush values; see deflate() and inflate() below for details */
//var Z_NO_FLUSH      = 0;
//var Z_PARTIAL_FLUSH = 1;
//var Z_SYNC_FLUSH    = 2;
//var Z_FULL_FLUSH    = 3;
var Z_FINISH        = 4;
var Z_BLOCK         = 5;
var Z_TREES         = 6;


/* Return codes for the compression/decompression functions. Negative values
 * are errors, positive values are used for special but normal events.
 */
var Z_OK            = 0;
var Z_STREAM_END    = 1;
var Z_NEED_DICT     = 2;
//var Z_ERRNO         = -1;
var Z_STREAM_ERROR  = -2;
var Z_DATA_ERROR    = -3;
var Z_MEM_ERROR     = -4;
var Z_BUF_ERROR     = -5;
//var Z_VERSION_ERROR = -6;

/* The deflate compression method */
var Z_DEFLATED  = 8;


/* STATES ====================================================================*/
/* ===========================================================================*/


var    HEAD = 1;       /* i: waiting for magic header */
var    FLAGS = 2;      /* i: waiting for method and flags (gzip) */
var    TIME = 3;       /* i: waiting for modification time (gzip) */
var    OS = 4;         /* i: waiting for extra flags and operating system (gzip) */
var    EXLEN = 5;      /* i: waiting for extra length (gzip) */
var    EXTRA = 6;      /* i: waiting for extra bytes (gzip) */
var    NAME = 7;       /* i: waiting for end of file name (gzip) */
var    COMMENT = 8;    /* i: waiting for end of comment (gzip) */
var    HCRC = 9;       /* i: waiting for header crc (gzip) */
var    DICTID = 10;    /* i: waiting for dictionary check value */
var    DICT = 11;      /* waiting for inflateSetDictionary() call */
var        TYPE = 12;      /* i: waiting for type bits, including last-flag bit */
var        TYPEDO = 13;    /* i: same, but skip check to exit inflate on new block */
var        STORED = 14;    /* i: waiting for stored size (length and complement) */
var        COPY_ = 15;     /* i/o: same as COPY below, but only first time in */
var        COPY = 16;      /* i/o: waiting for input or output to copy stored block */
var        TABLE = 17;     /* i: waiting for dynamic block table lengths */
var        LENLENS = 18;   /* i: waiting for code length code lengths */
var        CODELENS = 19;  /* i: waiting for length/lit and distance code lengths */
var            LEN_ = 20;      /* i: same as LEN below, but only first time in */
var            LEN = 21;       /* i: waiting for length/lit/eob code */
var            LENEXT = 22;    /* i: waiting for length extra bits */
var            DIST = 23;      /* i: waiting for distance code */
var            DISTEXT = 24;   /* i: waiting for distance extra bits */
var            MATCH = 25;     /* o: waiting for output space to copy string */
var            LIT = 26;       /* o: waiting for output space to write literal */
var    CHECK = 27;     /* i: waiting for 32-bit check value */
var    LENGTH = 28;    /* i: waiting for 32-bit length (gzip) */
var    DONE = 29;      /* finished check, done -- remain here until reset */
var    BAD = 30;       /* got a data error -- remain here until reset */
var    MEM = 31;       /* got an inflate() memory error -- remain here until reset */
var    SYNC = 32;      /* looking for synchronization bytes to restart inflate() */

/* ===========================================================================*/



var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH =  (ENOUGH_LENS+ENOUGH_DISTS);

var MAX_WBITS = 15;
/* 32K LZ77 window */
var DEF_WBITS = MAX_WBITS;


function zswap32(q) {
  return  (((q >>> 24) & 0xff) +
          ((q >>> 8) & 0xff00) +
          ((q & 0xff00) << 8) +
          ((q & 0xff) << 24));
}


function InflateState() {
  this.mode = 0;             /* current inflate mode */
  this.last = false;          /* true if processing last block */
  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */
  this.havedict = false;      /* true if dictionary provided */
  this.flags = 0;             /* gzip header method and flags (0 if zlib) */
  this.dmax = 0;              /* zlib header max distance (INFLATE_STRICT) */
  this.check = 0;             /* protected copy of check value */
  this.total = 0;             /* protected copy of output count */
  // TODO: may be {}
  this.head = null;           /* where to save gzip header information */

  /* sliding window */
  this.wbits = 0;             /* log base 2 of requested window size */
  this.wsize = 0;             /* window size or zero if not using window */
  this.whave = 0;             /* valid bytes in the window */
  this.wnext = 0;             /* window write index */
  this.window = null;         /* allocated sliding window, if needed */

  /* bit accumulator */
  this.hold = 0;              /* input bit accumulator */
  this.bits = 0;              /* number of bits in "in" */

  /* for string and stored block copying */
  this.length = 0;            /* literal or length of data to copy */
  this.offset = 0;            /* distance back to copy string from */

  /* for table and code decoding */
  this.extra = 0;             /* extra bits needed */

  /* fixed and dynamic code tables */
  this.lencode = null;          /* starting table for length/literal codes */
  this.distcode = null;         /* starting table for distance codes */
  this.lenbits = 0;           /* index bits for lencode */
  this.distbits = 0;          /* index bits for distcode */

  /* dynamic table building */
  this.ncode = 0;             /* number of code length code lengths */
  this.nlen = 0;              /* number of length code lengths */
  this.ndist = 0;             /* number of distance code lengths */
  this.have = 0;              /* number of code lengths in lens[] */
  this.next = null;              /* next available space in codes[] */

  this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
  this.work = new utils.Buf16(288); /* work area for code table building */

  /*
   because we don't have pointers in js, we use lencode and distcode directly
   as buffers so we don't need codes
  */
  //this.codes = new utils.Buf32(ENOUGH);       /* space for code tables */
  this.lendyn = null;              /* dynamic table for length/literal codes (JS specific) */
  this.distdyn = null;             /* dynamic table for distance codes (JS specific) */
  this.sane = 0;                   /* if false, allow invalid distance too far */
  this.back = 0;                   /* bits back of last unprocessed length/lit */
  this.was = 0;                    /* initial length of match */
}

function inflateResetKeep(strm) {
  var state;

  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  strm.total_in = strm.total_out = state.total = 0;
  strm.msg = ''; /*Z_NULL*/
  if (state.wrap) {       /* to support ill-conceived Java test suite */
    strm.adler = state.wrap & 1;
  }
  state.mode = HEAD;
  state.last = 0;
  state.havedict = 0;
  state.dmax = 32768;
  state.head = null/*Z_NULL*/;
  state.hold = 0;
  state.bits = 0;
  //state.lencode = state.distcode = state.next = state.codes;
  state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
  state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);

  state.sane = 1;
  state.back = -1;
  //Tracev((stderr, "inflate: reset\n"));
  return Z_OK;
}

function inflateReset(strm) {
  var state;

  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  state.wsize = 0;
  state.whave = 0;
  state.wnext = 0;
  return inflateResetKeep(strm);

}

function inflateReset2(strm, windowBits) {
  var wrap;
  var state;

  /* get the state */
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;

  /* extract wrap request from windowBits parameter */
  if (windowBits < 0) {
    wrap = 0;
    windowBits = -windowBits;
  }
  else {
    wrap = (windowBits >> 4) + 1;
    if (windowBits < 48) {
      windowBits &= 15;
    }
  }

  /* set number of window bits, free window if different */
  if (windowBits && (windowBits < 8 || windowBits > 15)) {
    return Z_STREAM_ERROR;
  }
  if (state.window !== null && state.wbits !== windowBits) {
    state.window = null;
  }

  /* update state and reset the rest of it */
  state.wrap = wrap;
  state.wbits = windowBits;
  return inflateReset(strm);
}

function inflateInit2(strm, windowBits) {
  var ret;
  var state;

  if (!strm) { return Z_STREAM_ERROR; }
  //strm.msg = Z_NULL;                 /* in case we return an error */

  state = new InflateState();

  //if (state === Z_NULL) return Z_MEM_ERROR;
  //Tracev((stderr, "inflate: allocated\n"));
  strm.state = state;
  state.window = null/*Z_NULL*/;
  ret = inflateReset2(strm, windowBits);
  if (ret !== Z_OK) {
    strm.state = null/*Z_NULL*/;
  }
  return ret;
}

function inflateInit(strm) {
  return inflateInit2(strm, DEF_WBITS);
}


/*
 Return state with length and distance decoding tables and index sizes set to
 fixed code decoding.  Normally this returns fixed tables from inffixed.h.
 If BUILDFIXED is defined, then instead this routine builds the tables the
 first time it's called, and returns those tables the first time and
 thereafter.  This reduces the size of the code by about 2K bytes, in
 exchange for a little execution time.  However, BUILDFIXED should not be
 used for threaded applications, since the rewriting of the tables and virgin
 may not be thread-safe.
 */
var virgin = true;

var lenfix, distfix; // We have no pointers in JS, so keep tables separate

function fixedtables(state) {
  /* build fixed huffman tables if first call (may not be thread safe) */
  if (virgin) {
    var sym;

    lenfix = new utils.Buf32(512);
    distfix = new utils.Buf32(32);

    /* literal/length table */
    sym = 0;
    while (sym < 144) { state.lens[sym++] = 8; }
    while (sym < 256) { state.lens[sym++] = 9; }
    while (sym < 280) { state.lens[sym++] = 7; }
    while (sym < 288) { state.lens[sym++] = 8; }

    inflate_table(LENS,  state.lens, 0, 288, lenfix,   0, state.work, { bits: 9 });

    /* distance table */
    sym = 0;
    while (sym < 32) { state.lens[sym++] = 5; }

    inflate_table(DISTS, state.lens, 0, 32,   distfix, 0, state.work, { bits: 5 });

    /* do this just once */
    virgin = false;
  }

  state.lencode = lenfix;
  state.lenbits = 9;
  state.distcode = distfix;
  state.distbits = 5;
}


/*
 Update the window with the last wsize (normally 32K) bytes written before
 returning.  If window does not exist yet, create it.  This is only called
 when a window is already in use, or when output has been written during this
 inflate call, but the end of the deflate stream has not been reached yet.
 It is also called to create a window for dictionary data when a dictionary
 is loaded.

 Providing output buffers larger than 32K to inflate() should provide a speed
 advantage, since only the last 32K of output is copied to the sliding window
 upon return from inflate(), and since all distances after the first 32K of
 output will fall in the output data, making match copies simpler and faster.
 The advantage may be dependent on the size of the processor's data caches.
 */
function updatewindow(strm, src, end, copy) {
  var dist;
  var state = strm.state;

  /* if it hasn't been done already, allocate space for the window */
  if (state.window === null) {
    state.wsize = 1 << state.wbits;
    state.wnext = 0;
    state.whave = 0;

    state.window = new utils.Buf8(state.wsize);
  }

  /* copy state->wsize or less output bytes into the circular window */
  if (copy >= state.wsize) {
    utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
    state.wnext = 0;
    state.whave = state.wsize;
  }
  else {
    dist = state.wsize - state.wnext;
    if (dist > copy) {
      dist = copy;
    }
    //zmemcpy(state->window + state->wnext, end - copy, dist);
    utils.arraySet(state.window, src, end - copy, dist, state.wnext);
    copy -= dist;
    if (copy) {
      //zmemcpy(state->window, end - copy, copy);
      utils.arraySet(state.window, src, end - copy, copy, 0);
      state.wnext = copy;
      state.whave = state.wsize;
    }
    else {
      state.wnext += dist;
      if (state.wnext === state.wsize) { state.wnext = 0; }
      if (state.whave < state.wsize) { state.whave += dist; }
    }
  }
  return 0;
}

function inflate(strm, flush) {
  var state;
  var input, output;          // input/output buffers
  var next;                   /* next input INDEX */
  var put;                    /* next output INDEX */
  var have, left;             /* available input and output */
  var hold;                   /* bit buffer */
  var bits;                   /* bits in bit buffer */
  var _in, _out;              /* save starting available input and output */
  var copy;                   /* number of stored or match bytes to copy */
  var from;                   /* where to copy match bytes from */
  var from_source;
  var here = 0;               /* current decoding table entry */
  var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
  //var last;                   /* parent table entry */
  var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
  var len;                    /* length to copy for repeats, bits to drop */
  var ret;                    /* return code */
  var hbuf = new utils.Buf8(4);    /* buffer for gzip header crc calculation */
  var opts;

  var n; // temporary var for NEED_BITS

  var order = /* permutation of code lengths */
    [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];


  if (!strm || !strm.state || !strm.output ||
      (!strm.input && strm.avail_in !== 0)) {
    return Z_STREAM_ERROR;
  }

  state = strm.state;
  if (state.mode === TYPE) { state.mode = TYPEDO; }    /* skip check */


  //--- LOAD() ---
  put = strm.next_out;
  output = strm.output;
  left = strm.avail_out;
  next = strm.next_in;
  input = strm.input;
  have = strm.avail_in;
  hold = state.hold;
  bits = state.bits;
  //---

  _in = have;
  _out = left;
  ret = Z_OK;

  inf_leave: // goto emulation
  for (;;) {
    switch (state.mode) {
      case HEAD:
        if (state.wrap === 0) {
          state.mode = TYPEDO;
          break;
        }
        //=== NEEDBITS(16);
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if ((state.wrap & 2) && hold === 0x8b1f) {  /* gzip header */
          state.check = 0/*crc32(0L, Z_NULL, 0)*/;
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//

          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
          state.mode = FLAGS;
          break;
        }
        state.flags = 0;           /* expect zlib header */
        if (state.head) {
          state.head.done = false;
        }
        if (!(state.wrap & 1) ||   /* check if zlib header allowed */
          (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
          strm.msg = 'incorrect header check';
          state.mode = BAD;
          break;
        }
        if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
          strm.msg = 'unknown compression method';
          state.mode = BAD;
          break;
        }
        //--- DROPBITS(4) ---//
        hold >>>= 4;
        bits -= 4;
        //---//
        len = (hold & 0x0f)/*BITS(4)*/ + 8;
        if (state.wbits === 0) {
          state.wbits = len;
        }
        else if (len > state.wbits) {
          strm.msg = 'invalid window size';
          state.mode = BAD;
          break;
        }
        state.dmax = 1 << len;
        //Tracev((stderr, "inflate:   zlib header ok\n"));
        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
        state.mode = hold & 0x200 ? DICTID : TYPE;
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        break;
      case FLAGS:
        //=== NEEDBITS(16); */
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.flags = hold;
        if ((state.flags & 0xff) !== Z_DEFLATED) {
          strm.msg = 'unknown compression method';
          state.mode = BAD;
          break;
        }
        if (state.flags & 0xe000) {
          strm.msg = 'unknown header flags set';
          state.mode = BAD;
          break;
        }
        if (state.head) {
          state.head.text = ((hold >> 8) & 1);
        }
        if (state.flags & 0x0200) {
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = TIME;
        /* falls through */
      case TIME:
        //=== NEEDBITS(32); */
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if (state.head) {
          state.head.time = hold;
        }
        if (state.flags & 0x0200) {
          //=== CRC4(state.check, hold)
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          hbuf[2] = (hold >>> 16) & 0xff;
          hbuf[3] = (hold >>> 24) & 0xff;
          state.check = crc32(state.check, hbuf, 4, 0);
          //===
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = OS;
        /* falls through */
      case OS:
        //=== NEEDBITS(16); */
        while (bits < 16) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if (state.head) {
          state.head.xflags = (hold & 0xff);
          state.head.os = (hold >> 8);
        }
        if (state.flags & 0x0200) {
          //=== CRC2(state.check, hold);
          hbuf[0] = hold & 0xff;
          hbuf[1] = (hold >>> 8) & 0xff;
          state.check = crc32(state.check, hbuf, 2, 0);
          //===//
        }
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = EXLEN;
        /* falls through */
      case EXLEN:
        if (state.flags & 0x0400) {
          //=== NEEDBITS(16); */
          while (bits < 16) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.length = hold;
          if (state.head) {
            state.head.extra_len = hold;
          }
          if (state.flags & 0x0200) {
            //=== CRC2(state.check, hold);
            hbuf[0] = hold & 0xff;
            hbuf[1] = (hold >>> 8) & 0xff;
            state.check = crc32(state.check, hbuf, 2, 0);
            //===//
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
        }
        else if (state.head) {
          state.head.extra = null/*Z_NULL*/;
        }
        state.mode = EXTRA;
        /* falls through */
      case EXTRA:
        if (state.flags & 0x0400) {
          copy = state.length;
          if (copy > have) { copy = have; }
          if (copy) {
            if (state.head) {
              len = state.head.extra_len - state.length;
              if (!state.head.extra) {
                // Use untyped array for more convenient processing later
                state.head.extra = new Array(state.head.extra_len);
              }
              utils.arraySet(
                state.head.extra,
                input,
                next,
                // extra field is limited to 65536 bytes
                // - no need for additional size check
                copy,
                /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
                len
              );
              //zmemcpy(state.head.extra + len, next,
              //        len + copy > state.head.extra_max ?
              //        state.head.extra_max - len : copy);
            }
            if (state.flags & 0x0200) {
              state.check = crc32(state.check, input, copy, next);
            }
            have -= copy;
            next += copy;
            state.length -= copy;
          }
          if (state.length) { break inf_leave; }
        }
        state.length = 0;
        state.mode = NAME;
        /* falls through */
      case NAME:
        if (state.flags & 0x0800) {
          if (have === 0) { break inf_leave; }
          copy = 0;
          do {
            // TODO: 2 or 1 bytes?
            len = input[next + copy++];
            /* use constant limit because in js we should not preallocate memory */
            if (state.head && len &&
                (state.length < 65536 /*state.head.name_max*/)) {
              state.head.name += String.fromCharCode(len);
            }
          } while (len && copy < have);

          if (state.flags & 0x0200) {
            state.check = crc32(state.check, input, copy, next);
          }
          have -= copy;
          next += copy;
          if (len) { break inf_leave; }
        }
        else if (state.head) {
          state.head.name = null;
        }
        state.length = 0;
        state.mode = COMMENT;
        /* falls through */
      case COMMENT:
        if (state.flags & 0x1000) {
          if (have === 0) { break inf_leave; }
          copy = 0;
          do {
            len = input[next + copy++];
            /* use constant limit because in js we should not preallocate memory */
            if (state.head && len &&
                (state.length < 65536 /*state.head.comm_max*/)) {
              state.head.comment += String.fromCharCode(len);
            }
          } while (len && copy < have);
          if (state.flags & 0x0200) {
            state.check = crc32(state.check, input, copy, next);
          }
          have -= copy;
          next += copy;
          if (len) { break inf_leave; }
        }
        else if (state.head) {
          state.head.comment = null;
        }
        state.mode = HCRC;
        /* falls through */
      case HCRC:
        if (state.flags & 0x0200) {
          //=== NEEDBITS(16); */
          while (bits < 16) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          if (hold !== (state.check & 0xffff)) {
            strm.msg = 'header crc mismatch';
            state.mode = BAD;
            break;
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
        }
        if (state.head) {
          state.head.hcrc = ((state.flags >> 9) & 1);
          state.head.done = true;
        }
        strm.adler = state.check = 0;
        state.mode = TYPE;
        break;
      case DICTID:
        //=== NEEDBITS(32); */
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        strm.adler = state.check = zswap32(hold);
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = DICT;
        /* falls through */
      case DICT:
        if (state.havedict === 0) {
          //--- RESTORE() ---
          strm.next_out = put;
          strm.avail_out = left;
          strm.next_in = next;
          strm.avail_in = have;
          state.hold = hold;
          state.bits = bits;
          //---
          return Z_NEED_DICT;
        }
        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
        state.mode = TYPE;
        /* falls through */
      case TYPE:
        if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
        /* falls through */
      case TYPEDO:
        if (state.last) {
          //--- BYTEBITS() ---//
          hold >>>= bits & 7;
          bits -= bits & 7;
          //---//
          state.mode = CHECK;
          break;
        }
        //=== NEEDBITS(3); */
        while (bits < 3) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.last = (hold & 0x01)/*BITS(1)*/;
        //--- DROPBITS(1) ---//
        hold >>>= 1;
        bits -= 1;
        //---//

        switch ((hold & 0x03)/*BITS(2)*/) {
          case 0:                             /* stored block */
            //Tracev((stderr, "inflate:     stored block%s\n",
            //        state.last ? " (last)" : ""));
            state.mode = STORED;
            break;
          case 1:                             /* fixed block */
            fixedtables(state);
            //Tracev((stderr, "inflate:     fixed codes block%s\n",
            //        state.last ? " (last)" : ""));
            state.mode = LEN_;             /* decode codes */
            if (flush === Z_TREES) {
              //--- DROPBITS(2) ---//
              hold >>>= 2;
              bits -= 2;
              //---//
              break inf_leave;
            }
            break;
          case 2:                             /* dynamic block */
            //Tracev((stderr, "inflate:     dynamic codes block%s\n",
            //        state.last ? " (last)" : ""));
            state.mode = TABLE;
            break;
          case 3:
            strm.msg = 'invalid block type';
            state.mode = BAD;
        }
        //--- DROPBITS(2) ---//
        hold >>>= 2;
        bits -= 2;
        //---//
        break;
      case STORED:
        //--- BYTEBITS() ---// /* go to byte boundary */
        hold >>>= bits & 7;
        bits -= bits & 7;
        //---//
        //=== NEEDBITS(32); */
        while (bits < 32) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
          strm.msg = 'invalid stored block lengths';
          state.mode = BAD;
          break;
        }
        state.length = hold & 0xffff;
        //Tracev((stderr, "inflate:       stored length %u\n",
        //        state.length));
        //=== INITBITS();
        hold = 0;
        bits = 0;
        //===//
        state.mode = COPY_;
        if (flush === Z_TREES) { break inf_leave; }
        /* falls through */
      case COPY_:
        state.mode = COPY;
        /* falls through */
      case COPY:
        copy = state.length;
        if (copy) {
          if (copy > have) { copy = have; }
          if (copy > left) { copy = left; }
          if (copy === 0) { break inf_leave; }
          //--- zmemcpy(put, next, copy); ---
          utils.arraySet(output, input, next, copy, put);
          //---//
          have -= copy;
          next += copy;
          left -= copy;
          put += copy;
          state.length -= copy;
          break;
        }
        //Tracev((stderr, "inflate:       stored end\n"));
        state.mode = TYPE;
        break;
      case TABLE:
        //=== NEEDBITS(14); */
        while (bits < 14) {
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
        }
        //===//
        state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
        //--- DROPBITS(5) ---//
        hold >>>= 5;
        bits -= 5;
        //---//
        state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
        //--- DROPBITS(5) ---//
        hold >>>= 5;
        bits -= 5;
        //---//
        state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
        //--- DROPBITS(4) ---//
        hold >>>= 4;
        bits -= 4;
        //---//
//#ifndef PKZIP_BUG_WORKAROUND
        if (state.nlen > 286 || state.ndist > 30) {
          strm.msg = 'too many length or distance symbols';
          state.mode = BAD;
          break;
        }
//#endif
        //Tracev((stderr, "inflate:       table sizes ok\n"));
        state.have = 0;
        state.mode = LENLENS;
        /* falls through */
      case LENLENS:
        while (state.have < state.ncode) {
          //=== NEEDBITS(3);
          while (bits < 3) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
          //--- DROPBITS(3) ---//
          hold >>>= 3;
          bits -= 3;
          //---//
        }
        while (state.have < 19) {
          state.lens[order[state.have++]] = 0;
        }
        // We have separate tables & no pointers. 2 commented lines below not needed.
        //state.next = state.codes;
        //state.lencode = state.next;
        // Switch to use dynamic table
        state.lencode = state.lendyn;
        state.lenbits = 7;

        opts = { bits: state.lenbits };
        ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
        state.lenbits = opts.bits;

        if (ret) {
          strm.msg = 'invalid code lengths set';
          state.mode = BAD;
          break;
        }
        //Tracev((stderr, "inflate:       code lengths ok\n"));
        state.have = 0;
        state.mode = CODELENS;
        /* falls through */
      case CODELENS:
        while (state.have < state.nlen + state.ndist) {
          for (;;) {
            here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
            here_bits = here >>> 24;
            here_op = (here >>> 16) & 0xff;
            here_val = here & 0xffff;

            if ((here_bits) <= bits) { break; }
            //--- PULLBYTE() ---//
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
            //---//
          }
          if (here_val < 16) {
            //--- DROPBITS(here.bits) ---//
            hold >>>= here_bits;
            bits -= here_bits;
            //---//
            state.lens[state.have++] = here_val;
          }
          else {
            if (here_val === 16) {
              //=== NEEDBITS(here.bits + 2);
              n = here_bits + 2;
              while (bits < n) {
                if (have === 0) { break inf_leave; }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              //===//
              //--- DROPBITS(here.bits) ---//
              hold >>>= here_bits;
              bits -= here_bits;
              //---//
              if (state.have === 0) {
                strm.msg = 'invalid bit length repeat';
                state.mode = BAD;
                break;
              }
              len = state.lens[state.have - 1];
              copy = 3 + (hold & 0x03);//BITS(2);
              //--- DROPBITS(2) ---//
              hold >>>= 2;
              bits -= 2;
              //---//
            }
            else if (here_val === 17) {
              //=== NEEDBITS(here.bits + 3);
              n = here_bits + 3;
              while (bits < n) {
                if (have === 0) { break inf_leave; }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              //===//
              //--- DROPBITS(here.bits) ---//
              hold >>>= here_bits;
              bits -= here_bits;
              //---//
              len = 0;
              copy = 3 + (hold & 0x07);//BITS(3);
              //--- DROPBITS(3) ---//
              hold >>>= 3;
              bits -= 3;
              //---//
            }
            else {
              //=== NEEDBITS(here.bits + 7);
              n = here_bits + 7;
              while (bits < n) {
                if (have === 0) { break inf_leave; }
                have--;
                hold += input[next++] << bits;
                bits += 8;
              }
              //===//
              //--- DROPBITS(here.bits) ---//
              hold >>>= here_bits;
              bits -= here_bits;
              //---//
              len = 0;
              copy = 11 + (hold & 0x7f);//BITS(7);
              //--- DROPBITS(7) ---//
              hold >>>= 7;
              bits -= 7;
              //---//
            }
            if (state.have + copy > state.nlen + state.ndist) {
              strm.msg = 'invalid bit length repeat';
              state.mode = BAD;
              break;
            }
            while (copy--) {
              state.lens[state.have++] = len;
            }
          }
        }

        /* handle error breaks in while */
        if (state.mode === BAD) { break; }

        /* check for end-of-block code (better have one) */
        if (state.lens[256] === 0) {
          strm.msg = 'invalid code -- missing end-of-block';
          state.mode = BAD;
          break;
        }

        /* build code tables -- note: do not change the lenbits or distbits
           values here (9 and 6) without reading the comments in inftrees.h
           concerning the ENOUGH constants, which depend on those values */
        state.lenbits = 9;

        opts = { bits: state.lenbits };
        ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
        // We have separate tables & no pointers. 2 commented lines below not needed.
        // state.next_index = opts.table_index;
        state.lenbits = opts.bits;
        // state.lencode = state.next;

        if (ret) {
          strm.msg = 'invalid literal/lengths set';
          state.mode = BAD;
          break;
        }

        state.distbits = 6;
        //state.distcode.copy(state.codes);
        // Switch to use dynamic table
        state.distcode = state.distdyn;
        opts = { bits: state.distbits };
        ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
        // We have separate tables & no pointers. 2 commented lines below not needed.
        // state.next_index = opts.table_index;
        state.distbits = opts.bits;
        // state.distcode = state.next;

        if (ret) {
          strm.msg = 'invalid distances set';
          state.mode = BAD;
          break;
        }
        //Tracev((stderr, 'inflate:       codes ok\n'));
        state.mode = LEN_;
        if (flush === Z_TREES) { break inf_leave; }
        /* falls through */
      case LEN_:
        state.mode = LEN;
        /* falls through */
      case LEN:
        if (have >= 6 && left >= 258) {
          //--- RESTORE() ---
          strm.next_out = put;
          strm.avail_out = left;
          strm.next_in = next;
          strm.avail_in = have;
          state.hold = hold;
          state.bits = bits;
          //---
          inflate_fast(strm, _out);
          //--- LOAD() ---
          put = strm.next_out;
          output = strm.output;
          left = strm.avail_out;
          next = strm.next_in;
          input = strm.input;
          have = strm.avail_in;
          hold = state.hold;
          bits = state.bits;
          //---

          if (state.mode === TYPE) {
            state.back = -1;
          }
          break;
        }
        state.back = 0;
        for (;;) {
          here = state.lencode[hold & ((1 << state.lenbits) - 1)];  /*BITS(state.lenbits)*/
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if (here_bits <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        if (here_op && (here_op & 0xf0) === 0) {
          last_bits = here_bits;
          last_op = here_op;
          last_val = here_val;
          for (;;) {
            here = state.lencode[last_val +
                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
            here_bits = here >>> 24;
            here_op = (here >>> 16) & 0xff;
            here_val = here & 0xffff;

            if ((last_bits + here_bits) <= bits) { break; }
            //--- PULLBYTE() ---//
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
            //---//
          }
          //--- DROPBITS(last.bits) ---//
          hold >>>= last_bits;
          bits -= last_bits;
          //---//
          state.back += last_bits;
        }
        //--- DROPBITS(here.bits) ---//
        hold >>>= here_bits;
        bits -= here_bits;
        //---//
        state.back += here_bits;
        state.length = here_val;
        if (here_op === 0) {
          //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
          //        "inflate:         literal '%c'\n" :
          //        "inflate:         literal 0x%02x\n", here.val));
          state.mode = LIT;
          break;
        }
        if (here_op & 32) {
          //Tracevv((stderr, "inflate:         end of block\n"));
          state.back = -1;
          state.mode = TYPE;
          break;
        }
        if (here_op & 64) {
          strm.msg = 'invalid literal/length code';
          state.mode = BAD;
          break;
        }
        state.extra = here_op & 15;
        state.mode = LENEXT;
        /* falls through */
      case LENEXT:
        if (state.extra) {
          //=== NEEDBITS(state.extra);
          n = state.extra;
          while (bits < n) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
          //--- DROPBITS(state.extra) ---//
          hold >>>= state.extra;
          bits -= state.extra;
          //---//
          state.back += state.extra;
        }
        //Tracevv((stderr, "inflate:         length %u\n", state.length));
        state.was = state.length;
        state.mode = DIST;
        /* falls through */
      case DIST:
        for (;;) {
          here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
          here_bits = here >>> 24;
          here_op = (here >>> 16) & 0xff;
          here_val = here & 0xffff;

          if ((here_bits) <= bits) { break; }
          //--- PULLBYTE() ---//
          if (have === 0) { break inf_leave; }
          have--;
          hold += input[next++] << bits;
          bits += 8;
          //---//
        }
        if ((here_op & 0xf0) === 0) {
          last_bits = here_bits;
          last_op = here_op;
          last_val = here_val;
          for (;;) {
            here = state.distcode[last_val +
                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
            here_bits = here >>> 24;
            here_op = (here >>> 16) & 0xff;
            here_val = here & 0xffff;

            if ((last_bits + here_bits) <= bits) { break; }
            //--- PULLBYTE() ---//
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
            //---//
          }
          //--- DROPBITS(last.bits) ---//
          hold >>>= last_bits;
          bits -= last_bits;
          //---//
          state.back += last_bits;
        }
        //--- DROPBITS(here.bits) ---//
        hold >>>= here_bits;
        bits -= here_bits;
        //---//
        state.back += here_bits;
        if (here_op & 64) {
          strm.msg = 'invalid distance code';
          state.mode = BAD;
          break;
        }
        state.offset = here_val;
        state.extra = (here_op) & 15;
        state.mode = DISTEXT;
        /* falls through */
      case DISTEXT:
        if (state.extra) {
          //=== NEEDBITS(state.extra);
          n = state.extra;
          while (bits < n) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
          //--- DROPBITS(state.extra) ---//
          hold >>>= state.extra;
          bits -= state.extra;
          //---//
          state.back += state.extra;
        }
//#ifdef INFLATE_STRICT
        if (state.offset > state.dmax) {
          strm.msg = 'invalid distance too far back';
          state.mode = BAD;
          break;
        }
//#endif
        //Tracevv((stderr, "inflate:         distance %u\n", state.offset));
        state.mode = MATCH;
        /* falls through */
      case MATCH:
        if (left === 0) { break inf_leave; }
        copy = _out - left;
        if (state.offset > copy) {         /* copy from window */
          copy = state.offset - copy;
          if (copy > state.whave) {
            if (state.sane) {
              strm.msg = 'invalid distance too far back';
              state.mode = BAD;
              break;
            }
// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility
//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
//          Trace((stderr, "inflate.c too far\n"));
//          copy -= state.whave;
//          if (copy > state.length) { copy = state.length; }
//          if (copy > left) { copy = left; }
//          left -= copy;
//          state.length -= copy;
//          do {
//            output[put++] = 0;
//          } while (--copy);
//          if (state.length === 0) { state.mode = LEN; }
//          break;
//#endif
          }
          if (copy > state.wnext) {
            copy -= state.wnext;
            from = state.wsize - copy;
          }
          else {
            from = state.wnext - copy;
          }
          if (copy > state.length) { copy = state.length; }
          from_source = state.window;
        }
        else {                              /* copy from output */
          from_source = output;
          from = put - state.offset;
          copy = state.length;
        }
        if (copy > left) { copy = left; }
        left -= copy;
        state.length -= copy;
        do {
          output[put++] = from_source[from++];
        } while (--copy);
        if (state.length === 0) { state.mode = LEN; }
        break;
      case LIT:
        if (left === 0) { break inf_leave; }
        output[put++] = state.length;
        left--;
        state.mode = LEN;
        break;
      case CHECK:
        if (state.wrap) {
          //=== NEEDBITS(32);
          while (bits < 32) {
            if (have === 0) { break inf_leave; }
            have--;
            // Use '|' instead of '+' to make sure that result is signed
            hold |= input[next++] << bits;
            bits += 8;
          }
          //===//
          _out -= left;
          strm.total_out += _out;
          state.total += _out;
          if (_out) {
            strm.adler = state.check =
                /*UPDATE(state.check, put - _out, _out);*/
                (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));

          }
          _out = left;
          // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
          if ((state.flags ? hold : zswap32(hold)) !== state.check) {
            strm.msg = 'incorrect data check';
            state.mode = BAD;
            break;
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
          //Tracev((stderr, "inflate:   check matches trailer\n"));
        }
        state.mode = LENGTH;
        /* falls through */
      case LENGTH:
        if (state.wrap && state.flags) {
          //=== NEEDBITS(32);
          while (bits < 32) {
            if (have === 0) { break inf_leave; }
            have--;
            hold += input[next++] << bits;
            bits += 8;
          }
          //===//
          if (hold !== (state.total & 0xffffffff)) {
            strm.msg = 'incorrect length check';
            state.mode = BAD;
            break;
          }
          //=== INITBITS();
          hold = 0;
          bits = 0;
          //===//
          //Tracev((stderr, "inflate:   length matches trailer\n"));
        }
        state.mode = DONE;
        /* falls through */
      case DONE:
        ret = Z_STREAM_END;
        break inf_leave;
      case BAD:
        ret = Z_DATA_ERROR;
        break inf_leave;
      case MEM:
        return Z_MEM_ERROR;
      case SYNC:
        /* falls through */
      default:
        return Z_STREAM_ERROR;
    }
  }

  // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"

  /*
     Return from inflate(), updating the total counts and the check value.
     If there was no progress during the inflate() call, return a buffer
     error.  Call updatewindow() to create and/or update the window state.
     Note: a memory error from inflate() is non-recoverable.
   */

  //--- RESTORE() ---
  strm.next_out = put;
  strm.avail_out = left;
  strm.next_in = next;
  strm.avail_in = have;
  state.hold = hold;
  state.bits = bits;
  //---

  if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
                      (state.mode < CHECK || flush !== Z_FINISH))) {
    if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
      state.mode = MEM;
      return Z_MEM_ERROR;
    }
  }
  _in -= strm.avail_in;
  _out -= strm.avail_out;
  strm.total_in += _in;
  strm.total_out += _out;
  state.total += _out;
  if (state.wrap && _out) {
    strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
      (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
  }
  strm.data_type = state.bits + (state.last ? 64 : 0) +
                    (state.mode === TYPE ? 128 : 0) +
                    (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
  if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
    ret = Z_BUF_ERROR;
  }
  return ret;
}

function inflateEnd(strm) {

  if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
    return Z_STREAM_ERROR;
  }

  var state = strm.state;
  if (state.window) {
    state.window = null;
  }
  strm.state = null;
  return Z_OK;
}

function inflateGetHeader(strm, head) {
  var state;

  /* check state */
  if (!strm || !strm.state) { return Z_STREAM_ERROR; }
  state = strm.state;
  if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }

  /* save header structure */
  state.head = head;
  head.done = false;
  return Z_OK;
}

function inflateSetDictionary(strm, dictionary) {
  var dictLength = dictionary.length;

  var state;
  var dictid;
  var ret;

  /* check state */
  if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
  state = strm.state;

  if (state.wrap !== 0 && state.mode !== DICT) {
    return Z_STREAM_ERROR;
  }

  /* check for correct dictionary identifier */
  if (state.mode === DICT) {
    dictid = 1; /* adler32(0, null, 0)*/
    /* dictid = adler32(dictid, dictionary, dictLength); */
    dictid = adler32(dictid, dictionary, dictLength, 0);
    if (dictid !== state.check) {
      return Z_DATA_ERROR;
    }
  }
  /* copy dictionary to window using updatewindow(), which will amend the
   existing dictionary if appropriate */
  ret = updatewindow(strm, dictionary, dictLength, dictLength);
  if (ret) {
    state.mode = MEM;
    return Z_MEM_ERROR;
  }
  state.havedict = 1;
  // Tracev((stderr, "inflate:   dictionary set\n"));
  return Z_OK;
}

exports.inflateReset = inflateReset;
exports.inflateReset2 = inflateReset2;
exports.inflateResetKeep = inflateResetKeep;
exports.inflateInit = inflateInit;
exports.inflateInit2 = inflateInit2;
exports.inflate = inflate;
exports.inflateEnd = inflateEnd;
exports.inflateGetHeader = inflateGetHeader;
exports.inflateSetDictionary = inflateSetDictionary;
exports.inflateInfo = 'pako inflate (from Nodeca project)';

/* Not implemented
exports.inflateCopy = inflateCopy;
exports.inflateGetDictionary = inflateGetDictionary;
exports.inflateMark = inflateMark;
exports.inflatePrime = inflatePrime;
exports.inflateSync = inflateSync;
exports.inflateSyncPoint = inflateSyncPoint;
exports.inflateUndermine = inflateUndermine;
*/


/***/ }),
/* 1230 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

var utils = __webpack_require__(83);

var MAXBITS = 15;
var ENOUGH_LENS = 852;
var ENOUGH_DISTS = 592;
//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);

var CODES = 0;
var LENS = 1;
var DISTS = 2;

var lbase = [ /* Length codes 257..285 base */
  3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
];

var lext = [ /* Length codes 257..285 extra */
  16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
  19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
];

var dbase = [ /* Distance codes 0..29 base */
  1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  8193, 12289, 16385, 24577, 0, 0
];

var dext = [ /* Distance codes 0..29 extra */
  16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
  23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
  28, 28, 29, 29, 64, 64
];

module.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
{
  var bits = opts.bits;
      //here = opts.here; /* table entry for duplication */

  var len = 0;               /* a code's length in bits */
  var sym = 0;               /* index of code symbols */
  var min = 0, max = 0;          /* minimum and maximum code lengths */
  var root = 0;              /* number of index bits for root table */
  var curr = 0;              /* number of index bits for current table */
  var drop = 0;              /* code bits to drop for sub-table */
  var left = 0;                   /* number of prefix codes available */
  var used = 0;              /* code entries in table used */
  var huff = 0;              /* Huffman code */
  var incr;              /* for incrementing code, index */
  var fill;              /* index for replicating entries */
  var low;               /* low bits for current root entry */
  var mask;              /* mask for low root bits */
  var next;             /* next available space in table */
  var base = null;     /* base value table to use */
  var base_index = 0;
//  var shoextra;    /* extra bits table to use */
  var end;                    /* use base and extra for symbol > end */
  var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];    /* number of codes of each length */
  var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];     /* offsets in table for each length */
  var extra = null;
  var extra_index = 0;

  var here_bits, here_op, here_val;

  /*
   Process a set of code lengths to create a canonical Huffman code.  The
   code lengths are lens[0..codes-1].  Each length corresponds to the
   symbols 0..codes-1.  The Huffman code is generated by first sorting the
   symbols by length from short to long, and retaining the symbol order
   for codes with equal lengths.  Then the code starts with all zero bits
   for the first code of the shortest length, and the codes are integer
   increments for the same length, and zeros are appended as the length
   increases.  For the deflate format, these bits are stored backwards
   from their more natural integer increment ordering, and so when the
   decoding tables are built in the large loop below, the integer codes
   are incremented backwards.

   This routine assumes, but does not check, that all of the entries in
   lens[] are in the range 0..MAXBITS.  The caller must assure this.
   1..MAXBITS is interpreted as that code length.  zero means that that
   symbol does not occur in this code.

   The codes are sorted by computing a count of codes for each length,
   creating from that a table of starting indices for each length in the
   sorted table, and then entering the symbols in order in the sorted
   table.  The sorted table is work[], with that space being provided by
   the caller.

   The length counts are used for other purposes as well, i.e. finding
   the minimum and maximum length codes, determining if there are any
   codes at all, checking for a valid set of lengths, and looking ahead
   at length counts to determine sub-table sizes when building the
   decoding tables.
   */

  /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
  for (len = 0; len <= MAXBITS; len++) {
    count[len] = 0;
  }
  for (sym = 0; sym < codes; sym++) {
    count[lens[lens_index + sym]]++;
  }

  /* bound code lengths, force root to be within code lengths */
  root = bits;
  for (max = MAXBITS; max >= 1; max--) {
    if (count[max] !== 0) { break; }
  }
  if (root > max) {
    root = max;
  }
  if (max === 0) {                     /* no symbols to code at all */
    //table.op[opts.table_index] = 64;  //here.op = (var char)64;    /* invalid code marker */
    //table.bits[opts.table_index] = 1;   //here.bits = (var char)1;
    //table.val[opts.table_index++] = 0;   //here.val = (var short)0;
    table[table_index++] = (1 << 24) | (64 << 16) | 0;


    //table.op[opts.table_index] = 64;
    //table.bits[opts.table_index] = 1;
    //table.val[opts.table_index++] = 0;
    table[table_index++] = (1 << 24) | (64 << 16) | 0;

    opts.bits = 1;
    return 0;     /* no symbols, but wait for decoding to report error */
  }
  for (min = 1; min < max; min++) {
    if (count[min] !== 0) { break; }
  }
  if (root < min) {
    root = min;
  }

  /* check for an over-subscribed or incomplete set of lengths */
  left = 1;
  for (len = 1; len <= MAXBITS; len++) {
    left <<= 1;
    left -= count[len];
    if (left < 0) {
      return -1;
    }        /* over-subscribed */
  }
  if (left > 0 && (type === CODES || max !== 1)) {
    return -1;                      /* incomplete set */
  }

  /* generate offsets into symbol table for each length for sorting */
  offs[1] = 0;
  for (len = 1; len < MAXBITS; len++) {
    offs[len + 1] = offs[len] + count[len];
  }

  /* sort symbols by length, by symbol order within each length */
  for (sym = 0; sym < codes; sym++) {
    if (lens[lens_index + sym] !== 0) {
      work[offs[lens[lens_index + sym]]++] = sym;
    }
  }

  /*
   Create and fill in decoding tables.  In this loop, the table being
   filled is at next and has curr index bits.  The code being used is huff
   with length len.  That code is converted to an index by dropping drop
   bits off of the bottom.  For codes where len is less than drop + curr,
   those top drop + curr - len bits are incremented through all values to
   fill the table with replicated entries.

   root is the number of index bits for the root table.  When len exceeds
   root, sub-tables are created pointed to by the root entry with an index
   of the low root bits of huff.  This is saved in low to check for when a
   new sub-table should be started.  drop is zero when the root table is
   being filled, and drop is root when sub-tables are being filled.

   When a new sub-table is needed, it is necessary to look ahead in the
   code lengths to determine what size sub-table is needed.  The length
   counts are used for this, and so count[] is decremented as codes are
   entered in the tables.

   used keeps track of how many table entries have been allocated from the
   provided *table space.  It is checked for LENS and DIST tables against
   the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
   the initial root table size constants.  See the comments in inftrees.h
   for more information.

   sym increments through all symbols, and the loop terminates when
   all codes of length max, i.e. all codes, have been processed.  This
   routine permits incomplete codes, so another loop after this one fills
   in the rest of the decoding tables with invalid code markers.
   */

  /* set up for code type */
  // poor man optimization - use if-else instead of switch,
  // to avoid deopts in old v8
  if (type === CODES) {
    base = extra = work;    /* dummy value--not used */
    end = 19;

  } else if (type === LENS) {
    base = lbase;
    base_index -= 257;
    extra = lext;
    extra_index -= 257;
    end = 256;

  } else {                    /* DISTS */
    base = dbase;
    extra = dext;
    end = -1;
  }

  /* initialize opts for loop */
  huff = 0;                   /* starting code */
  sym = 0;                    /* starting code symbol */
  len = min;                  /* starting code length */
  next = table_index;              /* current table to fill in */
  curr = root;                /* current table index bits */
  drop = 0;                   /* current bits to drop from code for index */
  low = -1;                   /* trigger new sub-table when len > root */
  used = 1 << root;          /* use root table entries */
  mask = used - 1;            /* mask for comparing low */

  /* check available table space */
  if ((type === LENS && used > ENOUGH_LENS) ||
    (type === DISTS && used > ENOUGH_DISTS)) {
    return 1;
  }

  /* process all codes and make table entries */
  for (;;) {
    /* create table entry */
    here_bits = len - drop;
    if (work[sym] < end) {
      here_op = 0;
      here_val = work[sym];
    }
    else if (work[sym] > end) {
      here_op = extra[extra_index + work[sym]];
      here_val = base[base_index + work[sym]];
    }
    else {
      here_op = 32 + 64;         /* end of block */
      here_val = 0;
    }

    /* replicate for those indices with low len bits equal to huff */
    incr = 1 << (len - drop);
    fill = 1 << curr;
    min = fill;                 /* save offset to next table */
    do {
      fill -= incr;
      table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
    } while (fill !== 0);

    /* backwards increment the len-bit code huff */
    incr = 1 << (len - 1);
    while (huff & incr) {
      incr >>= 1;
    }
    if (incr !== 0) {
      huff &= incr - 1;
      huff += incr;
    } else {
      huff = 0;
    }

    /* go to next symbol, update count, len */
    sym++;
    if (--count[len] === 0) {
      if (len === max) { break; }
      len = lens[lens_index + work[sym]];
    }

    /* create new sub-table if needed */
    if (len > root && (huff & mask) !== low) {
      /* if first time, transition to sub-tables */
      if (drop === 0) {
        drop = root;
      }

      /* increment past last table */
      next += min;            /* here min is 1 << curr */

      /* determine length of next table */
      curr = len - drop;
      left = 1 << curr;
      while (curr + drop < max) {
        left -= count[curr + drop];
        if (left <= 0) { break; }
        curr++;
        left <<= 1;
      }

      /* check for enough space */
      used += 1 << curr;
      if ((type === LENS && used > ENOUGH_LENS) ||
        (type === DISTS && used > ENOUGH_DISTS)) {
        return 1;
      }

      /* point entry in root table to sub-table */
      low = huff & mask;
      /*table.op[low] = curr;
      table.bits[low] = root;
      table.val[low] = next - opts.table_index;*/
      table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
    }
  }

  /* fill in remaining table entry if code is incomplete (guaranteed to have
   at most one remaining entry, since if the code is incomplete, the
   maximum code length that was allowed to get this far is one bit) */
  if (huff !== 0) {
    //table.op[next + huff] = 64;            /* invalid code marker */
    //table.bits[next + huff] = len - drop;
    //table.val[next + huff] = 0;
    table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
  }

  /* set return parameters */
  //opts.table_index += used;
  opts.bits = root;
  return 0;
};


/***/ }),
/* 1231 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


// (C) 1995-2013 Jean-loup Gailly and Mark Adler
// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
//   claim that you wrote the original software. If you use this software
//   in a product, an acknowledgment in the product documentation would be
//   appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
//   misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.

/* eslint-disable space-unary-ops */

var utils = __webpack_require__(83);

/* Public constants ==========================================================*/
/* ===========================================================================*/


//var Z_FILTERED          = 1;
//var Z_HUFFMAN_ONLY      = 2;
//var Z_RLE               = 3;
var Z_FIXED               = 4;
//var Z_DEFAULT_STRATEGY  = 0;

/* Possible values of the data_type field (though see inflate()) */
var Z_BINARY              = 0;
var Z_TEXT                = 1;
//var Z_ASCII             = 1; // = Z_TEXT
var Z_UNKNOWN             = 2;

/*============================================================================*/


function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }

// From zutil.h

var STORED_BLOCK = 0;
var STATIC_TREES = 1;
var DYN_TREES    = 2;
/* The three kinds of block type */

var MIN_MATCH    = 3;
var MAX_MATCH    = 258;
/* The minimum and maximum match lengths */

// From deflate.h
/* ===========================================================================
 * Internal compression state.
 */

var LENGTH_CODES  = 29;
/* number of length codes, not counting the special END_BLOCK code */

var LITERALS      = 256;
/* number of literal bytes 0..255 */

var L_CODES       = LITERALS + 1 + LENGTH_CODES;
/* number of Literal or Length codes, including the END_BLOCK code */

var D_CODES       = 30;
/* number of distance codes */

var BL_CODES      = 19;
/* number of codes used to transfer the bit lengths */

var HEAP_SIZE     = 2 * L_CODES + 1;
/* maximum heap size */

var MAX_BITS      = 15;
/* All codes must not exceed MAX_BITS bits */

var Buf_size      = 16;
/* size of bit buffer in bi_buf */


/* ===========================================================================
 * Constants
 */

var MAX_BL_BITS = 7;
/* Bit length codes must not exceed MAX_BL_BITS bits */

var END_BLOCK   = 256;
/* end of block literal code */

var REP_3_6     = 16;
/* repeat previous bit length 3-6 times (2 bits of repeat count) */

var REPZ_3_10   = 17;
/* repeat a zero length 3-10 times  (3 bits of repeat count) */

var REPZ_11_138 = 18;
/* repeat a zero length 11-138 times  (7 bits of repeat count) */

/* eslint-disable comma-spacing,array-bracket-spacing */
var extra_lbits =   /* extra bits for each length code */
  [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];

var extra_dbits =   /* extra bits for each distance code */
  [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];

var extra_blbits =  /* extra bits for each bit length code */
  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];

var bl_order =
  [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
/* eslint-enable comma-spacing,array-bracket-spacing */

/* The lengths of the bit length codes are sent in order of decreasing
 * probability, to avoid transmitting the lengths for unused bit length codes.
 */

/* ===========================================================================
 * Local data. These are initialized only once.
 */

// We pre-fill arrays with 0 to avoid uninitialized gaps

var DIST_CODE_LEN = 512; /* see definition of array dist_code below */

// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1
var static_ltree  = new Array((L_CODES + 2) * 2);
zero(static_ltree);
/* The static literal tree. Since the bit lengths are imposed, there is no
 * need for the L_CODES extra codes used during heap construction. However
 * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
 * below).
 */

var static_dtree  = new Array(D_CODES * 2);
zero(static_dtree);
/* The static distance tree. (Actually a trivial tree since all codes use
 * 5 bits.)
 */

var _dist_code    = new Array(DIST_CODE_LEN);
zero(_dist_code);
/* Distance codes. The first 256 values correspond to the distances
 * 3 .. 258, the last 256 values correspond to the top 8 bits of
 * the 15 bit distances.
 */

var _length_code  = new Array(MAX_MATCH - MIN_MATCH + 1);
zero(_length_code);
/* length code for each normalized match length (0 == MIN_MATCH) */

var base_length   = new Array(LENGTH_CODES);
zero(base_length);
/* First normalized length for each code (0 = MIN_MATCH) */

var base_dist     = new Array(D_CODES);
zero(base_dist);
/* First normalized distance for each code (0 = distance of 1) */


function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {

  this.static_tree  = static_tree;  /* static tree or NULL */
  this.extra_bits   = extra_bits;   /* extra bits for each code or NULL */
  this.extra_base   = extra_base;   /* base index for extra_bits */
  this.elems        = elems;        /* max number of elements in the tree */
  this.max_length   = max_length;   /* max bit length for the codes */

  // show if `static_tree` has data or dummy - needed for monomorphic objects
  this.has_stree    = static_tree && static_tree.length;
}


var static_l_desc;
var static_d_desc;
var static_bl_desc;


function TreeDesc(dyn_tree, stat_desc) {
  this.dyn_tree = dyn_tree;     /* the dynamic tree */
  this.max_code = 0;            /* largest code with non zero frequency */
  this.stat_desc = stat_desc;   /* the corresponding static tree */
}



function d_code(dist) {
  return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
}


/* ===========================================================================
 * Output a short LSB first on the stream.
 * IN assertion: there is enough room in pendingBuf.
 */
function put_short(s, w) {
//    put_byte(s, (uch)((w) & 0xff));
//    put_byte(s, (uch)((ush)(w) >> 8));
  s.pending_buf[s.pending++] = (w) & 0xff;
  s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
}


/* ===========================================================================
 * Send a value on a given number of bits.
 * IN assertion: length <= 16 and value fits in length bits.
 */
function send_bits(s, value, length) {
  if (s.bi_valid > (Buf_size - length)) {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    put_short(s, s.bi_buf);
    s.bi_buf = value >> (Buf_size - s.bi_valid);
    s.bi_valid += length - Buf_size;
  } else {
    s.bi_buf |= (value << s.bi_valid) & 0xffff;
    s.bi_valid += length;
  }
}


function send_code(s, c, tree) {
  send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
}


/* ===========================================================================
 * Reverse the first len bits of a code, using straightforward code (a faster
 * method would use a table)
 * IN assertion: 1 <= len <= 15
 */
function bi_reverse(code, len) {
  var res = 0;
  do {
    res |= code & 1;
    code >>>= 1;
    res <<= 1;
  } while (--len > 0);
  return res >>> 1;
}


/* ===========================================================================
 * Flush the bit buffer, keeping at most 7 bits in it.
 */
function bi_flush(s) {
  if (s.bi_valid === 16) {
    put_short(s, s.bi_buf);
    s.bi_buf = 0;
    s.bi_valid = 0;

  } else if (s.bi_valid >= 8) {
    s.pending_buf[s.pending++] = s.bi_buf & 0xff;
    s.bi_buf >>= 8;
    s.bi_valid -= 8;
  }
}


/* ===========================================================================
 * Compute the optimal bit lengths for a tree and update the total bit length
 * for the current block.
 * IN assertion: the fields freq and dad are set, heap[heap_max] and
 *    above are the tree nodes sorted by increasing frequency.
 * OUT assertions: the field len is set to the optimal bit length, the
 *     array bl_count contains the frequencies for each bit length.
 *     The length opt_len is updated; static_len is also updated if stree is
 *     not null.
 */
function gen_bitlen(s, desc)
//    deflate_state *s;
//    tree_desc *desc;    /* the tree descriptor */
{
  var tree            = desc.dyn_tree;
  var max_code        = desc.max_code;
  var stree           = desc.stat_desc.static_tree;
  var has_stree       = desc.stat_desc.has_stree;
  var extra           = desc.stat_desc.extra_bits;
  var base            = desc.stat_desc.extra_base;
  var max_length      = desc.stat_desc.max_length;
  var h;              /* heap index */
  var n, m;           /* iterate over the tree elements */
  var bits;           /* bit length */
  var xbits;          /* extra bits */
  var f;              /* frequency */
  var overflow = 0;   /* number of elements with bit length too large */

  for (bits = 0; bits <= MAX_BITS; bits++) {
    s.bl_count[bits] = 0;
  }

  /* In a first pass, compute the optimal bit lengths (which may
   * overflow in the case of the bit length tree).
   */
  tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */

  for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
    n = s.heap[h];
    bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
    if (bits > max_length) {
      bits = max_length;
      overflow++;
    }
    tree[n * 2 + 1]/*.Len*/ = bits;
    /* We overwrite tree[n].Dad which is no longer needed */

    if (n > max_code) { continue; } /* not a leaf node */

    s.bl_count[bits]++;
    xbits = 0;
    if (n >= base) {
      xbits = extra[n - base];
    }
    f = tree[n * 2]/*.Freq*/;
    s.opt_len += f * (bits + xbits);
    if (has_stree) {
      s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
    }
  }
  if (overflow === 0) { return; }

  // Trace((stderr,"\nbit length overflow\n"));
  /* This happens for example on obj2 and pic of the Calgary corpus */

  /* Find the first bit length which could increase: */
  do {
    bits = max_length - 1;
    while (s.bl_count[bits] === 0) { bits--; }
    s.bl_count[bits]--;      /* move one leaf down the tree */
    s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
    s.bl_count[max_length]--;
    /* The brother of the overflow item also moves one step up,
     * but this does not affect bl_count[max_length]
     */
    overflow -= 2;
  } while (overflow > 0);

  /* Now recompute all bit lengths, scanning in increasing frequency.
   * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
   * lengths instead of fixing only the wrong ones. This idea is taken
   * from 'ar' written by Haruhiko Okumura.)
   */
  for (bits = max_length; bits !== 0; bits--) {
    n = s.bl_count[bits];
    while (n !== 0) {
      m = s.heap[--h];
      if (m > max_code) { continue; }
      if (tree[m * 2 + 1]/*.Len*/ !== bits) {
        // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
        s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
        tree[m * 2 + 1]/*.Len*/ = bits;
      }
      n--;
    }
  }
}


/* ===========================================================================
 * Generate the codes for a given tree and bit counts (which need not be
 * optimal).
 * IN assertion: the array bl_count contains the bit length statistics for
 * the given tree and the field len is set for all tree elements.
 * OUT assertion: the field code is set for all tree elements of non
 *     zero code length.
 */
function gen_codes(tree, max_code, bl_count)
//    ct_data *tree;             /* the tree to decorate */
//    int max_code;              /* largest code with non zero frequency */
//    ushf *bl_count;            /* number of codes at each bit length */
{
  var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
  var code = 0;              /* running code value */
  var bits;                  /* bit index */
  var n;                     /* code index */

  /* The distribution counts are first used to generate the code values
   * without bit reversal.
   */
  for (bits = 1; bits <= MAX_BITS; bits++) {
    next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
  }
  /* Check that the bit counts in bl_count are consistent. The last code
   * must be all ones.
   */
  //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
  //        "inconsistent bit counts");
  //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));

  for (n = 0;  n <= max_code; n++) {
    var len = tree[n * 2 + 1]/*.Len*/;
    if (len === 0) { continue; }
    /* Now reverse the bits */
    tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);

    //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
    //     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
  }
}


/* ===========================================================================
 * Initialize the various 'constant' tables.
 */
function tr_static_init() {
  var n;        /* iterates over tree elements */
  var bits;     /* bit counter */
  var length;   /* length value */
  var code;     /* code value */
  var dist;     /* distance index */
  var bl_count = new Array(MAX_BITS + 1);
  /* number of codes at each bit length for an optimal tree */

  // do check in _tr_init()
  //if (static_init_done) return;

  /* For some embedded targets, global variables are not initialized: */
/*#ifdef NO_INIT_GLOBAL_POINTERS
  static_l_desc.static_tree = static_ltree;
  static_l_desc.extra_bits = extra_lbits;
  static_d_desc.static_tree = static_dtree;
  static_d_desc.extra_bits = extra_dbits;
  static_bl_desc.extra_bits = extra_blbits;
#endif*/

  /* Initialize the mapping length (0..255) -> length code (0..28) */
  length = 0;
  for (code = 0; code < LENGTH_CODES - 1; code++) {
    base_length[code] = length;
    for (n = 0; n < (1 << extra_lbits[code]); n++) {
      _length_code[length++] = code;
    }
  }
  //Assert (length == 256, "tr_static_init: length != 256");
  /* Note that the length 255 (match length 258) can be represented
   * in two different ways: code 284 + 5 bits or code 285, so we
   * overwrite length_code[255] to use the best encoding:
   */
  _length_code[length - 1] = code;

  /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
  dist = 0;
  for (code = 0; code < 16; code++) {
    base_dist[code] = dist;
    for (n = 0; n < (1 << extra_dbits[code]); n++) {
      _dist_code[dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: dist != 256");
  dist >>= 7; /* from now on, all distances are divided by 128 */
  for (; code < D_CODES; code++) {
    base_dist[code] = dist << 7;
    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
      _dist_code[256 + dist++] = code;
    }
  }
  //Assert (dist == 256, "tr_static_init: 256+dist != 512");

  /* Construct the codes of the static literal tree */
  for (bits = 0; bits <= MAX_BITS; bits++) {
    bl_count[bits] = 0;
  }

  n = 0;
  while (n <= 143) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  while (n <= 255) {
    static_ltree[n * 2 + 1]/*.Len*/ = 9;
    n++;
    bl_count[9]++;
  }
  while (n <= 279) {
    static_ltree[n * 2 + 1]/*.Len*/ = 7;
    n++;
    bl_count[7]++;
  }
  while (n <= 287) {
    static_ltree[n * 2 + 1]/*.Len*/ = 8;
    n++;
    bl_count[8]++;
  }
  /* Codes 286 and 287 do not exist, but we must include them in the
   * tree construction to get a canonical Huffman tree (longest code
   * all ones)
   */
  gen_codes(static_ltree, L_CODES + 1, bl_count);

  /* The static distance tree is trivial: */
  for (n = 0; n < D_CODES; n++) {
    static_dtree[n * 2 + 1]/*.Len*/ = 5;
    static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
  }

  // Now data ready and we can init static trees
  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS);
  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0,         BL_CODES, MAX_BL_BITS);

  //static_init_done = true;
}


/* ===========================================================================
 * Initialize a new block.
 */
function init_block(s) {
  var n; /* iterates over tree elements */

  /* Initialize the trees. */
  for (n = 0; n < L_CODES;  n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < D_CODES;  n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
  for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }

  s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
  s.opt_len = s.static_len = 0;
  s.last_lit = s.matches = 0;
}


/* ===========================================================================
 * Flush the bit buffer and align the output on a byte boundary
 */
function bi_windup(s)
{
  if (s.bi_valid > 8) {
    put_short(s, s.bi_buf);
  } else if (s.bi_valid > 0) {
    //put_byte(s, (Byte)s->bi_buf);
    s.pending_buf[s.pending++] = s.bi_buf;
  }
  s.bi_buf = 0;
  s.bi_valid = 0;
}

/* ===========================================================================
 * Copy a stored block, storing first the length and its
 * one's complement if requested.
 */
function copy_block(s, buf, len, header)
//DeflateState *s;
//charf    *buf;    /* the input data */
//unsigned len;     /* its length */
//int      header;  /* true if block header must be written */
{
  bi_windup(s);        /* align on byte boundary */

  if (header) {
    put_short(s, len);
    put_short(s, ~len);
  }
//  while (len--) {
//    put_byte(s, *buf++);
//  }
  utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
  s.pending += len;
}

/* ===========================================================================
 * Compares to subtrees, using the tree depth as tie breaker when
 * the subtrees have equal frequency. This minimizes the worst case length.
 */
function smaller(tree, n, m, depth) {
  var _n2 = n * 2;
  var _m2 = m * 2;
  return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
         (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
}

/* ===========================================================================
 * Restore the heap property by moving down the tree starting at node k,
 * exchanging a node with the smallest of its two sons if necessary, stopping
 * when the heap property is re-established (each father smaller than its
 * two sons).
 */
function pqdownheap(s, tree, k)
//    deflate_state *s;
//    ct_data *tree;  /* the tree to restore */
//    int k;               /* node to move down */
{
  var v = s.heap[k];
  var j = k << 1;  /* left son of k */
  while (j <= s.heap_len) {
    /* Set j to the smallest of the two sons: */
    if (j < s.heap_len &&
      smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
      j++;
    }
    /* Exit if v is smaller than both sons */
    if (smaller(tree, v, s.heap[j], s.depth)) { break; }

    /* Exchange v with the smallest son */
    s.heap[k] = s.heap[j];
    k = j;

    /* And continue down the tree, setting j to the left son of k */
    j <<= 1;
  }
  s.heap[k] = v;
}


// inlined manually
// var SMALLEST = 1;

/* ===========================================================================
 * Send the block data compressed using the given Huffman trees
 */
function compress_block(s, ltree, dtree)
//    deflate_state *s;
//    const ct_data *ltree; /* literal tree */
//    const ct_data *dtree; /* distance tree */
{
  var dist;           /* distance of matched string */
  var lc;             /* match length or unmatched char (if dist == 0) */
  var lx = 0;         /* running index in l_buf */
  var code;           /* the code to send */
  var extra;          /* number of extra bits to send */

  if (s.last_lit !== 0) {
    do {
      dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
      lc = s.pending_buf[s.l_buf + lx];
      lx++;

      if (dist === 0) {
        send_code(s, lc, ltree); /* send a literal byte */
        //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
      } else {
        /* Here, lc is the match length - MIN_MATCH */
        code = _length_code[lc];
        send_code(s, code + LITERALS + 1, ltree); /* send the length code */
        extra = extra_lbits[code];
        if (extra !== 0) {
          lc -= base_length[code];
          send_bits(s, lc, extra);       /* send the extra length bits */
        }
        dist--; /* dist is now the match distance - 1 */
        code = d_code(dist);
        //Assert (code < D_CODES, "bad d_code");

        send_code(s, code, dtree);       /* send the distance code */
        extra = extra_dbits[code];
        if (extra !== 0) {
          dist -= base_dist[code];
          send_bits(s, dist, extra);   /* send the extra distance bits */
        }
      } /* literal or match pair ? */

      /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
      //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
      //       "pendingBuf overflow");

    } while (lx < s.last_lit);
  }

  send_code(s, END_BLOCK, ltree);
}


/* ===========================================================================
 * Construct one Huffman tree and assigns the code bit strings and lengths.
 * Update the total bit length for the current block.
 * IN assertion: the field freq is set for all tree elements.
 * OUT assertions: the fields len and code are set to the optimal bit length
 *     and corresponding code. The length opt_len is updated; static_len is
 *     also updated if stree is not null. The field max_code is set.
 */
function build_tree(s, desc)
//    deflate_state *s;
//    tree_desc *desc; /* the tree descriptor */
{
  var tree     = desc.dyn_tree;
  var stree    = desc.stat_desc.static_tree;
  var has_stree = desc.stat_desc.has_stree;
  var elems    = desc.stat_desc.elems;
  var n, m;          /* iterate over heap elements */
  var max_code = -1; /* largest code with non zero frequency */
  var node;          /* new node being created */

  /* Construct the initial heap, with least frequent element in
   * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
   * heap[0] is not used.
   */
  s.heap_len = 0;
  s.heap_max = HEAP_SIZE;

  for (n = 0; n < elems; n++) {
    if (tree[n * 2]/*.Freq*/ !== 0) {
      s.heap[++s.heap_len] = max_code = n;
      s.depth[n] = 0;

    } else {
      tree[n * 2 + 1]/*.Len*/ = 0;
    }
  }

  /* The pkzip format requires that at least one distance code exists,
   * and that at least one bit should be sent even if there is only one
   * possible code. So to avoid special checks later on we force at least
   * two codes of non zero frequency.
   */
  while (s.heap_len < 2) {
    node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
    tree[node * 2]/*.Freq*/ = 1;
    s.depth[node] = 0;
    s.opt_len--;

    if (has_stree) {
      s.static_len -= stree[node * 2 + 1]/*.Len*/;
    }
    /* node is 0 or 1 so it does not have extra bits */
  }
  desc.max_code = max_code;

  /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
   * establish sub-heaps of increasing lengths:
   */
  for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }

  /* Construct the Huffman tree by repeatedly combining the least two
   * frequent nodes.
   */
  node = elems;              /* next internal node of the tree */
  do {
    //pqremove(s, tree, n);  /* n = node of least frequency */
    /*** pqremove ***/
    n = s.heap[1/*SMALLEST*/];
    s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
    pqdownheap(s, tree, 1/*SMALLEST*/);
    /***/

    m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */

    s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
    s.heap[--s.heap_max] = m;

    /* Create a new node father of n and m */
    tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
    s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
    tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;

    /* and insert the new node in the heap */
    s.heap[1/*SMALLEST*/] = node++;
    pqdownheap(s, tree, 1/*SMALLEST*/);

  } while (s.heap_len >= 2);

  s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];

  /* At this point, the fields freq and dad are set. We can now
   * generate the bit lengths.
   */
  gen_bitlen(s, desc);

  /* The field len is now set, we can generate the bit codes */
  gen_codes(tree, max_code, s.bl_count);
}


/* ===========================================================================
 * Scan a literal or distance tree to determine the frequencies of the codes
 * in the bit length tree.
 */
function scan_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree;   /* the tree to be scanned */
//    int max_code;    /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }
  tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      s.bl_tree[curlen * 2]/*.Freq*/ += count;

    } else if (curlen !== 0) {

      if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
      s.bl_tree[REP_3_6 * 2]/*.Freq*/++;

    } else if (count <= 10) {
      s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;

    } else {
      s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
    }

    count = 0;
    prevlen = curlen;

    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Send a literal or distance tree in compressed form, using the codes in
 * bl_tree.
 */
function send_tree(s, tree, max_code)
//    deflate_state *s;
//    ct_data *tree; /* the tree to be scanned */
//    int max_code;       /* and its largest code of non zero frequency */
{
  var n;                     /* iterates over all tree elements */
  var prevlen = -1;          /* last emitted length */
  var curlen;                /* length of current code */

  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */

  var count = 0;             /* repeat count of the current code */
  var max_count = 7;         /* max repeat count */
  var min_count = 4;         /* min repeat count */

  /* tree[max_code+1].Len = -1; */  /* guard already set */
  if (nextlen === 0) {
    max_count = 138;
    min_count = 3;
  }

  for (n = 0; n <= max_code; n++) {
    curlen = nextlen;
    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;

    if (++count < max_count && curlen === nextlen) {
      continue;

    } else if (count < min_count) {
      do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);

    } else if (curlen !== 0) {
      if (curlen !== prevlen) {
        send_code(s, curlen, s.bl_tree);
        count--;
      }
      //Assert(count >= 3 && count <= 6, " 3_6?");
      send_code(s, REP_3_6, s.bl_tree);
      send_bits(s, count - 3, 2);

    } else if (count <= 10) {
      send_code(s, REPZ_3_10, s.bl_tree);
      send_bits(s, count - 3, 3);

    } else {
      send_code(s, REPZ_11_138, s.bl_tree);
      send_bits(s, count - 11, 7);
    }

    count = 0;
    prevlen = curlen;
    if (nextlen === 0) {
      max_count = 138;
      min_count = 3;

    } else if (curlen === nextlen) {
      max_count = 6;
      min_count = 3;

    } else {
      max_count = 7;
      min_count = 4;
    }
  }
}


/* ===========================================================================
 * Construct the Huffman tree for the bit lengths and return the index in
 * bl_order of the last bit length code to send.
 */
function build_bl_tree(s) {
  var max_blindex;  /* index of last bit length code of non zero freq */

  /* Determine the bit length frequencies for literal and distance trees */
  scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
  scan_tree(s, s.dyn_dtree, s.d_desc.max_code);

  /* Build the bit length tree: */
  build_tree(s, s.bl_desc);
  /* opt_len now includes the length of the tree representations, except
   * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
   */

  /* Determine the number of bit length codes to send. The pkzip format
   * requires that at least 4 bit length codes be sent. (appnote.txt says
   * 3 but the actual value used is 4.)
   */
  for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
    if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
      break;
    }
  }
  /* Update opt_len to include the bit length tree and counts */
  s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
  //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
  //        s->opt_len, s->static_len));

  return max_blindex;
}


/* ===========================================================================
 * Send the header for a block using dynamic Huffman trees: the counts, the
 * lengths of the bit length codes, the literal tree and the distance tree.
 * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
 */
function send_all_trees(s, lcodes, dcodes, blcodes)
//    deflate_state *s;
//    int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
  var rank;                    /* index in bl_order */

  //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
  //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
  //        "too many codes");
  //Tracev((stderr, "\nbl counts: "));
  send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
  send_bits(s, dcodes - 1,   5);
  send_bits(s, blcodes - 4,  4); /* not -3 as stated in appnote.txt */
  for (rank = 0; rank < blcodes; rank++) {
    //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
    send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
  }
  //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
  //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));

  send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
  //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}


/* ===========================================================================
 * Check if the data type is TEXT or BINARY, using the following algorithm:
 * - TEXT if the two conditions below are satisfied:
 *    a) There are no non-portable control characters belonging to the
 *       "black list" (0..6, 14..25, 28..31).
 *    b) There is at least one printable character belonging to the
 *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
 * - BINARY otherwise.
 * - The following partially-portable control characters form a
 *   "gray list" that is ignored in this detection algorithm:
 *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
 * IN assertion: the fields Freq of dyn_ltree are set.
 */
function detect_data_type(s) {
  /* black_mask is the bit mask of black-listed bytes
   * set bits 0..6, 14..25, and 28..31
   * 0xf3ffc07f = binary 11110011111111111100000001111111
   */
  var black_mask = 0xf3ffc07f;
  var n;

  /* Check for non-textual ("black-listed") bytes. */
  for (n = 0; n <= 31; n++, black_mask >>>= 1) {
    if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
      return Z_BINARY;
    }
  }

  /* Check for textual ("white-listed") bytes. */
  if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
      s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
    return Z_TEXT;
  }
  for (n = 32; n < LITERALS; n++) {
    if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
      return Z_TEXT;
    }
  }

  /* There are no "black-listed" or "white-listed" bytes:
   * this stream either is empty or has tolerated ("gray-listed") bytes only.
   */
  return Z_BINARY;
}


var static_init_done = false;

/* ===========================================================================
 * Initialize the tree data structures for a new zlib stream.
 */
function _tr_init(s)
{

  if (!static_init_done) {
    tr_static_init();
    static_init_done = true;
  }

  s.l_desc  = new TreeDesc(s.dyn_ltree, static_l_desc);
  s.d_desc  = new TreeDesc(s.dyn_dtree, static_d_desc);
  s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);

  s.bi_buf = 0;
  s.bi_valid = 0;

  /* Initialize the first block of the first file: */
  init_block(s);
}


/* ===========================================================================
 * Send a stored block
 */
function _tr_stored_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */
  copy_block(s, buf, stored_len, true); /* with header */
}


/* ===========================================================================
 * Send one empty static block to give enough lookahead for inflate.
 * This takes 10 bits, of which 7 may remain in the bit buffer.
 */
function _tr_align(s) {
  send_bits(s, STATIC_TREES << 1, 3);
  send_code(s, END_BLOCK, static_ltree);
  bi_flush(s);
}


/* ===========================================================================
 * Determine the best encoding for the current block: dynamic trees, static
 * trees or store, and output the encoded block to the zip file.
 */
function _tr_flush_block(s, buf, stored_len, last)
//DeflateState *s;
//charf *buf;       /* input block, or NULL if too old */
//ulg stored_len;   /* length of input block */
//int last;         /* one if this is the last block for a file */
{
  var opt_lenb, static_lenb;  /* opt_len and static_len in bytes */
  var max_blindex = 0;        /* index of last bit length code of non zero freq */

  /* Build the Huffman trees unless a stored block is forced */
  if (s.level > 0) {

    /* Check if the file is binary or text */
    if (s.strm.data_type === Z_UNKNOWN) {
      s.strm.data_type = detect_data_type(s);
    }

    /* Construct the literal and distance trees */
    build_tree(s, s.l_desc);
    // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));

    build_tree(s, s.d_desc);
    // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
    //        s->static_len));
    /* At this point, opt_len and static_len are the total bit lengths of
     * the compressed block data, excluding the tree representations.
     */

    /* Build the bit length tree for the above two trees, and get the index
     * in bl_order of the last bit length code to send.
     */
    max_blindex = build_bl_tree(s);

    /* Determine the best encoding. Compute the block lengths in bytes. */
    opt_lenb = (s.opt_len + 3 + 7) >>> 3;
    static_lenb = (s.static_len + 3 + 7) >>> 3;

    // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
    //        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
    //        s->last_lit));

    if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }

  } else {
    // Assert(buf != (char*)0, "lost buf");
    opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
  }

  if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
    /* 4: two words for the lengths */

    /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
     * Otherwise we can't have processed more than WSIZE input bytes since
     * the last block flush, because compression would have been
     * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
     * transform a block into a stored block.
     */
    _tr_stored_block(s, buf, stored_len, last);

  } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {

    send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
    compress_block(s, static_ltree, static_dtree);

  } else {
    send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
    send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
    compress_block(s, s.dyn_ltree, s.dyn_dtree);
  }
  // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
  /* The above check is made mod 2^32, for files larger than 512 MB
   * and uLong implemented on 32 bits.
   */
  init_block(s);

  if (last) {
    bi_windup(s);
  }
  // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
  //       s->compressed_len-7*last));
}

/* ===========================================================================
 * Save the match info and tally the frequency counts. Return true if
 * the current block must be flushed.
 */
function _tr_tally(s, dist, lc)
//    deflate_state *s;
//    unsigned dist;  /* distance of matched string */
//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
  //var out_length, in_length, dcode;

  s.pending_buf[s.d_buf + s.last_lit * 2]     = (dist >>> 8) & 0xff;
  s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;

  s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
  s.last_lit++;

  if (dist === 0) {
    /* lc is the unmatched char */
    s.dyn_ltree[lc * 2]/*.Freq*/++;
  } else {
    s.matches++;
    /* Here, lc is the match length - MIN_MATCH */
    dist--;             /* dist = match distance - 1 */
    //Assert((ush)dist < (ush)MAX_DIST(s) &&
    //       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
    //       (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");

    s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
    s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
  }

// (!) This block is disabled in zlib defaults,
// don't enable it for binary compatibility

//#ifdef TRUNCATE_BLOCK
//  /* Try to guess if it is profitable to stop the current block here */
//  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
//    /* Compute an upper bound for the compressed length */
//    out_length = s.last_lit*8;
//    in_length = s.strstart - s.block_start;
//
//    for (dcode = 0; dcode < D_CODES; dcode++) {
//      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
//    }
//    out_length >>>= 3;
//    //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
//    //       s->last_lit, in_length, out_length,
//    //       100L - out_length*100L/in_length));
//    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
//      return true;
//    }
//  }
//#endif

  return (s.last_lit === s.lit_bufsize - 1);
  /* We avoid equality with lit_bufsize because of wraparound at 64K
   * on 16 bit machines and because stored blocks are restricted to
   * 64K-1 bytes.
   */
}

exports._tr_init  = _tr_init;
exports._tr_stored_block = _tr_stored_block;
exports._tr_flush_block  = _tr_flush_block;
exports._tr_tally = _tr_tally;
exports._tr_align = _tr_align;


/***/ }),
/* 1232 */
/***/ (function(module, exports, __webpack_require__) {

var trim = __webpack_require__(1383)
  , forEach = __webpack_require__(1214)
  , isArray = function(arg) {
      return Object.prototype.toString.call(arg) === '[object Array]';
    }

module.exports = function (headers) {
  if (!headers)
    return {}

  var result = {}

  forEach(
      trim(headers).split('\n')
    , function (row) {
        var index = row.indexOf(':')
          , key = trim(row.slice(0, index)).toLowerCase()
          , value = trim(row.slice(index + 1))

        if (typeof(result[key]) === 'undefined') {
          result[key] = value
        } else if (isArray(result[key])) {
          result[key].push(value)
        } else {
          result[key] = [ result[key], value ]
        }
      }
  )

  return result
}


/***/ }),
/* 1233 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/**
 * Copyright (c) 2013-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */



var ReactIs = __webpack_require__(142);
var assign = __webpack_require__(140);

var ReactPropTypesSecret = __webpack_require__(365);
var checkPropTypes = __webpack_require__(182);

var has = Function.call.bind(Object.prototype.hasOwnProperty);
var printWarning = function() {};

if (true) {
  printWarning = function(text) {
    var message = 'Warning: ' + text;
    if (typeof console !== 'undefined') {
      console.error(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };
}

function emptyFunctionThatReturnsNull() {
  return null;
}

module.exports = function(isValidElement, throwOnDirectAccess) {
  /* global Symbol */
  var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
  var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.

  /**
   * Returns the iterator method function contained on the iterable object.
   *
   * Be sure to invoke the function with the iterable as context:
   *
   *     var iteratorFn = getIteratorFn(myIterable);
   *     if (iteratorFn) {
   *       var iterator = iteratorFn.call(myIterable);
   *       ...
   *     }
   *
   * @param {?object} maybeIterable
   * @return {?function}
   */
  function getIteratorFn(maybeIterable) {
    var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
    if (typeof iteratorFn === 'function') {
      return iteratorFn;
    }
  }

  /**
   * Collection of methods that allow declaration and validation of props that are
   * supplied to React components. Example usage:
   *
   *   var Props = require('ReactPropTypes');
   *   var MyArticle = React.createClass({
   *     propTypes: {
   *       // An optional string prop named "description".
   *       description: Props.string,
   *
   *       // A required enum prop named "category".
   *       category: Props.oneOf(['News','Photos']).isRequired,
   *
   *       // A prop named "dialog" that requires an instance of Dialog.
   *       dialog: Props.instanceOf(Dialog).isRequired
   *     },
   *     render: function() { ... }
   *   });
   *
   * A more formal specification of how these methods are used:
   *
   *   type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
   *   decl := ReactPropTypes.{type}(.isRequired)?
   *
   * Each and every declaration produces a function with the same signature. This
   * allows the creation of custom validation functions. For example:
   *
   *  var MyLink = React.createClass({
   *    propTypes: {
   *      // An optional string or URI prop named "href".
   *      href: function(props, propName, componentName) {
   *        var propValue = props[propName];
   *        if (propValue != null && typeof propValue !== 'string' &&
   *            !(propValue instanceof URI)) {
   *          return new Error(
   *            'Expected a string or an URI for ' + propName + ' in ' +
   *            componentName
   *          );
   *        }
   *      }
   *    },
   *    render: function() {...}
   *  });
   *
   * @internal
   */

  var ANONYMOUS = '<<anonymous>>';

  // Important!
  // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
  var ReactPropTypes = {
    array: createPrimitiveTypeChecker('array'),
    bool: createPrimitiveTypeChecker('boolean'),
    func: createPrimitiveTypeChecker('function'),
    number: createPrimitiveTypeChecker('number'),
    object: createPrimitiveTypeChecker('object'),
    string: createPrimitiveTypeChecker('string'),
    symbol: createPrimitiveTypeChecker('symbol'),

    any: createAnyTypeChecker(),
    arrayOf: createArrayOfTypeChecker,
    element: createElementTypeChecker(),
    elementType: createElementTypeTypeChecker(),
    instanceOf: createInstanceTypeChecker,
    node: createNodeChecker(),
    objectOf: createObjectOfTypeChecker,
    oneOf: createEnumTypeChecker,
    oneOfType: createUnionTypeChecker,
    shape: createShapeTypeChecker,
    exact: createStrictShapeTypeChecker,
  };

  /**
   * inlined Object.is polyfill to avoid requiring consumers ship their own
   * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
   */
  /*eslint-disable no-self-compare*/
  function is(x, y) {
    // SameValue algorithm
    if (x === y) {
      // Steps 1-5, 7-10
      // Steps 6.b-6.e: +0 != -0
      return x !== 0 || 1 / x === 1 / y;
    } else {
      // Step 6.a: NaN == NaN
      return x !== x && y !== y;
    }
  }
  /*eslint-enable no-self-compare*/

  /**
   * We use an Error-like object for backward compatibility as people may call
   * PropTypes directly and inspect their output. However, we don't use real
   * Errors anymore. We don't inspect their stack anyway, and creating them
   * is prohibitively expensive if they are created too often, such as what
   * happens in oneOfType() for any type before the one that matched.
   */
  function PropTypeError(message) {
    this.message = message;
    this.stack = '';
  }
  // Make `instanceof Error` still work for returned errors.
  PropTypeError.prototype = Error.prototype;

  function createChainableTypeChecker(validate) {
    if (true) {
      var manualPropTypeCallCache = {};
      var manualPropTypeWarningCount = 0;
    }
    function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
      componentName = componentName || ANONYMOUS;
      propFullName = propFullName || propName;

      if (secret !== ReactPropTypesSecret) {
        if (throwOnDirectAccess) {
          // New behavior only for users of `prop-types` package
          var err = new Error(
            'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
            'Use `PropTypes.checkPropTypes()` to call them. ' +
            'Read more at http://fb.me/use-check-prop-types'
          );
          err.name = 'Invariant Violation';
          throw err;
        } else if ("development" !== 'production' && typeof console !== 'undefined') {
          // Old behavior for people using React.PropTypes
          var cacheKey = componentName + ':' + propName;
          if (
            !manualPropTypeCallCache[cacheKey] &&
            // Avoid spamming the console because they are often not actionable except for lib authors
            manualPropTypeWarningCount < 3
          ) {
            printWarning(
              'You are manually calling a React.PropTypes validation ' +
              'function for the `' + propFullName + '` prop on `' + componentName  + '`. This is deprecated ' +
              'and will throw in the standalone `prop-types` package. ' +
              'You may be seeing this warning due to a third-party PropTypes ' +
              'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
            );
            manualPropTypeCallCache[cacheKey] = true;
            manualPropTypeWarningCount++;
          }
        }
      }
      if (props[propName] == null) {
        if (isRequired) {
          if (props[propName] === null) {
            return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
          }
          return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
        }
        return null;
      } else {
        return validate(props, propName, componentName, location, propFullName);
      }
    }

    var chainedCheckType = checkType.bind(null, false);
    chainedCheckType.isRequired = checkType.bind(null, true);

    return chainedCheckType;
  }

  function createPrimitiveTypeChecker(expectedType) {
    function validate(props, propName, componentName, location, propFullName, secret) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== expectedType) {
        // `propValue` being instance of, say, date/regexp, pass the 'object'
        // check, but we can offer a more precise error message here rather than
        // 'of type `object`'.
        var preciseType = getPreciseType(propValue);

        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createAnyTypeChecker() {
    return createChainableTypeChecker(emptyFunctionThatReturnsNull);
  }

  function createArrayOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
      }
      var propValue = props[propName];
      if (!Array.isArray(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
      }
      for (var i = 0; i < propValue.length; i++) {
        var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
        if (error instanceof Error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!isValidElement(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createElementTypeTypeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      if (!ReactIs.isValidElementType(propValue)) {
        var propType = getPropType(propValue);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createInstanceTypeChecker(expectedClass) {
    function validate(props, propName, componentName, location, propFullName) {
      if (!(props[propName] instanceof expectedClass)) {
        var expectedClassName = expectedClass.name || ANONYMOUS;
        var actualClassName = getClassName(props[propName]);
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createEnumTypeChecker(expectedValues) {
    if (!Array.isArray(expectedValues)) {
      if (true) {
        if (arguments.length > 1) {
          printWarning(
            'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
            'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
          );
        } else {
          printWarning('Invalid argument supplied to oneOf, expected an array.');
        }
      }
      return emptyFunctionThatReturnsNull;
    }

    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      for (var i = 0; i < expectedValues.length; i++) {
        if (is(propValue, expectedValues[i])) {
          return null;
        }
      }

      var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
        var type = getPreciseType(value);
        if (type === 'symbol') {
          return String(value);
        }
        return value;
      });
      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createObjectOfTypeChecker(typeChecker) {
    function validate(props, propName, componentName, location, propFullName) {
      if (typeof typeChecker !== 'function') {
        return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
      }
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
      }
      for (var key in propValue) {
        if (has(propValue, key)) {
          var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
          if (error instanceof Error) {
            return error;
          }
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createUnionTypeChecker(arrayOfTypeCheckers) {
    if (!Array.isArray(arrayOfTypeCheckers)) {
       true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
      return emptyFunctionThatReturnsNull;
    }

    for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
      var checker = arrayOfTypeCheckers[i];
      if (typeof checker !== 'function') {
        printWarning(
          'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
          'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
        );
        return emptyFunctionThatReturnsNull;
      }
    }

    function validate(props, propName, componentName, location, propFullName) {
      for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
        var checker = arrayOfTypeCheckers[i];
        if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
          return null;
        }
      }

      return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
    }
    return createChainableTypeChecker(validate);
  }

  function createNodeChecker() {
    function validate(props, propName, componentName, location, propFullName) {
      if (!isNode(props[propName])) {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      for (var key in shapeTypes) {
        var checker = shapeTypes[key];
        if (!checker) {
          continue;
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }
    return createChainableTypeChecker(validate);
  }

  function createStrictShapeTypeChecker(shapeTypes) {
    function validate(props, propName, componentName, location, propFullName) {
      var propValue = props[propName];
      var propType = getPropType(propValue);
      if (propType !== 'object') {
        return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
      }
      // We need to check all keys in case some are required but missing from
      // props.
      var allKeys = assign({}, props[propName], shapeTypes);
      for (var key in allKeys) {
        var checker = shapeTypes[key];
        if (!checker) {
          return new PropTypeError(
            'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
            '\nBad object: ' + JSON.stringify(props[propName], null, '  ') +
            '\nValid keys: ' +  JSON.stringify(Object.keys(shapeTypes), null, '  ')
          );
        }
        var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
        if (error) {
          return error;
        }
      }
      return null;
    }

    return createChainableTypeChecker(validate);
  }

  function isNode(propValue) {
    switch (typeof propValue) {
      case 'number':
      case 'string':
      case 'undefined':
        return true;
      case 'boolean':
        return !propValue;
      case 'object':
        if (Array.isArray(propValue)) {
          return propValue.every(isNode);
        }
        if (propValue === null || isValidElement(propValue)) {
          return true;
        }

        var iteratorFn = getIteratorFn(propValue);
        if (iteratorFn) {
          var iterator = iteratorFn.call(propValue);
          var step;
          if (iteratorFn !== propValue.entries) {
            while (!(step = iterator.next()).done) {
              if (!isNode(step.value)) {
                return false;
              }
            }
          } else {
            // Iterator will provide entry [k,v] tuples rather than values.
            while (!(step = iterator.next()).done) {
              var entry = step.value;
              if (entry) {
                if (!isNode(entry[1])) {
                  return false;
                }
              }
            }
          }
        } else {
          return false;
        }

        return true;
      default:
        return false;
    }
  }

  function isSymbol(propType, propValue) {
    // Native Symbol.
    if (propType === 'symbol') {
      return true;
    }

    // falsy value can't be a Symbol
    if (!propValue) {
      return false;
    }

    // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
    if (propValue['@@toStringTag'] === 'Symbol') {
      return true;
    }

    // Fallback for non-spec compliant Symbols which are polyfilled.
    if (typeof Symbol === 'function' && propValue instanceof Symbol) {
      return true;
    }

    return false;
  }

  // Equivalent of `typeof` but with special handling for array and regexp.
  function getPropType(propValue) {
    var propType = typeof propValue;
    if (Array.isArray(propValue)) {
      return 'array';
    }
    if (propValue instanceof RegExp) {
      // Old webkits (at least until Android 4.0) return 'function' rather than
      // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
      // passes PropTypes.object.
      return 'object';
    }
    if (isSymbol(propType, propValue)) {
      return 'symbol';
    }
    return propType;
  }

  // This handles more types than `getPropType`. Only used for error messages.
  // See `createPrimitiveTypeChecker`.
  function getPreciseType(propValue) {
    if (typeof propValue === 'undefined' || propValue === null) {
      return '' + propValue;
    }
    var propType = getPropType(propValue);
    if (propType === 'object') {
      if (propValue instanceof Date) {
        return 'date';
      } else if (propValue instanceof RegExp) {
        return 'regexp';
      }
    }
    return propType;
  }

  // Returns a string that is postfixed to a warning about an invalid type.
  // For example, "undefined" or "of type array"
  function getPostfixForTypeWarning(value) {
    var type = getPreciseType(value);
    switch (type) {
      case 'array':
      case 'object':
        return 'an ' + type;
      case 'boolean':
      case 'date':
      case 'regexp':
        return 'a ' + type;
      default:
        return type;
    }
  }

  // Returns class name of the object, if any.
  function getClassName(propValue) {
    if (!propValue.constructor || !propValue.constructor.name) {
      return ANONYMOUS;
    }
    return propValue.constructor.name;
  }

  ReactPropTypes.checkPropTypes = checkPropTypes;
  ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
  ReactPropTypes.PropTypes = ReactPropTypes;

  return ReactPropTypes;
};


/***/ }),
/* 1234 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>action</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"action\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M43.968,49.5483944 L8,49.5483944 L8,17.1992261 L18.368,17.1992261 C21.76,14.7406893 25.856,13.1232309 30.656,12.4115492 L30.656,9.11193405 L8,9.11193405 C5.824,9.11193405 3.968,9.88831409 2.368,11.5057725 C0.768,13.1232309 0,14.9994827 0,17.1992261 L0,49.5483944 C0,51.7481379 0.768,53.6243896 2.368,55.241848 C3.968,56.8593065 5.824,57.6356865 8,57.6356865 L43.968,57.6356865 C46.144,57.6356865 48,56.8593065 49.6,55.241848 C51.2,53.6243896 51.968,51.7481379 51.968,49.5483944 L51.968,40.8788173 L43.968,46.3781759 L43.968,49.5483944 Z M38.08,6.65339726 C37.696,6.32990558 37.248,6.26520724 36.736,6.52400059 C36.224,6.78279394 35.968,7.17098396 35.968,7.75326899 L35.968,17.2639245 C28.352,17.5227178 22.592,19.7871596 18.688,24.0572498 C15.104,27.8744517 13.312,32.7915252 13.312,38.8084705 C13.44,39.5201523 13.824,39.9730406 14.4,40.1024373 L14.656,40.1024373 C15.168,40.1024373 15.552,39.9083423 15.808,39.4554539 L15.872,39.3260572 C16.32,38.7437722 16.512,38.4202805 18.752,37.1263138 C19.84,36.4146321 21.12,35.8323471 22.464,35.3794587 C25.216,34.4089837 30.272,33.3738103 35.968,33.3091119 L35.968,42.8197674 C35.968,43.3373541 36.224,43.7255441 36.736,43.9843375 C36.928,44.1137341 37.12,44.1784325 37.312,44.1784325 C37.632,44.1784325 37.888,44.1137341 38.08,43.9196391 L63.424,26.3863899 C63.808,26.1275966 64,25.7394066 64,25.2865182 C64,24.8336298 63.808,24.4454398 63.424,24.1219481 L38.08,6.65339726 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1235 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"alert\" fill=\"#292929\">\r\n            <path d=\"M36.6819313,12.61 C35.8269313,10.855 34.4319313,10 32.4969313,10 C30.5619313,10 29.1669313,10.855 28.2669313,12.61 L10.4469313,48.25 C9.72693126,49.825 9.81693126,51.355 10.6719313,52.75 C11.6169313,54.235 12.9219313,55 14.6769313,55 L50.3169313,55 C52.0719313,55 53.3769313,54.235 54.3219313,52.75 C55.2219313,51.31 55.2669313,49.825 54.4569313,48.25 L36.6819313,12.61 Z M35.2869313,22.195 L35.2869313,38.125 L29.6619313,38.125 L29.6619313,22.195 L35.2869313,22.195 Z M29.8419313,49.24 C28.4019313,47.755 28.4019313,45.37 29.8419313,43.93 C31.2819313,42.445 33.7119313,42.445 35.1519313,43.93 C36.5919313,45.37 36.5919313,47.755 35.1519313,49.24 C33.7119313,50.68 31.2819313,50.68 29.8419313,49.24 L29.8419313,49.24 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1236 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>back</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"back\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M29.696,62.4197275 C30.08,62.8699138 30.592,62.9342261 31.168,62.7412891 C31.744,62.4840398 32,62.0338536 32,61.4550427 L32,44.0907162 L62.656,44.0907162 C63.424,44.0907162 64,43.5119053 64,42.7401575 L64,21.2598425 C64,20.4880947 63.424,19.9735961 62.656,19.9735961 L32,19.9735961 L32,2.54495729 C32,1.9661464 31.744,1.51596016 31.168,1.25871088 C30.592,1.06577392 30.08,1.13008624 29.696,1.58027248 L0.384,31.0353152 C-0.128,31.7427507 -0.128,32.2572493 0.384,32.9646848 L29.696,62.4197275 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1237 */
/***/ (function(module, exports) {

module.exports = "\r\n<svg viewBox=\"0 0 45 45\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <g id=\"Icons\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"Artboard-2\" sketch:type=\"MSArtboardGroup\" fill=\"#FFFFFF\">\r\n            <path d=\"M17.82,0 C17.28,0 16.875,0.405 16.875,0.945 L16.875,44.055 C16.875,44.595 17.28,45 17.82,45 L27.18,45 C27.72,45 28.125,44.595 28.125,44.055 L28.125,0.945 C28.125,0.405 27.72,0 27.18,0 L17.82,0 Z M0.945,22.5 C0.405,22.5 0,22.905 0,23.445 L0,44.055 C0,44.595 0.405,45 0.945,45 L10.305,45 C10.845,45 11.25,44.595 11.25,44.055 L11.25,23.445 C11.25,22.905 10.845,22.5 10.305,22.5 L0.945,22.5 Z M34.695,11.25 C34.155,11.25 33.75,11.655 33.75,12.195 L33.75,44.055 C33.75,44.595 34.155,45 34.695,45 L44.055,45 C44.595,45 45,44.595 45,44.055 L45,12.195 C45,11.655 44.595,11.25 44.055,11.25 L34.695,11.25 Z\" id=\"barchart\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>\r\n"

/***/ }),
/* 1238 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"circle_number_1\" fill=\"#000000\">\r\n            <path d=\"M23.8615723,26.4946289 L23.8615723,22.6108398 C25.6633391,22.5307613 26.9245569,22.4106453 27.6452637,22.2504883 C28.7930559,21.9969063 29.7272913,21.4897499 30.447998,20.7290039 C30.9418156,20.2084935 31.3155098,19.51449 31.5690918,18.6469727 C31.7159024,18.1264622 31.7893066,17.7394218 31.7893066,17.4858398 L36.5339355,17.4858398 L36.5339355,46.5141602 L30.6882324,46.5141602 L30.6882324,26.4946289 L23.8615723,26.4946289 Z\" id=\"1\"></path>\r\n            <path d=\"M61.1977539,32 C61.1977539,15.9837423 48.2140117,3 32.1977539,3 C16.1814962,3 3.19775391,15.9837423 3.19775391,32 C3.19775391,48.0162577 16.1814962,61 32.1977539,61 C48.2140117,61 61.1977539,48.0162577 61.1977539,32 Z M7.19775391,32 C7.19775391,18.1928813 18.3906352,7 32.1977539,7 C46.0048727,7 57.1977539,18.1928813 57.1977539,32 C57.1977539,45.8071187 46.0048727,57 32.1977539,57 C18.3906352,57 7.19775391,45.8071187 7.19775391,32 Z\" id=\"Oval-1\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1239 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"circle_number_2\" fill=\"#000000\">\r\n            <path d=\"M29.3649902,34.732666 C31.9942352,32.8508207 33.6958783,31.5028524 34.4699707,30.6887207 C35.6578022,29.4208107 36.251709,28.0328038 36.251709,26.5246582 C36.251709,25.2967875 35.9113804,24.2758016 35.2307129,23.4616699 C34.5500454,22.6475382 33.5757713,22.2404785 32.3078613,22.2404785 C30.5728266,22.2404785 29.3916861,22.8877702 28.7644043,24.182373 C28.4040509,24.9297726 28.1905114,26.1175863 28.1237793,27.7458496 L22.5783691,27.7458496 C22.6717941,25.2767617 23.1188925,23.2815017 23.9196777,21.7600098 C25.4411697,18.8638364 28.1437794,17.4157715 32.0275879,17.4157715 C35.0972647,17.4157715 37.5396231,18.2665931 39.3547363,19.9682617 C41.1698496,21.6699304 42.0773926,23.9221051 42.0773926,26.7248535 C42.0773926,28.8736273 41.436774,30.7821368 40.1555176,32.4504395 C39.3146931,33.5581924 37.9333592,34.7927178 36.0114746,36.1540527 L33.729248,37.7756348 C32.301181,38.7899628 31.3235703,39.5240049 30.7963867,39.9777832 C30.2692031,40.4315615 29.8254413,40.9587372 29.4650879,41.5593262 L42.1374512,41.5593262 L42.1374512,46.5842285 L22.2580566,46.5842285 C22.3114423,44.5021869 22.7585407,42.6003504 23.5993652,40.8786621 C24.4134969,38.9434311 26.3353527,36.8947862 29.3649902,34.732666 Z\" id=\"2\"></path>\r\n            <path d=\"M61.1977539,32 C61.1977539,15.9837423 48.2140117,3 32.1977539,3 C16.1814962,3 3.19775391,15.9837423 3.19775391,32 C3.19775391,48.0162577 16.1814962,61 32.1977539,61 C48.2140117,61 61.1977539,48.0162577 61.1977539,32 Z M7.19775391,32 C7.19775391,18.1928813 18.3906352,7 32.1977539,7 C46.0048727,7 57.1977539,18.1928813 57.1977539,32 C57.1977539,45.8071187 46.0048727,57 32.1977539,57 C18.3906352,57 7.19775391,45.8071187 7.19775391,32 Z\" id=\"Oval-2\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1240 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"65px\" height=\"64px\" viewBox=\"0 0 65 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"circle_number_3\" transform=\"translate(0.802246, 0.000000)\" fill=\"#000000\">\r\n            <path d=\"M27.9611816,37.3151855 C27.9611816,38.4763242 28.1480287,39.4372521 28.5217285,40.197998 C29.2157424,41.5993722 30.4769603,42.3000488 32.3054199,42.3000488 C33.4265193,42.3000488 34.4041299,41.916345 35.2382812,41.1489258 C36.0724326,40.3815066 36.489502,39.2771068 36.489502,37.8356934 C36.489502,35.9271552 35.7154212,34.6525911 34.1672363,34.0119629 C33.2863725,33.6516095 31.8983656,33.4714355 30.0031738,33.4714355 L30.0031738,29.3874512 C31.8583263,29.3607583 33.1529097,29.1805844 33.8869629,28.8469238 C35.1548729,28.2863742 35.7888184,27.1519454 35.7888184,25.4436035 C35.7888184,24.3358506 35.4651725,23.4349807 34.8178711,22.7409668 C34.1705697,22.0469529 33.2596901,21.6999512 32.0852051,21.6999512 C30.7372166,21.6999512 29.7462597,22.1270302 29.1123047,22.9812012 C28.4783497,23.8353721 28.1747232,24.976474 28.201416,26.404541 L22.8762207,26.404541 C22.9296064,24.9631276 23.1765115,23.5951399 23.6169434,22.3005371 C24.0840681,21.1660913 24.8181102,20.118413 25.8190918,19.1574707 C26.5664914,18.4768032 27.454015,17.9563006 28.4816895,17.5959473 C29.5093639,17.2355939 30.7705817,17.0554199 32.2653809,17.0554199 C35.0414364,17.0554199 37.2802649,17.7727793 38.9819336,19.2075195 C40.6836023,20.6422598 41.5344238,22.5674521 41.5344238,24.9831543 C41.5344238,26.6914962 41.0272674,28.132888 40.0129395,29.307373 C39.3723112,30.0414262 38.7050002,30.5419095 38.0109863,30.8088379 C38.5314967,30.8088379 39.2788851,31.2559363 40.2531738,32.1501465 C41.7079337,33.498135 42.4353027,35.3399135 42.4353027,37.6755371 C42.4353027,40.1312786 41.5844812,42.2900298 39.8828125,44.1518555 C38.1811438,46.0136812 35.6620447,46.9445801 32.3254395,46.9445801 C28.2147418,46.9445801 25.3586506,45.6032849 23.7570801,42.9206543 C22.9162556,41.4925873 22.4491378,39.6241164 22.3557129,37.3151855 L27.9611816,37.3151855 Z\" id=\"3\"></path>\r\n            <path d=\"M61.3955078,32 C61.3955078,15.9837423 48.4117656,3 32.3955078,3 C16.3792501,3 3.39550781,15.9837423 3.39550781,32 C3.39550781,48.0162577 16.3792501,61 32.3955078,61 C48.4117656,61 61.3955078,48.0162577 61.3955078,32 Z M7.39550781,32 C7.39550781,18.1928813 18.5883891,7 32.3955078,7 C46.2026266,7 57.3955078,18.1928813 57.3955078,32 C57.3955078,45.8071187 46.2026266,57 32.3955078,57 C18.5883891,57 7.39550781,45.8071187 7.39550781,32 Z\" id=\"Oval-2\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1241 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>close</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"close\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M42.7444089,32 L58.284345,16.4600639 C58.7699681,15.7923323 58.7699681,15.3067093 58.284345,14.6389776 L49.3610224,5.71565495 C48.6932907,5.23003195 48.2076677,5.23003195 47.5399361,5.71565495 L32,21.2555911 L16.4600639,5.71565495 C15.7923323,5.23003195 15.3067093,5.23003195 14.6389776,5.71565495 L5.71565495,14.6389776 C5.23003195,15.3067093 5.23003195,15.7923323 5.71565495,16.4600639 L21.2555911,32 L5.71565495,47.5399361 C5.23003195,48.2076677 5.23003195,48.6932907 5.71565495,49.3610224 L14.6389776,58.284345 C15.3067093,58.7699681 15.7923323,58.7699681 16.4600639,58.284345 L32,42.7444089 L47.5399361,58.284345 C48.2076677,58.7699681 48.6932907,58.7699681 49.3610224,58.284345 L58.284345,49.3610224 C58.7699681,48.6932907 58.7699681,48.2076677 58.284345,47.5399361 L42.7444089,32 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>\r\n"

/***/ }),
/* 1242 */
/***/ (function(module, exports) {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n  <path fill=\"#000000\" fill-rule=\"evenodd\" d=\"M20.5,35 C12.4918711,35 6,28.5081289 6,20.5 C6,12.4918711 12.4918711,6 20.5,6 C28.5081289,6 35,12.4918711 35,20.5 C35,28.5081289 28.5081289,35 20.5,35 Z M23.4083826,20.7049999 L27.3183598,16.7950227 C27.4405465,16.6270159 27.4405465,16.5048291 27.3183598,16.3368223 L25.0731776,14.0916401 C24.9051707,13.9694533 24.7829839,13.9694533 24.6149771,14.0916401 L20.7049999,18.0016173 L16.7950227,14.0916401 C16.6270159,13.9694533 16.5048291,13.9694533 16.3368223,14.0916401 L14.0916401,16.3368223 C13.9694533,16.5048291 13.9694533,16.6270159 14.0916401,16.7950227 L18.0016173,20.7049999 L14.0916401,24.6149771 C13.9694533,24.7829839 13.9694533,24.9051707 14.0916401,25.0731776 L16.3368223,27.3183598 C16.5048291,27.4405465 16.6270159,27.4405465 16.7950227,27.3183598 L20.7049999,23.4083826 L24.6149771,27.3183598 C24.7829839,27.4405465 24.9051707,27.4405465 25.0731776,27.3183598 L27.3183598,25.0731776 C27.4405465,24.9051707 27.4405465,24.7829839 27.3183598,24.6149771 L23.4083826,20.7049999 Z\"/>\r\n</svg>\r\n"

/***/ }),
/* 1243 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>upload</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"upload\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M57.92,35.24 C57.92,32.18144 56.98688,29.5376 55.0688,27.2048 C53.20256,24.872 50.81792,23.3168 47.96672,22.64288 C47.2928,18.85856 45.42656,15.69632 42.41984,13.15616 C39.46496,10.616 35.99168,9.32 32,9.32 C27.48992,9.32 23.65376,10.92704 20.49152,14.08928 C17.32928,17.25152 15.77408,21.03584 15.77408,25.54592 L15.77408,25.6496 C13.02656,26.01248 10.7456,27.30848 8.87936,29.43392 C7.01312,31.55936 6.08,33.99584 6.08,36.84704 C6.08,40.00928 7.16864,42.65312 9.39776,44.88224 C11.62688,47.11136 14.27072,48.2 17.43296,48.2 L27.69728,48.2 L27.69728,38.50592 L19.5584,38.50592 C19.09184,38.50592 18.7808,38.29856 18.57344,37.832 C18.41792,37.36544 18.46976,36.95072 18.7808,36.63968 L32,23.47232 L45.2192,36.63968 C45.53024,36.95072 45.58208,37.36544 45.42656,37.832 C45.2192,38.29856 44.90816,38.50592 44.4416,38.50592 L36.30272,38.50592 L36.30272,48.2 L44.96,48.2 C48.53696,48.2 51.54368,46.95584 54.08384,44.41568 C56.624,41.87552 57.92,38.81696 57.92,35.24 L57.92,35.24 Z\" id=\"uploadcloud\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1244 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>cog</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"cog\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M51.236168,35.4110069 C51.5904801,33.7912944 51.5904801,31.1592616 51.236168,29.5395491 L56.0953055,25.3384198 C56.5002336,25.0853397 56.6014657,24.6804116 56.3990016,24.2248674 C55.4372973,21.2385225 53.8175848,18.4546417 51.5904801,15.8732249 C51.286784,15.5189127 50.9324719,15.4176807 50.4769278,15.6201448 L44.4030059,17.6954014 C42.8339094,16.430001 41.1635809,15.4682967 39.3414043,14.7596725 L38.12662,8.43267055 C38.0760039,7.97712641 37.7723078,7.72404633 37.3167637,7.6228143 C34.1279547,6.9648061 30.8885297,6.9648061 27.6997207,7.6228143 C27.2441766,7.72404633 26.9404805,7.97712641 26.8898645,8.43267055 L25.6750801,14.7596725 C23.7516715,15.5189127 22.081343,16.480617 20.6134785,17.6954014 L14.5395567,15.6201448 C14.0840125,15.4176807 13.7297004,15.5189127 13.4260043,15.8732249 C11.1988996,18.4546417 9.57918713,21.2385225 8.61748283,24.2248674 C8.41501877,24.6804116 8.5162508,25.0853397 8.92117893,25.3384198 L13.7803164,29.5395491 C13.4260043,31.1592616 13.4260043,33.7912944 13.7803164,35.4110069 L8.92117893,39.6121362 C8.5162508,39.8652163 8.41501877,40.2701444 8.61748283,40.7256885 C9.57918713,43.7120335 11.1988996,46.4959143 13.4260043,49.0773311 C13.7297004,49.4316432 14.0840125,49.5328753 14.5395567,49.3304112 L20.6134785,47.2551546 C22.081343,48.4699389 23.7516715,49.4316432 25.6750801,50.1908835 L26.8898645,56.5178854 C26.9404805,56.9734296 27.2441766,57.2265096 27.6997207,57.3277417 C31.0909938,57.9351339 33.9254907,57.9351339 37.3167637,57.3277417 C37.7723078,57.2265096 38.0760039,56.9734296 38.12662,56.5178854 L39.3414043,50.1908835 C41.1635809,49.4822592 42.8339094,48.5205549 44.4030059,47.2551546 L50.4769278,49.3304112 C50.9324719,49.5328753 51.286784,49.4316432 51.5904801,49.0773311 C53.8175848,46.4959143 55.4372973,43.7120335 56.3990016,40.7256885 C56.6014657,40.2701444 56.5002336,39.8652163 56.0953055,39.6121362 L51.236168,35.4110069 Z M32.5082422,41.9910889 C29.8255934,41.9910889 27.5984887,41.0800006 25.7256961,39.2578241 C23.9035196,37.3850315 22.9924313,35.1579268 22.9924313,32.475278 C22.9924313,29.8432452 23.9035196,27.6161405 25.7763121,25.7939639 C27.6491047,23.9211713 29.8762094,23.0100831 32.5082422,23.0100831 C35.140275,23.0100831 37.3673797,23.9211713 39.1895563,25.7939639 C41.0623489,27.6161405 41.9734371,29.8432452 41.9734371,32.475278 C41.9734371,35.1073108 41.0623489,37.3344155 39.1895563,39.2072081 C37.3673797,41.0800006 35.140275,41.9910889 32.5082422,41.9910889 L32.5082422,41.9910889 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1245 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>copy</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"copy\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M46.5,13.904 C46.5,11.874 44.876,10.25 42.846,10.25 L6.596,10.25 C4.682,10.25 3,11.874 3,13.904 L3,39.25 C3,41.164 4.682,42.904 6.596,42.904 L12.686,42.904 L12.686,27.186 C12.686,25.156 13.382,23.474 14.774,22.082 C16.224,20.632 17.906,19.936 19.936,19.936 L46.5,19.936 L46.5,13.904 Z M61,28.404 C61,26.374 59.376,24.75 57.346,24.75 L19.936,24.75 C18.544,24.75 17.5,25.794 17.5,27.186 L17.5,50.154 C17.5,52.068 19.182,53.75 21.096,53.75 L57.346,53.75 C59.376,53.75 61,52.068 61,50.154 L61,28.404 Z\" id=\"layers\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1246 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>curvedtriangle</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"curvedtriangle\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M35.6959096,17.0172228 C45.1306064,28.5485189 64,51.6111111 64,51.6111111 L0,51.6111111 C0,51.6111111 18.8679215,28.5503181 28.3018823,17.0199216 C29.5345882,15.5132811 30.1520452,14.5006745 32,14.5 C33.8479548,14.4993255 34.4639397,15.5114819 35.6959096,17.0172228 Z\" id=\"downarrow\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1247 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>curvedtriangledown</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"curvedtriangledown\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M35.5804124,16.4418571 C44.7202749,27.6279048 63,50 63,50 L1,50 C1,50 19.278299,27.6296501 28.4174485,16.4444752 C29.6116323,14.9829436 30.2097938,14.0006546 32,14.0000003 C33.7902062,13.999346 34.3869416,14.9811983 35.5804124,16.4418571 Z\" id=\"downarrow\" sketch:type=\"MSShapeGroup\" transform=\"translate(32.000000, 32.000000) rotate(-180.000000) translate(-32.000000, -32.000000) \"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1248 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"110px\" height=\"75px\" viewBox=\"0 0 110 75\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>logo</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"Filter-View\" sketch:type=\"MSArtboardGroup\" transform=\"translate(-129.000000, -45.000000)\">\r\n            <g id=\"logo\" sketch:type=\"MSLayerGroup\" transform=\"translate(129.000000, 44.649254)\">\r\n                <g id=\"dairyaustralialogo\" sketch:type=\"MSShapeGroup\">\r\n                    <g id=\"Group\">\r\n                        <g id=\"Shape\">\r\n                            <g id=\"Group\" transform=\"translate(0.000000, 14.228856)\" fill=\"#FFFFFF\">\r\n                                <path d=\"M11.179408,24.4641459 C4.21233463,26.7211982 1.45171851,29.5628192 0.45197228,31.5068367 L0.45197228,30.5884826 C1.3494517,28.0385531 3.81972412,24.251306 10.6169405,21.8620439 C17.0421173,19.6026202 19.5329606,15.7827653 20.4039917,13.8986277 L20.4039917,15.2580763 C19.6781325,18.0279602 17.5740223,22.3926617 11.179408,24.4641459\" id=\"Shape\"></path>\r\n                                <path d=\"M11.179408,20.0057711 C4.21233463,22.2616376 1.45171851,25.1044444 0.45197228,27.0496476 L0.45197228,26.1312935 C1.3494517,23.581364 3.81972412,19.7929312 10.6169405,17.4024834 C17.0421173,15.1454312 19.5329606,11.3243905 20.4039917,9.44143864 L20.4039917,10.7997015 C19.6781325,13.5689925 17.5740223,17.9331012 11.179408,20.0057711\" id=\"Shape\"></path>\r\n                                <path d=\"M11.179408,15.553325 C4.21233463,17.8091915 1.45171851,20.6519983 0.45197228,22.5972015 L0.45197228,21.6788474 C1.3494517,19.1277322 3.81972412,15.3404851 10.6169405,12.9500373 C17.0421173,10.6917993 19.5329606,6.87194444 20.4039917,4.9878068 L20.4039917,6.34725539 C19.6781325,9.11654643 17.5740223,13.4818408 11.179408,15.553325\" id=\"Shape\"></path>\r\n                                <path d=\"M11.179408,11.0641211 C4.21233463,13.3188018 1.45171851,16.1616086 0.45197228,18.1068118 L0.45197228,17.1884577 C1.3494517,14.6373425 3.81972412,10.8500954 10.6169405,8.46083333 C17.0421173,6.20140962 19.5317852,2.38155473 20.4051672,0.498602819 L20.4039917,1.85805141 C19.6781325,4.62734245 17.5740223,8.99145108 11.179408,11.0641211\" id=\"Shape\"></path>\r\n                            </g>\r\n                            <g id=\"Group\" fill=\"#0067B8\">\r\n                                <path d=\"M11.179408,38.6930017 C4.21233463,40.9500539 1.45171851,43.791675 0.45197228,45.7356924 L0.45197228,58.6596434 L10.4376797,48.8423259 L20.4039917,58.6596434 L20.4039917,29.486932 C19.6781325,32.2568159 17.5740223,36.6215174 11.179408,38.6930017\" id=\"Shape\"></path>\r\n                                <path d=\"M11.179408,34.2346269 C4.21233463,36.4904934 1.45171851,39.3333002 0.45197228,41.2785033 L0.45197228,44.8173383 C1.3494517,42.2674088 3.81972412,38.4801617 10.6169405,36.0908997 C17.0421173,33.831476 19.5329606,30.0116211 20.4039917,28.1274834 L20.4039917,25.0285572 C19.6781325,27.7978483 17.5740223,32.1619569 11.179408,34.2346269\" id=\"Shape\"></path>\r\n                                <path d=\"M11.179408,29.7821808 C4.21233463,32.0380473 1.45171851,34.8808541 0.45197228,36.8260572 L0.45197228,40.3601493 C1.3494517,37.8102197 3.81972412,34.0217869 10.6169405,31.6313391 C17.0421173,29.3742869 19.5329606,25.5532463 20.4039917,23.6702944 L20.4039917,20.5761111 C19.6781325,23.3454022 17.5740223,27.7106965 11.179408,29.7821808\" id=\"Shape\"></path>\r\n                                <path d=\"M0.45197228,0.56263267 L0.45197228,31.4173134 C1.3494517,28.8661982 3.81972412,25.0789511 10.6169405,22.6896891 C17.0421173,20.4302653 19.5317852,16.6104104 20.4051672,14.7274585 L20.4051672,0.56263267 L0.45197228,0.56263267 L0.45197228,0.56263267 Z\" id=\"Shape\"></path>\r\n                                <path d=\"M11.179408,25.2929768 C4.21233463,27.5476575 1.45171851,30.3904643 0.45197228,32.3356675 L0.45197228,35.9077032 C1.3494517,33.3565879 3.81972412,29.5693408 10.6169405,27.178893 C17.0421173,24.9206551 19.5329606,21.1008002 20.4039917,19.2166625 L20.4039917,16.0869071 C19.6781325,18.8561982 17.5740223,23.2203068 11.179408,25.2929768\" id=\"Shape\"></path>\r\n                            </g>\r\n                        </g>\r\n                        <g id=\"Shape\" transform=\"translate(26.448313, 0.000000)\" fill=\"#231F20\">\r\n                            <path d=\"M2.23106212,2.08452736 L0.491938619,2.08452736 L0.491938619,0.604726368 L6.71728372,0.604726368 C11.285789,0.604726368 13.7584123,3.48014096 13.7584123,8.28060116 C13.7584123,12.5498507 11.0136652,15.5094527 7.07404208,15.5094527 L0.491938619,15.5094527 L0.491938619,14.0308375 L2.23106212,14.0308375 L2.23106212,2.08452736 L2.23106212,2.08452736 Z M4.07597888,14.0308375 L6.08840162,14.0308375 C11.161188,14.0308375 11.7671483,10.8163018 11.7671483,8.17388474 C11.7671483,3.98763682 10.1132471,2.08452736 6.44398449,2.08452736 L4.07597888,2.08452736 L4.07597888,14.0308375 L4.07597888,14.0308375 Z\"></path>\r\n                            <path d=\"M25.2358046,15.5094527 L22.0490768,15.5094527 L22.0490768,13.5025912 C21.1492464,14.9177695 19.9320363,15.721107 18.2757842,15.721107 C16.1799023,15.721107 14.6506021,14.2620564 14.6506021,12.2961028 C14.6506021,10.1398383 16.5378362,9.06200249 20.9811527,8.63810116 C21.1269123,8.61853648 21.5882884,8.57584992 22.0279182,8.53375622 L22.0279182,7.36995439 C22.0279182,6.07987148 21.0428654,5.27771973 19.4924066,5.27771973 C17.8567254,5.27771973 17.1255764,5.82790216 16.7876258,7.28458126 L15.0908196,7.28458126 C15.3411969,6.14508706 15.6773844,5.55221808 16.347996,4.95934909 C17.1020668,4.32735075 18.1511832,3.98763682 19.3660424,3.98763682 C21.6723353,3.98763682 23.641853,5.06547264 23.641853,7.92013682 L23.641853,14.1790547 L25.2352169,14.1790547 L25.2352169,15.5094527 L25.2358046,15.5094527 L25.2358046,15.5094527 Z M22.0279182,9.69637231 L21.0005481,9.8226534 C17.563443,10.2465547 16.4108843,10.8809245 16.4108843,12.318039 C16.4108843,13.5025912 17.4382543,14.4743035 18.737748,14.4743035 C20.7284244,14.4743035 22.0279182,12.5706012 22.0279182,11.5354519 L22.0279182,9.69637231 L22.0279182,9.69637231 Z\"></path>\r\n                            <path d=\"M25.9463826,4.11510365 L29.2353773,4.11510365 L29.2353773,14.1790547 L30.8504876,14.1790547 L30.8504876,15.5094527 L25.9258117,15.5094527 L25.9258117,14.1790547 L27.6226179,14.1790547 L27.6226179,5.46803068 L25.9463826,5.46803068 L25.9463826,4.11510365 L25.9463826,4.11510365 Z M27.2235423,0.56263267 L29.1301718,0.56263267 L29.1301718,2.48589967 L27.2235423,2.48589967 L27.2235423,0.56263267 L27.2235423,0.56263267 Z\"></path>\r\n                            <path d=\"M34.8001023,6.73677032 C35.3431743,5.55221808 35.6370445,5.1923466 36.1407379,4.70560116 C36.7273027,4.19869818 37.4619781,3.92538557 38.1943025,3.92538557 C38.4664262,3.92538557 38.8431677,3.96570066 39.4097494,4.05166667 L39.4097494,5.72118574 C38.84258,5.61565506 38.5087435,5.57296849 38.2148734,5.57296849 C35.1556852,5.57296849 34.7995146,8.76556799 34.7995146,8.93453566 L34.7995146,14.1790547 L36.726715,14.1790547 L36.726715,15.5094527 L31.5716449,15.5094527 L31.5716449,14.1790547 L33.1844043,14.1790547 L33.1844043,5.46803068 L31.5093444,5.46803068 L31.5093444,4.11569652 L34.7995146,4.11569652 L34.7995146,6.73677032 L34.8001023,6.73677032 L34.8001023,6.73677032 Z\"></path>\r\n                            <path d=\"M39.6560125,4.11510365 L43.9306476,4.11510365 L43.9306476,5.46743781 L42.5265361,5.46743781 L45.4182183,13.4806551 L48.0172058,5.46743781 L46.6765702,5.46743781 L46.6765702,4.11510365 L50.8894926,4.11510365 L50.8894926,5.46743781 L49.6522993,5.46743781 L45.9019286,16.7781924 C45.2313169,18.8081758 44.8963049,19.1472968 43.470447,19.1472968 C42.9885,19.1472968 42.7563425,19.1046103 42.0240182,19.0393947 L41.4374533,18.9771434 L41.5203247,17.6016874 C42.485982,17.7095896 42.6946298,17.73034 42.967929,17.73034 C44.0781704,17.73034 44.1204877,17.5833085 44.7070526,15.7430431 L40.913189,5.46743781 L39.6560125,5.46743781 L39.6560125,4.11510365 L39.6560125,4.11510365 Z\"></path>\r\n                            <path d=\"M6.27530303,20.0709867 L8.41408993,20.0709867 L12.9825952,33.496505 L14.3878822,33.496505 L14.3878822,34.976306 L11.6419596,34.976306 L10.3001485,30.7473715 L4.47270357,30.7473715 L3.17438528,34.976306 L0.491938619,34.976306 L0.491938619,33.496505 L1.83374969,33.496505 L6.27530303,20.0709867 L6.27530303,20.0709867 Z M7.34381487,21.6349751 L4.95406287,29.2900995 L9.81761373,29.2900995 L7.34381487,21.6349751 L7.34381487,21.6349751 Z\"></path>\r\n                            <path d=\"M13.6943487,23.581364 L16.7946787,23.581364 L16.7946787,31.4671144 C16.7946787,32.9249793 17.5693204,33.876534 18.7659596,33.876534 C19.5406013,33.876534 20.3375771,33.4953192 21.0299352,32.8206343 C21.9726706,31.8465506 22.2236357,30.9572471 22.2236357,28.6545439 L22.2236357,24.934291 L20.6725891,24.934291 L20.6725891,23.5819569 L23.8375705,23.5819569 L23.8375705,33.6453151 L25.3668707,33.6453151 L25.3668707,34.9757131 L22.1813184,34.9757131 L22.1813184,32.7571973 C21.5107067,33.7087521 20.421624,35.2513972 18.1576484,35.2513972 C16.3762076,35.2513972 15.1813316,33.8551907 15.1813316,31.7623632 L15.1813316,24.934291 L13.6943487,24.934291 L13.6943487,23.581364 L13.6943487,23.581364 Z\"></path>\r\n                            <path d=\"M33.261986,23.581364 L34.5420843,23.581364 L34.5420843,26.9417454 L33.2837324,26.9417454 C32.9287372,26.2018449 32.7371339,25.9065962 32.3827265,25.5674751 C31.7332735,24.9538557 30.978615,24.6597927 30.0135454,24.6597927 C28.799274,24.6597927 27.8130458,25.4844735 27.8130458,26.5208085 C27.8130458,27.5340216 28.4431034,27.9152363 30.4337797,28.147641 C33.5975857,28.52767 35.0246191,29.4157877 35.0246191,31.6159245 C35.0246191,33.6020357 33.368367,35.2300539 31.3148024,35.2300539 C29.2394915,35.2300539 28.2761851,33.9607214 27.5850026,33.0726036 L27.5850026,34.976306 L26.2625869,34.976306 L26.2625869,31.2779892 L27.5415098,31.2779892 C27.8970926,32.0807338 28.0881082,32.3979187 28.5059916,32.799291 C29.1766033,33.4538184 29.9524204,33.7929395 30.8534263,33.7929395 C32.3192506,33.7929395 33.3912888,32.9048217 33.3912888,31.6787687 C33.3912888,30.5588391 32.7183262,30.1349378 30.5813025,29.8817828 L29.9524204,29.7981882 C27.5415098,29.5225041 26.2431915,28.4446683 26.2431915,26.7526202 C26.2431915,24.7854809 27.7101912,23.4118035 29.8260563,23.4118035 C31.7761785,23.4118035 32.698343,24.6378566 33.2631615,25.4002861 L33.2631615,23.581364 L33.261986,23.581364 L33.261986,23.581364 Z\"></path>\r\n                            <path d=\"M37.543674,20.7272927 L39.1564333,20.7272927 L39.1564333,23.581364 L41.8829605,23.581364 L41.8829605,24.9336982 L39.1564333,24.9336982 L39.1564333,32.3747968 C39.1564333,33.813097 39.4926207,33.9405638 41.2329197,33.9192206 L41.8183091,33.8960987 L41.8183091,35.1654312 C41.1694438,35.2093035 40.3948021,35.2288682 39.8717132,35.2288682 C38.0890969,35.2288682 37.543674,34.7018076 37.543674,32.9243864 L37.543674,24.934291 L35.6152981,24.934291 L35.6152981,23.5819569 L37.543674,23.5819569 L37.543674,20.7272927 L37.543674,20.7272927 Z\"></path>\r\n                            <path d=\"M46.222247,26.2018449 C46.7664945,25.0172927 47.0591892,24.6591998 47.5617071,24.1730473 C48.1494474,23.6649585 48.8817718,23.3904602 49.6152717,23.3904602 C49.8885709,23.3904602 50.2659002,23.4331468 50.8318941,23.5167413 L50.8318941,25.1874461 C50.2659002,25.0807297 49.9308882,25.0380431 49.6370181,25.0380431 C46.5766544,25.0380431 46.2216593,28.2318284 46.2216593,28.400796 L46.2216593,33.6441294 L48.1488597,33.6441294 L48.1488597,34.9757131 L42.9926141,34.9757131 L42.9926141,33.6441294 L44.6077244,33.6441294 L44.6077244,24.934291 L42.9297259,24.934291 L42.9297259,23.5819569 L46.222247,23.5819569 L46.222247,26.2018449 L46.222247,26.2018449 Z\"></path>\r\n                            <path d=\"M61.1796495,34.9757131 L57.9964481,34.9757131 L57.9964481,32.9676658 C57.0942668,34.3840299 55.8776444,35.1861816 54.2231555,35.1861816 C52.1284491,35.1861816 50.596798,33.7295025 50.596798,31.7623632 C50.596798,29.6060987 52.4828565,28.5270771 56.9267608,28.1043615 C57.0748714,28.0847968 57.535072,28.0409245 57.9758772,28.0000166 L57.9758772,26.8374005 C57.9758772,25.5461318 56.989649,24.7427944 55.4391902,24.7427944 C53.803509,24.7427944 53.0700091,25.2953483 52.7344094,26.7508416 L51.0364277,26.7508416 C51.289156,25.6101617 51.6229925,25.0172927 52.2936042,24.4267952 C53.0488504,23.7924254 54.0979668,23.4538972 55.3140015,23.4538972 C57.6179434,23.4538972 59.5886366,24.531733 59.5886366,27.3852114 L59.5886366,33.6441294 L61.1796495,33.6441294 L61.1796495,34.9757131 L61.1796495,34.9757131 Z M57.9758772,29.1620398 L56.9473317,29.2906924 C53.5102265,29.7122222 52.3564924,30.346592 52.3564924,31.7837065 C52.3564924,32.9682587 53.3838624,33.939971 54.6845316,33.939971 C56.675208,33.939971 57.9758772,32.0386401 57.9758772,31.0034909 L57.9758772,29.1620398 L57.9758772,29.1620398 Z\"></path>\r\n                            <path d=\"M61.9155004,19.4152736 L65.1216236,19.4152736 L65.1216236,33.6441294 L66.6309407,33.6441294 L66.6309407,34.9757131 L61.8949295,34.9757131 L61.8949295,33.6441294 L63.5076888,33.6441294 L63.5076888,20.7480431 L61.9155004,20.7480431 L61.9155004,19.4152736 L61.9155004,19.4152736 Z\"></path>\r\n                            <path d=\"M67.3291761,23.581364 L70.6193463,23.581364 L70.6193463,33.6453151 L72.2321056,33.6453151 L72.2321056,34.9757131 L67.3062543,34.9757131 L67.3062543,33.6453151 L69.004236,33.6453151 L69.004236,24.934291 L67.3291761,24.934291 L67.3291761,23.581364 L67.3291761,23.581364 Z M68.6045726,20.028893 L70.5123775,20.028893 L70.5123775,21.9533458 L68.6045726,21.9533458 L68.6045726,20.028893 L68.6045726,20.028893 Z\"></path>\r\n                            <path d=\"M83.2716314,34.9757131 L80.086079,34.9757131 L80.086079,32.9676658 C79.1850732,34.3840299 77.967863,35.1861816 76.3116109,35.1861816 C74.2169045,35.1861816 72.6876043,33.7295025 72.6876043,31.7623632 C72.6876043,29.6060987 74.5736629,28.5270771 79.0175672,28.1043615 C79.1633268,28.0847968 79.6235274,28.0409245 80.0643326,28.0000166 L80.0643326,26.8374005 C80.0643326,25.5461318 79.0792799,24.7427944 77.5276456,24.7427944 C75.8943153,24.7427944 75.1608154,25.2953483 74.8252157,26.7508416 L73.1272341,26.7508416 C73.3787869,25.6101617 73.7137989,25.0172927 74.385586,24.4267952 C75.1384813,23.7924254 76.1875977,23.4538972 77.4024569,23.4538972 C79.7099253,23.4538972 81.677092,24.531733 81.677092,27.3852114 L81.677092,33.6441294 L83.2716314,33.6441294 L83.2716314,34.9757131 L83.2716314,34.9757131 Z M80.0643326,29.1620398 L79.0369626,29.2906924 C75.6010329,29.7122222 74.4472987,30.346592 74.4472987,31.7837065 C74.4472987,32.9682587 75.4746688,33.939971 76.7741625,33.939971 C78.7636634,33.939971 80.0643326,32.0386401 80.0643326,31.0034909 L80.0643326,29.1620398 L80.0643326,29.1620398 Z\"></path>\r\n                        </g>\r\n                        <path d=\"M26.9402515,40.9447181 L109.719944,40.9447181\" id=\"Shape\" stroke=\"#004964\" stroke-width=\"0.5\"></path>\r\n                        <g id=\"Shape\" transform=\"translate(26.448313, 66.401327)\" fill=\"#0067B8\">\r\n                            <path d=\"M2.05767874,4.08723881 L0.425523967,0.192682421 L1.55045887,0.192682421 L2.61544427,2.94893035 L3.70746572,0.192682421 L4.76304727,0.192682421 L3.06800429,4.08723881 L3.06800429,6.58321725 L2.05767874,6.58321725 L2.05767874,4.08723881 L2.05767874,4.08723881 Z\"></path>\r\n                            <path d=\"M6.07899777,5.991534 C6.77899645,5.991534 6.90300965,5.40222222 6.90300965,4.17498342 C6.90300965,3.11078358 6.77899645,2.35843284 6.07899777,2.35843284 C5.38663972,2.35843284 5.26203878,3.11137645 5.26203878,4.17498342 C5.26203878,5.40222222 5.38663972,5.991534 6.07899777,5.991534 M6.07899777,1.64343284 C7.47135451,1.64343284 7.86161406,2.67976783 7.86161406,4.17498342 C7.86161406,5.670199 7.40905404,6.7083126 6.07899777,6.7083126 C4.75599439,6.7083126 4.30225889,5.66960614 4.30225889,4.17498342 C4.30225889,2.6803607 4.69428166,1.64343284 6.07899777,1.64343284\"></path>\r\n                            <path d=\"M11.0407013,6.01939884 L11.0130775,6.01939884 C10.7744549,6.44922886 10.3207194,6.7083126 9.78940219,6.7083126 C9.08058741,6.7083126 8.59981586,6.37808458 8.59981586,5.13246683 L8.59981586,1.76734245 L9.55842026,1.76734245 L9.55842026,5.22139718 C9.55842026,5.76090796 9.7982183,5.93817579 10.2066978,5.93817579 C10.6151773,5.93817579 10.9883924,5.66960614 10.9883924,5.13246683 L10.9883924,1.76734245 L11.946409,1.76734245 L11.946409,6.58321725 L11.041289,6.58321725 L11.041289,6.01939884 L11.0407013,6.01939884 L11.0407013,6.01939884 Z\"></path>\r\n                            <path d=\"M12.869749,1.76734245 L13.8289412,1.76734245 L13.8289412,2.52028607 L13.8465734,2.52028607 C14.0599231,1.98196103 14.4143305,1.64343284 14.9550516,1.64343284 C15.062608,1.64343284 15.1243208,1.6594403 15.1860335,1.67722637 L15.1860335,2.66257463 C15.1155047,2.64419569 14.9468232,2.60921642 14.7875456,2.60921642 C14.35203,2.60921642 13.8289412,2.80604892 13.8289412,3.70128109 L13.8289412,6.58321725 L12.869749,6.58321725 L12.869749,1.76734245 L12.869749,1.76734245 Z\"></path>\r\n                            <path d=\"M17.7438792,0.192682421 L18.7553802,0.192682421 L18.7553802,5.72415008 L21.2050818,5.72415008 L21.2050818,6.58321725 L17.7438792,6.58321725 L17.7438792,0.192682421 L17.7438792,0.192682421 Z\"></path>\r\n                            <path d=\"M24.1002904,3.63784411 L24.1002904,3.3781675 C24.1002904,2.77047678 23.9039851,2.3056675 23.3632641,2.3056675 C22.7514264,2.3056675 22.5639373,2.91335821 22.5639373,3.53883499 L22.5639373,3.63725124 L24.1002904,3.63725124 L24.1002904,3.63784411 L24.1002904,3.63784411 Z M22.5639373,4.30245025 L22.5639373,4.57813433 C22.5639373,5.22199005 22.64387,6.04667081 23.3632641,6.04667081 C24.0450428,6.04667081 24.1273265,5.2593408 24.1273265,4.97239221 L25.0300955,4.97239221 C25.0300955,6.03777778 24.3923973,6.70949834 23.354448,6.70949834 C22.5733411,6.70949834 21.6065084,6.47650083 21.6065084,4.24909204 C21.6065084,2.98687396 21.8715792,1.64461857 23.3720802,1.64461857 C24.7027242,1.64461857 25.0588948,2.44914179 25.0588948,3.79258292 L25.0588948,4.30304312 L22.5639373,4.30304312 L22.5639373,4.30245025 L22.5639373,4.30245025 Z\"></path>\r\n                            <path d=\"M25.4497421,1.76734245 L26.4812263,1.76734245 L27.314642,5.56348259 L27.3316865,5.56348259 L28.086345,1.76734245 L29.1054867,1.76734245 L27.846547,6.58321725 L26.7298404,6.58321725 L25.4497421,1.76734245 L25.4497421,1.76734245 Z\"></path>\r\n                            <path d=\"M30.2709757,1.76734245 L31.096163,5.38384328 L31.1132075,5.38384328 L31.8772699,1.76734245 L32.8776038,1.76734245 L31.5663553,6.76285655 C31.1925524,8.0772471 30.8828133,8.2474005 29.8977606,8.23139303 C29.7737474,8.23139303 29.6403303,8.21182836 29.5163171,8.19522803 L29.5163171,7.42390547 C29.6244613,7.44228441 29.720263,7.46066335 29.826644,7.46066335 C30.1557786,7.46066335 30.3691283,7.38774046 30.4737461,7.08419154 L30.5989347,6.6893408 L29.2418424,1.76674959 L30.2709757,1.76674959 L30.2709757,1.76734245 L30.2709757,1.76734245 Z\"></path>\r\n                            <path d=\"M37.7717172,4.04158789 C37.523103,4.23723466 36.9923736,4.35402985 36.7067318,4.48742537 C36.4316693,4.62319237 36.3164722,4.90776949 36.3164722,5.26764096 C36.3164722,5.66960614 36.5110143,5.991534 36.9106777,5.991534 C37.4860754,5.991534 37.7717172,5.55399668 37.7717172,4.84492537 L37.7717172,4.04158789 L37.7717172,4.04158789 Z M38.6768372,5.58186153 C38.6768372,5.76150083 38.7832182,5.92098259 38.9248636,5.92098259 C38.9865764,5.92098259 39.0488768,5.91149668 39.0853167,5.89430348 L39.0853167,6.520966 C38.9695319,6.57550995 38.8008504,6.63657546 38.613949,6.63657546 C38.1872496,6.63657546 37.8334299,6.46642206 37.8075693,6.00220564 L37.7893494,6.00220564 C37.5319191,6.47590796 37.1592918,6.7083126 36.6003508,6.7083126 C35.8368762,6.7083126 35.3584556,6.27848259 35.3584556,5.35597844 C35.3584556,4.2822927 35.8210072,4.05878109 36.468697,3.84475539 L37.2133639,3.63725124 C37.5607184,3.53883499 37.7723049,3.44041874 37.7723049,3.02007463 C37.7723049,2.58135158 37.6212557,2.3056675 37.1169745,2.3056675 C36.4763376,2.3056675 36.3881766,2.76099088 36.3881766,3.22639303 L35.4830565,3.22639303 C35.4830565,2.20487977 35.8997644,1.64343284 37.1604673,1.64343284 C38.0038746,1.64343284 38.6780127,1.97366086 38.6780127,2.82324212 L38.6780127,5.58186153 L38.6768372,5.58186153 L38.6768372,5.58186153 Z\"></path>\r\n                            <path d=\"M39.2287254,1.76734245 L39.885819,1.76734245 L39.885819,0.39840796 L40.8438357,0.39840796 L40.8438357,1.76734245 L41.6255302,1.76734245 L41.6255302,2.48293532 L40.8438357,2.48293532 L40.8438357,5.35597844 C40.8438357,5.73245025 40.9508044,5.86643864 41.2787635,5.86643864 C41.4204089,5.86643864 41.5361937,5.85813847 41.6255302,5.84094527 L41.6255302,6.5553524 C41.4204089,6.60989635 41.1547503,6.63657546 40.8526518,6.63657546 C40.204962,6.63657546 39.885819,6.45812189 39.885819,5.47395937 L39.885819,2.48293532 L39.2287254,2.48293532 L39.2287254,1.76734245 L39.2287254,1.76734245 Z\"></path>\r\n                            <path d=\"M43.8454253,0.192682421 L44.8651547,0.192682421 L45.7009214,5.15914594 L45.7179658,5.15914594 L46.5513816,0.192682421 L47.6169547,0.192682421 L48.4697659,5.18701078 L48.4856348,5.18701078 L49.3108222,0.192682421 L50.3129194,0.192682421 L49.0551552,6.58321725 L47.8832011,6.58321725 L47.0668298,1.76734245 L47.0486099,1.76734245 L46.2428179,6.58321725 L45.0708638,6.58321725 L43.8454253,0.192682421 L43.8454253,0.192682421 Z\"></path>\r\n                            <path d=\"M52.2706823,5.991534 C52.970681,5.991534 53.0958696,5.40222222 53.0958696,4.17498342 C53.0958696,3.11078358 52.970681,2.35843284 52.2706823,2.35843284 C51.5783242,2.35843284 51.4531355,3.11137645 51.4531355,4.17498342 C51.4531355,5.40222222 51.5783242,5.991534 52.2706823,5.991534 M52.2706823,1.64343284 C53.663039,1.64343284 54.0532986,2.67976783 54.0532986,4.17498342 C54.0532986,5.670199 53.601914,6.7083126 52.2706823,6.7083126 C50.9494421,6.7083126 50.4951189,5.66960614 50.4951189,4.17498342 C50.4951189,2.6803607 50.8871417,1.64343284 52.2706823,1.64343284\"></path>\r\n                            <path d=\"M54.7926759,1.76734245 L55.7512803,1.76734245 L55.7512803,2.52028607 L55.7683247,2.52028607 C55.9816744,1.98196103 56.3366696,1.64343284 56.8762152,1.64343284 C56.9843594,1.64343284 57.0460721,1.6594403 57.1089603,1.67722637 L57.1089603,2.66257463 C57.0390192,2.64419569 56.8691623,2.60921642 56.7081214,2.60921642 C56.2743691,2.60921642 55.7506925,2.80604892 55.7506925,3.70128109 L55.7506925,6.58321725 L54.7920881,6.58321725 L54.7920881,1.76734245 L54.7926759,1.76734245 L54.7926759,1.76734245 Z\"></path>\r\n                            <path d=\"M57.5885564,0.192682421 L58.5471608,0.192682421 L58.5471608,3.78250415 L58.564793,3.78250415 L60.0118096,1.76734245 L61.1197,1.75963516 L59.6838505,3.62005804 L61.3060137,6.58321725 L60.259836,6.58321725 L59.0878819,4.39019486 L58.5471608,5.05361526 L58.5471608,6.58321725 L57.5885564,6.58321725 L57.5885564,0.192682421 L57.5885564,0.192682421 Z\"></path>\r\n                        </g>\r\n                        <path d=\"M28.7095394,46.834829 L28.7095394,52.3643975 L30.3278476,52.3643975 C31.1560001,52.3643975 31.7334188,51.9524622 32.0601212,51.1285792 C32.2386678,50.6764015 32.3279398,50.1380116 32.3279398,49.5133933 C32.3279398,48.6511902 32.1940318,47.9892197 31.9262119,47.527462 C31.658392,47.0657044 31.1256092,46.834829 30.3278476,46.834829 L28.7095394,46.834829 L28.7095394,46.834829 Z M31.9233627,45.5472787 C32.5121868,45.7427114 32.9889371,46.1009994 33.3536281,46.6221533 C33.6461407,47.0436748 33.8455781,47.4996776 33.9519463,47.9901754 C34.0583145,48.4806732 34.1114978,48.9481719 34.1114978,49.3926855 C34.1114978,50.5192976 33.8873681,51.4734548 33.4391022,52.2551856 C32.8312838,53.3089895 31.8929783,53.8358835 30.6241576,53.8358835 L27.0057572,53.8358835 L27.0057572,45.363343 L30.6241576,45.363343 C31.144602,45.371007 31.5776661,45.4323183 31.9233627,45.5472787 L31.9233627,45.5472787 L31.9233627,45.5472787 Z M38.7270951,50.7894476 C38.6245258,50.8545919 38.5210083,50.9072813 38.4165395,50.9475174 C38.3120707,50.9877536 38.1686657,51.0251152 37.9863203,51.0596032 L37.6216311,51.1285792 C37.2797333,51.1898914 37.0347102,51.2646146 36.8865545,51.3527509 C36.6358294,51.5021994 36.5104688,51.7340328 36.5104688,52.0482579 C36.5104688,52.3279949 36.5873946,52.5301306 36.7412487,52.6546711 C36.8951027,52.7792116 37.0821939,52.8414808 37.3025281,52.8414808 C37.6520236,52.8414808 37.9739725,52.738018 38.2683846,52.5310892 C38.5627966,52.3241605 38.7156986,51.9467128 38.7270951,51.3987348 L38.7270951,50.7894476 L38.7270951,50.7894476 Z M37.7412947,50.0249647 C38.041405,49.9866445 38.2560377,49.9387451 38.3851991,49.8812649 C38.6169298,49.7816325 38.7327934,49.6264383 38.7327934,49.4156775 C38.7327934,49.1589326 38.6444711,48.9817046 38.467824,48.8839882 C38.2911767,48.7862718 38.0319081,48.7374144 37.6900103,48.7374144 C37.306325,48.7374144 37.0347103,48.8332133 36.8751579,49.024814 C36.761192,49.1665985 36.6852159,49.3581964 36.6472272,49.5996133 L35.0802034,49.5996133 C35.1143932,49.0516352 35.2663455,48.6013804 35.5360649,48.2488351 C35.9653366,47.6970251 36.7023053,47.4211242 37.746993,47.4211242 C38.4269898,47.4211242 39.0310002,47.5571587 39.5590423,47.8292316 C40.0870845,48.1013046 40.3511016,48.6147868 40.3511016,49.3696936 L40.3511016,52.2436897 C40.3511016,52.4429544 40.3549004,52.6843676 40.3624982,52.9679367 C40.3738947,53.1825295 40.4061846,53.3281438 40.4593688,53.4047841 C40.5125528,53.4814244 40.5923278,53.5446517 40.698696,53.5944678 L40.698696,53.8358835 L38.9322328,53.8358835 C38.8828476,53.709427 38.8486583,53.5906364 38.829664,53.479508 C38.8106697,53.3683796 38.7954744,53.241925 38.7840778,53.1001405 C38.5599449,53.3453894 38.3016259,53.554231 38.0091134,53.7266716 C37.6596178,53.9297684 37.2645418,54.0313152 36.8238735,54.0313152 C36.2616416,54.0313152 35.7972374,53.8694151 35.4306469,53.5456099 C35.0640565,53.2218047 34.880764,52.7629279 34.880764,52.1689658 C34.880764,51.3987309 35.1751716,50.8411813 35.7639956,50.4963 C36.0868991,50.3085313 36.5617501,50.1744128 37.1885627,50.0939405 L37.7412947,50.0249647 L37.7412947,50.0249647 Z M43.4623562,46.823333 L41.8155566,46.823333 L41.8155566,45.311611 L43.4623562,45.311611 L43.4623562,46.823333 L43.4623562,46.823333 Z M41.8155566,47.570572 L43.4623562,47.570572 L43.4623562,53.8358835 L41.8155566,53.8358835 L41.8155566,47.570572 L41.8155566,47.570572 Z M48.4853797,47.4239982 C48.5062735,47.4259142 48.5528089,47.4287882 48.6249872,47.4326202 L48.6249872,49.1110339 C48.5224179,49.0995379 48.4312465,49.0918739 48.3514704,49.0880419 C48.2716942,49.0842099 48.2071145,49.0822939 48.1577293,49.0822939 C47.5043246,49.0822939 47.0655623,49.2968835 46.8414293,49.7260691 C46.7160667,49.9674859 46.6533864,50.3391857 46.6533864,50.8411796 L46.6533864,53.8358835 L45.0179834,53.8358835 L45.0179834,47.570572 L46.5679124,47.570572 L46.5679124,48.6626905 C46.8186375,48.245001 47.0370689,47.9595202 47.2232133,47.8062396 C47.5271224,47.5494947 47.9221984,47.4211242 48.4084531,47.4211242 C48.438844,47.4211242 48.464486,47.4220822 48.4853797,47.4239982 L48.4853797,47.4239982 L48.4853797,47.4239982 Z M49.8273219,55.0372139 L50.0324595,55.0487098 C50.1920119,55.0563739 50.3439641,55.0506259 50.488321,55.0314659 C50.6326779,55.0123058 50.7542397,54.9682383 50.8530102,54.899262 C50.9479818,54.8341178 51.0363041,54.6980834 51.1179796,54.4911546 C51.1996553,54.2842258 51.2328948,54.1577713 51.2176994,54.1117871 L48.938392,47.570572 L50.7447431,47.570572 L52.100931,52.1919578 L53.3830413,47.570572 L55.1096166,47.570572 L52.9784643,53.7324196 C52.5681869,54.920344 52.2433889,55.6570376 52.0040604,55.9425226 C51.7647319,56.2280077 51.2860822,56.370748 50.5680968,56.370748 C50.4237399,56.370748 50.3078763,56.3697901 50.2205024,56.367874 C50.1331285,56.3659581 50.0020697,56.3592521 49.8273219,56.3477561 L49.8273219,55.0372139 L49.8273219,55.0372139 Z M57.9017681,46.834829 L57.9017681,48.7029264 L59.9645412,48.7029264 C60.3330314,48.7029264 60.6321871,48.6329933 60.8620188,48.4931247 C61.09185,48.3532562 61.2067638,48.105137 61.2067638,47.7487598 C61.2067638,47.3540623 61.0548117,47.0934893 60.7509024,46.9670328 C60.4887808,46.8788965 60.1544853,46.834829 59.7480071,46.834829 L57.9017681,46.834829 L57.9017681,46.834829 Z M57.9017681,50.1054366 L57.9017681,52.3643975 L59.9645412,52.3643975 C60.3330314,52.3643975 60.619841,52.314582 60.82498,52.2149497 C61.1972682,52.031013 61.3834103,51.678473 61.3834103,51.1573191 C61.3834103,50.7166375 61.202967,50.4139129 60.8420744,50.2491363 C60.6407346,50.157168 60.3577235,50.1092686 59.9930325,50.1054366 L57.9017681,50.1054366 L57.9017681,50.1054366 Z M62.4945727,46.2657778 C62.7528951,46.6259871 62.8820546,47.0570822 62.8820546,47.559076 C62.8820546,48.0763979 62.7528951,48.4921652 62.4945727,48.8063903 C62.3502154,48.9826629 62.1374822,49.1436051 61.8563666,49.2892217 C62.285638,49.4463342 62.6094865,49.6954114 62.8279213,50.0364607 C63.0463556,50.3775099 63.1555712,50.7913612 63.1555712,51.278027 C63.1555712,51.7800208 63.0302109,52.2302757 62.7794856,52.6288051 C62.6199336,52.8932141 62.4204962,53.1154676 62.1811678,53.2955722 C61.9114485,53.502501 61.5932982,53.6442834 61.2267075,53.7209237 C60.8601175,53.7975639 60.462192,53.8358835 60.0329206,53.8358835 L56.2264772,53.8358835 L56.2264772,45.363343 L60.3064373,45.363343 C61.3359297,45.3786711 62.0653007,45.6794796 62.4945727,46.2657778 L62.4945727,46.2657778 L62.4945727,46.2657778 Z M67.9193238,50.7894476 C67.8167543,50.8545919 67.7132368,50.9072813 67.6087683,50.9475174 C67.5042992,50.9877536 67.3608947,51.0251152 67.1785489,51.0596032 L66.8138596,51.1285792 C66.4719622,51.1898914 66.2269392,51.2646146 66.0787834,51.3527509 C65.8280581,51.5021994 65.7026978,51.7340328 65.7026978,52.0482579 C65.7026978,52.3279949 65.7796236,52.5301306 65.9334775,52.6546711 C66.0873315,52.7792116 66.2744227,52.8414808 66.4947566,52.8414808 C66.8442522,52.8414808 67.166201,52.738018 67.4606131,52.5310892 C67.7550251,52.3241605 67.9079275,51.9467128 67.9193238,51.3987348 L67.9193238,50.7894476 L67.9193238,50.7894476 Z M66.9335235,50.0249647 C67.2336337,49.9866445 67.4482664,49.9387451 67.5774276,49.8812649 C67.8091584,49.7816325 67.925022,49.6264383 67.925022,49.4156775 C67.925022,49.1589326 67.8366999,48.9817046 67.6600528,48.8839882 C67.4834057,48.7862718 67.224137,48.7374144 66.882239,48.7374144 C66.4985539,48.7374144 66.2269392,48.8332133 66.0673865,49.024814 C65.9534207,49.1665985 65.8774447,49.3581964 65.8394561,49.5996133 L64.2724324,49.5996133 C64.3066218,49.0516352 64.4585744,48.6013804 64.7282937,48.2488351 C65.1575651,47.6970251 65.8945338,47.4211242 66.9392216,47.4211242 C67.6192183,47.4211242 68.223229,47.5571587 68.7512708,47.8292316 C69.2793131,48.1013046 69.5433302,48.6147868 69.5433302,49.3696936 L69.5433302,52.2436897 C69.5433302,52.4429544 69.5471293,52.6843676 69.554727,52.9679367 C69.5661233,53.1825295 69.5984132,53.3281438 69.6515972,53.4047841 C69.7047818,53.4814244 69.7845564,53.5446517 69.8909245,53.5944678 L69.8909245,53.8358835 L68.1244616,53.8358835 C68.0750762,53.709427 68.0408873,53.5906364 68.0218927,53.479508 C68.0028981,53.3683796 67.9877033,53.241925 67.9763064,53.1001405 C67.7521734,53.3453894 67.4938545,53.554231 67.201342,53.7266716 C66.8518464,53.9297684 66.4567703,54.0313152 66.016102,54.0313152 C65.4538703,54.0313152 64.9894661,53.8694151 64.6228755,53.5456099 C64.2562854,53.2218047 64.0729927,52.7629279 64.0729927,52.1689658 C64.0729927,51.3987309 64.3674,50.8411813 64.9562241,50.4963 C65.279128,50.3085313 65.7539787,50.1744128 66.3807914,50.0939405 L66.9335235,50.0249647 L66.9335235,50.0249647 Z M72.2500076,51.8355822 C72.2841976,52.1268153 72.358274,52.3337409 72.4722404,52.4563653 C72.6735803,52.6747901 73.0458632,52.7840009 73.5891009,52.7840009 C73.9082057,52.7840009 74.1617757,52.7361014 74.3498197,52.6403011 C74.5378636,52.5445008 74.6318839,52.4008024 74.6318839,52.2092017 C74.6318839,52.025265 74.5559079,51.8853986 74.4039535,51.7895983 C74.2519985,51.6937979 73.687876,51.5290238 72.7115677,51.2952709 C72.0087778,51.1189983 71.513033,50.8986608 71.2243197,50.6342518 C70.9356058,50.3736749 70.7912509,49.9981432 70.7912509,49.5076453 C70.7912509,48.9290113 71.0163307,48.4318149 71.4664957,48.0160414 C71.9166613,47.6002679 72.5501125,47.3923842 73.3668681,47.3923842 C74.1418366,47.3923842 74.7733888,47.5485365 75.2615424,47.8608456 C75.7496965,48.1731547 76.0298588,48.7125026 76.1020374,49.4789054 L74.4780305,49.4789054 C74.4552373,49.2681447 74.3963558,49.1014545 74.3013846,48.9788301 C74.1228379,48.7565732 73.8189333,48.6454465 73.3896613,48.6454465 C73.0363671,48.6454465 72.7846961,48.7010099 72.6346407,48.8121383 C72.4845859,48.9232667 72.4095591,49.0535532 72.4095591,49.2030018 C72.4095591,49.3907705 72.4893343,49.5268049 72.6488863,49.6111092 C72.808439,49.6992455 73.3725616,49.8506078 74.3412722,50.0652006 C74.9870794,50.2184812 75.4714274,50.4503145 75.7943307,50.7607077 C76.1134355,51.0749328 76.2729852,51.4677083 76.2729852,51.9390461 C76.2729852,52.5598323 76.0441068,53.0666086 75.5863441,53.45939 C75.1285808,53.8521714 74.4210526,54.0485592 73.4637389,54.0485592 C72.4874306,54.0485592 71.7666071,53.8406756 71.3012461,53.424902 C70.8358851,53.0091285 70.6032081,52.4793605 70.6032081,51.8355822 L72.2500076,51.8355822 L72.2500076,51.8355822 Z M79.0508909,49.1110339 C78.8438529,49.3486187 78.7137437,49.6705031 78.6605596,50.0766966 L81.1848924,50.0766966 C81.1583007,49.643679 81.0281914,49.3150887 80.7945612,49.0909159 C80.5609309,48.8667431 80.2712719,48.7546584 79.9255754,48.7546584 C79.5494874,48.7546584 79.2579295,48.873449 79.0508909,49.1110339 L79.0508909,49.1110339 L79.0508909,49.1110339 Z M81.3216508,47.6970278 C81.7357273,47.8924605 82.0776199,48.200933 82.3473393,48.6224545 C82.5904668,48.9941599 82.748117,49.425255 82.8202956,49.9157528 C82.8620834,50.2031538 82.8791778,50.6170051 82.8715801,51.1573191 L78.6206721,51.1573191 C78.6434652,51.7857694 78.8391034,52.2264444 79.2075936,52.4793573 C79.4317266,52.6364699 79.7014418,52.715025 80.0167474,52.715025 C80.3510476,52.715025 80.6226624,52.6192261 80.8316,52.4276254 C80.9455657,52.324161 81.0462345,52.1804627 81.133608,51.996526 L82.7918043,51.996526 C82.7500166,52.3682313 82.558177,52.7456791 82.216279,53.1288805 C81.6844382,53.7381707 80.9398717,54.0428112 79.982558,54.0428112 C79.1923941,54.0428112 78.4953129,53.7860701 77.8912934,53.2725802 C77.2872739,52.7590904 76.9852688,51.9237239 76.9852688,50.7664557 C76.9852688,49.6819957 77.2578334,48.8504612 77.8029702,48.271827 C78.3481075,47.6931929 79.0556351,47.4038802 79.9255754,47.4038802 C80.4422209,47.4038802 80.9075748,47.5015951 81.3216508,47.6970278 L81.3216508,47.6970278 L81.3216508,47.6970278 Z\" id=\"DairyBase\" fill=\"#003A52\"></path>\r\n                    </g>\r\n                </g>\r\n            </g>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1249 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>dollarsign</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"dollarsign\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M14.3353995,14.3852995 C9.49509931,19.2255996 7.04999924,25.1137998 7.04999924,32 C7.04999924,38.8862002 9.49509931,44.7744004 14.3353995,49.6646005 C19.2255996,54.5049007 25.1137998,56.9500008 32,56.9500008 C38.8862002,56.9500008 44.7744004,54.5049007 49.6147005,49.6646005 C54.5049007,44.7744004 56.9500008,38.8862002 56.9500008,32 C56.9500008,25.1137998 54.5049007,19.2255996 49.6147005,14.3852995 C44.7744004,9.49509931 38.8862002,7.04999924 32,7.04999924 C25.1137998,7.04999924 19.2255996,9.49509931 14.3353995,14.3852995 L14.3353995,14.3852995 Z M35.0938001,50.7125006 L28.8562999,50.7125006 L28.8562999,47.4191005 C25.3133998,46.9700005 22.5688997,45.9720004 20.5728997,44.4750004 L23.6666997,39.2854002 C26.4610998,40.6826003 29.2554999,41.3812003 32,41.3812003 C35.3932001,41.3812003 38.2375002,40.2335003 38.2375002,38.2375002 C38.2375002,35.0439001 33.5469,35.4431001 28.8562999,34.7445001 C25.6626998,34.1457001 22.7684997,33.5968 20.9221997,30.9521 C19.9740996,29.6047999 19.5249996,27.9081999 19.5249996,25.7624998 C19.5249996,23.0678997 20.4231996,20.9720997 22.2195997,19.5249996 C24.0159998,18.0279996 26.2115998,17.0798995 28.8562999,16.6307995 L28.8562999,13.2874994 L35.0938001,13.2874994 L35.0938001,16.5808995 C38.6367002,17.0299995 41.4311003,18.0279996 43.4271003,19.5249996 L40.3333003,24.7145998 C37.5389002,23.3672997 34.7445001,22.6686997 32,22.6686997 C28.6067999,22.6686997 25.7624998,23.7664997 25.7624998,25.7624998 C25.7624998,28.9061999 30.503,28.6067999 35.0938001,29.3053999 C38.3373002,29.8542999 41.2315003,30.4032 43.0778003,33.0479 C44.0259004,34.3952001 44.4750004,36.0918001 44.4750004,38.2375002 C44.4750004,40.9321003 43.5768004,43.0279003 41.7804003,44.5249004 C39.9840002,45.9720004 37.7385002,46.9201005 35.0938001,47.3692005 L35.0938001,50.7125006 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1250 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>downarrow</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"downarrow\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <polygon sketch:type=\"MSShapeGroup\" transform=\"translate(32.000000, 32.055556) rotate(-180.000000) translate(-32.000000, -32.055556) \" points=\"32 12.5 64 51.6111111 3.55271368e-15 51.6111111 \"></polygon>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1251 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"download\" fill=\"#000000\">\r\n            <path d=\"M51.7482683,55.6687099 C52.3163174,55.6687099 52.6950167,55.2426731 52.6950167,54.6746241 L52.6950167,48.7574466 C52.6950167,48.1893976 52.3163174,47.7633608 51.7482683,47.7633608 L12.2688603,47.7633608 C11.7008112,47.7633608 11.2747744,48.1893976 11.2747744,48.7574466 L11.2747744,54.6746241 C11.2747744,55.2426731 11.7008112,55.6687099 12.2688603,55.6687099 L51.7482683,55.6687099 Z M52.4583296,23.8579638 C52.7423541,23.5266019 52.7896916,23.1479025 52.6476793,22.7218657 C52.505667,22.3431664 52.1743051,22.1538167 51.7482683,22.1538167 L40.8606618,22.1538167 L40.8606618,9.32537594 C40.8606618,8.7573269 40.4819624,8.33129013 39.9139134,8.33129013 L24.1032152,8.33129013 C23.5351662,8.33129013 23.1091294,8.7573269 23.1091294,9.32537594 L23.1091294,22.1538167 L12.2688603,22.1538167 C11.8428235,22.1538167 11.5114615,22.3431664 11.3694493,22.7218657 C11.227437,23.1479025 11.2747744,23.5266019 11.558799,23.8579638 L31.298503,43.5503304 C31.8192146,43.9290298 32.197914,43.9290298 32.7186256,43.5503304 L52.4583296,23.8579638 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1252 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>edit</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"edit\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M60.57008,12.99856 C61.08848,12.48016 61.08848,11.96176 60.57008,11.4952 L54.5048,5.42992 C54.03824,4.91152 53.51984,4.91152 53.00144,5.42992 L50.0984,8.3848 L57.6152,15.9016 L60.57008,12.99856 Z M44.6552,35.3416 L44.6552,50.47888 L15.52112,50.47888 L15.52112,18.07888 L33.87248,18.07888 L40.35248,11.59888 L15.52112,11.59888 C13.75856,11.59888 12.2552,12.22096 10.9592,13.51696 C9.6632,14.81296 9.04112,16.31632 9.04112,18.07888 L9.04112,50.47888 C9.04112,52.24144 9.6632,53.7448 10.9592,55.0408 C12.2552,56.3368 13.75856,56.95888 15.52112,56.95888 L44.6552,56.95888 C46.41776,56.95888 47.92112,56.3368 49.21712,55.0408 C50.51312,53.7448 51.1352,52.24144 51.1352,50.47888 L51.1352,28.8616 L44.6552,35.3416 Z M46.83248,11.59888 L24.28208,34.14928 C24.1784,34.3048 24.12656,34.40848 24.12656,34.46032 L19.772,44.82832 L19.72016,44.88016 C19.61648,45.29488 19.72016,45.65776 20.0312,45.9688 C20.23856,46.228 20.49776,46.33168 20.75696,46.33168 C20.8088,46.33168 20.96432,46.27984 21.11984,46.27984 L21.17168,46.228 L31.53968,41.87344 C31.59152,41.87344 31.6952,41.8216 31.85072,41.71792 L54.40112,19.16752 L46.83248,11.59888 Z\" id=\"compose\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1253 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>error</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"error\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M50.29952,13.70048 C45.27104,8.62016 39.15392,6.08 32,6.08 C24.84608,6.08 18.72896,8.62016 13.64864,13.70048 C8.62016,18.72896 6.08,24.84608 6.08,32 C6.08,39.15392 8.62016,45.27104 13.64864,50.35136 C18.72896,55.37984 24.84608,57.92 32,57.92 C39.15392,57.92 45.27104,55.37984 50.29952,50.35136 C55.37984,45.27104 57.92,39.15392 57.92,32 C57.92,24.84608 55.37984,18.72896 50.29952,13.70048 L50.29952,13.70048 Z M14.73728,32 C14.73728,27.23072 16.39616,23.1872 19.76576,19.8176 C23.13536,16.448 27.23072,14.73728 32,14.73728 C35.47328,14.73728 38.53184,15.61856 41.22752,17.43296 L17.43296,41.22752 C15.61856,38.53184 14.73728,35.47328 14.73728,32 L14.73728,32 Z M46.56704,22.77248 C48.38144,25.46816 49.26272,28.52672 49.26272,32 C49.26272,36.76928 47.552,40.86464 44.1824,44.23424 C40.8128,47.60384 36.76928,49.26272 32,49.26272 C28.52672,49.26272 25.46816,48.38144 22.77248,46.56704 L46.56704,22.77248 Z\" id=\"ban\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1254 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"folder\" fill=\"#292929\">\r\n            <path d=\"M6,48.276 C6,49.992 7.508,51.5 9.224,51.5 L54.724,51.5 C56.544,51.5 58,49.992 58,48.276 L58,22.276 C58,20.456 56.544,19 54.724,19 L32,19 L30.388,14.268 C30.024,13.28 28.932,12.5 28.048,12.5 L9.224,12.5 C7.508,12.5 6,13.956 6,15.776 L6,48.276 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1255 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"forward\" fill=\"#000000\">\r\n            <path d=\"M29.696,62.4197275 C30.08,62.8699138 30.592,62.9342261 31.168,62.7412891 C31.744,62.4840398 32,62.0338536 32,61.4550427 L32,44.0907162 L62.656,44.0907162 C63.424,44.0907162 64,43.5119053 64,42.7401575 L64,21.2598425 C64,20.4880947 63.424,19.9735961 62.656,19.9735961 L32,19.9735961 L32,2.54495729 C32,1.9661464 31.744,1.51596016 31.168,1.25871088 C30.592,1.06577392 30.08,1.13008624 29.696,1.58027248 L0.384,31.0353152 C-0.128,31.7427507 -0.128,32.2572493 0.384,32.9646848 L29.696,62.4197275 Z\" id=\"back\" transform=\"translate(32.000000, 32.000000) rotate(-180.000000) translate(-32.000000, -32.000000) \"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1256 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"globe\" fill=\"#292929\">\r\n            <path d=\"M13.592,13.644 C8.548,18.688 6,24.824 6,32 C6,39.176 8.548,45.312 13.592,50.408 C18.688,55.452 24.824,58 32,58 C39.176,58 45.312,55.452 50.356,50.408 C55.452,45.312 58,39.176 58,32 C58,24.824 55.452,18.688 50.356,13.644 C45.312,8.548 39.176,6 32,6 C24.824,6 18.688,8.548 13.592,13.644 L13.592,13.644 Z M35.224,52.592 C34.6,52.592 34.184,52.124 34.184,51.5 L34.184,43.752 C31.064,42.972 28.724,40.164 28.724,36.888 C28.724,36.368 28.776,35.848 28.932,35.276 L28.724,35.276 C25.5,35.276 22.692,34.08 20.352,31.74 C18.012,29.4 16.816,26.592 16.816,23.316 C16.816,19.728 18.168,16.868 20.924,14.788 C23.68,12.708 27.372,11.564 32,11.408 C32.988,11.408 34.132,11.512 35.432,11.72 C36.004,11.772 36.316,12.136 36.316,12.812 C36.264,15.932 35.588,18.74 34.288,21.288 C35.64,22.64 36.316,24.044 36.316,25.5 C36.316,26.696 35.38,27.684 34.184,27.684 C33.716,27.684 33.144,27.32 32.468,26.592 C31.844,25.864 31.168,25.5 30.388,25.5 C28.88,25.5 27.684,26.696 27.684,28.204 C27.684,30.336 29.92,32 33.092,32 L37.408,32 C39.488,32 41.256,32.728 42.764,34.236 C44.272,35.744 45,37.512 45,39.592 C45,43.024 43.856,46.04 41.568,48.692 C39.28,51.292 37.148,52.592 35.224,52.592 L35.224,52.592 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1257 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"help\" fill=\"#292929\">\r\n            <path d=\"M32.5,8 C39.2299719,8 44.9957322,10.4008248 49.7974537,15.2025463 C54.5991752,20.0042678 57,25.7700281 57,32.5 C57,39.2677808 54.6086273,45.0429931 49.8258102,49.8258102 C45.0429931,54.6086273 39.2677808,57 32.5,57 C25.7322192,57 19.9570069,54.6086273 15.1741898,49.8258102 C10.3913727,45.0429931 8,39.2677808 8,32.5 C8,25.7322192 10.3913727,19.9570069 15.1741898,15.1741898 C19.9570069,10.3913727 25.7322192,8 32.5,8 L32.5,8 Z M32.5,50.875 C33.6342649,50.875 34.5983757,50.4780132 35.3923611,49.6840278 C36.1863466,48.8900423 36.5833333,47.9259316 36.5833333,46.7916667 C36.5833333,45.6574017 36.1863466,44.693291 35.3923611,43.8993056 C34.5983757,43.1053201 33.6342649,42.7083333 32.5,42.7083333 C31.3657351,42.7083333 30.4016243,43.1053201 29.6076389,43.8993056 C28.8136534,44.693291 28.4166667,45.6574017 28.4166667,46.7916667 C28.4166667,47.9259316 28.8136534,48.8900423 29.6076389,49.6840278 C30.4016243,50.4780132 31.3657351,50.875 32.5,50.875 L32.5,50.875 Z M35.5625,36.5833333 C35.5625,36.0540097 35.846062,35.5435981 36.4131944,35.0520833 C36.9803269,34.5605685 37.6608757,34.0785132 38.4548611,33.6059028 C39.2488466,33.1332924 40.0428201,32.5850726 40.8368056,31.9612269 C41.630791,31.3373811 42.3113398,30.458339 42.8784722,29.3240741 C43.4456047,28.1898091 43.7291667,26.8665199 43.7291667,25.3541667 C43.7291667,22.367269 42.6516311,19.9191839 40.4965278,18.009838 C38.3414244,16.100492 35.6759418,15.1458333 32.5,15.1458333 C30.6851761,15.1458333 28.9270918,15.5711763 27.2256944,16.421875 C25.524297,17.2725737 24.2766243,18.1327117 23.4826389,19.0023148 L22.2916667,20.25 L26.375,24.3333333 C26.601853,24.1064803 26.9137712,23.8229184 27.3107639,23.4826389 C27.7077566,23.1423594 28.4450178,22.6886602 29.5225694,22.1215278 C30.6001211,21.5543953 31.5925881,21.2708333 32.5,21.2708333 C33.9745444,21.2708333 35.1938609,21.6867242 36.1579861,22.5185185 C37.1221113,23.3503128 37.6041667,24.2955194 37.6041667,25.3541667 C37.6041667,26.2615786 37.1788237,27.0839084 36.328125,27.8211806 C35.4774263,28.5584528 34.5416718,29.1822891 33.5208333,29.6927083 C32.4999949,30.2031276 31.5642404,30.9687449 30.7135417,31.9895833 C29.862843,33.0104218 29.4375,34.2013821 29.4375,35.5625 L29.4375,37.6041667 L35.5625,37.6041667 L35.5625,36.5833333 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1258 */
/***/ (function(module, exports) {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n  <path fill=\"#000000\" fill-rule=\"evenodd\" d=\"M34.918115,20.2621068 C34.9780252,19.9925112 34.918115,19.7828258 34.7683397,19.5731403 L20.4198624,5.22466301 C20.1203117,4.92511233 19.8207611,4.92511233 19.5212104,5.22466301 L5.17273311,19.5731403 C5.02295777,19.7828258 4.96304763,19.9925112 5.02295777,20.2621068 C5.14277804,20.5317024 5.35246351,20.6515227 5.62205912,20.6515227 L8.73738613,20.6515227 L8.73738613,34.3709436 C8.73738613,34.7304044 9.00698173,35 9.36644254,35 L15.5970966,35 C15.9565574,35 16.226153,34.7304044 16.226153,34.3709436 L16.226153,23.7668497 L23.7149198,23.7668497 L23.7149198,34.3709436 C23.7149198,34.7304044 23.9845154,35 24.3439762,35 L30.5746303,35 C30.9340911,35 31.2036867,34.7304044 31.2036867,34.3709436 L31.2036867,20.6515227 L34.3190137,20.6515227 C34.5886093,20.6515227 34.7982948,20.5317024 34.918115,20.2621068 Z\"/>\r\n</svg>\r\n"

/***/ }),
/* 1259 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"inbox\" fill=\"#292929\">\r\n            <path d=\"M51.968,10.544 C51.728,9.056 50.48,8 48.992,8 L15.008,8 C13.52,8 12.224,9.056 12.032,10.544 L8.048,37.568 C8,37.664 8,37.808 8,38 L8,53.024 C8,54.608 9.392,56 10.976,56 L52.976,56 C54.656,56 56,54.608 56,53.024 L56,38 C56,37.808 56,37.664 55.952,37.568 L51.968,10.544 Z M46.4,14 L49.952,38 L40.16,38 C39.728,38 39.392,38.192 39.2,38.624 L37.28,43.376 C37.088,43.808 36.752,44 36.32,44 L27.68,44 C27.248,44 26.912,43.808 26.72,43.376 L24.8,38.624 C24.608,38.192 24.272,38 23.84,38 L14.048,38 L17.6,14 L46.4,14 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1260 */
/***/ (function(module, exports) {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n  <path fill=\"#000000\" fill-rule=\"evenodd\" d=\"M10.234,10.263 C13.076,7.421 16.498,6 20.5,6 C24.502,6 27.924,7.421 30.737,10.263 C33.579,13.076 35,16.498 35,20.5 C35,24.502 33.579,27.924 30.737,30.766 C27.924,33.579 24.502,35 20.5,35 C16.498,35 13.076,33.579 10.234,30.766 C7.421,27.924 6,24.502 6,20.5 C6,16.498 7.421,13.076 10.234,10.263 Z M18.673,29.577 L22.298,29.577 L22.298,19.282 L18.673,19.282 L18.673,29.577 Z M18.789,15.57 C19.717,16.498 21.283,16.498 22.211,15.57 C23.139,14.642 23.139,13.076 22.211,12.148 C21.283,11.22 19.717,11.22 18.789,12.148 C17.861,13.076 17.861,14.642 18.789,15.57 Z\"/>\r\n</svg>\r\n"

/***/ }),
/* 1261 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"leftarrow\" fill=\"#292929\">\r\n            <path d=\"M51.5555556,0.0555555556 L51.5555556,64.0555556 L12.4444444,32.0555556 L51.5555556,0.0555555556 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1262 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>loading</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"loading\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M36.899,10.399 C36.899,8.014 34.991,6 32.5,6 C30.009,6 28.101,8.014 28.101,10.399 L28.101,18.137 C28.101,20.628 30.009,22.589 32.5,22.589 C34.991,22.589 36.899,20.628 36.899,18.137 L36.899,10.399 Z M36.899,46.863 C36.899,44.372 34.991,42.464 32.5,42.464 C30.009,42.464 28.101,44.372 28.101,46.863 L28.101,54.601 C28.101,56.986 30.009,59 32.5,59 C34.991,59 36.899,56.986 36.899,54.601 L36.899,46.863 Z M18.137,36.899 C20.628,36.899 22.536,34.991 22.536,32.5 C22.536,30.009 20.628,28.101 18.137,28.101 L10.399,28.101 C8.014,28.101 6,30.009 6,32.5 C6,34.991 8.014,36.899 10.399,36.899 L18.137,36.899 Z M54.601,36.899 C56.986,36.899 59,34.991 59,32.5 C59,30.009 56.986,28.101 54.601,28.101 L46.863,28.101 C44.372,28.101 42.411,30.009 42.411,32.5 C42.411,34.991 44.372,36.899 46.863,36.899 L54.601,36.899 Z M25.451,25.451 C27.2,23.755 27.2,20.946 25.451,19.25 L19.992,13.791 C18.296,12.042 15.487,12.042 13.738,13.791 C12.042,15.487 12.042,18.296 13.738,19.992 L19.25,25.451 C20.946,27.2 23.755,27.2 25.451,25.451 L25.451,25.451 Z M51.209,51.262 C52.958,49.513 52.958,46.704 51.209,45.008 L45.75,39.549 C44.054,37.8 41.245,37.8 39.549,39.549 C37.8,41.245 37.8,44.054 39.549,45.75 L45.008,51.262 C46.704,52.958 49.513,52.958 51.209,51.262 L51.209,51.262 Z M51.209,19.992 C52.958,18.296 52.958,15.487 51.209,13.791 C49.513,12.042 46.704,12.042 45.008,13.791 L39.549,19.25 C37.8,20.946 37.8,23.755 39.549,25.451 C41.245,27.2 44.054,27.2 45.75,25.451 L51.209,19.992 Z M25.451,45.75 C27.2,44.054 27.2,41.245 25.451,39.549 C23.755,37.8 20.946,37.8 19.25,39.549 L13.738,45.008 C12.042,46.704 12.042,49.513 13.738,51.262 C15.487,52.958 18.296,52.958 19.992,51.262 L25.451,45.75 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1263 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>lock</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"lock\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M45.2571433,28.7122285 L45.2571433,18.7428567 C45.2571433,15.0838852 43.931429,12.0082279 41.3330289,9.40982783 C38.7346288,6.81142774 35.6589715,5.48571341 32,5.48571341 C28.3410285,5.48571341 25.2123426,6.81142774 22.6139425,9.40982783 C20.0155425,12.0082279 18.7428567,15.0838852 18.7428567,18.7428567 L18.7428567,28.7122285 L15.4020566,28.7122285 C13.6521137,28.7122285 12.1142851,30.2500571 12.1142851,32 L12.1142851,55.226515 C12.1142851,56.976458 13.6521137,58.5142866 15.4020566,58.5142866 L48.5449148,58.5142866 C50.4009149,58.5142866 51.8857149,56.976458 51.8857149,55.226515 L51.8857149,32 C51.8857149,30.2500571 50.4009149,28.7122285 48.5449148,28.7122285 L45.2571433,28.7122285 Z M25.3714284,18.7428567 C25.3714284,16.8868566 26.0077712,15.349028 27.280457,14.0763423 C28.6061713,12.7506279 30.1439999,12.1142851 32,12.1142851 C33.8560001,12.1142851 35.3938287,12.7506279 36.6665144,14.0763423 C37.9922288,15.349028 38.6285716,16.8868566 38.6285716,18.7428567 L38.6285716,28.7122285 L25.3714284,28.7122285 L25.3714284,18.7428567 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1264 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>mail</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"mail\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M32,35.0714286 L7.5,16.6428571 C7.5,15.8086378 7.80246611,15.0881865 8.40740741,14.4814815 C9.0123487,13.8747765 9.73070572,13.5714286 10.5625,13.5714286 L53.4375,13.5714286 C54.2692943,13.5714286 54.9876513,13.8747765 55.5925926,14.4814815 C56.1975339,15.0881865 56.5,15.8086378 56.5,16.6428571 L32,35.0714286 Z M32,40.5886243 L56.5,22.1600529 L56.5,47.3571429 C56.5,48.1913622 56.1975339,48.9118135 55.5925926,49.5185185 C54.9876513,50.1252235 54.2692943,50.4285714 53.4375,50.4285714 L10.5625,50.4285714 C9.73070572,50.4285714 9.0123487,50.1252235 8.40740741,49.5185185 C7.80246611,48.9118135 7.5,48.1913622 7.5,47.3571429 L7.5,22.1600529 L32,40.5886243 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1265 */
/***/ (function(module, exports) {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\">\r\n  <path fill=\"#292929\" fill-rule=\"evenodd\" d=\"M23.9480182,8.29257825 C23.4116248,7.90247392 23.0215204,7.90247392 22.485127,8.29257825 L15.3657228,15.4119824 C14.8780924,15.8996128 14.8780924,16.3872432 15.3657228,16.8748737 L30.9211332,32.381521 L15.3657228,47.8881684 C14.8780924,48.3757988 14.8780924,48.8634292 15.3657228,49.3510597 L22.485127,56.4704638 C22.9727574,56.9580942 23.4603878,56.9580942 23.9480182,56.4704638 L47.3542784,33.1129667 C47.8419088,32.6253362 47.8419088,32.1377058 47.3542784,31.6500754 L23.9480182,8.29257825 Z\" transform=\"rotate(-180 31.36 32.418)\"/>\r\n</svg>\r\n"

/***/ }),
/* 1266 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>pin</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"pin\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M29.3637625,42.198738 L29.3637625,59.2785363 C29.3637625,59.6824504 29.3060604,60.1440666 30.4601009,61.0672989 C31.0948231,61.4712131 31.9026514,61.7020212 32.9989898,61.7020212 C35.1339646,61.7020212 36.403409,60.6633848 36.4611111,59.9132585 L36.5765151,59.2785363 L36.5765151,42.198738 C34.4992423,42.6026522 31.4987372,42.6026522 29.3637625,42.198738 L29.3637625,42.198738 Z M16.1499996,20.8489902 C16.1499996,25.4651519 17.8233582,29.4465913 21.1123734,32.7356065 C24.4013886,36.0246217 28.3828281,37.6402783 32.9989898,37.6402783 C37.6151515,37.6402783 41.596591,36.0246217 44.8856062,32.7356065 C48.1746214,29.4465913 49.84798,25.4651519 49.84798,20.8489902 C49.84798,16.1751265 48.1746214,12.251389 44.8856062,8.96237382 C41.596591,5.67335861 37.6151515,4 32.9989898,4 C28.3828281,4 24.4013886,5.67335861 21.1123734,8.96237382 C17.8233582,12.251389 16.1499996,16.1751265 16.1499996,20.8489902 Z M33.3452019,20.5027781 C31.2679292,18.3678033 31.2679292,14.84798 33.3452019,12.7707072 C35.4801767,10.6934345 38.942298,10.6934345 41.0195707,12.7707072 C43.1545455,14.84798 43.1545455,18.3678033 41.0195707,20.5027781 C38.942298,22.5800508 35.4801767,22.5800508 33.3452019,20.5027781 L33.3452019,20.5027781 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1267 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>plus</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"plus\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M36.784,55 C37.336,55 37.75,54.586 37.75,54.034 L37.75,37.75 L54.034,37.75 C54.586,37.75 55,37.336 55,36.784 L55,27.216 C55,26.664 54.586,26.25 54.034,26.25 L37.75,26.25 L37.75,9.966 C37.75,9.414 37.336,9 36.784,9 L27.216,9 C26.664,9 26.25,9.414 26.25,9.966 L26.25,26.25 L9.966,26.25 C9.414,26.25 9,26.664 9,27.216 L9,36.784 C9,37.336 9.414,37.75 9.966,37.75 L26.25,37.75 L26.25,54.034 C26.25,54.586 26.664,55 27.216,55 L36.784,55 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1268 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>print</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"print\" sketch:type=\"MSArtboardGroup\" fill=\"#37383A\">\r\n            <path d=\"M57.5,24.5951504 L57.5,44.5005116 C57.5,46.8102108 55.603329,48.7132187 53.4343207,48.7132187 L49.303872,48.7132187 L51.1322037,57 L13.6797082,57 L15.1699133,48.7137303 L10.698788,48.7137303 C8.2599924,48.7137303 6.5,46.8102108 6.5,44.5010231 L6.5,24.5951504 C6.5,22.2859628 8.2599924,20.3839779 10.698788,20.3839779 L15.9134859,20.3839779 L15.9134859,13.9966237 L17.7418176,13.9966237 L17.7418176,7 L46.3229518,7 L46.3229518,13.9966237 L48.1512835,13.9966237 L48.1512835,20.3834663 L53.4338107,20.3834663 C55.603329,20.3834663 57.5,22.2859628 57.5,24.5951504 L57.5,24.5951504 Z M16.5239498,27.7883159 C16.5239498,26.2249847 15.1699133,24.8667894 13.5430296,24.8667894 C11.9844852,24.8667894 10.6304487,26.2249847 10.6304487,27.7883159 C10.6304487,29.4186618 11.9844852,30.7083078 13.5430296,30.7083078 C15.1699133,30.710354 16.5239498,29.4186618 16.5239498,27.7883159 L16.5239498,27.7883159 Z M47.6774982,54.487211 L45.1050839,41.3758952 L18.8944061,41.3758952 L16.9299057,54.487211 L47.6774982,54.487211 L47.6774982,54.487211 Z M19.6384886,25.4110906 L44.4267907,25.4110906 L44.4267907,9.58133824 L19.6384886,9.58133824 L19.6384886,25.4110906 L19.6384886,25.4110906 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1269 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"rightarrow\" fill=\"#292929\">\r\n            <path d=\"M12.4444444,64.0555556 L12.4444444,0.0555555556 L51.5555556,32.0555556 L12.4444444,64.0555556 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1270 */
/***/ (function(module, exports) {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\">\r\n  <path fill=\"#000000\" fill-rule=\"evenodd\" d=\"M5.99095697,15.6658339 C6.19180346,15.74952 6.39264996,15.7829944 6.61023366,15.7829944 C7.22951035,15.7829944 7.83204984,15.4147758 8.09984517,14.7954991 C10.0078869,10.1927669 14.4767214,7.21354392 19.4644093,7.21354392 C23.5984997,7.21354392 27.3643715,9.25548329 29.6238946,12.5694505 L26.9626785,12.5694505 C26.0756065,12.5694505 25.3559065,13.2891504 25.3559065,14.1762224 C25.3559065,15.0632944 26.0756065,15.7829944 26.9626785,15.7829944 L34.9965383,15.7829944 L34.9965383,7.74913458 C34.9965383,6.86206256 34.2768384,6.14236261 33.3897663,6.14236261 C32.5026943,6.14236261 31.7829944,6.86206256 31.7829944,7.74913458 L31.7829944,10.0756065 C28.8874574,6.29299749 24.3851485,4 19.4644093,4 C13.1712192,4 7.5475173,7.74913458 5.12062216,13.5569457 C4.785878,14.3770689 5.17083378,15.3143526 5.99095697,15.6658339 L5.99095697,15.6658339 Z M34.009043,23.398424 C33.1889198,23.0636798 32.2516362,23.4486356 31.9001548,24.2687588 C29.9921131,28.871491 25.5232786,31.850714 20.5355907,31.850714 C16.4015003,31.850714 12.6356285,29.8087746 10.3761054,26.4948075 L13.0373215,26.4948075 C13.9243935,26.4948075 14.6440935,25.7751075 14.6440935,24.8880355 C14.6440935,24.0009635 13.9243935,23.2812635 13.0373215,23.2812635 L5.0034617,23.2812635 L5.0034617,31.3151233 C5.0034617,32.2021954 5.72316164,32.9218953 6.61023366,32.9218953 C7.49730568,32.9218953 8.21700562,32.2021954 8.21700562,31.3151233 L8.21700562,28.9886514 C11.1125426,32.7545232 15.6148515,35.0642579 20.5355907,35.0642579 C26.8287808,35.0642579 32.4524827,31.3151233 34.8793778,25.5073122 C35.214122,24.687189 34.8291662,23.7499054 34.009043,23.398424 L34.009043,23.398424 Z\"/>\r\n</svg>\r\n"

/***/ }),
/* 1271 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>tag</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"tag\" sketch:type=\"MSArtboardGroup\" fill=\"#ABABAB\">\r\n            <path d=\"M25.9438872,55.595114 C27.0356934,56.7952953 28.8553705,56.7952953 29.9926687,55.595114 L54.4673256,29.7672126 C54.6492933,29.6231908 54.7402772,29.3831545 54.7402772,29.095111 L54.7402772,11.5244569 C54.7402772,9.84420305 53.4665032,8.5 51.8742858,8.5 L35.2242403,8.5 C34.9512888,8.5 34.7238291,8.5960145 34.5873534,8.78804351 L10.1126965,34.615945 C8.97539828,35.8161263 8.97539828,37.7364164 10.1126965,38.8885904 L25.9438872,55.595114 Z M41.729586,15.8451095 C43.4127873,14.0688412 46.1877948,14.0688412 47.8255042,15.7971023 C49.4632136,17.5253633 49.4632136,20.4538057 47.8255042,22.230074 C46.1877948,23.9583351 43.4127873,23.9583351 41.729586,22.230074 C40.9107313,21.3179362 40.5013039,20.2617767 40.5013039,19.0135881 C40.5013039,17.7173923 40.9107313,16.6612328 41.729586,15.8451095 L41.729586,15.8451095 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1272 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>tick</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"tick\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M60.4544,16.7216 C61.0304,16.1456 61.0304,15.5696 60.4544,14.9936 L52.0448,6.584 C51.4688,6.008 50.8928,6.008 50.3168,6.584 L24.8,32.1584 L13.6832,20.984 C13.1072,20.408 12.5312,20.408 11.9552,20.984 L3.5456,29.3936 C2.9696,29.9696 2.9696,30.5456 3.5456,31.1216 L23.936,51.512 C24.5696,51.9728 25.0304,51.9728 25.664,51.512 L60.4544,16.7216 Z\" id=\"check\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1273 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"uparrow\" fill=\"#292929\">\r\n            <path d=\"M64,51.6111111 L3.55271368e-15,51.6111111 L32,12.5 L64,51.6111111 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1274 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>user</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"user\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M58.9997157,55.714 C59.0527154,49.301 51.6857549,46.969 46.1207847,44.955 C42.3048052,43.471 39.1248223,41.192 39.1248223,38.012 L39.8138186,37.27 C40.661814,36.21 42.0928064,33.931 43.4177992,31.122 C44.7427921,28.313 45.7497867,23.755 45.7497867,19.25 C45.7497867,15.593 44.4247938,12.519 41.8278078,9.922 C39.2308217,7.325 36.1568382,6 32.4998578,6 C28.8428774,6 25.7158942,7.325 23.1189082,9.922 C20.5219221,12.519 19.2499289,15.593 19.2499289,19.25 C19.2499289,23.755 20.4159227,28.366 21.5289167,31.122 C22.1119136,32.447 22.8009099,33.719 23.5429059,34.938 C25.0798976,37.323 25.5038954,37.747 25.8748934,38.012 C25.9278931,43.047 18.5609326,44.902 12.9959625,47.234 C9.17998294,48.771 6,51.633 6,55.714 L6,57.887 C6,58.523 6.47699744,59 7.11299403,59 L57.8867216,59 C58.5227182,59 58.9997157,58.523 58.9997157,57.887 L58.9997157,55.714 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1275 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>action</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"action\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M43.968,49.5483944 L8,49.5483944 L8,17.1992261 L18.368,17.1992261 C21.76,14.7406893 25.856,13.1232309 30.656,12.4115492 L30.656,9.11193405 L8,9.11193405 C5.824,9.11193405 3.968,9.88831409 2.368,11.5057725 C0.768,13.1232309 0,14.9994827 0,17.1992261 L0,49.5483944 C0,51.7481379 0.768,53.6243896 2.368,55.241848 C3.968,56.8593065 5.824,57.6356865 8,57.6356865 L43.968,57.6356865 C46.144,57.6356865 48,56.8593065 49.6,55.241848 C51.2,53.6243896 51.968,51.7481379 51.968,49.5483944 L51.968,40.8788173 L43.968,46.3781759 L43.968,49.5483944 Z M38.08,6.65339726 C37.696,6.32990558 37.248,6.26520724 36.736,6.52400059 C36.224,6.78279394 35.968,7.17098396 35.968,7.75326899 L35.968,17.2639245 C28.352,17.5227178 22.592,19.7871596 18.688,24.0572498 C15.104,27.8744517 13.312,32.7915252 13.312,38.8084705 C13.44,39.5201523 13.824,39.9730406 14.4,40.1024373 L14.656,40.1024373 C15.168,40.1024373 15.552,39.9083423 15.808,39.4554539 L15.872,39.3260572 C16.32,38.7437722 16.512,38.4202805 18.752,37.1263138 C19.84,36.4146321 21.12,35.8323471 22.464,35.3794587 C25.216,34.4089837 30.272,33.3738103 35.968,33.3091119 L35.968,42.8197674 C35.968,43.3373541 36.224,43.7255441 36.736,43.9843375 C36.928,44.1137341 37.12,44.1784325 37.312,44.1784325 C37.632,44.1784325 37.888,44.1137341 38.08,43.9196391 L63.424,26.3863899 C63.808,26.1275966 64,25.7394066 64,25.2865182 C64,24.8336298 63.808,24.4454398 63.424,24.1219481 L38.08,6.65339726 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1276 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"alert\" fill=\"#292929\">\r\n            <path d=\"M36.6819313,12.61 C35.8269313,10.855 34.4319313,10 32.4969313,10 C30.5619313,10 29.1669313,10.855 28.2669313,12.61 L10.4469313,48.25 C9.72693126,49.825 9.81693126,51.355 10.6719313,52.75 C11.6169313,54.235 12.9219313,55 14.6769313,55 L50.3169313,55 C52.0719313,55 53.3769313,54.235 54.3219313,52.75 C55.2219313,51.31 55.2669313,49.825 54.4569313,48.25 L36.6819313,12.61 Z M35.2869313,22.195 L35.2869313,38.125 L29.6619313,38.125 L29.6619313,22.195 L35.2869313,22.195 Z M29.8419313,49.24 C28.4019313,47.755 28.4019313,45.37 29.8419313,43.93 C31.2819313,42.445 33.7119313,42.445 35.1519313,43.93 C36.5919313,45.37 36.5919313,47.755 35.1519313,49.24 C33.7119313,50.68 31.2819313,50.68 29.8419313,49.24 L29.8419313,49.24 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1277 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>back</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"back\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M29.696,62.4197275 C30.08,62.8699138 30.592,62.9342261 31.168,62.7412891 C31.744,62.4840398 32,62.0338536 32,61.4550427 L32,44.0907162 L62.656,44.0907162 C63.424,44.0907162 64,43.5119053 64,42.7401575 L64,21.2598425 C64,20.4880947 63.424,19.9735961 62.656,19.9735961 L32,19.9735961 L32,2.54495729 C32,1.9661464 31.744,1.51596016 31.168,1.25871088 C30.592,1.06577392 30.08,1.13008624 29.696,1.58027248 L0.384,31.0353152 C-0.128,31.7427507 -0.128,32.2572493 0.384,32.9646848 L29.696,62.4197275 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1278 */
/***/ (function(module, exports) {

module.exports = "\r\n<svg viewBox=\"0 0 45 45\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <g id=\"Icons\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"Artboard-2\" sketch:type=\"MSArtboardGroup\" fill=\"#FFFFFF\">\r\n            <path d=\"M17.82,0 C17.28,0 16.875,0.405 16.875,0.945 L16.875,44.055 C16.875,44.595 17.28,45 17.82,45 L27.18,45 C27.72,45 28.125,44.595 28.125,44.055 L28.125,0.945 C28.125,0.405 27.72,0 27.18,0 L17.82,0 Z M0.945,22.5 C0.405,22.5 0,22.905 0,23.445 L0,44.055 C0,44.595 0.405,45 0.945,45 L10.305,45 C10.845,45 11.25,44.595 11.25,44.055 L11.25,23.445 C11.25,22.905 10.845,22.5 10.305,22.5 L0.945,22.5 Z M34.695,11.25 C34.155,11.25 33.75,11.655 33.75,12.195 L33.75,44.055 C33.75,44.595 34.155,45 34.695,45 L44.055,45 C44.595,45 45,44.595 45,44.055 L45,12.195 C45,11.655 44.595,11.25 44.055,11.25 L34.695,11.25 Z\" id=\"barchart\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>\r\n"

/***/ }),
/* 1279 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"circle_number_1\" fill=\"#000000\">\r\n            <path d=\"M23.8615723,26.4946289 L23.8615723,22.6108398 C25.6633391,22.5307613 26.9245569,22.4106453 27.6452637,22.2504883 C28.7930559,21.9969063 29.7272913,21.4897499 30.447998,20.7290039 C30.9418156,20.2084935 31.3155098,19.51449 31.5690918,18.6469727 C31.7159024,18.1264622 31.7893066,17.7394218 31.7893066,17.4858398 L36.5339355,17.4858398 L36.5339355,46.5141602 L30.6882324,46.5141602 L30.6882324,26.4946289 L23.8615723,26.4946289 Z\" id=\"1\"></path>\r\n            <path d=\"M61.1977539,32 C61.1977539,15.9837423 48.2140117,3 32.1977539,3 C16.1814962,3 3.19775391,15.9837423 3.19775391,32 C3.19775391,48.0162577 16.1814962,61 32.1977539,61 C48.2140117,61 61.1977539,48.0162577 61.1977539,32 Z M7.19775391,32 C7.19775391,18.1928813 18.3906352,7 32.1977539,7 C46.0048727,7 57.1977539,18.1928813 57.1977539,32 C57.1977539,45.8071187 46.0048727,57 32.1977539,57 C18.3906352,57 7.19775391,45.8071187 7.19775391,32 Z\" id=\"Oval-1\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1280 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"circle_number_2\" fill=\"#000000\">\r\n            <path d=\"M29.3649902,34.732666 C31.9942352,32.8508207 33.6958783,31.5028524 34.4699707,30.6887207 C35.6578022,29.4208107 36.251709,28.0328038 36.251709,26.5246582 C36.251709,25.2967875 35.9113804,24.2758016 35.2307129,23.4616699 C34.5500454,22.6475382 33.5757713,22.2404785 32.3078613,22.2404785 C30.5728266,22.2404785 29.3916861,22.8877702 28.7644043,24.182373 C28.4040509,24.9297726 28.1905114,26.1175863 28.1237793,27.7458496 L22.5783691,27.7458496 C22.6717941,25.2767617 23.1188925,23.2815017 23.9196777,21.7600098 C25.4411697,18.8638364 28.1437794,17.4157715 32.0275879,17.4157715 C35.0972647,17.4157715 37.5396231,18.2665931 39.3547363,19.9682617 C41.1698496,21.6699304 42.0773926,23.9221051 42.0773926,26.7248535 C42.0773926,28.8736273 41.436774,30.7821368 40.1555176,32.4504395 C39.3146931,33.5581924 37.9333592,34.7927178 36.0114746,36.1540527 L33.729248,37.7756348 C32.301181,38.7899628 31.3235703,39.5240049 30.7963867,39.9777832 C30.2692031,40.4315615 29.8254413,40.9587372 29.4650879,41.5593262 L42.1374512,41.5593262 L42.1374512,46.5842285 L22.2580566,46.5842285 C22.3114423,44.5021869 22.7585407,42.6003504 23.5993652,40.8786621 C24.4134969,38.9434311 26.3353527,36.8947862 29.3649902,34.732666 Z\" id=\"2\"></path>\r\n            <path d=\"M61.1977539,32 C61.1977539,15.9837423 48.2140117,3 32.1977539,3 C16.1814962,3 3.19775391,15.9837423 3.19775391,32 C3.19775391,48.0162577 16.1814962,61 32.1977539,61 C48.2140117,61 61.1977539,48.0162577 61.1977539,32 Z M7.19775391,32 C7.19775391,18.1928813 18.3906352,7 32.1977539,7 C46.0048727,7 57.1977539,18.1928813 57.1977539,32 C57.1977539,45.8071187 46.0048727,57 32.1977539,57 C18.3906352,57 7.19775391,45.8071187 7.19775391,32 Z\" id=\"Oval-2\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1281 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"65px\" height=\"64px\" viewBox=\"0 0 65 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"circle_number_3\" transform=\"translate(0.802246, 0.000000)\" fill=\"#000000\">\r\n            <path d=\"M27.9611816,37.3151855 C27.9611816,38.4763242 28.1480287,39.4372521 28.5217285,40.197998 C29.2157424,41.5993722 30.4769603,42.3000488 32.3054199,42.3000488 C33.4265193,42.3000488 34.4041299,41.916345 35.2382812,41.1489258 C36.0724326,40.3815066 36.489502,39.2771068 36.489502,37.8356934 C36.489502,35.9271552 35.7154212,34.6525911 34.1672363,34.0119629 C33.2863725,33.6516095 31.8983656,33.4714355 30.0031738,33.4714355 L30.0031738,29.3874512 C31.8583263,29.3607583 33.1529097,29.1805844 33.8869629,28.8469238 C35.1548729,28.2863742 35.7888184,27.1519454 35.7888184,25.4436035 C35.7888184,24.3358506 35.4651725,23.4349807 34.8178711,22.7409668 C34.1705697,22.0469529 33.2596901,21.6999512 32.0852051,21.6999512 C30.7372166,21.6999512 29.7462597,22.1270302 29.1123047,22.9812012 C28.4783497,23.8353721 28.1747232,24.976474 28.201416,26.404541 L22.8762207,26.404541 C22.9296064,24.9631276 23.1765115,23.5951399 23.6169434,22.3005371 C24.0840681,21.1660913 24.8181102,20.118413 25.8190918,19.1574707 C26.5664914,18.4768032 27.454015,17.9563006 28.4816895,17.5959473 C29.5093639,17.2355939 30.7705817,17.0554199 32.2653809,17.0554199 C35.0414364,17.0554199 37.2802649,17.7727793 38.9819336,19.2075195 C40.6836023,20.6422598 41.5344238,22.5674521 41.5344238,24.9831543 C41.5344238,26.6914962 41.0272674,28.132888 40.0129395,29.307373 C39.3723112,30.0414262 38.7050002,30.5419095 38.0109863,30.8088379 C38.5314967,30.8088379 39.2788851,31.2559363 40.2531738,32.1501465 C41.7079337,33.498135 42.4353027,35.3399135 42.4353027,37.6755371 C42.4353027,40.1312786 41.5844812,42.2900298 39.8828125,44.1518555 C38.1811438,46.0136812 35.6620447,46.9445801 32.3254395,46.9445801 C28.2147418,46.9445801 25.3586506,45.6032849 23.7570801,42.9206543 C22.9162556,41.4925873 22.4491378,39.6241164 22.3557129,37.3151855 L27.9611816,37.3151855 Z\" id=\"3\"></path>\r\n            <path d=\"M61.3955078,32 C61.3955078,15.9837423 48.4117656,3 32.3955078,3 C16.3792501,3 3.39550781,15.9837423 3.39550781,32 C3.39550781,48.0162577 16.3792501,61 32.3955078,61 C48.4117656,61 61.3955078,48.0162577 61.3955078,32 Z M7.39550781,32 C7.39550781,18.1928813 18.5883891,7 32.3955078,7 C46.2026266,7 57.3955078,18.1928813 57.3955078,32 C57.3955078,45.8071187 46.2026266,57 32.3955078,57 C18.5883891,57 7.39550781,45.8071187 7.39550781,32 Z\" id=\"Oval-2\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1282 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>close</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"close\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M42.7444089,32 L58.284345,16.4600639 C58.7699681,15.7923323 58.7699681,15.3067093 58.284345,14.6389776 L49.3610224,5.71565495 C48.6932907,5.23003195 48.2076677,5.23003195 47.5399361,5.71565495 L32,21.2555911 L16.4600639,5.71565495 C15.7923323,5.23003195 15.3067093,5.23003195 14.6389776,5.71565495 L5.71565495,14.6389776 C5.23003195,15.3067093 5.23003195,15.7923323 5.71565495,16.4600639 L21.2555911,32 L5.71565495,47.5399361 C5.23003195,48.2076677 5.23003195,48.6932907 5.71565495,49.3610224 L14.6389776,58.284345 C15.3067093,58.7699681 15.7923323,58.7699681 16.4600639,58.284345 L32,42.7444089 L47.5399361,58.284345 C48.2076677,58.7699681 48.6932907,58.7699681 49.3610224,58.284345 L58.284345,49.3610224 C58.7699681,48.6932907 58.7699681,48.2076677 58.284345,47.5399361 L42.7444089,32 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1283 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>upload</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"upload\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M57.92,35.24 C57.92,32.18144 56.98688,29.5376 55.0688,27.2048 C53.20256,24.872 50.81792,23.3168 47.96672,22.64288 C47.2928,18.85856 45.42656,15.69632 42.41984,13.15616 C39.46496,10.616 35.99168,9.32 32,9.32 C27.48992,9.32 23.65376,10.92704 20.49152,14.08928 C17.32928,17.25152 15.77408,21.03584 15.77408,25.54592 L15.77408,25.6496 C13.02656,26.01248 10.7456,27.30848 8.87936,29.43392 C7.01312,31.55936 6.08,33.99584 6.08,36.84704 C6.08,40.00928 7.16864,42.65312 9.39776,44.88224 C11.62688,47.11136 14.27072,48.2 17.43296,48.2 L27.69728,48.2 L27.69728,38.50592 L19.5584,38.50592 C19.09184,38.50592 18.7808,38.29856 18.57344,37.832 C18.41792,37.36544 18.46976,36.95072 18.7808,36.63968 L32,23.47232 L45.2192,36.63968 C45.53024,36.95072 45.58208,37.36544 45.42656,37.832 C45.2192,38.29856 44.90816,38.50592 44.4416,38.50592 L36.30272,38.50592 L36.30272,48.2 L44.96,48.2 C48.53696,48.2 51.54368,46.95584 54.08384,44.41568 C56.624,41.87552 57.92,38.81696 57.92,35.24 L57.92,35.24 Z\" id=\"uploadcloud\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1284 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>cog</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"cog\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M51.236168,35.4110069 C51.5904801,33.7912944 51.5904801,31.1592616 51.236168,29.5395491 L56.0953055,25.3384198 C56.5002336,25.0853397 56.6014657,24.6804116 56.3990016,24.2248674 C55.4372973,21.2385225 53.8175848,18.4546417 51.5904801,15.8732249 C51.286784,15.5189127 50.9324719,15.4176807 50.4769278,15.6201448 L44.4030059,17.6954014 C42.8339094,16.430001 41.1635809,15.4682967 39.3414043,14.7596725 L38.12662,8.43267055 C38.0760039,7.97712641 37.7723078,7.72404633 37.3167637,7.6228143 C34.1279547,6.9648061 30.8885297,6.9648061 27.6997207,7.6228143 C27.2441766,7.72404633 26.9404805,7.97712641 26.8898645,8.43267055 L25.6750801,14.7596725 C23.7516715,15.5189127 22.081343,16.480617 20.6134785,17.6954014 L14.5395567,15.6201448 C14.0840125,15.4176807 13.7297004,15.5189127 13.4260043,15.8732249 C11.1988996,18.4546417 9.57918713,21.2385225 8.61748283,24.2248674 C8.41501877,24.6804116 8.5162508,25.0853397 8.92117893,25.3384198 L13.7803164,29.5395491 C13.4260043,31.1592616 13.4260043,33.7912944 13.7803164,35.4110069 L8.92117893,39.6121362 C8.5162508,39.8652163 8.41501877,40.2701444 8.61748283,40.7256885 C9.57918713,43.7120335 11.1988996,46.4959143 13.4260043,49.0773311 C13.7297004,49.4316432 14.0840125,49.5328753 14.5395567,49.3304112 L20.6134785,47.2551546 C22.081343,48.4699389 23.7516715,49.4316432 25.6750801,50.1908835 L26.8898645,56.5178854 C26.9404805,56.9734296 27.2441766,57.2265096 27.6997207,57.3277417 C31.0909938,57.9351339 33.9254907,57.9351339 37.3167637,57.3277417 C37.7723078,57.2265096 38.0760039,56.9734296 38.12662,56.5178854 L39.3414043,50.1908835 C41.1635809,49.4822592 42.8339094,48.5205549 44.4030059,47.2551546 L50.4769278,49.3304112 C50.9324719,49.5328753 51.286784,49.4316432 51.5904801,49.0773311 C53.8175848,46.4959143 55.4372973,43.7120335 56.3990016,40.7256885 C56.6014657,40.2701444 56.5002336,39.8652163 56.0953055,39.6121362 L51.236168,35.4110069 Z M32.5082422,41.9910889 C29.8255934,41.9910889 27.5984887,41.0800006 25.7256961,39.2578241 C23.9035196,37.3850315 22.9924313,35.1579268 22.9924313,32.475278 C22.9924313,29.8432452 23.9035196,27.6161405 25.7763121,25.7939639 C27.6491047,23.9211713 29.8762094,23.0100831 32.5082422,23.0100831 C35.140275,23.0100831 37.3673797,23.9211713 39.1895563,25.7939639 C41.0623489,27.6161405 41.9734371,29.8432452 41.9734371,32.475278 C41.9734371,35.1073108 41.0623489,37.3344155 39.1895563,39.2072081 C37.3673797,41.0800006 35.140275,41.9910889 32.5082422,41.9910889 L32.5082422,41.9910889 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1285 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>copy</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"copy\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M46.5,13.904 C46.5,11.874 44.876,10.25 42.846,10.25 L6.596,10.25 C4.682,10.25 3,11.874 3,13.904 L3,39.25 C3,41.164 4.682,42.904 6.596,42.904 L12.686,42.904 L12.686,27.186 C12.686,25.156 13.382,23.474 14.774,22.082 C16.224,20.632 17.906,19.936 19.936,19.936 L46.5,19.936 L46.5,13.904 Z M61,28.404 C61,26.374 59.376,24.75 57.346,24.75 L19.936,24.75 C18.544,24.75 17.5,25.794 17.5,27.186 L17.5,50.154 C17.5,52.068 19.182,53.75 21.096,53.75 L57.346,53.75 C59.376,53.75 61,52.068 61,50.154 L61,28.404 Z\" id=\"layers\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1286 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>curvedtriangle</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"curvedtriangle\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M35.6959096,17.0172228 C45.1306064,28.5485189 64,51.6111111 64,51.6111111 L0,51.6111111 C0,51.6111111 18.8679215,28.5503181 28.3018823,17.0199216 C29.5345882,15.5132811 30.1520452,14.5006745 32,14.5 C33.8479548,14.4993255 34.4639397,15.5114819 35.6959096,17.0172228 Z\" id=\"downarrow\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1287 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>curvedtriangledown</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"curvedtriangledown\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M35.5804124,16.4418571 C44.7202749,27.6279048 63,50 63,50 L1,50 C1,50 19.278299,27.6296501 28.4174485,16.4444752 C29.6116323,14.9829436 30.2097938,14.0006546 32,14.0000003 C33.7902062,13.999346 34.3869416,14.9811983 35.5804124,16.4418571 Z\" id=\"downarrow\" sketch:type=\"MSShapeGroup\" transform=\"translate(32.000000, 32.000000) rotate(-180.000000) translate(-32.000000, -32.000000) \"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1288 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M14.7 5C14.9761 5 15.2 5.22386 15.2 5.5V6.77949C18.5279 7.03971 21.2 9.87197 21.2 13.26C21.2 16.0282 21.4971 17.613 21.7763 18.488C21.9155 18.9241 22.0487 19.179 22.1348 19.3148C22.1778 19.3826 22.209 19.4207 22.2234 19.437C22.2265 19.4405 22.2288 19.443 22.2303 19.4446C22.3827 19.5787 22.4395 19.7925 22.3718 19.9855C22.3015 20.1859 22.1123 20.32 21.9 20.32H7.5C7.30838 20.32 7.13362 20.2105 7.05005 20.038C6.96739 19.8675 6.98836 19.665 7.10375 19.5151C7.10336 19.5156 7.10322 19.5158 7.10333 19.5156L7.10456 19.514L7.10584 19.5124M7.10376 19.5151C7.10419 19.5145 7.10493 19.5134 7.10596 19.512C7.10991 19.5064 7.11815 19.4946 7.13011 19.4758C7.154 19.4384 7.19282 19.3735 7.24181 19.2771C7.33977 19.0845 7.47881 18.7653 7.6207 18.2876C7.90437 17.3326 8.19953 15.7435 8.2 13.2659C8.12034 9.86189 10.8053 7.03368 14.2 6.77871V5.5C14.2 5.22386 14.4239 5 14.7 5M21.0178 19.32C20.9536 19.1689 20.8881 18.994 20.8237 18.792C20.5029 17.787 20.2 16.0918 20.2 13.26C20.2 10.2561 17.7039 7.76 14.7 7.76C11.6092 7.76 9.12699 10.2602 9.19986 13.2478L9.20015 13.26H9.2C9.2 15.8191 8.89541 17.5082 8.57931 18.5724C8.49146 18.8681 8.40272 19.1156 8.31942 19.32H21.0178ZM12.9419 21.8257C13.2039 21.7383 13.487 21.8799 13.5743 22.1419C13.7513 22.6727 14.2106 23 14.7 23C15.1894 23 15.6487 22.6727 15.8257 22.1419C15.913 21.8799 16.1961 21.7383 16.4581 21.8257C16.7201 21.913 16.8617 22.1961 16.7743 22.4581C16.4713 23.3673 15.6506 24 14.7 24C13.7494 24 12.9287 23.3673 12.6257 22.4581C12.5383 22.1961 12.6799 21.913 12.9419 21.8257Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1289 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15 17.8462L9.07692 11.9231L8 13L15 20L22 13L20.9231 11.9231L15 17.8462Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1290 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.1538 15L18.0769 9.07692L17 8L10 15L17 22L18.0769 20.9231L12.1538 15Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1291 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M17.8462 15L11.9231 20.9231L13 22L20 15L13 8L11.9231 9.07692L17.8462 15Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1292 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15 12.1538L20.9231 18.0769L22 17L15 10L8 17L9.07692 18.0769L15 12.1538Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1293 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.5 5C6.5 4.72386 6.72386 4.5 7 4.5H22.0244C22.3005 4.5 22.5244 4.72386 22.5244 5V25C22.5244 25.2761 22.3005 25.5 22.0244 25.5H7C6.72386 25.5 6.5 25.2761 6.5 25V5ZM7.5 5.5V24.5H21.5244V5.5H7.5ZM9.00437 7.72705C9.00437 7.45091 9.22823 7.22705 9.50437 7.22705H19.5206C19.7968 7.22705 20.0206 7.45091 20.0206 7.72705V12.2725C20.0206 12.5486 19.7968 12.7725 19.5206 12.7725H9.50437C9.22823 12.7725 9.00437 12.5486 9.00437 12.2725V7.72705ZM10.0044 8.22705V11.7725H19.0206V8.22705H10.0044ZM9.00437 15C9.00437 14.7239 9.22823 14.5 9.50437 14.5H19.5199C19.7961 14.5 20.0199 14.7239 20.0199 15V22.2726C20.0199 22.5487 19.7961 22.7726 19.5199 22.7726H9.50437C9.22823 22.7726 9.00437 22.5487 9.00437 22.2726V15ZM10.0044 15.5V18.1364H12.3431V15.5H10.0044ZM13.3431 15.5V18.1364H15.682V15.5H13.3431ZM16.682 15.5V18.1364H19.0199V15.5H16.682ZM19.0199 19.1364H16.682V21.7726H19.0199V19.1364ZM15.682 21.7726V19.1364H13.3431V21.7726H15.682ZM12.3431 21.7726V19.1364H10.0044V21.7726H12.3431Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1294 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M15.2747 14.0384L26.3131 3L27 3.68687L15.9616 14.7253L27.5495 26.3131L26.8626 27L15.2747 15.4121L3.68687 27L3 26.3131L14.5879 14.7253L3.5495 3.68687L4.23636 3L15.2747 14.0384Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1295 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<line x1=\"20\" y1=\"10.5\" y2=\"10.5\" stroke=\"#0C2340\"/>\r\n</svg>\r\n"

/***/ }),
/* 1296 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.90507 5.14645C8.99884 5.05268 9.12601 5 9.25862 5H18.569C19.4313 5 20.1034 5.67213 20.1034 6.53448V21.7069C20.1034 22.5692 19.4313 23.2414 18.569 23.2414H7.53448C6.67213 23.2414 6 22.5692 6 21.7069V8.25862C6 8.12601 6.05268 7.99884 6.14645 7.90507L8.90507 5.14645ZM9.46573 6L7 8.46573V21.7069C7 22.017 7.22442 22.2414 7.53448 22.2414H18.569C18.879 22.2414 19.1034 22.017 19.1034 21.7069V6.53448C19.1034 6.22442 18.879 6 18.569 6H9.46573ZM20.8276 8.25862C20.8276 7.98248 21.0514 7.75862 21.3276 7.75862H22.0172C22.8796 7.75862 23.5517 8.43075 23.5517 9.2931V24.4655C23.5517 25.3279 22.8796 26 22.0172 26H10.9828C10.1204 26 9.44828 25.3279 9.44828 24.4655C9.44828 24.1894 9.67213 23.9655 9.94828 23.9655C10.2244 23.9655 10.4483 24.1894 10.4483 24.4655C10.4483 24.7756 10.6727 25 10.9828 25H22.0172C22.3273 25 22.5517 24.7756 22.5517 24.4655V9.2931C22.5517 8.98304 22.3273 8.75862 22.0172 8.75862H21.3276C21.0514 8.75862 20.8276 8.53476 20.8276 8.25862ZM11.5 10.5C11.5 10.2239 11.7239 10 12 10H16.5C16.7762 10 17 10.2239 17 10.5C17 10.7761 16.7762 11 16.5 11H12C11.7239 11 11.5 10.7761 11.5 10.5ZM9.10345 14.4998C9.10345 14.2237 9.32731 13.9998 9.60345 13.9998H16.5C16.7761 13.9998 17 14.2237 17 14.4998C17 14.7759 16.7761 14.9998 16.5 14.9998H9.60345C9.32731 14.9998 9.10345 14.7759 9.10345 14.4998ZM9.10352 18.5C9.10352 18.2239 9.32737 18 9.60352 18H16.5001C16.7762 18 17.0001 18.2239 17.0001 18.5C17.0001 18.7761 16.7762 19 16.5001 19H9.60352C9.32737 19 9.10352 18.7761 9.10352 18.5Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1297 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.5 5C6.5 4.72386 6.72386 4.5 7 4.5H17.6118C17.7444 4.5 17.8715 4.55268 17.9653 4.64645L21.3373 8.0184C21.431 8.11217 21.4837 8.23935 21.4837 8.37196V11.9423C21.4837 12.2184 21.2599 12.4423 20.9837 12.4423C20.7076 12.4423 20.4837 12.2184 20.4837 11.9423V8.57906L17.4046 5.5H7.5V23.74H13.7439C14.0201 23.74 14.2439 23.9639 14.2439 24.24C14.2439 24.5161 14.0201 24.74 13.7439 24.74H7C6.72386 24.74 6.5 24.5161 6.5 24.24V5ZM17.5994 12.3101C17.8755 12.3101 18.0994 12.5339 18.0994 12.8101V17.3308H22.6201C22.8962 17.3308 23.1201 17.5547 23.1201 17.8308C23.1201 18.1069 22.8962 18.3308 22.6201 18.3308H18.0994V22.8515C18.0994 23.1277 17.8755 23.3515 17.5994 23.3515C17.3232 23.3515 17.0994 23.1277 17.0994 22.8515V18.3308L12.5786 18.3308C12.3025 18.3308 12.0786 18.1069 12.0786 17.8308C12.0786 17.5547 12.3025 17.3308 12.5786 17.3308L17.0994 17.3308V12.8101C17.0994 12.5339 17.3232 12.3101 17.5994 12.3101Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1298 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"20\" height=\"21\" viewBox=\"0 0 20 21\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M8.74392 20.24H2V1H12.6118L15.9837 4.37196V7.94227M12.5994 8.81005V13.8308M12.5994 13.8308V18.8515M12.5994 13.8308H17.6201M12.5994 13.8308L7.57861 13.8308\" stroke=\"#407EC9\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>\r\n"

/***/ }),
/* 1299 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9.0859 1.81912C9.77314 1.4986 10.5964 1.70052 11.1303 2.35088C11.2128 2.45136 11.3084 2.61097 11.4044 2.78255C11.5069 2.96587 11.6303 3.20044 11.7703 3.47619C12.0507 4.02828 12.4051 4.75944 12.8057 5.60495C13.6071 7.29677 14.5992 9.45843 15.5651 11.5872C16.5311 13.7164 17.4719 15.8148 18.1711 17.3806C18.5207 18.1636 18.81 18.8135 19.0118 19.2678L19.3279 19.9799C19.328 19.9801 19.3282 19.9807 18.8711 20.1832L19.3279 19.9799C19.415 20.1766 19.3654 20.4 19.2198 20.5416C19.3531 20.6312 19.4762 20.7358 19.5868 20.8535C19.6494 20.9201 19.6925 21.0025 19.7115 21.0918L20.9205 26.7751C20.969 27.0032 20.8534 27.2346 20.6418 27.3327C20.4303 27.4309 20.179 27.3697 20.0361 27.1854L20.0192 27.1634L19.9722 27.1024C19.9319 27.0499 19.8743 26.9747 19.8052 26.8838C19.6672 26.7021 19.4825 26.4565 19.2967 26.2023C19.1117 25.9492 18.922 25.6826 18.7757 25.4605C18.7031 25.3502 18.6365 25.2437 18.5856 25.1516C18.5603 25.1059 18.5348 25.0564 18.5138 25.0072C18.4979 24.9699 18.4636 24.886 18.4554 24.786C18.4543 24.7732 18.4538 24.7603 18.4537 24.7474C18.4532 24.6058 18.4822 24.4656 18.5389 24.3359C18.5956 24.2062 18.6788 24.0898 18.7831 23.9941C18.8874 23.8984 19.0106 23.8255 19.1447 23.7801C19.1808 23.7679 19.2174 23.7578 19.2545 23.7498L18.7653 21.4499C18.6699 21.3687 18.5616 21.3035 18.4446 21.257C18.2957 21.198 18.1363 21.1707 17.9764 21.177C17.7146 21.2244 17.6464 21.2842 17.621 21.3109C17.5747 21.3595 17.5356 21.4373 17.4399 21.7017C17.4179 21.7625 17.3693 21.8614 17.2635 21.9405C17.1474 22.0272 17.0156 22.0506 16.9057 22.0395C16.7382 22.0226 16.6295 21.9281 16.606 21.9078L16.6044 21.9064C16.5338 21.8454 16.4766 21.7673 16.4416 21.7176C16.3592 21.6004 16.2556 21.4275 16.1385 21.2198C15.9007 20.7982 15.5743 20.174 15.1907 19.4152C14.4221 17.8951 13.4116 15.81 12.3961 13.6656C11.3805 11.5209 10.3582 9.31325 9.56613 7.54724C9.17021 6.66453 8.83078 5.88991 8.57814 5.28769C8.33273 4.70275 8.15168 4.24028 8.0939 4.00837C8.08796 3.98455 8.08379 3.96033 8.08142 3.9359C7.98354 2.92961 8.38728 2.14495 9.0859 1.81912ZM19.4336 24.6149C19.4309 24.6084 19.4318 24.6093 19.4342 24.6162C19.434 24.6157 19.4338 24.6153 19.4336 24.6149ZM18.331 20.1985L18.098 19.6739C17.8963 19.2201 17.6073 18.5707 17.258 17.7883C16.5593 16.2235 15.6194 14.1272 14.6544 12.0004C13.6892 9.8731 12.6999 7.71737 11.9019 6.03308C11.5028 5.19055 11.153 4.46899 10.8787 3.92902C10.7415 3.65874 10.6249 3.43744 10.5316 3.27072C10.4318 3.09226 10.3757 3.00767 10.3575 2.98544C10.0854 2.65413 9.74358 2.6158 9.50857 2.7254C9.28921 2.82771 9.01977 3.13356 9.07323 3.79978C9.1203 3.96273 9.2627 4.33456 9.50027 4.90083C9.74843 5.49234 10.0841 6.25864 10.4786 7.138C11.2671 8.89614 12.2864 11.0973 13.2999 13.2376C14.3137 15.3784 15.3201 17.4548 16.0831 18.964C16.4228 19.6359 16.7118 20.1905 16.9307 20.5871C17.1638 20.361 17.4678 20.2486 17.837 20.1862C17.8545 20.1832 17.8721 20.1812 17.8899 20.1801C18.0376 20.1711 18.1854 20.1773 18.331 20.1985Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1300 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"31\" height=\"31\" viewBox=\"0 0 31 31\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M19.8711 21.1834C19.8711 21.1834 12.5499 4.65008 11.7439 3.66841C10.9379 2.68674 9.41375 3.18791 9.57908 4.88774C9.95108 6.38091 17.7941 23.0176 17.9697 22.5319C18.1454 22.0462 18.2487 21.7931 18.9204 21.6794C19.1621 21.6646 19.404 21.7032 19.629 21.7925C19.8541 21.8818 20.0567 22.0196 20.2224 22.1961L21.4314 27.8794C21.4314 27.8794 19.9744 25.9987 19.9537 25.7456C19.9535 25.6736 19.9682 25.6024 19.997 25.5365C20.0258 25.4706 20.0681 25.4114 20.1211 25.3628C20.1741 25.3141 20.2367 25.2771 20.3049 25.254C20.373 25.231 20.4453 25.2224 20.5169 25.2289\" stroke=\"#407EC9\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>\r\n"

/***/ }),
/* 1301 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11.5 11.5V0H12.5V11.5L24 11.5V12.5L12.5 12.5V24H11.5V12.5L0 12.5V11.5L11.5 11.5Z\" fill=\"#0C2340\"/>\r\n</svg>\r\n"

/***/ }),
/* 1302 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M16.2501 8C16.2501 7.72386 16.4739 7.5 16.7501 7.5H22.0001C22.2762 7.5 22.5001 7.72386 22.5001 8V13.25C22.5001 13.5261 22.2762 13.75 22.0001 13.75C21.7239 13.75 21.5001 13.5261 21.5001 13.25V9.20005L13.0204 17.6867C12.8253 17.8821 12.5087 17.8822 12.3133 17.687C12.118 17.4919 12.1179 17.1753 12.313 16.9799L20.7859 8.5H16.7501C16.4739 8.5 16.2501 8.27614 16.2501 8Z\" fill=\"#407EC9\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.5 11.5C7.5 11.2239 7.72386 11 8 11H13.8333C14.1095 11 14.3333 11.2239 14.3333 11.5C14.3333 11.7761 14.1095 12 13.8333 12H8.5V21.5H18V16.1667C18 15.8905 18.2239 15.6667 18.5 15.6667C18.7761 15.6667 19 15.8905 19 16.1667V22C19 22.2761 18.7761 22.5 18.5 22.5H8C7.72386 22.5 7.5 22.2761 7.5 22V11.5Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1303 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M14 10.4679V8H16V10.4679H14ZM14 21.72V14.0854H16V21.72H14Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1304 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.93001 5C7.93001 5 7.93001 5 7.93001 5H14.015C14.2912 5 14.515 5.22386 14.515 5.5C14.515 5.77614 14.2912 6 14.015 6H7.93001C7.8076 6 7.6864 6.02416 7.57336 6.0711C7.46031 6.11804 7.35765 6.18684 7.27124 6.27354C7.18484 6.36024 7.11641 6.46315 7.06986 6.57636C7.02332 6.68957 6.99958 6.81085 7.00001 6.93325L7.00001 6.935L7.00001 23.755L7.00001 23.7568C6.99958 23.8792 7.02332 24.0004 7.06986 24.1136C7.11641 24.2269 7.18484 24.3298 7.27124 24.4165C7.35765 24.5032 7.46031 24.572 7.57336 24.6189C7.6864 24.6658 7.8076 24.69 7.93001 24.69H14.015C14.2912 24.69 14.515 24.9139 14.515 25.19C14.515 25.4661 14.2912 25.69 14.015 25.69H7.93001C7.67599 25.69 7.42447 25.6399 7.18987 25.5424C6.95527 25.445 6.74221 25.3023 6.5629 25.1223C6.3836 24.9424 6.24158 24.7288 6.14498 24.4939C6.04851 24.2593 5.99925 24.0079 6.00001 23.7542C6.00001 23.7539 6.00001 23.7545 6.00001 23.7542V6.9358C6.00001 6.93549 6.00001 6.93612 6.00001 6.9358\" fill=\"#407EC9\"/>\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M19.54 12.57L22.9257 15.9944L19.7353 19.2658V18.2C19.7353 18.0356 19.67 17.8779 19.5537 17.7616C19.4374 17.6453 19.2797 17.58 19.1153 17.58H13.4703C13.1942 17.58 12.9703 17.8039 12.9703 18.08C12.9703 18.3562 13.1942 18.58 13.4703 18.58H18.7353V20.24L18.7353 20.2436C18.7362 20.3635 18.7721 20.4805 18.8386 20.5803C18.9051 20.6801 18.9993 20.7582 19.1097 20.8051C19.1447 20.82 19.1813 20.8309 19.2188 20.8375C19.3237 20.8559 19.4316 20.8472 19.5323 20.8122C19.628 20.7789 19.7141 20.7229 19.7832 20.6491L23.9024 16.4251C23.9575 16.3712 24.0019 16.3072 24.0331 16.2365C24.0669 16.1596 24.0845 16.0765 24.0845 15.9925C24.0845 15.9085 24.0669 15.8254 24.0331 15.7485C24.0016 15.6771 23.9566 15.6125 23.9007 15.5582L19.5409 11.1485L19.5325 11.1402C19.449 11.0596 19.3444 11.0044 19.2309 10.9807C19.1228 10.9582 19.0107 10.9652 18.9064 11.0009C18.7888 11.0395 18.6857 11.1134 18.6113 11.2126C18.5335 11.3164 18.4911 11.4424 18.4903 11.572C18.4903 11.5813 18.4905 11.5905 18.4909 11.5997L18.5712 13.225H12.0553C11.8909 13.225 11.7332 13.2903 11.6169 13.4066C11.5006 13.5229 11.4353 13.6806 11.4353 13.845V15.88C11.4353 16.1562 11.6592 16.38 11.9353 16.38C12.2114 16.38 12.4353 16.1562 12.4353 15.88V14.225H18.9588C19.0396 14.2265 19.12 14.2122 19.1954 14.1828C19.2754 14.1517 19.3481 14.1042 19.4088 14.0435C19.4695 13.9828 19.517 13.9101 19.5481 13.8301C19.5793 13.7501 19.5935 13.6645 19.5898 13.5787L19.54 12.57Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1305 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M18.8294 6.01925C18.931 6.03377 19.5449 6.06887 19.698 6.22202C19.7005 6.2245 19.7031 6.22709 19.7059 6.2298C19.7919 6.3155 19.9956 6.51822 19.9956 6.87779V8.47707C21.0244 8.32105 22.0124 8.26668 23.0467 8.26668L23.0517 8.26668C23.09 8.26664 23.1817 8.26654 23.28 8.28293C23.3714 8.29815 23.5539 8.34006 23.7025 8.48868C23.705 8.49116 23.7076 8.49376 23.7103 8.49647C23.7964 8.58217 24 8.78489 24 9.14446V21.0822C24 21.3092 23.9222 21.5372 23.7497 21.7097C23.5781 21.8813 23.3516 21.9592 23.1258 21.96C20.0434 21.9974 18.0662 22.4984 16.8757 22.9728C16.2801 23.2102 15.8797 23.4415 15.6348 23.6065C15.5122 23.6891 15.4282 23.7553 15.3779 23.7977C15.3528 23.819 15.336 23.8342 15.327 23.8427L15.3196 23.8497L15.3208 23.8485L14.6051 23.8499M18.9956 9.05889C18.9955 9.06517 18.9955 9.07147 18.9956 9.07779V18.3538C17.785 18.7015 16.6988 19.323 15.8105 20.2825C15.685 20.4085 15.5691 20.5409 15.4623 20.6788V10.9213C15.6043 10.0365 15.9438 9.24782 16.6003 8.59135C16.612 8.5796 16.6232 8.56727 16.6337 8.55441C17.2189 7.83915 18.0661 7.30001 18.9956 7.01301V9.05889ZM15.6566 22.4326C15.8427 21.8733 16.128 21.3791 16.5247 20.9825C16.5294 20.9777 16.534 20.9729 16.5386 20.968C17.3692 20.0682 18.41 19.5091 19.6101 19.2267C19.836 19.1736 19.9956 18.972 19.9956 18.74V9.48922C21.0021 9.32692 21.9695 9.26842 23 9.26672V20.9617C19.8778 21.0111 17.8108 21.5237 16.5055 22.0439C16.1748 22.1757 15.8934 22.3078 15.6566 22.4326ZM14.6032 23.848L14.6051 23.8499C14.6991 23.9459 14.8278 24 14.9623 24C15.0967 24 15.2256 23.9456 15.3196 23.8497M14.6032 23.848L14.6051 23.8499L14.5973 23.8425C14.5883 23.834 14.5715 23.8186 14.5463 23.7974C14.496 23.7549 14.4122 23.6886 14.2901 23.606C14.0461 23.4409 13.6479 23.2096 13.0571 22.9723C11.8761 22.4982 9.91814 21.9974 6.87424 21.96C6.64847 21.9592 6.42197 21.8813 6.25038 21.7097C6.07788 21.5372 6.00005 21.3092 6.00005 21.0822V9.14446C6.00005 9.14166 6.00004 9.13865 6.00003 9.13544C5.99971 9.04354 5.99884 8.78745 6.22205 8.56424C6.37067 8.41562 6.55317 8.37371 6.64451 8.35848C6.74284 8.3421 6.83452 8.34219 6.87288 8.34223L6.87782 8.34224H6.88392C10.0341 8.38065 12.1176 8.89976 13.4297 9.42657C13.9487 9.63497 14.3459 9.84412 14.6395 10.0242C14.8629 9.25624 15.2505 8.53319 15.8756 7.90191C16.6269 6.99278 17.6937 6.34371 18.8294 6.01925C18.874 6.00649 18.9203 6.00001 18.9667 6.00001C18.9703 6.00001 18.8255 6.01925 18.8294 6.01925C18.8968 6.0192 18.7271 6.00464 18.8294 6.01925M14.4623 11.112C14.4167 11.077 14.3596 11.0352 14.2901 10.9882C14.0461 10.8231 13.6479 10.5918 13.0571 10.3546C11.8925 9.88696 9.97221 9.39347 7.00005 9.34405V20.9617C10.0854 21.0113 12.1338 21.524 13.4297 22.0443C13.8508 22.2134 14.1918 22.3831 14.4623 22.5372V11.112Z\" fill=\"#407EC9\"/>\r\n</svg>\r\n"

/***/ }),
/* 1306 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"19\" height=\"19\" viewBox=\"0 0 19 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M13.9956 3.56889C15.2044 3.34222 16.3378 3.26667 17.5467 3.26667C17.6222 3.26667 17.7733 3.26667 17.8489 3.34222C17.9244 3.41778 18 3.49333 18 3.64444V15.5822C18 15.8089 17.8489 15.96 17.6222 15.96C11.3511 16.0356 9.46222 18 9.46222 18M9.46222 18V5.38222M9.46222 18C9.46222 18 7.57333 16.0356 1.37778 15.96C1.15111 15.96 1 15.8089 1 15.5822V3.64444C1 3.56889 1 3.49333 1.07556 3.41778C1.15111 3.34222 1.30222 3.34222 1.37778 3.34222C7.57333 3.41778 9.46222 5.38222 9.46222 5.38222M9.46222 5.38222C9.61333 4.4 9.99111 3.49333 10.7467 2.73778C11.4267 1.90667 12.4089 1.30222 13.4667 1C13.6178 1 13.7689 1 13.8444 1.07556C13.92 1.15111 13.9956 1.22667 13.9956 1.37778V13.24C12.7111 13.5422 11.5778 14.1467 10.6711 15.1289C9.99111 15.8089 9.61333 16.7156 9.46222 17.6978\" stroke=\"#407EC9\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n</svg>\r\n"

/***/ }),
/* 1307 */
/***/ (function(module, exports) {

module.exports = "<svg width=\"110\" height=\"62\" viewBox=\"0 0 110 62\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n<path d=\"M30.49 27.4902H28.8892V26.1411H34.6163C38.8196 26.1411 41.0938 28.7633 41.0938 33.1379C41.0938 37.0306 38.5683 39.7306 34.9436 39.7306H28.8892V38.3806H30.49V27.4902V27.4902ZM32.1865 38.3815H34.0377C38.7033 38.3815 39.2623 35.4517 39.2623 33.0431C39.2623 29.2247 37.7401 27.4902 34.3659 27.4902H32.1865V38.3815V38.3815Z\" fill=\"#1A263E\"/>\r\n<path d=\"M51.7402 39.7305H48.8086V37.9004C47.9805 39.1914 46.8617 39.9236 45.3369 39.9236C43.4097 39.9236 42.0029 38.5932 42.0029 36.8016C42.0029 34.8356 43.7388 33.8521 47.8267 33.4668C47.9599 33.4489 48.3847 33.4096 48.7898 33.3711V32.3099C48.7898 31.1342 47.883 30.402 46.4566 30.402C44.9524 30.402 44.2789 30.9035 43.9695 32.2339H42.4081C42.6388 31.1932 42.9482 30.6514 43.5644 30.1123C44.2584 29.5348 45.2233 29.2263 46.3412 29.2263C48.4625 29.2263 50.2744 30.2107 50.2744 32.8123V38.5172H51.7402V39.7305ZM48.7898 34.4306L47.8446 34.545C44.6823 34.9312 43.6225 35.5106 43.6225 36.8203C43.6225 37.9004 44.5669 38.7872 45.7626 38.7872C47.5941 38.7872 48.7898 37.051 48.7898 36.1069V34.4306V34.4306Z\" fill=\"#1A263E\"/>\r\n<path d=\"M52.7472 29.3409H55.7735V38.5174H57.2581V39.7298H52.7275V38.5174H54.289V30.5738H52.7472V29.3409ZM53.9214 26.1018H55.6752V27.8568H53.9214V26.1018Z\" fill=\"#1A263E\"/>\r\n<path d=\"M61.3345 31.7314C61.8344 30.6514 62.1027 30.3242 62.5678 29.8808C63.1079 29.4177 63.7813 29.1682 64.4557 29.1682C64.7052 29.1682 65.0531 29.2067 65.5735 29.2835V30.8061C65.0531 30.7095 64.7454 30.6702 64.4762 30.6702C61.6592 30.6702 61.3336 33.5821 61.3336 33.7359V38.5164H63.1061V39.7305H58.3618V38.5155H59.8464V30.5745H58.3037V29.3417H61.3327V31.7314H61.3345Z\" fill=\"#1A263E\"/>\r\n<path d=\"M66.2432 29.3408H70.1746V30.5746H68.8823L71.5446 37.8799L73.936 30.5746H72.701V29.3408H76.5769V30.5746H75.4376L71.9882 40.8865C71.372 42.7363 71.0626 43.0465 69.7507 43.0465C69.3089 43.0465 69.0942 43.0081 68.4217 42.9491L67.8815 42.891L67.9584 41.6393C68.8456 41.735 69.0379 41.7555 69.2874 41.7555C70.3114 41.7555 70.3498 41.6205 70.8891 39.9433L67.3995 30.5755H66.2432V29.3408V29.3408Z\" fill=\"#1A263E\"/>\r\n<path d=\"M34.2088 43.8879H36.1763L40.3787 56.1283H41.671V57.4774H39.1454L37.9113 53.6214H32.5508L31.356 57.4774H28.8877V56.1283H30.1227L34.2088 43.8879ZM35.1917 45.3148L32.9935 52.2938H37.4677L35.1917 45.3148Z\" fill=\"#1A263E\"/>\r\n<path d=\"M41.0342 47.0894H43.887V54.2793C43.887 55.6078 44.5998 56.4759 45.6998 56.4759C46.4126 56.4759 47.1459 56.1273 47.7817 55.5122C48.6501 54.6244 48.8808 53.8144 48.8808 51.7151V48.3222H47.4535V47.0894H50.3654V56.2641H51.7721V57.4773H48.8415V55.4532C48.2253 56.3222 47.2228 57.7285 45.14 57.7285C43.5016 57.7285 42.4016 56.4554 42.4016 54.5475V48.3213H41.0342V47.0894Z\" fill=\"#1A263E\"/>\r\n<path d=\"M59.1255 47.0894H60.3006V50.1533H59.1443C58.8179 49.4783 58.6426 49.2092 58.3144 48.8999C57.717 48.3402 57.0239 48.072 56.1359 48.072C55.0162 48.072 54.1111 48.8239 54.1111 49.7689C54.1111 50.6933 54.6906 51.0393 56.5213 51.2521C59.4314 51.5981 60.7433 52.4081 60.7433 54.4125C60.7433 56.2239 59.2203 57.7089 57.3306 57.7089C55.4213 57.7089 54.5359 56.552 53.9001 55.7429V57.4773H52.6838V54.105H53.8598C54.1863 54.8381 54.3633 55.1278 54.747 55.4925C55.3632 56.0898 56.0777 56.3991 56.9059 56.3991C58.2545 56.3991 59.2409 55.5891 59.2409 54.4715C59.2409 53.4505 58.6229 53.0643 56.6554 52.8328L56.0777 52.7568C53.8598 52.5055 52.665 51.523 52.665 49.9808C52.665 48.1882 54.0154 46.9365 55.9615 46.9365C57.7572 46.9365 58.6041 48.055 59.1246 48.7479V47.0894H59.1255Z\" fill=\"#1A263E\"/>\r\n<path d=\"M63.1514 44.4868H64.6342V47.0894H67.1427V48.3232H64.6342V55.1072C64.6342 56.4179 64.9454 56.5332 66.5453 56.5153L67.0837 56.4939V57.6516C66.4863 57.6901 65.7753 57.7098 65.2933 57.7098C63.6531 57.7098 63.1514 57.2279 63.1514 55.607V48.3232H61.3789V47.0894H63.1514V44.4868V44.4868Z\" fill=\"#1A263E\"/>\r\n<path d=\"M71.3126 49.4785C71.8143 48.3985 72.0826 48.0713 72.5458 47.6296C73.086 47.1656 73.7576 46.9153 74.4337 46.9153C74.6832 46.9153 75.0329 46.9546 75.5534 47.0306V48.5532C75.0329 48.4575 74.7235 48.4191 74.4543 48.4191C71.6372 48.4191 71.3117 51.3301 71.3117 51.4848V56.2643H73.0842V57.4784H68.3417V56.2643H69.8262V48.3234H68.2817V47.0896H71.3108V49.4785H71.3126Z\" fill=\"#1A263E\"/>\r\n<path d=\"M85.0732 57.4783H82.1444V55.6464C81.3145 56.9374 80.1948 57.6705 78.6736 57.6705C76.7455 57.6705 75.3369 56.3419 75.3369 54.5485C75.3369 52.5816 77.0719 51.599 81.1607 51.2128C81.2948 51.1949 81.7196 51.1556 82.1247 51.1189V50.0568C82.1247 48.882 81.2179 48.1489 79.7915 48.1489C78.2872 48.1489 77.6129 48.6522 77.3026 49.9799H75.7403C75.9746 48.9392 76.2822 48.3992 76.8966 47.8601C77.5933 47.2826 78.5573 46.9741 79.6752 46.9741C81.7956 46.9741 83.6066 47.9567 83.6066 50.5584V56.265H85.0724V57.4783H85.0732ZM82.1247 52.1766L81.1776 52.2928C78.0163 52.679 76.9556 53.2557 76.9556 54.5664C76.9556 55.6464 77.8991 56.5324 79.0975 56.5324C80.9281 56.5324 82.1247 54.7988 82.1247 53.8538V52.1766Z\" fill=\"#1A263E\"/>\r\n<path d=\"M85.9254 43.2913H88.8758V56.2639H90.2637V57.478H85.9058V56.2639H87.3912V44.5045H85.9254V43.2913Z\" fill=\"#1A263E\"/>\r\n<path d=\"M91.0821 47.0892H94.1093V56.2639H95.5939V57.4772H91.0615V56.2639H92.6248V48.3221H91.0821V47.0892ZM92.4316 43.8501H94.1871V45.6042H92.4316V43.8501Z\" fill=\"#1A263E\"/>\r\n<path d=\"M105.925 57.4783H102.994V55.6464C102.166 56.9374 101.046 57.6705 99.5233 57.6705C97.5951 57.6705 96.1875 56.3419 96.1875 54.5485C96.1875 52.5816 97.9234 51.599 102.011 51.2128C102.145 51.1949 102.57 51.1556 102.975 51.1189V50.0568C102.975 48.882 102.068 48.1489 100.642 48.1489C99.1378 48.1489 98.4653 48.6522 98.155 49.9799H96.5935C96.8243 48.9392 97.1346 48.3992 97.7499 47.8601C98.4447 47.2826 99.4088 46.9741 100.527 46.9741C102.649 46.9741 104.458 47.9567 104.458 50.5584V56.265H105.926V57.4783H105.925ZM102.974 52.1766L102.027 52.2928C98.866 52.679 97.8053 53.2557 97.8053 54.5664C97.8053 55.6464 98.7506 56.5324 99.9472 56.5324C101.778 56.5324 102.974 54.7988 102.974 53.8538V52.1766Z\" fill=\"#1A263E\"/>\r\n<path d=\"M14.3893 39.3513C7.98157 41.4076 5.44083 43.9995 4.52148 45.7715V57.555L13.7078 48.6038L22.8763 57.555V30.958C22.2082 33.4837 20.2729 37.4622 14.3893 39.3513Z\" fill=\"#1A263E\"/>\r\n<path d=\"M14.3893 35.287C7.98157 37.3433 5.44083 39.9352 4.52148 41.7081V44.9338C5.34693 42.6093 7.61937 39.1564 13.8715 36.9777C19.7829 34.9187 22.0741 31.4364 22.8763 29.718V26.8928C22.2082 29.4167 20.2729 33.397 14.3893 35.287Z\" fill=\"#1A263E\"/>\r\n<path d=\"M14.3893 31.2273C7.98157 33.2845 5.44083 35.8754 4.52148 37.6474V40.8705C5.34693 38.5442 7.61937 35.0914 13.8715 32.9117C19.7829 30.8545 22.0741 27.3722 22.8763 25.6547V22.834C22.2082 25.3579 20.2729 29.3382 14.3893 31.2273Z\" fill=\"#1A263E\"/>\r\n<path d=\"M4.52148 4.62207V32.7184C5.34693 30.3921 7.61937 26.9392 13.8724 24.7614C19.7829 22.7024 22.0732 19.2192 22.8772 17.5026V4.62207H4.52148Z\" fill=\"#1A263E\"/>\r\n<path d=\"M14.3893 27.1344C7.98157 29.1898 5.44083 31.7816 4.52148 33.5545V36.8124C5.34693 34.487 7.61937 31.0324 13.8715 28.8545C19.7829 26.7955 22.0741 23.3123 22.8763 21.5957V18.7419C22.2082 21.2658 20.2729 25.2443 14.3893 27.1344Z\" fill=\"#1A263E\"/>\r\n</svg>\r\n"

/***/ }),
/* 1308 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>dollarsign</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"dollarsign\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M14.3353995,14.3852995 C9.49509931,19.2255996 7.04999924,25.1137998 7.04999924,32 C7.04999924,38.8862002 9.49509931,44.7744004 14.3353995,49.6646005 C19.2255996,54.5049007 25.1137998,56.9500008 32,56.9500008 C38.8862002,56.9500008 44.7744004,54.5049007 49.6147005,49.6646005 C54.5049007,44.7744004 56.9500008,38.8862002 56.9500008,32 C56.9500008,25.1137998 54.5049007,19.2255996 49.6147005,14.3852995 C44.7744004,9.49509931 38.8862002,7.04999924 32,7.04999924 C25.1137998,7.04999924 19.2255996,9.49509931 14.3353995,14.3852995 L14.3353995,14.3852995 Z M35.0938001,50.7125006 L28.8562999,50.7125006 L28.8562999,47.4191005 C25.3133998,46.9700005 22.5688997,45.9720004 20.5728997,44.4750004 L23.6666997,39.2854002 C26.4610998,40.6826003 29.2554999,41.3812003 32,41.3812003 C35.3932001,41.3812003 38.2375002,40.2335003 38.2375002,38.2375002 C38.2375002,35.0439001 33.5469,35.4431001 28.8562999,34.7445001 C25.6626998,34.1457001 22.7684997,33.5968 20.9221997,30.9521 C19.9740996,29.6047999 19.5249996,27.9081999 19.5249996,25.7624998 C19.5249996,23.0678997 20.4231996,20.9720997 22.2195997,19.5249996 C24.0159998,18.0279996 26.2115998,17.0798995 28.8562999,16.6307995 L28.8562999,13.2874994 L35.0938001,13.2874994 L35.0938001,16.5808995 C38.6367002,17.0299995 41.4311003,18.0279996 43.4271003,19.5249996 L40.3333003,24.7145998 C37.5389002,23.3672997 34.7445001,22.6686997 32,22.6686997 C28.6067999,22.6686997 25.7624998,23.7664997 25.7624998,25.7624998 C25.7624998,28.9061999 30.503,28.6067999 35.0938001,29.3053999 C38.3373002,29.8542999 41.2315003,30.4032 43.0778003,33.0479 C44.0259004,34.3952001 44.4750004,36.0918001 44.4750004,38.2375002 C44.4750004,40.9321003 43.5768004,43.0279003 41.7804003,44.5249004 C39.9840002,45.9720004 37.7385002,46.9201005 35.0938001,47.3692005 L35.0938001,50.7125006 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1309 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" >\r\n        <g id=\"downarrow\" fill=\"#000000\">\r\n            <polygon transform=\"translate(32.000000, 32.055556) rotate(-180.000000) translate(-32.000000, -32.055556) \" points=\"32 12.5 64 51.6111111 3.55271368e-15 51.6111111 \"></polygon>\r\n        </g>\r\n    </g>\r\n</svg>\r\n"

/***/ }),
/* 1310 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"download\" fill=\"#000000\">\r\n            <path d=\"M51.7482683,55.6687099 C52.3163174,55.6687099 52.6950167,55.2426731 52.6950167,54.6746241 L52.6950167,48.7574466 C52.6950167,48.1893976 52.3163174,47.7633608 51.7482683,47.7633608 L12.2688603,47.7633608 C11.7008112,47.7633608 11.2747744,48.1893976 11.2747744,48.7574466 L11.2747744,54.6746241 C11.2747744,55.2426731 11.7008112,55.6687099 12.2688603,55.6687099 L51.7482683,55.6687099 Z M52.4583296,23.8579638 C52.7423541,23.5266019 52.7896916,23.1479025 52.6476793,22.7218657 C52.505667,22.3431664 52.1743051,22.1538167 51.7482683,22.1538167 L40.8606618,22.1538167 L40.8606618,9.32537594 C40.8606618,8.7573269 40.4819624,8.33129013 39.9139134,8.33129013 L24.1032152,8.33129013 C23.5351662,8.33129013 23.1091294,8.7573269 23.1091294,9.32537594 L23.1091294,22.1538167 L12.2688603,22.1538167 C11.8428235,22.1538167 11.5114615,22.3431664 11.3694493,22.7218657 C11.227437,23.1479025 11.2747744,23.5266019 11.558799,23.8579638 L31.298503,43.5503304 C31.8192146,43.9290298 32.197914,43.9290298 32.7186256,43.5503304 L52.4583296,23.8579638 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1311 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>edit</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"edit\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M60.57008,12.99856 C61.08848,12.48016 61.08848,11.96176 60.57008,11.4952 L54.5048,5.42992 C54.03824,4.91152 53.51984,4.91152 53.00144,5.42992 L50.0984,8.3848 L57.6152,15.9016 L60.57008,12.99856 Z M44.6552,35.3416 L44.6552,50.47888 L15.52112,50.47888 L15.52112,18.07888 L33.87248,18.07888 L40.35248,11.59888 L15.52112,11.59888 C13.75856,11.59888 12.2552,12.22096 10.9592,13.51696 C9.6632,14.81296 9.04112,16.31632 9.04112,18.07888 L9.04112,50.47888 C9.04112,52.24144 9.6632,53.7448 10.9592,55.0408 C12.2552,56.3368 13.75856,56.95888 15.52112,56.95888 L44.6552,56.95888 C46.41776,56.95888 47.92112,56.3368 49.21712,55.0408 C50.51312,53.7448 51.1352,52.24144 51.1352,50.47888 L51.1352,28.8616 L44.6552,35.3416 Z M46.83248,11.59888 L24.28208,34.14928 C24.1784,34.3048 24.12656,34.40848 24.12656,34.46032 L19.772,44.82832 L19.72016,44.88016 C19.61648,45.29488 19.72016,45.65776 20.0312,45.9688 C20.23856,46.228 20.49776,46.33168 20.75696,46.33168 C20.8088,46.33168 20.96432,46.27984 21.11984,46.27984 L21.17168,46.228 L31.53968,41.87344 C31.59152,41.87344 31.6952,41.8216 31.85072,41.71792 L54.40112,19.16752 L46.83248,11.59888 Z\" id=\"compose\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1312 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>error</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"error\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M50.29952,13.70048 C45.27104,8.62016 39.15392,6.08 32,6.08 C24.84608,6.08 18.72896,8.62016 13.64864,13.70048 C8.62016,18.72896 6.08,24.84608 6.08,32 C6.08,39.15392 8.62016,45.27104 13.64864,50.35136 C18.72896,55.37984 24.84608,57.92 32,57.92 C39.15392,57.92 45.27104,55.37984 50.29952,50.35136 C55.37984,45.27104 57.92,39.15392 57.92,32 C57.92,24.84608 55.37984,18.72896 50.29952,13.70048 L50.29952,13.70048 Z M14.73728,32 C14.73728,27.23072 16.39616,23.1872 19.76576,19.8176 C23.13536,16.448 27.23072,14.73728 32,14.73728 C35.47328,14.73728 38.53184,15.61856 41.22752,17.43296 L17.43296,41.22752 C15.61856,38.53184 14.73728,35.47328 14.73728,32 L14.73728,32 Z M46.56704,22.77248 C48.38144,25.46816 49.26272,28.52672 49.26272,32 C49.26272,36.76928 47.552,40.86464 44.1824,44.23424 C40.8128,47.60384 36.76928,49.26272 32,49.26272 C28.52672,49.26272 25.46816,48.38144 22.77248,46.56704 L46.56704,22.77248 Z\" id=\"ban\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1313 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"folder\" fill=\"#292929\">\r\n            <path d=\"M6,48.276 C6,49.992 7.508,51.5 9.224,51.5 L54.724,51.5 C56.544,51.5 58,49.992 58,48.276 L58,22.276 C58,20.456 56.544,19 54.724,19 L32,19 L30.388,14.268 C30.024,13.28 28.932,12.5 28.048,12.5 L9.224,12.5 C7.508,12.5 6,13.956 6,15.776 L6,48.276 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1314 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"forward\" fill=\"#000000\">\r\n            <path d=\"M29.696,62.4197275 C30.08,62.8699138 30.592,62.9342261 31.168,62.7412891 C31.744,62.4840398 32,62.0338536 32,61.4550427 L32,44.0907162 L62.656,44.0907162 C63.424,44.0907162 64,43.5119053 64,42.7401575 L64,21.2598425 C64,20.4880947 63.424,19.9735961 62.656,19.9735961 L32,19.9735961 L32,2.54495729 C32,1.9661464 31.744,1.51596016 31.168,1.25871088 C30.592,1.06577392 30.08,1.13008624 29.696,1.58027248 L0.384,31.0353152 C-0.128,31.7427507 -0.128,32.2572493 0.384,32.9646848 L29.696,62.4197275 Z\" id=\"back\" transform=\"translate(32.000000, 32.000000) rotate(-180.000000) translate(-32.000000, -32.000000) \"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1315 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"globe\" fill=\"#292929\">\r\n            <path d=\"M13.592,13.644 C8.548,18.688 6,24.824 6,32 C6,39.176 8.548,45.312 13.592,50.408 C18.688,55.452 24.824,58 32,58 C39.176,58 45.312,55.452 50.356,50.408 C55.452,45.312 58,39.176 58,32 C58,24.824 55.452,18.688 50.356,13.644 C45.312,8.548 39.176,6 32,6 C24.824,6 18.688,8.548 13.592,13.644 L13.592,13.644 Z M35.224,52.592 C34.6,52.592 34.184,52.124 34.184,51.5 L34.184,43.752 C31.064,42.972 28.724,40.164 28.724,36.888 C28.724,36.368 28.776,35.848 28.932,35.276 L28.724,35.276 C25.5,35.276 22.692,34.08 20.352,31.74 C18.012,29.4 16.816,26.592 16.816,23.316 C16.816,19.728 18.168,16.868 20.924,14.788 C23.68,12.708 27.372,11.564 32,11.408 C32.988,11.408 34.132,11.512 35.432,11.72 C36.004,11.772 36.316,12.136 36.316,12.812 C36.264,15.932 35.588,18.74 34.288,21.288 C35.64,22.64 36.316,24.044 36.316,25.5 C36.316,26.696 35.38,27.684 34.184,27.684 C33.716,27.684 33.144,27.32 32.468,26.592 C31.844,25.864 31.168,25.5 30.388,25.5 C28.88,25.5 27.684,26.696 27.684,28.204 C27.684,30.336 29.92,32 33.092,32 L37.408,32 C39.488,32 41.256,32.728 42.764,34.236 C44.272,35.744 45,37.512 45,39.592 C45,43.024 43.856,46.04 41.568,48.692 C39.28,51.292 37.148,52.592 35.224,52.592 L35.224,52.592 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1316 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"help\" fill=\"#292929\">\r\n            <path d=\"M32.5,8 C39.2299719,8 44.9957322,10.4008248 49.7974537,15.2025463 C54.5991752,20.0042678 57,25.7700281 57,32.5 C57,39.2677808 54.6086273,45.0429931 49.8258102,49.8258102 C45.0429931,54.6086273 39.2677808,57 32.5,57 C25.7322192,57 19.9570069,54.6086273 15.1741898,49.8258102 C10.3913727,45.0429931 8,39.2677808 8,32.5 C8,25.7322192 10.3913727,19.9570069 15.1741898,15.1741898 C19.9570069,10.3913727 25.7322192,8 32.5,8 L32.5,8 Z M32.5,50.875 C33.6342649,50.875 34.5983757,50.4780132 35.3923611,49.6840278 C36.1863466,48.8900423 36.5833333,47.9259316 36.5833333,46.7916667 C36.5833333,45.6574017 36.1863466,44.693291 35.3923611,43.8993056 C34.5983757,43.1053201 33.6342649,42.7083333 32.5,42.7083333 C31.3657351,42.7083333 30.4016243,43.1053201 29.6076389,43.8993056 C28.8136534,44.693291 28.4166667,45.6574017 28.4166667,46.7916667 C28.4166667,47.9259316 28.8136534,48.8900423 29.6076389,49.6840278 C30.4016243,50.4780132 31.3657351,50.875 32.5,50.875 L32.5,50.875 Z M35.5625,36.5833333 C35.5625,36.0540097 35.846062,35.5435981 36.4131944,35.0520833 C36.9803269,34.5605685 37.6608757,34.0785132 38.4548611,33.6059028 C39.2488466,33.1332924 40.0428201,32.5850726 40.8368056,31.9612269 C41.630791,31.3373811 42.3113398,30.458339 42.8784722,29.3240741 C43.4456047,28.1898091 43.7291667,26.8665199 43.7291667,25.3541667 C43.7291667,22.367269 42.6516311,19.9191839 40.4965278,18.009838 C38.3414244,16.100492 35.6759418,15.1458333 32.5,15.1458333 C30.6851761,15.1458333 28.9270918,15.5711763 27.2256944,16.421875 C25.524297,17.2725737 24.2766243,18.1327117 23.4826389,19.0023148 L22.2916667,20.25 L26.375,24.3333333 C26.601853,24.1064803 26.9137712,23.8229184 27.3107639,23.4826389 C27.7077566,23.1423594 28.4450178,22.6886602 29.5225694,22.1215278 C30.6001211,21.5543953 31.5925881,21.2708333 32.5,21.2708333 C33.9745444,21.2708333 35.1938609,21.6867242 36.1579861,22.5185185 C37.1221113,23.3503128 37.6041667,24.2955194 37.6041667,25.3541667 C37.6041667,26.2615786 37.1788237,27.0839084 36.328125,27.8211806 C35.4774263,28.5584528 34.5416718,29.1822891 33.5208333,29.6927083 C32.4999949,30.2031276 31.5642404,30.9687449 30.7135417,31.9895833 C29.862843,33.0104218 29.4375,34.2013821 29.4375,35.5625 L29.4375,37.6041667 L35.5625,37.6041667 L35.5625,36.5833333 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1317 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"inbox\" fill=\"#292929\">\r\n            <path d=\"M51.968,10.544 C51.728,9.056 50.48,8 48.992,8 L15.008,8 C13.52,8 12.224,9.056 12.032,10.544 L8.048,37.568 C8,37.664 8,37.808 8,38 L8,53.024 C8,54.608 9.392,56 10.976,56 L52.976,56 C54.656,56 56,54.608 56,53.024 L56,38 C56,37.808 56,37.664 55.952,37.568 L51.968,10.544 Z M46.4,14 L49.952,38 L40.16,38 C39.728,38 39.392,38.192 39.2,38.624 L37.28,43.376 C37.088,43.808 36.752,44 36.32,44 L27.68,44 C27.248,44 26.912,43.808 26.72,43.376 L24.8,38.624 C24.608,38.192 24.272,38 23.84,38 L14.048,38 L17.6,14 L46.4,14 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1318 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"leftarrow\" fill=\"#292929\">\r\n            <path d=\"M51.5555556,0.0555555556 L51.5555556,64.0555556 L12.4444444,32.0555556 L51.5555556,0.0555555556 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1319 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>loading</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"loading\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M36.899,10.399 C36.899,8.014 34.991,6 32.5,6 C30.009,6 28.101,8.014 28.101,10.399 L28.101,18.137 C28.101,20.628 30.009,22.589 32.5,22.589 C34.991,22.589 36.899,20.628 36.899,18.137 L36.899,10.399 Z M36.899,46.863 C36.899,44.372 34.991,42.464 32.5,42.464 C30.009,42.464 28.101,44.372 28.101,46.863 L28.101,54.601 C28.101,56.986 30.009,59 32.5,59 C34.991,59 36.899,56.986 36.899,54.601 L36.899,46.863 Z M18.137,36.899 C20.628,36.899 22.536,34.991 22.536,32.5 C22.536,30.009 20.628,28.101 18.137,28.101 L10.399,28.101 C8.014,28.101 6,30.009 6,32.5 C6,34.991 8.014,36.899 10.399,36.899 L18.137,36.899 Z M54.601,36.899 C56.986,36.899 59,34.991 59,32.5 C59,30.009 56.986,28.101 54.601,28.101 L46.863,28.101 C44.372,28.101 42.411,30.009 42.411,32.5 C42.411,34.991 44.372,36.899 46.863,36.899 L54.601,36.899 Z M25.451,25.451 C27.2,23.755 27.2,20.946 25.451,19.25 L19.992,13.791 C18.296,12.042 15.487,12.042 13.738,13.791 C12.042,15.487 12.042,18.296 13.738,19.992 L19.25,25.451 C20.946,27.2 23.755,27.2 25.451,25.451 L25.451,25.451 Z M51.209,51.262 C52.958,49.513 52.958,46.704 51.209,45.008 L45.75,39.549 C44.054,37.8 41.245,37.8 39.549,39.549 C37.8,41.245 37.8,44.054 39.549,45.75 L45.008,51.262 C46.704,52.958 49.513,52.958 51.209,51.262 L51.209,51.262 Z M51.209,19.992 C52.958,18.296 52.958,15.487 51.209,13.791 C49.513,12.042 46.704,12.042 45.008,13.791 L39.549,19.25 C37.8,20.946 37.8,23.755 39.549,25.451 C41.245,27.2 44.054,27.2 45.75,25.451 L51.209,19.992 Z M25.451,45.75 C27.2,44.054 27.2,41.245 25.451,39.549 C23.755,37.8 20.946,37.8 19.25,39.549 L13.738,45.008 C12.042,46.704 12.042,49.513 13.738,51.262 C15.487,52.958 18.296,52.958 19.992,51.262 L25.451,45.75 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1320 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>lock</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"lock\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M45.2571433,28.7122285 L45.2571433,18.7428567 C45.2571433,15.0838852 43.931429,12.0082279 41.3330289,9.40982783 C38.7346288,6.81142774 35.6589715,5.48571341 32,5.48571341 C28.3410285,5.48571341 25.2123426,6.81142774 22.6139425,9.40982783 C20.0155425,12.0082279 18.7428567,15.0838852 18.7428567,18.7428567 L18.7428567,28.7122285 L15.4020566,28.7122285 C13.6521137,28.7122285 12.1142851,30.2500571 12.1142851,32 L12.1142851,55.226515 C12.1142851,56.976458 13.6521137,58.5142866 15.4020566,58.5142866 L48.5449148,58.5142866 C50.4009149,58.5142866 51.8857149,56.976458 51.8857149,55.226515 L51.8857149,32 C51.8857149,30.2500571 50.4009149,28.7122285 48.5449148,28.7122285 L45.2571433,28.7122285 Z M25.3714284,18.7428567 C25.3714284,16.8868566 26.0077712,15.349028 27.280457,14.0763423 C28.6061713,12.7506279 30.1439999,12.1142851 32,12.1142851 C33.8560001,12.1142851 35.3938287,12.7506279 36.6665144,14.0763423 C37.9922288,15.349028 38.6285716,16.8868566 38.6285716,18.7428567 L38.6285716,28.7122285 L25.3714284,28.7122285 L25.3714284,18.7428567 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1321 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>mail</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"mail\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M32,35.0714286 L7.5,16.6428571 C7.5,15.8086378 7.80246611,15.0881865 8.40740741,14.4814815 C9.0123487,13.8747765 9.73070572,13.5714286 10.5625,13.5714286 L53.4375,13.5714286 C54.2692943,13.5714286 54.9876513,13.8747765 55.5925926,14.4814815 C56.1975339,15.0881865 56.5,15.8086378 56.5,16.6428571 L32,35.0714286 Z M32,40.5886243 L56.5,22.1600529 L56.5,47.3571429 C56.5,48.1913622 56.1975339,48.9118135 55.5925926,49.5185185 C54.9876513,50.1252235 54.2692943,50.4285714 53.4375,50.4285714 L10.5625,50.4285714 C9.73070572,50.4285714 9.0123487,50.1252235 8.40740741,49.5185185 C7.80246611,48.9118135 7.5,48.1913622 7.5,47.3571429 L7.5,22.1600529 L32,40.5886243 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1322 */
/***/ (function(module, exports) {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"64\" height=\"64\" viewBox=\"0 0 64 64\">\r\n  <path fill=\"#292929\" fill-rule=\"evenodd\" d=\"M28.9480182,8.29257825 C28.4116248,7.90247392 28.0215204,7.90247392 27.485127,8.29257825 L20.3657228,15.4119824 C19.8780924,15.8996128 19.8780924,16.3872432 20.3657228,16.8748737 L35.9211332,32.381521 L20.3657228,47.8881684 C19.8780924,48.3757988 19.8780924,48.8634292 20.3657228,49.3510597 L27.485127,56.4704638 C27.9727574,56.9580942 28.4603878,56.9580942 28.9480182,56.4704638 L52.3542784,33.1129667 C52.8419088,32.6253362 52.8419088,32.1377058 52.3542784,31.6500754 L28.9480182,8.29257825 Z\"/>\r\n</svg>\r\n"

/***/ }),
/* 1323 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>pin</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"pin\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M29.3637625,42.198738 L29.3637625,59.2785363 C29.3637625,59.6824504 29.3060604,60.1440666 30.4601009,61.0672989 C31.0948231,61.4712131 31.9026514,61.7020212 32.9989898,61.7020212 C35.1339646,61.7020212 36.403409,60.6633848 36.4611111,59.9132585 L36.5765151,59.2785363 L36.5765151,42.198738 C34.4992423,42.6026522 31.4987372,42.6026522 29.3637625,42.198738 L29.3637625,42.198738 Z M16.1499996,20.8489902 C16.1499996,25.4651519 17.8233582,29.4465913 21.1123734,32.7356065 C24.4013886,36.0246217 28.3828281,37.6402783 32.9989898,37.6402783 C37.6151515,37.6402783 41.596591,36.0246217 44.8856062,32.7356065 C48.1746214,29.4465913 49.84798,25.4651519 49.84798,20.8489902 C49.84798,16.1751265 48.1746214,12.251389 44.8856062,8.96237382 C41.596591,5.67335861 37.6151515,4 32.9989898,4 C28.3828281,4 24.4013886,5.67335861 21.1123734,8.96237382 C17.8233582,12.251389 16.1499996,16.1751265 16.1499996,20.8489902 Z M33.3452019,20.5027781 C31.2679292,18.3678033 31.2679292,14.84798 33.3452019,12.7707072 C35.4801767,10.6934345 38.942298,10.6934345 41.0195707,12.7707072 C43.1545455,14.84798 43.1545455,18.3678033 41.0195707,20.5027781 C38.942298,22.5800508 35.4801767,22.5800508 33.3452019,20.5027781 L33.3452019,20.5027781 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1324 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>plus</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"plus\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M36.784,55 C37.336,55 37.75,54.586 37.75,54.034 L37.75,37.75 L54.034,37.75 C54.586,37.75 55,37.336 55,36.784 L55,27.216 C55,26.664 54.586,26.25 54.034,26.25 L37.75,26.25 L37.75,9.966 C37.75,9.414 37.336,9 36.784,9 L27.216,9 C26.664,9 26.25,9.414 26.25,9.966 L26.25,26.25 L9.966,26.25 C9.414,26.25 9,26.664 9,27.216 L9,36.784 C9,37.336 9.414,37.75 9.966,37.75 L26.25,37.75 L26.25,54.034 C26.25,54.586 26.664,55 27.216,55 L36.784,55 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1325 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>print</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"print\" sketch:type=\"MSArtboardGroup\" fill=\"#37383A\">\r\n            <path d=\"M57.5,24.5951504 L57.5,44.5005116 C57.5,46.8102108 55.603329,48.7132187 53.4343207,48.7132187 L49.303872,48.7132187 L51.1322037,57 L13.6797082,57 L15.1699133,48.7137303 L10.698788,48.7137303 C8.2599924,48.7137303 6.5,46.8102108 6.5,44.5010231 L6.5,24.5951504 C6.5,22.2859628 8.2599924,20.3839779 10.698788,20.3839779 L15.9134859,20.3839779 L15.9134859,13.9966237 L17.7418176,13.9966237 L17.7418176,7 L46.3229518,7 L46.3229518,13.9966237 L48.1512835,13.9966237 L48.1512835,20.3834663 L53.4338107,20.3834663 C55.603329,20.3834663 57.5,22.2859628 57.5,24.5951504 L57.5,24.5951504 Z M16.5239498,27.7883159 C16.5239498,26.2249847 15.1699133,24.8667894 13.5430296,24.8667894 C11.9844852,24.8667894 10.6304487,26.2249847 10.6304487,27.7883159 C10.6304487,29.4186618 11.9844852,30.7083078 13.5430296,30.7083078 C15.1699133,30.710354 16.5239498,29.4186618 16.5239498,27.7883159 L16.5239498,27.7883159 Z M47.6774982,54.487211 L45.1050839,41.3758952 L18.8944061,41.3758952 L16.9299057,54.487211 L47.6774982,54.487211 L47.6774982,54.487211 Z M19.6384886,25.4110906 L44.4267907,25.4110906 L44.4267907,9.58133824 L19.6384886,9.58133824 L19.6384886,25.4110906 L19.6384886,25.4110906 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1326 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"rightarrow\" fill=\"#292929\">\r\n            <path d=\"M12.4444444,64.0555556 L12.4444444,0.0555555556 L51.5555556,32.0555556 L12.4444444,64.0555556 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1327 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>tag</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"tag\" sketch:type=\"MSArtboardGroup\" fill=\"#ABABAB\">\r\n            <path d=\"M25.9438872,55.595114 C27.0356934,56.7952953 28.8553705,56.7952953 29.9926687,55.595114 L54.4673256,29.7672126 C54.6492933,29.6231908 54.7402772,29.3831545 54.7402772,29.095111 L54.7402772,11.5244569 C54.7402772,9.84420305 53.4665032,8.5 51.8742858,8.5 L35.2242403,8.5 C34.9512888,8.5 34.7238291,8.5960145 34.5873534,8.78804351 L10.1126965,34.615945 C8.97539828,35.8161263 8.97539828,37.7364164 10.1126965,38.8885904 L25.9438872,55.595114 Z M41.729586,15.8451095 C43.4127873,14.0688412 46.1877948,14.0688412 47.8255042,15.7971023 C49.4632136,17.5253633 49.4632136,20.4538057 47.8255042,22.230074 C46.1877948,23.9583351 43.4127873,23.9583351 41.729586,22.230074 C40.9107313,21.3179362 40.5013039,20.2617767 40.5013039,19.0135881 C40.5013039,17.7173923 40.9107313,16.6612328 41.729586,15.8451095 L41.729586,15.8451095 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1328 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>tick</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"tick\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M60.4544,16.7216 C61.0304,16.1456 61.0304,15.5696 60.4544,14.9936 L52.0448,6.584 C51.4688,6.008 50.8928,6.008 50.3168,6.584 L24.8,32.1584 L13.6832,20.984 C13.1072,20.408 12.5312,20.408 11.9552,20.984 L3.5456,29.3936 C2.9696,29.9696 2.9696,30.5456 3.5456,31.1216 L23.936,51.512 C24.5696,51.9728 25.0304,51.9728 25.664,51.512 L60.4544,16.7216 Z\" id=\"check\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1329 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n        <g id=\"uparrow\" fill=\"#292929\">\r\n            <path d=\"M64,51.6111111 L3.55271368e-15,51.6111111 L32,12.5 L64,51.6111111 Z\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1330 */
/***/ (function(module, exports) {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n<svg width=\"64px\" height=\"64px\" viewBox=\"0 0 64 64\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\r\n    <!-- Generator: Sketch 3.2.2 (9983) - http://www.bohemiancoding.com/sketch -->\r\n    <title>user</title>\r\n    <desc>Created with Sketch.</desc>\r\n    <defs></defs>\r\n    <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\r\n        <g id=\"user\" sketch:type=\"MSArtboardGroup\" fill=\"#000000\">\r\n            <path d=\"M58.9997157,55.714 C59.0527154,49.301 51.6857549,46.969 46.1207847,44.955 C42.3048052,43.471 39.1248223,41.192 39.1248223,38.012 L39.8138186,37.27 C40.661814,36.21 42.0928064,33.931 43.4177992,31.122 C44.7427921,28.313 45.7497867,23.755 45.7497867,19.25 C45.7497867,15.593 44.4247938,12.519 41.8278078,9.922 C39.2308217,7.325 36.1568382,6 32.4998578,6 C28.8428774,6 25.7158942,7.325 23.1189082,9.922 C20.5219221,12.519 19.2499289,15.593 19.2499289,19.25 C19.2499289,23.755 20.4159227,28.366 21.5289167,31.122 C22.1119136,32.447 22.8009099,33.719 23.5429059,34.938 C25.0798976,37.323 25.5038954,37.747 25.8748934,38.012 C25.9278931,43.047 18.5609326,44.902 12.9959625,47.234 C9.17998294,48.771 6,51.633 6,55.714 L6,57.887 C6,58.523 6.47699744,59 7.11299403,59 L57.8867216,59 C58.5227182,59 58.9997157,58.523 58.9997157,57.887 L58.9997157,55.714 Z\" sketch:type=\"MSShapeGroup\"></path>\r\n        </g>\r\n    </g>\r\n</svg>"

/***/ }),
/* 1331 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(__webpack_require__(0));
var react_1 = __webpack_require__(0);
var DndContext_1 = __webpack_require__(247);
/**
 * A React component that provides the React-DnD context
 */
exports.DndProvider = react_1.memo(function (_a) {
    var children = _a.children, props = __rest(_a, ["children"]);
    var context = 'manager' in props
        ? { dragDropManager: props.manager }
        : createSingletonDndContext(props.backend, props.context, props.options, props.debugMode);
    return React.createElement(DndContext_1.DndContext.Provider, { value: context }, children);
});
var instanceSymbol = Symbol.for('__REACT_DND_CONTEXT_INSTANCE__');
function createSingletonDndContext(backend, context, options, debugMode) {
    if (context === void 0) { context = getGlobalContext(); }
    var ctx = context;
    if (!ctx[instanceSymbol]) {
        ctx[instanceSymbol] = DndContext_1.createDndContext(backend, context, options, debugMode);
    }
    return ctx[instanceSymbol];
}
function getGlobalContext() {
    return typeof global !== 'undefined' ? global : window;
}

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1332 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(__webpack_require__(0));
/*
 * A utility for rendering a drag preview image
 */
exports.DragPreviewImage = React.memo(function (_a) {
    var connect = _a.connect, src = _a.src;
    if (typeof Image !== 'undefined') {
        var img_1 = new Image();
        img_1.src = src;
        img_1.onload = function () { return connect(img_1); };
    }
    return null;
});
exports.DragPreviewImage.displayName = 'DragPreviewImage';


/***/ }),
/* 1333 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(247));
__export(__webpack_require__(1331));
__export(__webpack_require__(1332));


/***/ }),
/* 1334 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(__webpack_require__(0));
var shallowequal_1 = __importDefault(__webpack_require__(143));
var hoist_non_react_statics_1 = __importDefault(__webpack_require__(242));
var invariant_1 = __importDefault(__webpack_require__(32));
var index_1 = __webpack_require__(84);
var js_utils_1 = __webpack_require__(106);
var utils_1 = __webpack_require__(119);
function DragLayer(collect, options) {
    if (options === void 0) { options = {}; }
    utils_1.checkDecoratorArguments('DragLayer', 'collect[, options]', collect, options);
    invariant_1.default(typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer to be a function that collects props to inject into the component. ', 'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer', collect);
    invariant_1.default(js_utils_1.isPlainObject(options), 'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. ' +
        'Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer', options);
    return function decorateLayer(DecoratedComponent) {
        var Decorated = DecoratedComponent;
        var _a = options.arePropsEqual, arePropsEqual = _a === void 0 ? shallowequal_1.default : _a;
        var displayName = Decorated.displayName || Decorated.name || 'Component';
        var DragLayerContainer = /** @class */ (function (_super) {
            __extends(DragLayerContainer, _super);
            function DragLayerContainer() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.isCurrentlyMounted = false;
                _this.ref = React.createRef();
                _this.handleChange = function () {
                    if (!_this.isCurrentlyMounted) {
                        return;
                    }
                    var nextState = _this.getCurrentState();
                    if (!shallowequal_1.default(nextState, _this.state)) {
                        _this.setState(nextState);
                    }
                };
                return _this;
            }
            DragLayerContainer.prototype.getDecoratedComponentInstance = function () {
                invariant_1.default(this.ref.current, 'In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()');
                return this.ref.current;
            };
            DragLayerContainer.prototype.shouldComponentUpdate = function (nextProps, nextState) {
                return (!arePropsEqual(nextProps, this.props) ||
                    !shallowequal_1.default(nextState, this.state));
            };
            DragLayerContainer.prototype.componentDidMount = function () {
                this.isCurrentlyMounted = true;
                this.handleChange();
            };
            DragLayerContainer.prototype.componentWillUnmount = function () {
                this.isCurrentlyMounted = false;
                if (this.unsubscribeFromOffsetChange) {
                    this.unsubscribeFromOffsetChange();
                    this.unsubscribeFromOffsetChange = undefined;
                }
                if (this.unsubscribeFromStateChange) {
                    this.unsubscribeFromStateChange();
                    this.unsubscribeFromStateChange = undefined;
                }
            };
            DragLayerContainer.prototype.render = function () {
                var _this = this;
                return (React.createElement(index_1.DndContext.Consumer, null, function (_a) {
                    var dragDropManager = _a.dragDropManager;
                    if (dragDropManager === undefined) {
                        return null;
                    }
                    _this.receiveDragDropManager(dragDropManager);
                    // Let componentDidMount fire to initialize the collected state
                    if (!_this.isCurrentlyMounted) {
                        return null;
                    }
                    return (React.createElement(Decorated, __assign({}, _this.props, _this.state, { ref: utils_1.isRefable(Decorated) ? _this.ref : null })));
                }));
            };
            DragLayerContainer.prototype.receiveDragDropManager = function (dragDropManager) {
                if (this.manager !== undefined) {
                    return;
                }
                this.manager = dragDropManager;
                invariant_1.default(typeof dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' +
                    'Make sure to render a DndProvider component in your top-level component. ' +
                    'Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName);
                var monitor = this.manager.getMonitor();
                this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange);
                this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange);
            };
            DragLayerContainer.prototype.getCurrentState = function () {
                if (!this.manager) {
                    return {};
                }
                var monitor = this.manager.getMonitor();
                return collect(monitor, this.props);
            };
            DragLayerContainer.displayName = "DragLayer(" + displayName + ")";
            DragLayerContainer.DecoratedComponent = DecoratedComponent;
            return DragLayerContainer;
        }(React.Component));
        return hoist_non_react_statics_1.default(DragLayerContainer, DecoratedComponent);
    };
}
exports.DragLayer = DragLayer;


/***/ }),
/* 1335 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var js_utils_1 = __webpack_require__(106);
var utils_1 = __webpack_require__(119);
var decorateHandler_1 = __importDefault(__webpack_require__(371));
var registration_1 = __webpack_require__(184);
var DragSourceMonitorImpl_1 = __webpack_require__(366);
var SourceConnector_1 = __webpack_require__(368);
var isValidType_1 = __webpack_require__(375);
var createSourceFactory_1 = __importDefault(__webpack_require__(1337));
/**
 * Decorates a component as a dragsource
 * @param type The dragsource type
 * @param spec The drag source specification
 * @param collect The props collector function
 * @param options DnD options
 */
function DragSource(type, spec, collect, options) {
    if (options === void 0) { options = {}; }
    utils_1.checkDecoratorArguments('DragSource', 'type, spec, collect[, options]', type, spec, collect, options);
    var getType = type;
    if (typeof type !== 'function') {
        invariant_1.default(isValidType_1.isValidType(type), 'Expected "type" provided as the first argument to DragSource to be ' +
            'a string, or a function that returns a string given the current props. ' +
            'Instead, received %s. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', type);
        getType = function () { return type; };
    }
    invariant_1.default(js_utils_1.isPlainObject(spec), 'Expected "spec" provided as the second argument to DragSource to be ' +
        'a plain object. Instead, received %s. ' +
        'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', spec);
    var createSource = createSourceFactory_1.default(spec);
    invariant_1.default(typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' +
        'a function that returns a plain object of props to inject. ' +
        'Instead, received %s. ' +
        'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', collect);
    invariant_1.default(js_utils_1.isPlainObject(options), 'Expected "options" provided as the fourth argument to DragSource to be ' +
        'a plain object when specified. ' +
        'Instead, received %s. ' +
        'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', collect);
    return function decorateSource(DecoratedComponent) {
        return decorateHandler_1.default({
            containerDisplayName: 'DragSource',
            createHandler: createSource,
            registerHandler: registration_1.registerSource,
            createConnector: function (backend) { return new SourceConnector_1.SourceConnector(backend); },
            createMonitor: function (manager) {
                return new DragSourceMonitorImpl_1.DragSourceMonitorImpl(manager);
            },
            DecoratedComponent: DecoratedComponent,
            getType: getType,
            collect: collect,
            options: options,
        });
    };
}
exports.DragSource = DragSource;


/***/ }),
/* 1336 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var js_utils_1 = __webpack_require__(106);
var registration_1 = __webpack_require__(184);
var isValidType_1 = __webpack_require__(375);
var TargetConnector_1 = __webpack_require__(369);
var DropTargetMonitorImpl_1 = __webpack_require__(367);
var utils_1 = __webpack_require__(119);
var decorateHandler_1 = __importDefault(__webpack_require__(371));
var createTargetFactory_1 = __importDefault(__webpack_require__(1338));
function DropTarget(type, spec, collect, options) {
    if (options === void 0) { options = {}; }
    utils_1.checkDecoratorArguments('DropTarget', 'type, spec, collect[, options]', type, spec, collect, options);
    var getType = type;
    if (typeof type !== 'function') {
        invariant_1.default(isValidType_1.isValidType(type, true), 'Expected "type" provided as the first argument to DropTarget to be ' +
            'a string, an array of strings, or a function that returns either given ' +
            'the current props. Instead, received %s. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', type);
        getType = function () { return type; };
    }
    invariant_1.default(js_utils_1.isPlainObject(spec), 'Expected "spec" provided as the second argument to DropTarget to be ' +
        'a plain object. Instead, received %s. ' +
        'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', spec);
    var createTarget = createTargetFactory_1.default(spec);
    invariant_1.default(typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' +
        'a function that returns a plain object of props to inject. ' +
        'Instead, received %s. ' +
        'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);
    invariant_1.default(js_utils_1.isPlainObject(options), 'Expected "options" provided as the fourth argument to DropTarget to be ' +
        'a plain object when specified. ' +
        'Instead, received %s. ' +
        'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', collect);
    return function decorateTarget(DecoratedComponent) {
        return decorateHandler_1.default({
            containerDisplayName: 'DropTarget',
            createHandler: createTarget,
            registerHandler: registration_1.registerTarget,
            createMonitor: function (manager) {
                return new DropTargetMonitorImpl_1.DropTargetMonitorImpl(manager);
            },
            createConnector: function (backend) { return new TargetConnector_1.TargetConnector(backend); },
            DecoratedComponent: DecoratedComponent,
            getType: getType,
            collect: collect,
            options: options,
        });
    };
}
exports.DropTarget = DropTarget;


/***/ }),
/* 1337 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var js_utils_1 = __webpack_require__(106);
var utils_1 = __webpack_require__(119);
var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'isDragging', 'endDrag'];
var REQUIRED_SPEC_METHODS = ['beginDrag'];
var SourceImpl = /** @class */ (function () {
    function SourceImpl(spec, monitor, ref) {
        var _this = this;
        this.props = null;
        this.beginDrag = function () {
            if (!_this.props) {
                return;
            }
            var item = _this.spec.beginDrag(_this.props, _this.monitor, _this.ref.current);
            if (true) {
                invariant_1.default(js_utils_1.isPlainObject(item), 'beginDrag() must return a plain object that represents the dragged item. ' +
                    'Instead received %s. ' +
                    'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', item);
            }
            return item;
        };
        this.spec = spec;
        this.monitor = monitor;
        this.ref = ref;
    }
    SourceImpl.prototype.receiveProps = function (props) {
        this.props = props;
    };
    SourceImpl.prototype.canDrag = function () {
        if (!this.props) {
            return false;
        }
        if (!this.spec.canDrag) {
            return true;
        }
        return this.spec.canDrag(this.props, this.monitor);
    };
    SourceImpl.prototype.isDragging = function (globalMonitor, sourceId) {
        if (!this.props) {
            return false;
        }
        if (!this.spec.isDragging) {
            return sourceId === globalMonitor.getSourceId();
        }
        return this.spec.isDragging(this.props, this.monitor);
    };
    SourceImpl.prototype.endDrag = function () {
        if (!this.props) {
            return;
        }
        if (!this.spec.endDrag) {
            return;
        }
        this.spec.endDrag(this.props, this.monitor, utils_1.getDecoratedComponent(this.ref));
    };
    return SourceImpl;
}());
function createSourceFactory(spec) {
    Object.keys(spec).forEach(function (key) {
        invariant_1.default(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' +
            'some of the following keys: %s. ' +
            'Instead received a specification with an unexpected "%s" key. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', ALLOWED_SPEC_METHODS.join(', '), key);
        invariant_1.default(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' +
            'Instead received a specification with %s: %s. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', key, key, spec[key]);
    });
    REQUIRED_SPEC_METHODS.forEach(function (key) {
        invariant_1.default(typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' +
            'Instead received a specification with %s: %s. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source', key, key, spec[key]);
    });
    return function createSource(monitor, ref) {
        return new SourceImpl(spec, monitor, ref);
    };
}
exports.default = createSourceFactory;


/***/ }),
/* 1338 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = __importDefault(__webpack_require__(32));
var js_utils_1 = __webpack_require__(106);
var utils_1 = __webpack_require__(119);
var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop'];
var TargetImpl = /** @class */ (function () {
    function TargetImpl(spec, monitor, ref) {
        this.props = null;
        this.spec = spec;
        this.monitor = monitor;
        this.ref = ref;
    }
    TargetImpl.prototype.receiveProps = function (props) {
        this.props = props;
    };
    TargetImpl.prototype.receiveMonitor = function (monitor) {
        this.monitor = monitor;
    };
    TargetImpl.prototype.canDrop = function () {
        if (!this.spec.canDrop) {
            return true;
        }
        return this.spec.canDrop(this.props, this.monitor);
    };
    TargetImpl.prototype.hover = function () {
        if (!this.spec.hover) {
            return;
        }
        this.spec.hover(this.props, this.monitor, utils_1.getDecoratedComponent(this.ref));
    };
    TargetImpl.prototype.drop = function () {
        if (!this.spec.drop) {
            return undefined;
        }
        var dropResult = this.spec.drop(this.props, this.monitor, this.ref.current);
        if (true) {
            invariant_1.default(typeof dropResult === 'undefined' || js_utils_1.isPlainObject(dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' +
                'Instead received %s. ' +
                'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', dropResult);
        }
        return dropResult;
    };
    return TargetImpl;
}());
function createTargetFactory(spec) {
    Object.keys(spec).forEach(function (key) {
        invariant_1.default(ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' +
            'some of the following keys: %s. ' +
            'Instead received a specification with an unexpected "%s" key. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', ALLOWED_SPEC_METHODS.join(', '), key);
        invariant_1.default(typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' +
            'Instead received a specification with %s: %s. ' +
            'Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target', key, key, spec[key]);
    });
    return function createTarget(monitor, ref) {
        return new TargetImpl(spec, monitor, ref);
    };
}
exports.default = createTargetFactory;


/***/ }),
/* 1339 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var js_utils_1 = __webpack_require__(106);
/**
 * Provides a set of static methods for creating Disposables.
 * @param {Function} action Action to run during the first call to dispose.
 * The action is guaranteed to be run at most once.
 */
var Disposable = /** @class */ (function () {
    function Disposable(action) {
        this.isDisposed = false;
        this.action = js_utils_1.isFunction(action) ? action : js_utils_1.noop;
    }
    /**
     * Validates whether the given object is a disposable
     * @param {Object} Object to test whether it has a dispose method
     * @returns {Boolean} true if a disposable object, else false.
     */
    Disposable.isDisposable = function (d) {
        return d && js_utils_1.isFunction(d.dispose);
    };
    Disposable._fixup = function (result) {
        return Disposable.isDisposable(result) ? result : Disposable.empty;
    };
    /**
     * Creates a disposable object that invokes the specified action when disposed.
     * @param {Function} dispose Action to run during the first call to dispose.
     * The action is guaranteed to be run at most once.
     * @return {Disposable} The disposable object that runs the given action upon disposal.
     */
    Disposable.create = function (action) {
        return new Disposable(action);
    };
    /** Performs the task of cleaning up resources. */
    Disposable.prototype.dispose = function () {
        if (!this.isDisposed) {
            this.action();
            this.isDisposed = true;
        }
    };
    /**
     * Gets the disposable that does nothing when disposed.
     */
    Disposable.empty = { dispose: js_utils_1.noop };
    return Disposable;
}());
exports.Disposable = Disposable;
/**
 * Represents a group of disposable resources that are disposed together.
 * @constructor
 */
var CompositeDisposable = /** @class */ (function () {
    function CompositeDisposable() {
        var disposables = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            disposables[_i] = arguments[_i];
        }
        this.isDisposed = false;
        this.disposables = disposables;
    }
    /**
     * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
     * @param {Any} item Disposable to add.
     */
    CompositeDisposable.prototype.add = function (item) {
        if (this.isDisposed) {
            item.dispose();
        }
        else {
            this.disposables.push(item);
        }
    };
    /**
     * Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
     * @param {Any} item Disposable to remove.
     * @returns {Boolean} true if found; false otherwise.
     */
    CompositeDisposable.prototype.remove = function (item) {
        var shouldDispose = false;
        if (!this.isDisposed) {
            var idx = this.disposables.indexOf(item);
            if (idx !== -1) {
                shouldDispose = true;
                this.disposables.splice(idx, 1);
                item.dispose();
            }
        }
        return shouldDispose;
    };
    /**
     *  Disposes all disposables in the group and removes them from the group but
     *  does not dispose the CompositeDisposable.
     */
    CompositeDisposable.prototype.clear = function () {
        if (!this.isDisposed) {
            var len = this.disposables.length;
            var currentDisposables = new Array(len);
            for (var i = 0; i < len; i++) {
                currentDisposables[i] = this.disposables[i];
            }
            this.disposables = [];
            for (var i = 0; i < len; i++) {
                currentDisposables[i].dispose();
            }
        }
    };
    /**
     *  Disposes all disposables in the group and removes them from the group.
     */
    CompositeDisposable.prototype.dispose = function () {
        if (!this.isDisposed) {
            this.isDisposed = true;
            var len = this.disposables.length;
            var currentDisposables = new Array(len);
            for (var i = 0; i < len; i++) {
                currentDisposables[i] = this.disposables[i];
            }
            this.disposables = [];
            for (var i = 0; i < len; i++) {
                currentDisposables[i].dispose();
            }
        }
    };
    return CompositeDisposable;
}());
exports.CompositeDisposable = CompositeDisposable;
/**
 * Represents a disposable resource whose underlying disposable resource can
 * be replaced by another disposable resource, causing automatic disposal of
 * the previous underlying disposable resource.
 */
var SerialDisposable = /** @class */ (function () {
    function SerialDisposable() {
        this.isDisposed = false;
    }
    /**
     * Gets the underlying disposable.
     * @returns {Any} the underlying disposable.
     */
    SerialDisposable.prototype.getDisposable = function () {
        return this.current;
    };
    SerialDisposable.prototype.setDisposable = function (value) {
        var shouldDispose = this.isDisposed;
        if (!shouldDispose) {
            var old = this.current;
            this.current = value;
            if (old) {
                old.dispose();
            }
        }
        if (shouldDispose && value) {
            value.dispose();
        }
    };
    /** Performs the task of cleaning up resources. */
    SerialDisposable.prototype.dispose = function () {
        if (!this.isDisposed) {
            this.isDisposed = true;
            var old = this.current;
            this.current = undefined;
            if (old) {
                old.dispose();
            }
        }
    };
    return SerialDisposable;
}());
exports.SerialDisposable = SerialDisposable;


/***/ }),
/* 1340 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(1335));
__export(__webpack_require__(1336));
__export(__webpack_require__(1334));


/***/ }),
/* 1341 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(__webpack_require__(1344));
__export(__webpack_require__(1346));
__export(__webpack_require__(1345));


/***/ }),
/* 1342 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var invariant_1 = __importDefault(__webpack_require__(32));
var registration_1 = __webpack_require__(184);
var useDragDropManager_1 = __webpack_require__(248);
var DragSourceMonitorImpl_1 = __webpack_require__(366);
var SourceConnector_1 = __webpack_require__(368);
var useIsomorphicLayoutEffect_1 = __webpack_require__(120);
function useDragSourceMonitor() {
    var manager = useDragDropManager_1.useDragDropManager();
    var monitor = react_1.useMemo(function () { return new DragSourceMonitorImpl_1.DragSourceMonitorImpl(manager); }, [manager]);
    var connector = react_1.useMemo(function () { return new SourceConnector_1.SourceConnector(manager.getBackend()); }, [
        manager,
    ]);
    return [monitor, connector];
}
exports.useDragSourceMonitor = useDragSourceMonitor;
function useDragHandler(spec, monitor, connector) {
    var manager = useDragDropManager_1.useDragDropManager();
    var handler = react_1.useMemo(function () {
        return {
            beginDrag: function () {
                var _a = spec.current, begin = _a.begin, item = _a.item;
                if (begin) {
                    var beginResult = begin(monitor);
                    invariant_1.default(beginResult == null || typeof beginResult === 'object', 'dragSpec.begin() must either return an object, undefined, or null');
                    return beginResult || item || {};
                }
                return item || {};
            },
            canDrag: function () {
                if (typeof spec.current.canDrag === 'boolean') {
                    return spec.current.canDrag;
                }
                else if (typeof spec.current.canDrag === 'function') {
                    return spec.current.canDrag(monitor);
                }
                else {
                    return true;
                }
            },
            isDragging: function (globalMonitor, target) {
                var isDragging = spec.current.isDragging;
                return isDragging
                    ? isDragging(monitor)
                    : target === globalMonitor.getSourceId();
            },
            endDrag: function () {
                var end = spec.current.end;
                if (end) {
                    end(monitor.getItem(), monitor);
                }
                connector.reconnect();
            },
        };
    }, []);
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function registerHandler() {
        var _a = registration_1.registerSource(spec.current.item.type, handler, manager), handlerId = _a[0], unregister = _a[1];
        monitor.receiveHandlerId(handlerId);
        connector.receiveHandlerId(handlerId);
        return unregister;
    }, []);
}
exports.useDragHandler = useDragHandler;


/***/ }),
/* 1343 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var registration_1 = __webpack_require__(184);
var useDragDropManager_1 = __webpack_require__(248);
var TargetConnector_1 = __webpack_require__(369);
var DropTargetMonitorImpl_1 = __webpack_require__(367);
var useIsomorphicLayoutEffect_1 = __webpack_require__(120);
function useDropTargetMonitor() {
    var manager = useDragDropManager_1.useDragDropManager();
    var monitor = react_1.useMemo(function () { return new DropTargetMonitorImpl_1.DropTargetMonitorImpl(manager); }, [manager]);
    var connector = react_1.useMemo(function () { return new TargetConnector_1.TargetConnector(manager.getBackend()); }, [
        manager,
    ]);
    return [monitor, connector];
}
exports.useDropTargetMonitor = useDropTargetMonitor;
function useDropHandler(spec, monitor, connector) {
    var manager = useDragDropManager_1.useDragDropManager();
    var handler = react_1.useMemo(function () {
        return {
            canDrop: function () {
                var canDrop = spec.current.canDrop;
                return canDrop ? canDrop(monitor.getItem(), monitor) : true;
            },
            hover: function () {
                var hover = spec.current.hover;
                if (hover) {
                    hover(monitor.getItem(), monitor);
                }
            },
            drop: function () {
                var drop = spec.current.drop;
                if (drop) {
                    return drop(monitor.getItem(), monitor);
                }
            },
        };
    }, [monitor]);
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function registerHandler() {
        var _a = registration_1.registerTarget(spec.current.accept, handler, manager), handlerId = _a[0], unregister = _a[1];
        monitor.receiveHandlerId(handlerId);
        connector.receiveHandlerId(handlerId);
        return unregister;
    }, [monitor, connector]);
}
exports.useDropHandler = useDropHandler;


/***/ }),
/* 1344 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var invariant_1 = __importDefault(__webpack_require__(32));
var useMonitorOutput_1 = __webpack_require__(373);
var useIsomorphicLayoutEffect_1 = __webpack_require__(120);
var drag_1 = __webpack_require__(1342);
/**
 * useDragSource hook
 * @param sourceSpec The drag source specification *
 */
function useDrag(spec) {
    var specRef = react_1.useRef(spec);
    specRef.current = spec;
    // TODO: wire options into createSourceConnector
    invariant_1.default(spec.item != null, 'item must be defined');
    invariant_1.default(spec.item.type != null, 'item type must be defined');
    var _a = drag_1.useDragSourceMonitor(), monitor = _a[0], connector = _a[1];
    drag_1.useDragHandler(specRef, monitor, connector);
    var result = useMonitorOutput_1.useMonitorOutput(monitor, specRef.current.collect || (function () { return ({}); }), function () { return connector.reconnect(); });
    var connectDragSource = react_1.useMemo(function () { return connector.hooks.dragSource(); }, [
        connector,
    ]);
    var connectDragPreview = react_1.useMemo(function () { return connector.hooks.dragPreview(); }, [
        connector,
    ]);
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function () {
        connector.dragSourceOptions = specRef.current.options || null;
        connector.reconnect();
    }, [connector]);
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function () {
        connector.dragPreviewOptions = specRef.current.previewOptions || null;
        connector.reconnect();
    }, [connector]);
    return [result, connectDragSource, connectDragPreview];
}
exports.useDrag = useDrag;


/***/ }),
/* 1345 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var useDragDropManager_1 = __webpack_require__(248);
var useCollector_1 = __webpack_require__(372);
/**
 * useDragLayer Hook
 * @param collector The property collector
 */
function useDragLayer(collect) {
    var dragDropManager = useDragDropManager_1.useDragDropManager();
    var monitor = dragDropManager.getMonitor();
    var _a = useCollector_1.useCollector(monitor, collect), collected = _a[0], updateCollected = _a[1];
    react_1.useEffect(function () { return monitor.subscribeToOffsetChange(updateCollected); });
    react_1.useEffect(function () { return monitor.subscribeToStateChange(updateCollected); });
    return collected;
}
exports.useDragLayer = useDragLayer;


/***/ }),
/* 1346 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var invariant_1 = __importDefault(__webpack_require__(32));
var useMonitorOutput_1 = __webpack_require__(373);
var useIsomorphicLayoutEffect_1 = __webpack_require__(120);
var drop_1 = __webpack_require__(1343);
/**
 * useDropTarget Hook
 * @param spec The drop target specification
 */
function useDrop(spec) {
    var specRef = react_1.useRef(spec);
    specRef.current = spec;
    invariant_1.default(spec.accept != null, 'accept must be defined');
    var _a = drop_1.useDropTargetMonitor(), monitor = _a[0], connector = _a[1];
    drop_1.useDropHandler(specRef, monitor, connector);
    var result = useMonitorOutput_1.useMonitorOutput(monitor, specRef.current.collect || (function () { return ({}); }), function () { return connector.reconnect(); });
    var connectDropTarget = react_1.useMemo(function () { return connector.hooks.dropTarget(); }, [
        connector,
    ]);
    useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function () {
        connector.dropTargetOptions = spec.options || null;
        connector.reconnect();
    }, [spec.options]);
    return [result, connectDropTarget];
}
exports.useDrop = useDrop;


/***/ }),
/* 1347 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __webpack_require__(0);
var invariant_1 = __importDefault(__webpack_require__(32));
function setRef(ref, node) {
    if (typeof ref === 'function') {
        ref(node);
    }
    else {
        ref.current = node;
    }
}
function cloneWithRef(element, newRef) {
    var previousRef = element.ref;
    invariant_1.default(typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' +
        'Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. ' +
        'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute');
    if (!previousRef) {
        // When there is no ref on the element, use the new ref directly
        return react_1.cloneElement(element, {
            ref: newRef,
        });
    }
    else {
        return react_1.cloneElement(element, {
            ref: function (node) {
                setRef(previousRef, node);
                setRef(newRef, node);
            },
        });
    }
}
exports.cloneWithRef = cloneWithRef;


/***/ }),
/* 1348 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var js_utils_1 = __webpack_require__(377);
var EnterLeaveCounter = /** @class */ (function () {
    function EnterLeaveCounter(isNodeInDocument) {
        this.entered = [];
        this.isNodeInDocument = isNodeInDocument;
    }
    EnterLeaveCounter.prototype.enter = function (enteringNode) {
        var _this = this;
        var previousLength = this.entered.length;
        var isNodeEntered = function (node) {
            return _this.isNodeInDocument(node) &&
                (!node.contains || node.contains(enteringNode));
        };
        this.entered = js_utils_1.union(this.entered.filter(isNodeEntered), [enteringNode]);
        return previousLength === 0 && this.entered.length > 0;
    };
    EnterLeaveCounter.prototype.leave = function (leavingNode) {
        var previousLength = this.entered.length;
        this.entered = js_utils_1.without(this.entered.filter(this.isNodeInDocument), leavingNode);
        return previousLength > 0 && this.entered.length === 0;
    };
    EnterLeaveCounter.prototype.reset = function () {
        this.entered = [];
    };
    return EnterLeaveCounter;
}());
exports.default = EnterLeaveCounter;


/***/ }),
/* 1349 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
var EnterLeaveCounter_1 = __importDefault(__webpack_require__(1348));
var BrowserDetector_1 = __webpack_require__(376);
var OffsetUtils_1 = __webpack_require__(1355);
var NativeDragSources_1 = __webpack_require__(1353);
var NativeTypes = __importStar(__webpack_require__(249));
var OptionsReader_1 = __webpack_require__(1356);
var HTML5Backend = /** @class */ (function () {
    function HTML5Backend(manager, globalContext) {
        var _this = this;
        this.sourcePreviewNodes = new Map();
        this.sourcePreviewNodeOptions = new Map();
        this.sourceNodes = new Map();
        this.sourceNodeOptions = new Map();
        this.dragStartSourceIds = null;
        this.dropTargetIds = [];
        this.dragEnterTargetIds = [];
        this.currentNativeSource = null;
        this.currentNativeHandle = null;
        this.currentDragSourceNode = null;
        this.altKeyPressed = false;
        this.mouseMoveTimeoutTimer = null;
        this.asyncEndDragFrameId = null;
        this.dragOverTargetIds = null;
        this.getSourceClientOffset = function (sourceId) {
            return OffsetUtils_1.getNodeClientOffset(_this.sourceNodes.get(sourceId));
        };
        this.endDragNativeItem = function () {
            if (!_this.isDraggingNativeItem()) {
                return;
            }
            _this.actions.endDrag();
            _this.registry.removeSource(_this.currentNativeHandle);
            _this.currentNativeHandle = null;
            _this.currentNativeSource = null;
        };
        this.isNodeInDocument = function (node) {
            // Check the node either in the main document or in the current context
            return _this.document && _this.document.body && document.body.contains(node);
        };
        this.endDragIfSourceWasRemovedFromDOM = function () {
            var node = _this.currentDragSourceNode;
            if (_this.isNodeInDocument(node)) {
                return;
            }
            if (_this.clearCurrentDragSourceNode()) {
                _this.actions.endDrag();
            }
        };
        this.handleTopDragStartCapture = function () {
            _this.clearCurrentDragSourceNode();
            _this.dragStartSourceIds = [];
        };
        this.handleTopDragStart = function (e) {
            if (e.defaultPrevented) {
                return;
            }
            var dragStartSourceIds = _this.dragStartSourceIds;
            _this.dragStartSourceIds = null;
            var clientOffset = OffsetUtils_1.getEventClientOffset(e);
            // Avoid crashing if we missed a drop event or our previous drag died
            if (_this.monitor.isDragging()) {
                _this.actions.endDrag();
            }
            // Don't publish the source just yet (see why below)
            _this.actions.beginDrag(dragStartSourceIds || [], {
                publishSource: false,
                getSourceClientOffset: _this.getSourceClientOffset,
                clientOffset: clientOffset,
            });
            var dataTransfer = e.dataTransfer;
            var nativeType = NativeDragSources_1.matchNativeItemType(dataTransfer);
            if (_this.monitor.isDragging()) {
                if (dataTransfer && typeof dataTransfer.setDragImage === 'function') {
                    // Use custom drag image if user specifies it.
                    // If child drag source refuses drag but parent agrees,
                    // use parent's node as drag image. Neither works in IE though.
                    var sourceId = _this.monitor.getSourceId();
                    var sourceNode = _this.sourceNodes.get(sourceId);
                    var dragPreview = _this.sourcePreviewNodes.get(sourceId) || sourceNode;
                    if (dragPreview) {
                        var _a = _this.getCurrentSourcePreviewNodeOptions(), anchorX = _a.anchorX, anchorY = _a.anchorY, offsetX = _a.offsetX, offsetY = _a.offsetY;
                        var anchorPoint = { anchorX: anchorX, anchorY: anchorY };
                        var offsetPoint = { offsetX: offsetX, offsetY: offsetY };
                        var dragPreviewOffset = OffsetUtils_1.getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint);
                        dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y);
                    }
                }
                try {
                    // Firefox won't drag without setting data
                    dataTransfer.setData('application/json', {});
                }
                catch (err) {
                    // IE doesn't support MIME types in setData
                }
                // Store drag source node so we can check whether
                // it is removed from DOM and trigger endDrag manually.
                _this.setCurrentDragSourceNode(e.target);
                // Now we are ready to publish the drag source.. or are we not?
                var captureDraggingState = _this.getCurrentSourcePreviewNodeOptions().captureDraggingState;
                if (!captureDraggingState) {
                    // Usually we want to publish it in the next tick so that browser
                    // is able to screenshot the current (not yet dragging) state.
                    //
                    // It also neatly avoids a situation where render() returns null
                    // in the same tick for the source element, and browser freaks out.
                    setTimeout(function () { return _this.actions.publishDragSource(); }, 0);
                }
                else {
                    // In some cases the user may want to override this behavior, e.g.
                    // to work around IE not supporting custom drag previews.
                    //
                    // When using a custom drag layer, the only way to prevent
                    // the default drag preview from drawing in IE is to screenshot
                    // the dragging state in which the node itself has zero opacity
                    // and height. In this case, though, returning null from render()
                    // will abruptly end the dragging, which is not obvious.
                    //
                    // This is the reason such behavior is strictly opt-in.
                    _this.actions.publishDragSource();
                }
            }
            else if (nativeType) {
                // A native item (such as URL) dragged from inside the document
                _this.beginDragNativeItem(nativeType);
            }
            else if (dataTransfer &&
                !dataTransfer.types &&
                ((e.target && !e.target.hasAttribute) ||
                    !e.target.hasAttribute('draggable'))) {
                // Looks like a Safari bug: dataTransfer.types is null, but there was no draggable.
                // Just let it drag. It's a native type (URL or text) and will be picked up in
                // dragenter handler.
                return;
            }
            else {
                // If by this time no drag source reacted, tell browser not to drag.
                e.preventDefault();
            }
        };
        this.handleTopDragEndCapture = function () {
            if (_this.clearCurrentDragSourceNode()) {
                // Firefox can dispatch this event in an infinite loop
                // if dragend handler does something like showing an alert.
                // Only proceed if we have not handled it already.
                _this.actions.endDrag();
            }
        };
        this.handleTopDragEnterCapture = function (e) {
            _this.dragEnterTargetIds = [];
            var isFirstEnter = _this.enterLeaveCounter.enter(e.target);
            if (!isFirstEnter || _this.monitor.isDragging()) {
                return;
            }
            var dataTransfer = e.dataTransfer;
            var nativeType = NativeDragSources_1.matchNativeItemType(dataTransfer);
            if (nativeType) {
                // A native item (such as file or URL) dragged from outside the document
                _this.beginDragNativeItem(nativeType);
            }
        };
        this.handleTopDragEnter = function (e) {
            var dragEnterTargetIds = _this.dragEnterTargetIds;
            _this.dragEnterTargetIds = [];
            if (!_this.monitor.isDragging()) {
                // This is probably a native item type we don't understand.
                return;
            }
            _this.altKeyPressed = e.altKey;
            if (!BrowserDetector_1.isFirefox()) {
                // Don't emit hover in `dragenter` on Firefox due to an edge case.
                // If the target changes position as the result of `dragenter`, Firefox
                // will still happily dispatch `dragover` despite target being no longer
                // there. The easy solution is to only fire `hover` in `dragover` on FF.
                _this.actions.hover(dragEnterTargetIds, {
                    clientOffset: OffsetUtils_1.getEventClientOffset(e),
                });
            }
            var canDrop = dragEnterTargetIds.some(function (targetId) {
                return _this.monitor.canDropOnTarget(targetId);
            });
            if (canDrop) {
                // IE requires this to fire dragover events
                e.preventDefault();
                if (e.dataTransfer) {
                    e.dataTransfer.dropEffect = _this.getCurrentDropEffect();
                }
            }
        };
        this.handleTopDragOverCapture = function () {
            _this.dragOverTargetIds = [];
        };
        this.handleTopDragOver = function (e) {
            var dragOverTargetIds = _this.dragOverTargetIds;
            _this.dragOverTargetIds = [];
            if (!_this.monitor.isDragging()) {
                // This is probably a native item type we don't understand.
                // Prevent default "drop and blow away the whole document" action.
                e.preventDefault();
                if (e.dataTransfer) {
                    e.dataTransfer.dropEffect = 'none';
                }
                return;
            }
            _this.altKeyPressed = e.altKey;
            _this.actions.hover(dragOverTargetIds || [], {
                clientOffset: OffsetUtils_1.getEventClientOffset(e),
            });
            var canDrop = (dragOverTargetIds || []).some(function (targetId) {
                return _this.monitor.canDropOnTarget(targetId);
            });
            if (canDrop) {
                // Show user-specified drop effect.
                e.preventDefault();
                if (e.dataTransfer) {
                    e.dataTransfer.dropEffect = _this.getCurrentDropEffect();
                }
            }
            else if (_this.isDraggingNativeItem()) {
                // Don't show a nice cursor but still prevent default
                // "drop and blow away the whole document" action.
                e.preventDefault();
            }
            else {
                e.preventDefault();
                if (e.dataTransfer) {
                    e.dataTransfer.dropEffect = 'none';
                }
            }
        };
        this.handleTopDragLeaveCapture = function (e) {
            if (_this.isDraggingNativeItem()) {
                e.preventDefault();
            }
            var isLastLeave = _this.enterLeaveCounter.leave(e.target);
            if (!isLastLeave) {
                return;
            }
            if (_this.isDraggingNativeItem()) {
                _this.endDragNativeItem();
            }
        };
        this.handleTopDropCapture = function (e) {
            _this.dropTargetIds = [];
            e.preventDefault();
            if (_this.isDraggingNativeItem()) {
                _this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer);
            }
            _this.enterLeaveCounter.reset();
        };
        this.handleTopDrop = function (e) {
            var dropTargetIds = _this.dropTargetIds;
            _this.dropTargetIds = [];
            _this.actions.hover(dropTargetIds, {
                clientOffset: OffsetUtils_1.getEventClientOffset(e),
            });
            _this.actions.drop({ dropEffect: _this.getCurrentDropEffect() });
            if (_this.isDraggingNativeItem()) {
                _this.endDragNativeItem();
            }
            else {
                _this.endDragIfSourceWasRemovedFromDOM();
            }
        };
        this.handleSelectStart = function (e) {
            var target = e.target;
            // Only IE requires us to explicitly say
            // we want drag drop operation to start
            if (typeof target.dragDrop !== 'function') {
                return;
            }
            // Inputs and textareas should be selectable
            if (target.tagName === 'INPUT' ||
                target.tagName === 'SELECT' ||
                target.tagName === 'TEXTAREA' ||
                target.isContentEditable) {
                return;
            }
            // For other targets, ask IE
            // to enable drag and drop
            e.preventDefault();
            target.dragDrop();
        };
        this.options = new OptionsReader_1.OptionsReader(globalContext);
        this.actions = manager.getActions();
        this.monitor = manager.getMonitor();
        this.registry = manager.getRegistry();
        this.enterLeaveCounter = new EnterLeaveCounter_1.default(this.isNodeInDocument);
    }
    Object.defineProperty(HTML5Backend.prototype, "window", {
        // public for test
        get: function () {
            return this.options.window;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(HTML5Backend.prototype, "document", {
        get: function () {
            return this.options.document;
        },
        enumerable: true,
        configurable: true
    });
    HTML5Backend.prototype.setup = function () {
        if (this.window === undefined) {
            return;
        }
        if (this.window.__isReactDndBackendSetUp) {
            throw new Error('Cannot have two HTML5 backends at the same time.');
        }
        this.window.__isReactDndBackendSetUp = true;
        this.addEventListeners(this.window);
    };
    HTML5Backend.prototype.teardown = function () {
        if (this.window === undefined) {
            return;
        }
        this.window.__isReactDndBackendSetUp = false;
        this.removeEventListeners(this.window);
        this.clearCurrentDragSourceNode();
        if (this.asyncEndDragFrameId) {
            this.window.cancelAnimationFrame(this.asyncEndDragFrameId);
        }
    };
    HTML5Backend.prototype.connectDragPreview = function (sourceId, node, options) {
        var _this = this;
        this.sourcePreviewNodeOptions.set(sourceId, options);
        this.sourcePreviewNodes.set(sourceId, node);
        return function () {
            _this.sourcePreviewNodes.delete(sourceId);
            _this.sourcePreviewNodeOptions.delete(sourceId);
        };
    };
    HTML5Backend.prototype.connectDragSource = function (sourceId, node, options) {
        var _this = this;
        this.sourceNodes.set(sourceId, node);
        this.sourceNodeOptions.set(sourceId, options);
        var handleDragStart = function (e) { return _this.handleDragStart(e, sourceId); };
        var handleSelectStart = function (e) { return _this.handleSelectStart(e); };
        node.setAttribute('draggable', 'true');
        node.addEventListener('dragstart', handleDragStart);
        node.addEventListener('selectstart', handleSelectStart);
        return function () {
            _this.sourceNodes.delete(sourceId);
            _this.sourceNodeOptions.delete(sourceId);
            node.removeEventListener('dragstart', handleDragStart);
            node.removeEventListener('selectstart', handleSelectStart);
            node.setAttribute('draggable', 'false');
        };
    };
    HTML5Backend.prototype.connectDropTarget = function (targetId, node) {
        var _this = this;
        var handleDragEnter = function (e) { return _this.handleDragEnter(e, targetId); };
        var handleDragOver = function (e) { return _this.handleDragOver(e, targetId); };
        var handleDrop = function (e) { return _this.handleDrop(e, targetId); };
        node.addEventListener('dragenter', handleDragEnter);
        node.addEventListener('dragover', handleDragOver);
        node.addEventListener('drop', handleDrop);
        return function () {
            node.removeEventListener('dragenter', handleDragEnter);
            node.removeEventListener('dragover', handleDragOver);
            node.removeEventListener('drop', handleDrop);
        };
    };
    HTML5Backend.prototype.addEventListeners = function (target) {
        // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813
        if (!target.addEventListener) {
            return;
        }
        target.addEventListener('dragstart', this
            .handleTopDragStart);
        target.addEventListener('dragstart', this.handleTopDragStartCapture, true);
        target.addEventListener('dragend', this.handleTopDragEndCapture, true);
        target.addEventListener('dragenter', this
            .handleTopDragEnter);
        target.addEventListener('dragenter', this.handleTopDragEnterCapture, true);
        target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true);
        target.addEventListener('dragover', this.handleTopDragOver);
        target.addEventListener('dragover', this.handleTopDragOverCapture, true);
        target.addEventListener('drop', this.handleTopDrop);
        target.addEventListener('drop', this.handleTopDropCapture, true);
    };
    HTML5Backend.prototype.removeEventListeners = function (target) {
        // SSR Fix (https://github.com/react-dnd/react-dnd/pull/813
        if (!target.removeEventListener) {
            return;
        }
        target.removeEventListener('dragstart', this.handleTopDragStart);
        target.removeEventListener('dragstart', this.handleTopDragStartCapture, true);
        target.removeEventListener('dragend', this.handleTopDragEndCapture, true);
        target.removeEventListener('dragenter', this
            .handleTopDragEnter);
        target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true);
        target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true);
        target.removeEventListener('dragover', this
            .handleTopDragOver);
        target.removeEventListener('dragover', this.handleTopDragOverCapture, true);
        target.removeEventListener('drop', this.handleTopDrop);
        target.removeEventListener('drop', this.handleTopDropCapture, true);
    };
    HTML5Backend.prototype.getCurrentSourceNodeOptions = function () {
        var sourceId = this.monitor.getSourceId();
        var sourceNodeOptions = this.sourceNodeOptions.get(sourceId);
        return __assign({ dropEffect: this.altKeyPressed ? 'copy' : 'move' }, (sourceNodeOptions || {}));
    };
    HTML5Backend.prototype.getCurrentDropEffect = function () {
        if (this.isDraggingNativeItem()) {
            // It makes more sense to default to 'copy' for native resources
            return 'copy';
        }
        return this.getCurrentSourceNodeOptions().dropEffect;
    };
    HTML5Backend.prototype.getCurrentSourcePreviewNodeOptions = function () {
        var sourceId = this.monitor.getSourceId();
        var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions.get(sourceId);
        return __assign({ anchorX: 0.5, anchorY: 0.5, captureDraggingState: false }, (sourcePreviewNodeOptions || {}));
    };
    HTML5Backend.prototype.isDraggingNativeItem = function () {
        var itemType = this.monitor.getItemType();
        return Object.keys(NativeTypes).some(function (key) { return NativeTypes[key] === itemType; });
    };
    HTML5Backend.prototype.beginDragNativeItem = function (type) {
        this.clearCurrentDragSourceNode();
        this.currentNativeSource = NativeDragSources_1.createNativeDragSource(type);
        this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource);
        this.actions.beginDrag([this.currentNativeHandle]);
    };
    HTML5Backend.prototype.setCurrentDragSourceNode = function (node) {
        var _this = this;
        this.clearCurrentDragSourceNode();
        this.currentDragSourceNode = node;
        // A timeout of > 0 is necessary to resolve Firefox issue referenced
        // See:
        //   * https://github.com/react-dnd/react-dnd/pull/928
        //   * https://github.com/react-dnd/react-dnd/issues/869
        var MOUSE_MOVE_TIMEOUT = 1000;
        // Receiving a mouse event in the middle of a dragging operation
        // means it has ended and the drag source node disappeared from DOM,
        // so the browser didn't dispatch the dragend event.
        //
        // We need to wait before we start listening for mousemove events.
        // This is needed because the drag preview needs to be drawn or else it fires an 'mousemove' event
        // immediately in some browsers.
        //
        // See:
        //   * https://github.com/react-dnd/react-dnd/pull/928
        //   * https://github.com/react-dnd/react-dnd/issues/869
        //
        this.mouseMoveTimeoutTimer = setTimeout(function () {
            return (_this.window &&
                _this.window.addEventListener('mousemove', _this.endDragIfSourceWasRemovedFromDOM, true));
        }, MOUSE_MOVE_TIMEOUT);
    };
    HTML5Backend.prototype.clearCurrentDragSourceNode = function () {
        if (this.currentDragSourceNode) {
            this.currentDragSourceNode = null;
            if (this.window) {
                this.window.clearTimeout(this.mouseMoveTimeoutTimer || undefined);
                this.window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true);
            }
            this.mouseMoveTimeoutTimer = null;
            return true;
        }
        return false;
    };
    HTML5Backend.prototype.handleDragStart = function (e, sourceId) {
        if (e.defaultPrevented) {
            return;
        }
        if (!this.dragStartSourceIds) {
            this.dragStartSourceIds = [];
        }
        this.dragStartSourceIds.unshift(sourceId);
    };
    HTML5Backend.prototype.handleDragEnter = function (e, targetId) {
        this.dragEnterTargetIds.unshift(targetId);
    };
    HTML5Backend.prototype.handleDragOver = function (e, targetId) {
        if (this.dragOverTargetIds === null) {
            this.dragOverTargetIds = [];
        }
        this.dragOverTargetIds.unshift(targetId);
    };
    HTML5Backend.prototype.handleDrop = function (e, targetId) {
        this.dropTargetIds.unshift(targetId);
    };
    return HTML5Backend;
}());
exports.default = HTML5Backend;


/***/ }),
/* 1350 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var MonotonicInterpolant = /** @class */ (function () {
    function MonotonicInterpolant(xs, ys) {
        var length = xs.length;
        // Rearrange xs and ys so that xs is sorted
        var indexes = [];
        for (var i = 0; i < length; i++) {
            indexes.push(i);
        }
        indexes.sort(function (a, b) { return (xs[a] < xs[b] ? -1 : 1); });
        // Get consecutive differences and slopes
        var dys = [];
        var dxs = [];
        var ms = [];
        var dx;
        var dy;
        for (var i = 0; i < length - 1; i++) {
            dx = xs[i + 1] - xs[i];
            dy = ys[i + 1] - ys[i];
            dxs.push(dx);
            dys.push(dy);
            ms.push(dy / dx);
        }
        // Get degree-1 coefficients
        var c1s = [ms[0]];
        for (var i = 0; i < dxs.length - 1; i++) {
            var m2 = ms[i];
            var mNext = ms[i + 1];
            if (m2 * mNext <= 0) {
                c1s.push(0);
            }
            else {
                dx = dxs[i];
                var dxNext = dxs[i + 1];
                var common = dx + dxNext;
                c1s.push((3 * common) / ((common + dxNext) / m2 + (common + dx) / mNext));
            }
        }
        c1s.push(ms[ms.length - 1]);
        // Get degree-2 and degree-3 coefficients
        var c2s = [];
        var c3s = [];
        var m;
        for (var i = 0; i < c1s.length - 1; i++) {
            m = ms[i];
            var c1 = c1s[i];
            var invDx = 1 / dxs[i];
            var common = c1 + c1s[i + 1] - m - m;
            c2s.push((m - c1 - common) * invDx);
            c3s.push(common * invDx * invDx);
        }
        this.xs = xs;
        this.ys = ys;
        this.c1s = c1s;
        this.c2s = c2s;
        this.c3s = c3s;
    }
    MonotonicInterpolant.prototype.interpolate = function (x) {
        var _a = this, xs = _a.xs, ys = _a.ys, c1s = _a.c1s, c2s = _a.c2s, c3s = _a.c3s;
        // The rightmost point in the dataset should give an exact result
        var i = xs.length - 1;
        if (x === xs[i]) {
            return ys[i];
        }
        // Search for the interval x is in, returning the corresponding y if x is one of the original xs
        var low = 0;
        var high = c3s.length - 1;
        var mid;
        while (low <= high) {
            mid = Math.floor(0.5 * (low + high));
            var xHere = xs[mid];
            if (xHere < x) {
                low = mid + 1;
            }
            else if (xHere > x) {
                high = mid - 1;
            }
            else {
                return ys[mid];
            }
        }
        i = Math.max(0, high);
        // Interpolate
        var diff = x - xs[i];
        var diffSq = diff * diff;
        return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq;
    };
    return MonotonicInterpolant;
}());
exports.default = MonotonicInterpolant;


/***/ }),
/* 1351 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var NativeDragSource = /** @class */ (function () {
    function NativeDragSource(config) {
        var _this = this;
        this.config = config;
        this.item = {};
        Object.keys(this.config.exposeProperties).forEach(function (property) {
            Object.defineProperty(_this.item, property, {
                configurable: true,
                enumerable: true,
                get: function () {
                    // eslint-disable-next-line no-console
                    console.warn("Browser doesn't allow reading \"" + property + "\" until the drop event.");
                    return null;
                },
            });
        });
    }
    NativeDragSource.prototype.mutateItemByReadingDataTransfer = function (dataTransfer) {
        var _this = this;
        var newProperties = {};
        if (dataTransfer) {
            Object.keys(this.config.exposeProperties).forEach(function (property) {
                newProperties[property] = {
                    value: _this.config.exposeProperties[property](dataTransfer, _this.config.matchesTypes),
                };
            });
        }
        Object.defineProperties(this.item, newProperties);
    };
    NativeDragSource.prototype.canDrag = function () {
        return true;
    };
    NativeDragSource.prototype.beginDrag = function () {
        return this.item;
    };
    NativeDragSource.prototype.isDragging = function (monitor, handle) {
        return handle === monitor.getSourceId();
    };
    NativeDragSource.prototype.endDrag = function () {
        // empty
    };
    return NativeDragSource;
}());
exports.NativeDragSource = NativeDragSource;


/***/ }),
/* 1352 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) {
    var result = typesToTry.reduce(function (resultSoFar, typeToTry) { return resultSoFar || dataTransfer.getData(typeToTry); }, '');
    return result != null ? result : defaultValue;
}
exports.getDataFromDataTransfer = getDataFromDataTransfer;


/***/ }),
/* 1353 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var nativeTypesConfig_1 = __webpack_require__(1354);
var NativeDragSource_1 = __webpack_require__(1351);
function createNativeDragSource(type) {
    return new NativeDragSource_1.NativeDragSource(nativeTypesConfig_1.nativeTypesConfig[type]);
}
exports.createNativeDragSource = createNativeDragSource;
function matchNativeItemType(dataTransfer) {
    if (!dataTransfer) {
        return null;
    }
    var dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || []);
    return (Object.keys(nativeTypesConfig_1.nativeTypesConfig).filter(function (nativeItemType) {
        var matchesTypes = nativeTypesConfig_1.nativeTypesConfig[nativeItemType].matchesTypes;
        return matchesTypes.some(function (t) { return dataTransferTypes.indexOf(t) > -1; });
    })[0] || null);
}
exports.matchNativeItemType = matchNativeItemType;


/***/ }),
/* 1354 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
var NativeTypes = __importStar(__webpack_require__(249));
var getDataFromDataTransfer_1 = __webpack_require__(1352);
exports.nativeTypesConfig = (_a = {},
    _a[NativeTypes.FILE] = {
        exposeProperties: {
            files: function (dataTransfer) {
                return Array.prototype.slice.call(dataTransfer.files);
            },
            items: function (dataTransfer) { return dataTransfer.items; },
        },
        matchesTypes: ['Files'],
    },
    _a[NativeTypes.URL] = {
        exposeProperties: {
            urls: function (dataTransfer, matchesTypes) {
                return getDataFromDataTransfer_1.getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\n');
            },
        },
        matchesTypes: ['Url', 'text/uri-list'],
    },
    _a[NativeTypes.TEXT] = {
        exposeProperties: {
            text: function (dataTransfer, matchesTypes) {
                return getDataFromDataTransfer_1.getDataFromDataTransfer(dataTransfer, matchesTypes, '');
            },
        },
        matchesTypes: ['Text', 'text/plain'],
    },
    _a);


/***/ }),
/* 1355 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var BrowserDetector_1 = __webpack_require__(376);
var MonotonicInterpolant_1 = __importDefault(__webpack_require__(1350));
var ELEMENT_NODE = 1;
function getNodeClientOffset(node) {
    var el = node.nodeType === ELEMENT_NODE ? node : node.parentElement;
    if (!el) {
        return null;
    }
    var _a = el.getBoundingClientRect(), top = _a.top, left = _a.left;
    return { x: left, y: top };
}
exports.getNodeClientOffset = getNodeClientOffset;
function getEventClientOffset(e) {
    return {
        x: e.clientX,
        y: e.clientY,
    };
}
exports.getEventClientOffset = getEventClientOffset;
function isImageNode(node) {
    return (node.nodeName === 'IMG' &&
        (BrowserDetector_1.isFirefox() || !document.documentElement.contains(node)));
}
function getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight) {
    var dragPreviewWidth = isImage ? dragPreview.width : sourceWidth;
    var dragPreviewHeight = isImage ? dragPreview.height : sourceHeight;
    // Work around @2x coordinate discrepancies in browsers
    if (BrowserDetector_1.isSafari() && isImage) {
        dragPreviewHeight /= window.devicePixelRatio;
        dragPreviewWidth /= window.devicePixelRatio;
    }
    return { dragPreviewWidth: dragPreviewWidth, dragPreviewHeight: dragPreviewHeight };
}
function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint, offsetPoint) {
    // The browsers will use the image intrinsic size under different conditions.
    // Firefox only cares if it's an image, but WebKit also wants it to be detached.
    var isImage = isImageNode(dragPreview);
    var dragPreviewNode = isImage ? sourceNode : dragPreview;
    var dragPreviewNodeOffsetFromClient = getNodeClientOffset(dragPreviewNode);
    var offsetFromDragPreview = {
        x: clientOffset.x - dragPreviewNodeOffsetFromClient.x,
        y: clientOffset.y - dragPreviewNodeOffsetFromClient.y,
    };
    var sourceWidth = sourceNode.offsetWidth, sourceHeight = sourceNode.offsetHeight;
    var anchorX = anchorPoint.anchorX, anchorY = anchorPoint.anchorY;
    var _a = getDragPreviewSize(isImage, dragPreview, sourceWidth, sourceHeight), dragPreviewWidth = _a.dragPreviewWidth, dragPreviewHeight = _a.dragPreviewHeight;
    var calculateYOffset = function () {
        var interpolantY = new MonotonicInterpolant_1.default([0, 0.5, 1], [
            // Dock to the top
            offsetFromDragPreview.y,
            // Align at the center
            (offsetFromDragPreview.y / sourceHeight) * dragPreviewHeight,
            // Dock to the bottom
            offsetFromDragPreview.y + dragPreviewHeight - sourceHeight,
        ]);
        var y = interpolantY.interpolate(anchorY);
        // Work around Safari 8 positioning bug
        if (BrowserDetector_1.isSafari() && isImage) {
            // We'll have to wait for @3x to see if this is entirely correct
            y += (window.devicePixelRatio - 1) * dragPreviewHeight;
        }
        return y;
    };
    var calculateXOffset = function () {
        // Interpolate coordinates depending on anchor point
        // If you know a simpler way to do this, let me know
        var interpolantX = new MonotonicInterpolant_1.default([0, 0.5, 1], [
            // Dock to the left
            offsetFromDragPreview.x,
            // Align at the center
            (offsetFromDragPreview.x / sourceWidth) * dragPreviewWidth,
            // Dock to the right
            offsetFromDragPreview.x + dragPreviewWidth - sourceWidth,
        ]);
        return interpolantX.interpolate(anchorX);
    };
    // Force offsets if specified in the options.
    var offsetX = offsetPoint.offsetX, offsetY = offsetPoint.offsetY;
    var isManualOffsetX = offsetX === 0 || offsetX;
    var isManualOffsetY = offsetY === 0 || offsetY;
    return {
        x: isManualOffsetX ? offsetX : calculateXOffset(),
        y: isManualOffsetY ? offsetY : calculateYOffset(),
    };
}
exports.getDragPreviewOffset = getDragPreviewOffset;


/***/ }),
/* 1356 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var OptionsReader = /** @class */ (function () {
    function OptionsReader(globalContext) {
        this.globalContext = globalContext;
    }
    Object.defineProperty(OptionsReader.prototype, "window", {
        get: function () {
            if (this.globalContext) {
                return this.globalContext;
            }
            else if (typeof window !== 'undefined') {
                return window;
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(OptionsReader.prototype, "document", {
        get: function () {
            if (this.window) {
                return this.window.document;
            }
            return undefined;
        },
        enumerable: true,
        configurable: true
    });
    return OptionsReader;
}());
exports.OptionsReader = OptionsReader;


/***/ }),
/* 1357 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var emptyImage;
function getEmptyImage() {
    if (!emptyImage) {
        emptyImage = new Image();
        emptyImage.src =
            'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
    }
    return emptyImage;
}
exports.getEmptyImage = getEmptyImage;


/***/ }),
/* 1358 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v16.8.6
 * react-dom-server.browser.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

var _assign = __webpack_require__(140);
var React = __webpack_require__(0);
var checkPropTypes = __webpack_require__(182);

/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

var validateFormat = function () {};

{
  validateFormat = function (format) {
    if (format === undefined) {
      throw new Error('invariant requires an error message argument');
    }
  };
}

function invariant(condition, format, a, b, c, d, e, f) {
  validateFormat(format);

  if (!condition) {
    var error = void 0;
    if (format === undefined) {
      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
    } else {
      var args = [a, b, c, d, e, f];
      var argIndex = 0;
      error = new Error(format.replace(/%s/g, function () {
        return args[argIndex++];
      }));
      error.name = 'Invariant Violation';
    }

    error.framesToPop = 1; // we don't care about invariant's own frame
    throw error;
  }
}

// Relying on the `invariant()` implementation lets us
// preserve the format and params in the www builds.

// TODO: this is special because it gets imported during build.

var ReactVersion = '16.8.6';

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warningWithoutStack = function () {};

{
  warningWithoutStack = function (condition, format) {
    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    if (format === undefined) {
      throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (args.length > 8) {
      // Check before the condition to catch violations early.
      throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
    }
    if (condition) {
      return;
    }
    if (typeof console !== 'undefined') {
      var argsWithFormat = args.map(function (item) {
        return '' + item;
      });
      argsWithFormat.unshift('Warning: ' + format);

      // We intentionally don't use spread (or .apply) directly because it
      // breaks IE9: https://github.com/facebook/react/issues/13610
      Function.prototype.apply.call(console.error, console, argsWithFormat);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      var argIndex = 0;
      var message = 'Warning: ' + format.replace(/%s/g, function () {
        return args[argIndex++];
      });
      throw new Error(message);
    } catch (x) {}
  };
}

var warningWithoutStack$1 = warningWithoutStack;

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;


var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;

var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;

var Resolved = 1;


function refineResolvedLazyComponent(lazyComponent) {
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }
  {
    if (typeof type.tag === 'number') {
      warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }
  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }
  if (typeof type === 'string') {
    return type;
  }
  switch (type) {
    case REACT_CONCURRENT_MODE_TYPE:
      return 'ConcurrentMode';
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';
    case REACT_PORTAL_TYPE:
      return 'Portal';
    case REACT_PROFILER_TYPE:
      return 'Profiler';
    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';
    case REACT_SUSPENSE_TYPE:
      return 'Suspense';
  }
  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        return 'Context.Consumer';
      case REACT_PROVIDER_TYPE:
        return 'Context.Provider';
      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');
      case REACT_MEMO_TYPE:
        return getComponentName(type.type);
      case REACT_LAZY_TYPE:
        {
          var thenable = type;
          var resolvedThenable = refineResolvedLazyComponent(thenable);
          if (resolvedThenable) {
            return getComponentName(resolvedThenable);
          }
        }
    }
  }
  return null;
}

/**
 * Forked from fbjs/warning:
 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
 *
 * Only change is we use console.warn instead of console.error,
 * and do nothing when 'console' is not supported.
 * This really simplifies the code.
 * ---
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var lowPriorityWarning = function () {};

{
  var printWarning = function (format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.warn(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  lowPriorityWarning = function (condition, format) {
    if (format === undefined) {
      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

var lowPriorityWarning$1 = lowPriorityWarning;

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// Prevent newer renderers from RTE when used with older react package versions.
// Current owner and dispatcher used to share the same ref,
// but PR #14548 split them out to better support the react-debug-tools package.
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
  ReactSharedInternals.ReactCurrentDispatcher = {
    current: null
  };
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warning = warningWithoutStack$1;

{
  warning = function (condition, format) {
    if (condition) {
      return;
    }
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();
    // eslint-disable-next-line react-internal/warning-and-invariant-args

    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
  };
}

var warning$1 = warning;

var BEFORE_SLASH_RE = /^(.*)[\\\/]/;

var describeComponentFrame = function (name, source, ownerName) {
  var sourceInfo = '';
  if (source) {
    var path = source.fileName;
    var fileName = path.replace(BEFORE_SLASH_RE, '');
    {
      // In DEV, include code for a common special case:
      // prefer "folder/index.js" instead of just "index.js".
      if (/^index\./.test(fileName)) {
        var match = path.match(BEFORE_SLASH_RE);
        if (match) {
          var pathBeforeSlash = match[1];
          if (pathBeforeSlash) {
            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
            fileName = folderName + '/' + fileName;
          }
        }
      }
    }
    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  } else if (ownerName) {
    sourceInfo = ' (created by ' + ownerName + ')';
  }
  return '\n    in ' + (name || 'Unknown') + sourceInfo;
};

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:


// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:


// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.


// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
var warnAboutDeprecatedLifecycles = false;

// Gather advanced timing metrics for Profiler subtrees.


// Trace which interactions trigger each commit.


// Only used in www builds.
var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties


// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.

var ReactDebugCurrentFrame$1 = void 0;
var didWarnAboutInvalidateContextType = void 0;
{
  ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
  didWarnAboutInvalidateContextType = new Set();
}

var emptyObject = {};
{
  Object.freeze(emptyObject);
}

function maskContext(type, context) {
  var contextTypes = type.contextTypes;
  if (!contextTypes) {
    return emptyObject;
  }
  var maskedContext = {};
  for (var contextName in contextTypes) {
    maskedContext[contextName] = context[contextName];
  }
  return maskedContext;
}

function checkContextTypes(typeSpecs, values, location) {
  {
    checkPropTypes(typeSpecs, values, location, 'Component', ReactDebugCurrentFrame$1.getCurrentStack);
  }
}

function validateContextBounds(context, threadID) {
  // If we don't have enough slots in this context to store this threadID,
  // fill it in without leaving any holes to ensure that the VM optimizes
  // this as non-holey index properties.
  // (Note: If `react` package is < 16.6, _threadCount is undefined.)
  for (var i = context._threadCount | 0; i <= threadID; i++) {
    // We assume that this is the same as the defaultValue which might not be
    // true if we're rendering inside a secondary renderer but they are
    // secondary because these use cases are very rare.
    context[i] = context._currentValue2;
    context._threadCount = i + 1;
  }
}

function processContext(type, context, threadID) {
  var contextType = type.contextType;
  {
    if ('contextType' in type) {
      var isValid =
      // Allow null for conditional declaration
      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>

      if (!isValid && !didWarnAboutInvalidateContextType.has(type)) {
        didWarnAboutInvalidateContextType.add(type);

        var addendum = '';
        if (contextType === undefined) {
          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
        } else if (typeof contextType !== 'object') {
          addendum = ' However, it is set to a ' + typeof contextType + '.';
        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
          addendum = ' Did you accidentally pass the Context.Provider instead?';
        } else if (contextType._context !== undefined) {
          // <Context.Consumer>
          addendum = ' Did you accidentally pass the Context.Consumer instead?';
        } else {
          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
        }
        warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);
      }
    }
  }
  if (typeof contextType === 'object' && contextType !== null) {
    validateContextBounds(contextType, threadID);
    return contextType[threadID];
  } else {
    var maskedContext = maskContext(type, context);
    {
      if (type.contextTypes) {
        checkContextTypes(type.contextTypes, maskedContext, 'context');
      }
    }
    return maskedContext;
  }
}

// Allocates a new index for each request. Tries to stay as compact as possible so that these
// indices can be used to reference a tightly packaged array. As opposed to being used in a Map.
// The first allocated index is 1.

var nextAvailableThreadIDs = new Uint16Array(16);
for (var i = 0; i < 15; i++) {
  nextAvailableThreadIDs[i] = i + 1;
}
nextAvailableThreadIDs[15] = 0;

function growThreadCountAndReturnNextAvailable() {
  var oldArray = nextAvailableThreadIDs;
  var oldSize = oldArray.length;
  var newSize = oldSize * 2;
  !(newSize <= 0x10000) ? invariant(false, 'Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.') : void 0;
  var newArray = new Uint16Array(newSize);
  newArray.set(oldArray);
  nextAvailableThreadIDs = newArray;
  nextAvailableThreadIDs[0] = oldSize + 1;
  for (var _i = oldSize; _i < newSize - 1; _i++) {
    nextAvailableThreadIDs[_i] = _i + 1;
  }
  nextAvailableThreadIDs[newSize - 1] = 0;
  return oldSize;
}

function allocThreadID() {
  var nextID = nextAvailableThreadIDs[0];
  if (nextID === 0) {
    return growThreadCountAndReturnNextAvailable();
  }
  nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID];
  return nextID;
}

function freeThreadID(id) {
  nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0];
  nextAvailableThreadIDs[0] = id;
}

// A reserved attribute.
// It is handled by React separately and shouldn't be written to the DOM.
var RESERVED = 0;

// A simple string attribute.
// Attributes that aren't in the whitelist are presumed to have this type.
var STRING = 1;

// A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.
var BOOLEANISH_STRING = 2;

// A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
var BOOLEAN = 3;

// An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.
var OVERLOADED_BOOLEAN = 4;

// An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.
var NUMERIC = 5;

// An attribute that must be positive numeric or parse as a positive numeric.
// When falsy, it should be removed.
var POSITIVE_NUMERIC = 6;

/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
/* eslint-enable max-len */
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';


var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');

var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};

function isAttributeNameSafe(attributeName) {
  if (hasOwnProperty$1.call(validatedAttributeNameCache, attributeName)) {
    return true;
  }
  if (hasOwnProperty$1.call(illegalAttributeNameCache, attributeName)) {
    return false;
  }
  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
    validatedAttributeNameCache[attributeName] = true;
    return true;
  }
  illegalAttributeNameCache[attributeName] = true;
  {
    warning$1(false, 'Invalid attribute name: `%s`', attributeName);
  }
  return false;
}

function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null) {
    return propertyInfo.type === RESERVED;
  }
  if (isCustomComponentTag) {
    return false;
  }
  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
    return true;
  }
  return false;
}

function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null && propertyInfo.type === RESERVED) {
    return false;
  }
  switch (typeof value) {
    case 'function':
    // $FlowIssue symbol is perfectly valid here
    case 'symbol':
      // eslint-disable-line
      return true;
    case 'boolean':
      {
        if (isCustomComponentTag) {
          return false;
        }
        if (propertyInfo !== null) {
          return !propertyInfo.acceptsBooleans;
        } else {
          var prefix = name.toLowerCase().slice(0, 5);
          return prefix !== 'data-' && prefix !== 'aria-';
        }
      }
    default:
      return false;
  }
}

function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  if (value === null || typeof value === 'undefined') {
    return true;
  }
  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
    return true;
  }
  if (isCustomComponentTag) {
    return false;
  }
  if (propertyInfo !== null) {
    switch (propertyInfo.type) {
      case BOOLEAN:
        return !value;
      case OVERLOADED_BOOLEAN:
        return value === false;
      case NUMERIC:
        return isNaN(value);
      case POSITIVE_NUMERIC:
        return isNaN(value) || value < 1;
    }
  }
  return false;
}

function getPropertyInfo(name) {
  return properties.hasOwnProperty(name) ? properties[name] : null;
}

function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  this.attributeName = attributeName;
  this.attributeNamespace = attributeNamespace;
  this.mustUseProperty = mustUseProperty;
  this.propertyName = name;
  this.type = type;
}

// When adding attributes to this list, be sure to also add them to
// the `possibleStandardNames` module to ensure casing and incorrect
// name warnings.
var properties = {};

// These props are reserved by React. They shouldn't be written to the DOM.
['children', 'dangerouslySetInnerHTML',
// TODO: This prevents the assignment of defaultValue to regular
// elements (not just inputs). Now that ReactDOMInput assigns to the
// defaultValue property -- do we need this?
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names.
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  var name = _ref[0],
      attributeName = _ref[1];

  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, // attributeName
  null);
} // attributeNamespace
);

// These are "enumerated" HTML attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

// These are "enumerated" SVG attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
// Since these are SVG attributes, their attribute names are case-sensitive.
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML boolean attributes.
['allowFullScreen', 'async',
// Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
// Microdata
'itemScope'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

// These are the few React props that we set as DOM properties
// rather than attributes. These are all booleans.
['checked',
// Note: `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`. We have special logic for handling this.
'multiple', 'muted', 'selected'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML attributes that are "overloaded booleans": they behave like
// booleans, but can also accept a string value.
['capture', 'download'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML attributes that must be positive numbers.
['cols', 'rows', 'size', 'span'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML attributes that must be numbers.
['rowSpan', 'start'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

var CAMELIZE = /[\-\:]([a-z])/g;
var capitalize = function (token) {
  return token[1].toUpperCase();
};

// This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML whitelist.
// Some of these attributes can be hard to find. This list was created by
// scrapping the MDN documentation.
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, null);
} // attributeNamespace
);

// String SVG attributes with the xlink namespace.
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/1999/xlink');
});

// String SVG attributes with the xml namespace.
['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/XML/1998/namespace');
});

// These attribute exists both in HTML and SVG.
// The attribute name is case-sensitive in SVG so we can't just use
// the React name like we do for attributes that exist only in HTML.
['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

// code copied and modified from escape-html
/**
 * Module variables.
 * @private
 */

var matchHtmlRegExp = /["'&<>]/;

/**
 * Escapes special characters and HTML entities in a given html string.
 *
 * @param  {string} string HTML string to escape for later insertion
 * @return {string}
 * @public
 */

function escapeHtml(string) {
  var str = '' + string;
  var match = matchHtmlRegExp.exec(str);

  if (!match) {
    return str;
  }

  var escape = void 0;
  var html = '';
  var index = void 0;
  var lastIndex = 0;

  for (index = match.index; index < str.length; index++) {
    switch (str.charCodeAt(index)) {
      case 34:
        // "
        escape = '&quot;';
        break;
      case 38:
        // &
        escape = '&amp;';
        break;
      case 39:
        // '
        escape = '&#x27;'; // modified from escape-html; used to be '&#39'
        break;
      case 60:
        // <
        escape = '&lt;';
        break;
      case 62:
        // >
        escape = '&gt;';
        break;
      default:
        continue;
    }

    if (lastIndex !== index) {
      html += str.substring(lastIndex, index);
    }

    lastIndex = index + 1;
    html += escape;
  }

  return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
}
// end code copied and modified from escape-html

/**
 * Escapes text to prevent scripting attacks.
 *
 * @param {*} text Text value to escape.
 * @return {string} An escaped string.
 */
function escapeTextForBrowser(text) {
  if (typeof text === 'boolean' || typeof text === 'number') {
    // this shortcircuit helps perf for types that we know will never have
    // special characters, especially given that this function is used often
    // for numeric dom ids.
    return '' + text;
  }
  return escapeHtml(text);
}

/**
 * Escapes attribute value to prevent scripting attacks.
 *
 * @param {*} value Value to escape.
 * @return {string} An escaped string.
 */
function quoteAttributeValueForBrowser(value) {
  return '"' + escapeTextForBrowser(value) + '"';
}

/**
 * Operations for dealing with DOM properties.
 */

/**
 * Creates markup for the ID property.
 *
 * @param {string} id Unescaped ID.
 * @return {string} Markup string.
 */


function createMarkupForRoot() {
  return ROOT_ATTRIBUTE_NAME + '=""';
}

/**
 * Creates markup for a property.
 *
 * @param {string} name
 * @param {*} value
 * @return {?string} Markup string, or null if the property was invalid.
 */
function createMarkupForProperty(name, value) {
  var propertyInfo = getPropertyInfo(name);
  if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {
    return '';
  }
  if (shouldRemoveAttribute(name, value, propertyInfo, false)) {
    return '';
  }
  if (propertyInfo !== null) {
    var attributeName = propertyInfo.attributeName;
    var type = propertyInfo.type;

    if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {
      return attributeName + '=""';
    } else {
      return attributeName + '=' + quoteAttributeValueForBrowser(value);
    }
  } else if (isAttributeNameSafe(name)) {
    return name + '=' + quoteAttributeValueForBrowser(value);
  }
  return '';
}

/**
 * Creates markup for a custom property.
 *
 * @param {string} name
 * @param {*} value
 * @return {string} Markup string, or empty string if the property was invalid.
 */
function createMarkupForCustomAttribute(name, value) {
  if (!isAttributeNameSafe(name) || value == null) {
    return '';
  }
  return name + '=' + quoteAttributeValueForBrowser(value);
}

/**
 * inlined Object.is polyfill to avoid requiring consumers ship their own
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
 */
function is(x, y) {
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  ;
}

var currentlyRenderingComponent = null;
var firstWorkInProgressHook = null;
var workInProgressHook = null;
// Whether the work-in-progress hook is a re-rendered hook
var isReRender = false;
// Whether an update was scheduled during the currently executing render pass.
var didScheduleRenderPhaseUpdate = false;
// Lazily created map of render-phase updates
var renderPhaseUpdates = null;
// Counter to prevent infinite loops.
var numberOfReRenders = 0;
var RE_RENDER_LIMIT = 25;

var isInHookUserCodeInDev = false;

// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = void 0;

function resolveCurrentlyRenderingComponent() {
  !(currentlyRenderingComponent !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0;
  {
    !!isInHookUserCodeInDev ? warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks') : void 0;
  }
  return currentlyRenderingComponent;
}

function areHookInputsEqual(nextDeps, prevDeps) {
  if (prevDeps === null) {
    {
      warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
    }
    return false;
  }

  {
    // Don't bother comparing lengths in prod because these arrays should be
    // passed inline.
    if (nextDeps.length !== prevDeps.length) {
      warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, '[' + nextDeps.join(', ') + ']', '[' + prevDeps.join(', ') + ']');
    }
  }
  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
    if (is(nextDeps[i], prevDeps[i])) {
      continue;
    }
    return false;
  }
  return true;
}

function createHook() {
  if (numberOfReRenders > 0) {
    invariant(false, 'Rendered more hooks than during the previous render');
  }
  return {
    memoizedState: null,
    queue: null,
    next: null
  };
}

function createWorkInProgressHook() {
  if (workInProgressHook === null) {
    // This is the first hook in the list
    if (firstWorkInProgressHook === null) {
      isReRender = false;
      firstWorkInProgressHook = workInProgressHook = createHook();
    } else {
      // There's already a work-in-progress. Reuse it.
      isReRender = true;
      workInProgressHook = firstWorkInProgressHook;
    }
  } else {
    if (workInProgressHook.next === null) {
      isReRender = false;
      // Append to the end of the list
      workInProgressHook = workInProgressHook.next = createHook();
    } else {
      // There's already a work-in-progress. Reuse it.
      isReRender = true;
      workInProgressHook = workInProgressHook.next;
    }
  }
  return workInProgressHook;
}

function prepareToUseHooks(componentIdentity) {
  currentlyRenderingComponent = componentIdentity;
  {
    isInHookUserCodeInDev = false;
  }

  // The following should have already been reset
  // didScheduleRenderPhaseUpdate = false;
  // firstWorkInProgressHook = null;
  // numberOfReRenders = 0;
  // renderPhaseUpdates = null;
  // workInProgressHook = null;
}

function finishHooks(Component, props, children, refOrContext) {
  // This must be called after every function component to prevent hooks from
  // being used in classes.

  while (didScheduleRenderPhaseUpdate) {
    // Updates were scheduled during the render phase. They are stored in
    // the `renderPhaseUpdates` map. Call the component again, reusing the
    // work-in-progress hooks and applying the additional updates on top. Keep
    // restarting until no more updates are scheduled.
    didScheduleRenderPhaseUpdate = false;
    numberOfReRenders += 1;

    // Start over from the beginning of the list
    workInProgressHook = null;

    children = Component(props, refOrContext);
  }
  currentlyRenderingComponent = null;
  firstWorkInProgressHook = null;
  numberOfReRenders = 0;
  renderPhaseUpdates = null;
  workInProgressHook = null;
  {
    isInHookUserCodeInDev = false;
  }

  // These were reset above
  // currentlyRenderingComponent = null;
  // didScheduleRenderPhaseUpdate = false;
  // firstWorkInProgressHook = null;
  // numberOfReRenders = 0;
  // renderPhaseUpdates = null;
  // workInProgressHook = null;

  return children;
}

function readContext(context, observedBits) {
  var threadID = currentThreadID;
  validateContextBounds(context, threadID);
  {
    !!isInHookUserCodeInDev ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
  }
  return context[threadID];
}

function useContext(context, observedBits) {
  {
    currentHookNameInDev = 'useContext';
  }
  resolveCurrentlyRenderingComponent();
  var threadID = currentThreadID;
  validateContextBounds(context, threadID);
  return context[threadID];
}

function basicStateReducer(state, action) {
  return typeof action === 'function' ? action(state) : action;
}

function useState(initialState) {
  {
    currentHookNameInDev = 'useState';
  }
  return useReducer(basicStateReducer,
  // useReducer has a special case to support lazy useState initializers
  initialState);
}

function useReducer(reducer, initialArg, init) {
  {
    if (reducer !== basicStateReducer) {
      currentHookNameInDev = 'useReducer';
    }
  }
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  workInProgressHook = createWorkInProgressHook();
  if (isReRender) {
    // This is a re-render. Apply the new render phase updates to the previous
    var _queue = workInProgressHook.queue;
    var _dispatch = _queue.dispatch;
    if (renderPhaseUpdates !== null) {
      // Render phase updates are stored in a map of queue -> linked list
      var firstRenderPhaseUpdate = renderPhaseUpdates.get(_queue);
      if (firstRenderPhaseUpdate !== undefined) {
        renderPhaseUpdates.delete(_queue);
        var newState = workInProgressHook.memoizedState;
        var update = firstRenderPhaseUpdate;
        do {
          // Process this render phase update. We don't have to check the
          // priority because it will always be the same as the current
          // render's.
          var _action = update.action;
          {
            isInHookUserCodeInDev = true;
          }
          newState = reducer(newState, _action);
          {
            isInHookUserCodeInDev = false;
          }
          update = update.next;
        } while (update !== null);

        workInProgressHook.memoizedState = newState;

        return [newState, _dispatch];
      }
    }
    return [workInProgressHook.memoizedState, _dispatch];
  } else {
    {
      isInHookUserCodeInDev = true;
    }
    var initialState = void 0;
    if (reducer === basicStateReducer) {
      // Special case for `useState`.
      initialState = typeof initialArg === 'function' ? initialArg() : initialArg;
    } else {
      initialState = init !== undefined ? init(initialArg) : initialArg;
    }
    {
      isInHookUserCodeInDev = false;
    }
    workInProgressHook.memoizedState = initialState;
    var _queue2 = workInProgressHook.queue = {
      last: null,
      dispatch: null
    };
    var _dispatch2 = _queue2.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue2);
    return [workInProgressHook.memoizedState, _dispatch2];
  }
}

function useMemo(nextCreate, deps) {
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  workInProgressHook = createWorkInProgressHook();

  var nextDeps = deps === undefined ? null : deps;

  if (workInProgressHook !== null) {
    var prevState = workInProgressHook.memoizedState;
    if (prevState !== null) {
      if (nextDeps !== null) {
        var prevDeps = prevState[1];
        if (areHookInputsEqual(nextDeps, prevDeps)) {
          return prevState[0];
        }
      }
    }
  }

  {
    isInHookUserCodeInDev = true;
  }
  var nextValue = nextCreate();
  {
    isInHookUserCodeInDev = false;
  }
  workInProgressHook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function useRef(initialValue) {
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
  workInProgressHook = createWorkInProgressHook();
  var previousRef = workInProgressHook.memoizedState;
  if (previousRef === null) {
    var ref = { current: initialValue };
    {
      Object.seal(ref);
    }
    workInProgressHook.memoizedState = ref;
    return ref;
  } else {
    return previousRef;
  }
}

function useLayoutEffect(create, inputs) {
  {
    currentHookNameInDev = 'useLayoutEffect';
  }
  warning$1(false, 'useLayoutEffect does nothing on the server, because its effect cannot ' + "be encoded into the server renderer's output format. This will lead " + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://fb.me/react-uselayouteffect-ssr for common fixes.');
}

function dispatchAction(componentIdentity, queue, action) {
  !(numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0;

  if (componentIdentity === currentlyRenderingComponent) {
    // This is a render phase update. Stash it in a lazily-created map of
    // queue -> linked list of updates. After this render pass, we'll restart
    // and apply the stashed updates on top of the work-in-progress hook.
    didScheduleRenderPhaseUpdate = true;
    var update = {
      action: action,
      next: null
    };
    if (renderPhaseUpdates === null) {
      renderPhaseUpdates = new Map();
    }
    var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
    if (firstRenderPhaseUpdate === undefined) {
      renderPhaseUpdates.set(queue, update);
    } else {
      // Append the update to the end of the list.
      var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
      while (lastRenderPhaseUpdate.next !== null) {
        lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
      }
      lastRenderPhaseUpdate.next = update;
    }
  } else {
    // This means an update has happened after the function component has
    // returned. On the server this is a no-op. In React Fiber, the update
    // would be scheduled for a future render.
  }
}

function useCallback(callback, deps) {
  // Callbacks are passed as they are in the server environment.
  return callback;
}

function noop() {}

var currentThreadID = 0;

function setCurrentThreadID(threadID) {
  currentThreadID = threadID;
}

var Dispatcher = {
  readContext: readContext,
  useContext: useContext,
  useMemo: useMemo,
  useReducer: useReducer,
  useRef: useRef,
  useState: useState,
  useLayoutEffect: useLayoutEffect,
  useCallback: useCallback,
  // useImperativeHandle is not run in the server environment
  useImperativeHandle: noop,
  // Effects are not run in the server environment.
  useEffect: noop,
  // Debugging effect
  useDebugValue: noop
};

var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';

var Namespaces = {
  html: HTML_NAMESPACE,
  mathml: MATH_NAMESPACE,
  svg: SVG_NAMESPACE
};

// Assumes there is no parent namespace.
function getIntrinsicNamespace(type) {
  switch (type) {
    case 'svg':
      return SVG_NAMESPACE;
    case 'math':
      return MATH_NAMESPACE;
    default:
      return HTML_NAMESPACE;
  }
}

function getChildNamespace(parentNamespace, type) {
  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {
    // No (or default) parent namespace: potential entry point.
    return getIntrinsicNamespace(type);
  }
  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
    // We're leaving SVG.
    return HTML_NAMESPACE;
  }
  // By default, pass namespace below.
  return parentNamespace;
}

var ReactDebugCurrentFrame$2 = null;

var ReactControlledValuePropTypes = {
  checkPropTypes: null
};

{
  ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;

  var hasReadOnlyValue = {
    button: true,
    checkbox: true,
    image: true,
    hidden: true,
    radio: true,
    reset: true,
    submit: true
  };

  var propTypes = {
    value: function (props, propName, componentName) {
      if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
        return null;
      }
      return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    },
    checked: function (props, propName, componentName) {
      if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
        return null;
      }
      return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }
  };

  /**
   * Provide a linked `value` attribute for controlled forms. You should not use
   * this outside of the ReactDOM controlled form components.
   */
  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
    checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
  };
}

// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special-case tags.

var omittedCloseTags = {
  area: true,
  base: true,
  br: true,
  col: true,
  embed: true,
  hr: true,
  img: true,
  input: true,
  keygen: true,
  link: true,
  meta: true,
  param: true,
  source: true,
  track: true,
  wbr: true
  // NOTE: menuitem's close tag should be omitted, but that causes problems.
};

// For HTML, certain tags cannot have children. This has the same purpose as
// `omittedCloseTags` except that `menuitem` should still have its closing tag.

var voidElementTags = _assign({
  menuitem: true
}, omittedCloseTags);

// TODO: We can remove this if we add invariantWithStack()
// or add stack by default to invariants where possible.
var HTML = '__html';

var ReactDebugCurrentFrame$3 = null;
{
  ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
}

function assertValidProps(tag, props) {
  if (!props) {
    return;
  }
  // Note the use of `==` which checks for null or undefined.
  if (voidElementTags[tag]) {
    !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, ReactDebugCurrentFrame$3.getStackAddendum()) : void 0;
  }
  if (props.dangerouslySetInnerHTML != null) {
    !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
    !(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
  }
  {
    !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
  }
  !(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', ReactDebugCurrentFrame$3.getStackAddendum()) : void 0;
}

/**
 * CSS properties which accept numbers but are not in units of "px".
 */
var isUnitlessNumber = {
  animationIterationCount: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridArea: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,

  // SVG-related properties
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
};

/**
 * @param {string} prefix vendor-specific prefix, eg: Webkit
 * @param {string} key style name, eg: transitionDuration
 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
 * WebkitTransitionDuration
 */
function prefixKey(prefix, key) {
  return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}

/**
 * Support style names that may come passed in prefixed by adding permutations
 * of vendor prefixes.
 */
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];

// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function (prop) {
  prefixes.forEach(function (prefix) {
    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  });
});

/**
 * Convert a value into the proper css writable value. The style name `name`
 * should be logical (no hyphens), as specified
 * in `CSSProperty.isUnitlessNumber`.
 *
 * @param {string} name CSS property name such as `topMargin`.
 * @param {*} value CSS property value such as `10px`.
 * @return {string} Normalized style value with dimensions applied.
 */
function dangerousStyleValue(name, value, isCustomProperty) {
  // Note that we've removed escapeTextForBrowser() calls here since the
  // whole string will be escaped when the attribute is injected into
  // the markup. If you provide unsafe user data here they can inject
  // arbitrary CSS which may be problematic (I couldn't repro this):
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  // This is not an XSS hole but instead a potential CSS injection issue
  // which has lead to a greater discussion about how we're going to
  // trust URLs moving forward. See #2115901

  var isEmpty = value == null || typeof value === 'boolean' || value === '';
  if (isEmpty) {
    return '';
  }

  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  }

  return ('' + value).trim();
}

var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;

/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 */
function hyphenateStyleName(name) {
  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}

function isCustomComponent(tagName, props) {
  if (tagName.indexOf('-') === -1) {
    return typeof props.is === 'string';
  }
  switch (tagName) {
    // These are reserved SVG and MathML elements.
    // We don't mind this whitelist too much because we expect it to never grow.
    // The alternative is to track the namespace in a few places which is convoluted.
    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
    case 'annotation-xml':
    case 'color-profile':
    case 'font-face':
    case 'font-face-src':
    case 'font-face-uri':
    case 'font-face-format':
    case 'font-face-name':
    case 'missing-glyph':
      return false;
    default:
      return true;
  }
}

var warnValidStyle = function () {};

{
  // 'msTransform' is correct, but the other prefixes should be capitalized
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  var msPattern$1 = /^-ms-/;
  var hyphenPattern = /-(.)/g;

  // style values shouldn't contain a semicolon
  var badStyleValueWithSemicolonPattern = /;\s*$/;

  var warnedStyleNames = {};
  var warnedStyleValues = {};
  var warnedForNaNValue = false;
  var warnedForInfinityValue = false;

  var camelize = function (string) {
    return string.replace(hyphenPattern, function (_, character) {
      return character.toUpperCase();
    });
  };

  var warnHyphenatedStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;
    warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
    // As Andi Smith suggests
    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
    // is converted to lowercase `ms`.
    camelize(name.replace(msPattern$1, 'ms-')));
  };

  var warnBadVendoredStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;
    warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  };

  var warnStyleValueWithSemicolon = function (name, value) {
    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
      return;
    }

    warnedStyleValues[value] = true;
    warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  };

  var warnStyleValueIsNaN = function (name, value) {
    if (warnedForNaNValue) {
      return;
    }

    warnedForNaNValue = true;
    warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
  };

  var warnStyleValueIsInfinity = function (name, value) {
    if (warnedForInfinityValue) {
      return;
    }

    warnedForInfinityValue = true;
    warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
  };

  warnValidStyle = function (name, value) {
    if (name.indexOf('-') > -1) {
      warnHyphenatedStyleName(name);
    } else if (badVendoredStyleNamePattern.test(name)) {
      warnBadVendoredStyleName(name);
    } else if (badStyleValueWithSemicolonPattern.test(value)) {
      warnStyleValueWithSemicolon(name, value);
    }

    if (typeof value === 'number') {
      if (isNaN(value)) {
        warnStyleValueIsNaN(name, value);
      } else if (!isFinite(value)) {
        warnStyleValueIsInfinity(name, value);
      }
    }
  };
}

var warnValidStyle$1 = warnValidStyle;

var ariaProperties = {
  'aria-current': 0, // state
  'aria-details': 0,
  'aria-disabled': 0, // state
  'aria-hidden': 0, // state
  'aria-invalid': 0, // state
  'aria-keyshortcuts': 0,
  'aria-label': 0,
  'aria-roledescription': 0,
  // Widget Attributes
  'aria-autocomplete': 0,
  'aria-checked': 0,
  'aria-expanded': 0,
  'aria-haspopup': 0,
  'aria-level': 0,
  'aria-modal': 0,
  'aria-multiline': 0,
  'aria-multiselectable': 0,
  'aria-orientation': 0,
  'aria-placeholder': 0,
  'aria-pressed': 0,
  'aria-readonly': 0,
  'aria-required': 0,
  'aria-selected': 0,
  'aria-sort': 0,
  'aria-valuemax': 0,
  'aria-valuemin': 0,
  'aria-valuenow': 0,
  'aria-valuetext': 0,
  // Live Region Attributes
  'aria-atomic': 0,
  'aria-busy': 0,
  'aria-live': 0,
  'aria-relevant': 0,
  // Drag-and-Drop Attributes
  'aria-dropeffect': 0,
  'aria-grabbed': 0,
  // Relationship Attributes
  'aria-activedescendant': 0,
  'aria-colcount': 0,
  'aria-colindex': 0,
  'aria-colspan': 0,
  'aria-controls': 0,
  'aria-describedby': 0,
  'aria-errormessage': 0,
  'aria-flowto': 0,
  'aria-labelledby': 0,
  'aria-owns': 0,
  'aria-posinset': 0,
  'aria-rowcount': 0,
  'aria-rowindex': 0,
  'aria-rowspan': 0,
  'aria-setsize': 0
};

var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

var hasOwnProperty$2 = Object.prototype.hasOwnProperty;

function validateProperty(tagName, name) {
  if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
    return true;
  }

  if (rARIACamel.test(name)) {
    var ariaName = 'aria-' + name.slice(4).toLowerCase();
    var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;

    // If this is an aria-* attribute, but is not listed in the known DOM
    // DOM properties, then it is an invalid aria-* attribute.
    if (correctName == null) {
      warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
      warnedProperties[name] = true;
      return true;
    }
    // aria-* attributes should be lowercase; suggest the lowercase version.
    if (name !== correctName) {
      warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
      warnedProperties[name] = true;
      return true;
    }
  }

  if (rARIA.test(name)) {
    var lowerCasedName = name.toLowerCase();
    var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;

    // If this is an aria-* attribute, but is not listed in the known DOM
    // DOM properties, then it is an invalid aria-* attribute.
    if (standardName == null) {
      warnedProperties[name] = true;
      return false;
    }
    // aria-* attributes should be lowercase; suggest the lowercase version.
    if (name !== standardName) {
      warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
      warnedProperties[name] = true;
      return true;
    }
  }

  return true;
}

function warnInvalidARIAProps(type, props) {
  var invalidProps = [];

  for (var key in props) {
    var isValid = validateProperty(type, key);
    if (!isValid) {
      invalidProps.push(key);
    }
  }

  var unknownPropString = invalidProps.map(function (prop) {
    return '`' + prop + '`';
  }).join(', ');

  if (invalidProps.length === 1) {
    warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  } else if (invalidProps.length > 1) {
    warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  }
}

function validateProperties(type, props) {
  if (isCustomComponent(type, props)) {
    return;
  }
  warnInvalidARIAProps(type, props);
}

var didWarnValueNull = false;

function validateProperties$1(type, props) {
  if (type !== 'input' && type !== 'textarea' && type !== 'select') {
    return;
  }

  if (props != null && props.value === null && !didWarnValueNull) {
    didWarnValueNull = true;
    if (type === 'select' && props.multiple) {
      warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
    } else {
      warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
    }
  }
}

/**
 * Registers plugins so that they can extract and dispatch events.
 *
 * @see {EventPluginHub}
 */

/**
 * Ordered list of injected plugins.
 */


/**
 * Mapping from event name to dispatch config
 */


/**
 * Mapping from registration name to plugin module
 */
var registrationNameModules = {};

/**
 * Mapping from registration name to event name
 */


/**
 * Mapping from lowercase registration names to the properly cased version,
 * used to warn in the case of missing event handlers. Available
 * only in true.
 * @type {Object}
 */
var possibleRegistrationNames = {};
// Trust the developer to only use possibleRegistrationNames in true

/**
 * Injects an ordering of plugins (by plugin name). This allows the ordering
 * to be decoupled from injection of the actual plugins so that ordering is
 * always deterministic regardless of packaging, on-the-fly injection, etc.
 *
 * @param {array} InjectedEventPluginOrder
 * @internal
 * @see {EventPluginHub.injection.injectEventPluginOrder}
 */


/**
 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
 * in the ordering injected by `injectEventPluginOrder`.
 *
 * Plugins can be injected as part of page initialization or on-the-fly.
 *
 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
 * @internal
 * @see {EventPluginHub.injection.injectEventPluginsByName}
 */

// When adding attributes to the HTML or SVG whitelist, be sure to
// also add them to this module to ensure casing and incorrect name
// warnings.
var possibleStandardNames = {
  // HTML
  accept: 'accept',
  acceptcharset: 'acceptCharset',
  'accept-charset': 'acceptCharset',
  accesskey: 'accessKey',
  action: 'action',
  allowfullscreen: 'allowFullScreen',
  alt: 'alt',
  as: 'as',
  async: 'async',
  autocapitalize: 'autoCapitalize',
  autocomplete: 'autoComplete',
  autocorrect: 'autoCorrect',
  autofocus: 'autoFocus',
  autoplay: 'autoPlay',
  autosave: 'autoSave',
  capture: 'capture',
  cellpadding: 'cellPadding',
  cellspacing: 'cellSpacing',
  challenge: 'challenge',
  charset: 'charSet',
  checked: 'checked',
  children: 'children',
  cite: 'cite',
  class: 'className',
  classid: 'classID',
  classname: 'className',
  cols: 'cols',
  colspan: 'colSpan',
  content: 'content',
  contenteditable: 'contentEditable',
  contextmenu: 'contextMenu',
  controls: 'controls',
  controlslist: 'controlsList',
  coords: 'coords',
  crossorigin: 'crossOrigin',
  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  data: 'data',
  datetime: 'dateTime',
  default: 'default',
  defaultchecked: 'defaultChecked',
  defaultvalue: 'defaultValue',
  defer: 'defer',
  dir: 'dir',
  disabled: 'disabled',
  download: 'download',
  draggable: 'draggable',
  enctype: 'encType',
  for: 'htmlFor',
  form: 'form',
  formmethod: 'formMethod',
  formaction: 'formAction',
  formenctype: 'formEncType',
  formnovalidate: 'formNoValidate',
  formtarget: 'formTarget',
  frameborder: 'frameBorder',
  headers: 'headers',
  height: 'height',
  hidden: 'hidden',
  high: 'high',
  href: 'href',
  hreflang: 'hrefLang',
  htmlfor: 'htmlFor',
  httpequiv: 'httpEquiv',
  'http-equiv': 'httpEquiv',
  icon: 'icon',
  id: 'id',
  innerhtml: 'innerHTML',
  inputmode: 'inputMode',
  integrity: 'integrity',
  is: 'is',
  itemid: 'itemID',
  itemprop: 'itemProp',
  itemref: 'itemRef',
  itemscope: 'itemScope',
  itemtype: 'itemType',
  keyparams: 'keyParams',
  keytype: 'keyType',
  kind: 'kind',
  label: 'label',
  lang: 'lang',
  list: 'list',
  loop: 'loop',
  low: 'low',
  manifest: 'manifest',
  marginwidth: 'marginWidth',
  marginheight: 'marginHeight',
  max: 'max',
  maxlength: 'maxLength',
  media: 'media',
  mediagroup: 'mediaGroup',
  method: 'method',
  min: 'min',
  minlength: 'minLength',
  multiple: 'multiple',
  muted: 'muted',
  name: 'name',
  nomodule: 'noModule',
  nonce: 'nonce',
  novalidate: 'noValidate',
  open: 'open',
  optimum: 'optimum',
  pattern: 'pattern',
  placeholder: 'placeholder',
  playsinline: 'playsInline',
  poster: 'poster',
  preload: 'preload',
  profile: 'profile',
  radiogroup: 'radioGroup',
  readonly: 'readOnly',
  referrerpolicy: 'referrerPolicy',
  rel: 'rel',
  required: 'required',
  reversed: 'reversed',
  role: 'role',
  rows: 'rows',
  rowspan: 'rowSpan',
  sandbox: 'sandbox',
  scope: 'scope',
  scoped: 'scoped',
  scrolling: 'scrolling',
  seamless: 'seamless',
  selected: 'selected',
  shape: 'shape',
  size: 'size',
  sizes: 'sizes',
  span: 'span',
  spellcheck: 'spellCheck',
  src: 'src',
  srcdoc: 'srcDoc',
  srclang: 'srcLang',
  srcset: 'srcSet',
  start: 'start',
  step: 'step',
  style: 'style',
  summary: 'summary',
  tabindex: 'tabIndex',
  target: 'target',
  title: 'title',
  type: 'type',
  usemap: 'useMap',
  value: 'value',
  width: 'width',
  wmode: 'wmode',
  wrap: 'wrap',

  // SVG
  about: 'about',
  accentheight: 'accentHeight',
  'accent-height': 'accentHeight',
  accumulate: 'accumulate',
  additive: 'additive',
  alignmentbaseline: 'alignmentBaseline',
  'alignment-baseline': 'alignmentBaseline',
  allowreorder: 'allowReorder',
  alphabetic: 'alphabetic',
  amplitude: 'amplitude',
  arabicform: 'arabicForm',
  'arabic-form': 'arabicForm',
  ascent: 'ascent',
  attributename: 'attributeName',
  attributetype: 'attributeType',
  autoreverse: 'autoReverse',
  azimuth: 'azimuth',
  basefrequency: 'baseFrequency',
  baselineshift: 'baselineShift',
  'baseline-shift': 'baselineShift',
  baseprofile: 'baseProfile',
  bbox: 'bbox',
  begin: 'begin',
  bias: 'bias',
  by: 'by',
  calcmode: 'calcMode',
  capheight: 'capHeight',
  'cap-height': 'capHeight',
  clip: 'clip',
  clippath: 'clipPath',
  'clip-path': 'clipPath',
  clippathunits: 'clipPathUnits',
  cliprule: 'clipRule',
  'clip-rule': 'clipRule',
  color: 'color',
  colorinterpolation: 'colorInterpolation',
  'color-interpolation': 'colorInterpolation',
  colorinterpolationfilters: 'colorInterpolationFilters',
  'color-interpolation-filters': 'colorInterpolationFilters',
  colorprofile: 'colorProfile',
  'color-profile': 'colorProfile',
  colorrendering: 'colorRendering',
  'color-rendering': 'colorRendering',
  contentscripttype: 'contentScriptType',
  contentstyletype: 'contentStyleType',
  cursor: 'cursor',
  cx: 'cx',
  cy: 'cy',
  d: 'd',
  datatype: 'datatype',
  decelerate: 'decelerate',
  descent: 'descent',
  diffuseconstant: 'diffuseConstant',
  direction: 'direction',
  display: 'display',
  divisor: 'divisor',
  dominantbaseline: 'dominantBaseline',
  'dominant-baseline': 'dominantBaseline',
  dur: 'dur',
  dx: 'dx',
  dy: 'dy',
  edgemode: 'edgeMode',
  elevation: 'elevation',
  enablebackground: 'enableBackground',
  'enable-background': 'enableBackground',
  end: 'end',
  exponent: 'exponent',
  externalresourcesrequired: 'externalResourcesRequired',
  fill: 'fill',
  fillopacity: 'fillOpacity',
  'fill-opacity': 'fillOpacity',
  fillrule: 'fillRule',
  'fill-rule': 'fillRule',
  filter: 'filter',
  filterres: 'filterRes',
  filterunits: 'filterUnits',
  floodopacity: 'floodOpacity',
  'flood-opacity': 'floodOpacity',
  floodcolor: 'floodColor',
  'flood-color': 'floodColor',
  focusable: 'focusable',
  fontfamily: 'fontFamily',
  'font-family': 'fontFamily',
  fontsize: 'fontSize',
  'font-size': 'fontSize',
  fontsizeadjust: 'fontSizeAdjust',
  'font-size-adjust': 'fontSizeAdjust',
  fontstretch: 'fontStretch',
  'font-stretch': 'fontStretch',
  fontstyle: 'fontStyle',
  'font-style': 'fontStyle',
  fontvariant: 'fontVariant',
  'font-variant': 'fontVariant',
  fontweight: 'fontWeight',
  'font-weight': 'fontWeight',
  format: 'format',
  from: 'from',
  fx: 'fx',
  fy: 'fy',
  g1: 'g1',
  g2: 'g2',
  glyphname: 'glyphName',
  'glyph-name': 'glyphName',
  glyphorientationhorizontal: 'glyphOrientationHorizontal',
  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  glyphorientationvertical: 'glyphOrientationVertical',
  'glyph-orientation-vertical': 'glyphOrientationVertical',
  glyphref: 'glyphRef',
  gradienttransform: 'gradientTransform',
  gradientunits: 'gradientUnits',
  hanging: 'hanging',
  horizadvx: 'horizAdvX',
  'horiz-adv-x': 'horizAdvX',
  horizoriginx: 'horizOriginX',
  'horiz-origin-x': 'horizOriginX',
  ideographic: 'ideographic',
  imagerendering: 'imageRendering',
  'image-rendering': 'imageRendering',
  in2: 'in2',
  in: 'in',
  inlist: 'inlist',
  intercept: 'intercept',
  k1: 'k1',
  k2: 'k2',
  k3: 'k3',
  k4: 'k4',
  k: 'k',
  kernelmatrix: 'kernelMatrix',
  kernelunitlength: 'kernelUnitLength',
  kerning: 'kerning',
  keypoints: 'keyPoints',
  keysplines: 'keySplines',
  keytimes: 'keyTimes',
  lengthadjust: 'lengthAdjust',
  letterspacing: 'letterSpacing',
  'letter-spacing': 'letterSpacing',
  lightingcolor: 'lightingColor',
  'lighting-color': 'lightingColor',
  limitingconeangle: 'limitingConeAngle',
  local: 'local',
  markerend: 'markerEnd',
  'marker-end': 'markerEnd',
  markerheight: 'markerHeight',
  markermid: 'markerMid',
  'marker-mid': 'markerMid',
  markerstart: 'markerStart',
  'marker-start': 'markerStart',
  markerunits: 'markerUnits',
  markerwidth: 'markerWidth',
  mask: 'mask',
  maskcontentunits: 'maskContentUnits',
  maskunits: 'maskUnits',
  mathematical: 'mathematical',
  mode: 'mode',
  numoctaves: 'numOctaves',
  offset: 'offset',
  opacity: 'opacity',
  operator: 'operator',
  order: 'order',
  orient: 'orient',
  orientation: 'orientation',
  origin: 'origin',
  overflow: 'overflow',
  overlineposition: 'overlinePosition',
  'overline-position': 'overlinePosition',
  overlinethickness: 'overlineThickness',
  'overline-thickness': 'overlineThickness',
  paintorder: 'paintOrder',
  'paint-order': 'paintOrder',
  panose1: 'panose1',
  'panose-1': 'panose1',
  pathlength: 'pathLength',
  patterncontentunits: 'patternContentUnits',
  patterntransform: 'patternTransform',
  patternunits: 'patternUnits',
  pointerevents: 'pointerEvents',
  'pointer-events': 'pointerEvents',
  points: 'points',
  pointsatx: 'pointsAtX',
  pointsaty: 'pointsAtY',
  pointsatz: 'pointsAtZ',
  prefix: 'prefix',
  preservealpha: 'preserveAlpha',
  preserveaspectratio: 'preserveAspectRatio',
  primitiveunits: 'primitiveUnits',
  property: 'property',
  r: 'r',
  radius: 'radius',
  refx: 'refX',
  refy: 'refY',
  renderingintent: 'renderingIntent',
  'rendering-intent': 'renderingIntent',
  repeatcount: 'repeatCount',
  repeatdur: 'repeatDur',
  requiredextensions: 'requiredExtensions',
  requiredfeatures: 'requiredFeatures',
  resource: 'resource',
  restart: 'restart',
  result: 'result',
  results: 'results',
  rotate: 'rotate',
  rx: 'rx',
  ry: 'ry',
  scale: 'scale',
  security: 'security',
  seed: 'seed',
  shaperendering: 'shapeRendering',
  'shape-rendering': 'shapeRendering',
  slope: 'slope',
  spacing: 'spacing',
  specularconstant: 'specularConstant',
  specularexponent: 'specularExponent',
  speed: 'speed',
  spreadmethod: 'spreadMethod',
  startoffset: 'startOffset',
  stddeviation: 'stdDeviation',
  stemh: 'stemh',
  stemv: 'stemv',
  stitchtiles: 'stitchTiles',
  stopcolor: 'stopColor',
  'stop-color': 'stopColor',
  stopopacity: 'stopOpacity',
  'stop-opacity': 'stopOpacity',
  strikethroughposition: 'strikethroughPosition',
  'strikethrough-position': 'strikethroughPosition',
  strikethroughthickness: 'strikethroughThickness',
  'strikethrough-thickness': 'strikethroughThickness',
  string: 'string',
  stroke: 'stroke',
  strokedasharray: 'strokeDasharray',
  'stroke-dasharray': 'strokeDasharray',
  strokedashoffset: 'strokeDashoffset',
  'stroke-dashoffset': 'strokeDashoffset',
  strokelinecap: 'strokeLinecap',
  'stroke-linecap': 'strokeLinecap',
  strokelinejoin: 'strokeLinejoin',
  'stroke-linejoin': 'strokeLinejoin',
  strokemiterlimit: 'strokeMiterlimit',
  'stroke-miterlimit': 'strokeMiterlimit',
  strokewidth: 'strokeWidth',
  'stroke-width': 'strokeWidth',
  strokeopacity: 'strokeOpacity',
  'stroke-opacity': 'strokeOpacity',
  suppresscontenteditablewarning: 'suppressContentEditableWarning',
  suppresshydrationwarning: 'suppressHydrationWarning',
  surfacescale: 'surfaceScale',
  systemlanguage: 'systemLanguage',
  tablevalues: 'tableValues',
  targetx: 'targetX',
  targety: 'targetY',
  textanchor: 'textAnchor',
  'text-anchor': 'textAnchor',
  textdecoration: 'textDecoration',
  'text-decoration': 'textDecoration',
  textlength: 'textLength',
  textrendering: 'textRendering',
  'text-rendering': 'textRendering',
  to: 'to',
  transform: 'transform',
  typeof: 'typeof',
  u1: 'u1',
  u2: 'u2',
  underlineposition: 'underlinePosition',
  'underline-position': 'underlinePosition',
  underlinethickness: 'underlineThickness',
  'underline-thickness': 'underlineThickness',
  unicode: 'unicode',
  unicodebidi: 'unicodeBidi',
  'unicode-bidi': 'unicodeBidi',
  unicoderange: 'unicodeRange',
  'unicode-range': 'unicodeRange',
  unitsperem: 'unitsPerEm',
  'units-per-em': 'unitsPerEm',
  unselectable: 'unselectable',
  valphabetic: 'vAlphabetic',
  'v-alphabetic': 'vAlphabetic',
  values: 'values',
  vectoreffect: 'vectorEffect',
  'vector-effect': 'vectorEffect',
  version: 'version',
  vertadvy: 'vertAdvY',
  'vert-adv-y': 'vertAdvY',
  vertoriginx: 'vertOriginX',
  'vert-origin-x': 'vertOriginX',
  vertoriginy: 'vertOriginY',
  'vert-origin-y': 'vertOriginY',
  vhanging: 'vHanging',
  'v-hanging': 'vHanging',
  videographic: 'vIdeographic',
  'v-ideographic': 'vIdeographic',
  viewbox: 'viewBox',
  viewtarget: 'viewTarget',
  visibility: 'visibility',
  vmathematical: 'vMathematical',
  'v-mathematical': 'vMathematical',
  vocab: 'vocab',
  widths: 'widths',
  wordspacing: 'wordSpacing',
  'word-spacing': 'wordSpacing',
  writingmode: 'writingMode',
  'writing-mode': 'writingMode',
  x1: 'x1',
  x2: 'x2',
  x: 'x',
  xchannelselector: 'xChannelSelector',
  xheight: 'xHeight',
  'x-height': 'xHeight',
  xlinkactuate: 'xlinkActuate',
  'xlink:actuate': 'xlinkActuate',
  xlinkarcrole: 'xlinkArcrole',
  'xlink:arcrole': 'xlinkArcrole',
  xlinkhref: 'xlinkHref',
  'xlink:href': 'xlinkHref',
  xlinkrole: 'xlinkRole',
  'xlink:role': 'xlinkRole',
  xlinkshow: 'xlinkShow',
  'xlink:show': 'xlinkShow',
  xlinktitle: 'xlinkTitle',
  'xlink:title': 'xlinkTitle',
  xlinktype: 'xlinkType',
  'xlink:type': 'xlinkType',
  xmlbase: 'xmlBase',
  'xml:base': 'xmlBase',
  xmllang: 'xmlLang',
  'xml:lang': 'xmlLang',
  xmlns: 'xmlns',
  'xml:space': 'xmlSpace',
  xmlnsxlink: 'xmlnsXlink',
  'xmlns:xlink': 'xmlnsXlink',
  xmlspace: 'xmlSpace',
  y1: 'y1',
  y2: 'y2',
  y: 'y',
  ychannelselector: 'yChannelSelector',
  z: 'z',
  zoomandpan: 'zoomAndPan'
};

var validateProperty$1 = function () {};

{
  var warnedProperties$1 = {};
  var _hasOwnProperty = Object.prototype.hasOwnProperty;
  var EVENT_NAME_REGEX = /^on./;
  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

  validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
      return true;
    }

    var lowerCasedName = name.toLowerCase();
    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
      warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
      warnedProperties$1[name] = true;
      return true;
    }

    // We can't rely on the event system being injected on the server.
    if (canUseEventSystem) {
      if (registrationNameModules.hasOwnProperty(name)) {
        return true;
      }
      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
      if (registrationName != null) {
        warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
        warnedProperties$1[name] = true;
        return true;
      }
      if (EVENT_NAME_REGEX.test(name)) {
        warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
        warnedProperties$1[name] = true;
        return true;
      }
    } else if (EVENT_NAME_REGEX.test(name)) {
      // If no event plugins have been injected, we are in a server environment.
      // So we can't tell if the event name is correct for sure, but we can filter
      // out known bad ones like `onclick`. We can't suggest a specific replacement though.
      if (INVALID_EVENT_NAME_REGEX.test(name)) {
        warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
      }
      warnedProperties$1[name] = true;
      return true;
    }

    // Let the ARIA attribute hook validate ARIA attributes
    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
      return true;
    }

    if (lowerCasedName === 'innerhtml') {
      warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'aria') {
      warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
      warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'number' && isNaN(value)) {
      warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
      warnedProperties$1[name] = true;
      return true;
    }

    var propertyInfo = getPropertyInfo(name);
    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;

    // Known attributes should match the casing specified in the property config.
    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      var standardName = possibleStandardNames[lowerCasedName];
      if (standardName !== name) {
        warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
        warnedProperties$1[name] = true;
        return true;
      }
    } else if (!isReserved && name !== lowerCasedName) {
      // Unknown attributes should have lowercase casing since that's how they
      // will be cased anyway with server rendering.
      warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      if (value) {
        warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
      } else {
        warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
      }
      warnedProperties$1[name] = true;
      return true;
    }

    // Now that we've validated casing, do not validate
    // data types for reserved props
    if (isReserved) {
      return true;
    }

    // Warn when a known attribute is a bad type
    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      warnedProperties$1[name] = true;
      return false;
    }

    // Warn when passing the strings 'false' or 'true' into a boolean prop
    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
      warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
      warnedProperties$1[name] = true;
      return true;
    }

    return true;
  };
}

var warnUnknownProperties = function (type, props, canUseEventSystem) {
  var unknownProps = [];
  for (var key in props) {
    var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
    if (!isValid) {
      unknownProps.push(key);
    }
  }

  var unknownPropString = unknownProps.map(function (prop) {
    return '`' + prop + '`';
  }).join(', ');
  if (unknownProps.length === 1) {
    warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  } else if (unknownProps.length > 1) {
    warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  }
};

function validateProperties$2(type, props, canUseEventSystem) {
  if (isCustomComponent(type, props)) {
    return;
  }
  warnUnknownProperties(type, props, canUseEventSystem);
}

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

// Based on reading the React.Children implementation. TODO: type this somewhere?

var toArray = React.Children.toArray;

// This is only used in DEV.
// Each entry is `this.stack` from a currently executing renderer instance.
// (There may be more than one because ReactDOMServer is reentrant).
// Each stack is an array of frames which may contain nested stacks of elements.
var currentDebugStacks = [];

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var ReactDebugCurrentFrame = void 0;
var prevGetCurrentStackImpl = null;
var getCurrentServerStackImpl = function () {
  return '';
};
var describeStackFrame = function (element) {
  return '';
};

var validatePropertiesInDevelopment = function (type, props) {};
var pushCurrentDebugStack = function (stack) {};
var pushElementToDebugStack = function (element) {};
var popCurrentDebugStack = function () {};
var hasWarnedAboutUsingContextAsConsumer = false;

{
  ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

  validatePropertiesInDevelopment = function (type, props) {
    validateProperties(type, props);
    validateProperties$1(type, props);
    validateProperties$2(type, props, /* canUseEventSystem */false);
  };

  describeStackFrame = function (element) {
    var source = element._source;
    var type = element.type;
    var name = getComponentName(type);
    var ownerName = null;
    return describeComponentFrame(name, source, ownerName);
  };

  pushCurrentDebugStack = function (stack) {
    currentDebugStacks.push(stack);

    if (currentDebugStacks.length === 1) {
      // We are entering a server renderer.
      // Remember the previous (e.g. client) global stack implementation.
      prevGetCurrentStackImpl = ReactDebugCurrentFrame.getCurrentStack;
      ReactDebugCurrentFrame.getCurrentStack = getCurrentServerStackImpl;
    }
  };

  pushElementToDebugStack = function (element) {
    // For the innermost executing ReactDOMServer call,
    var stack = currentDebugStacks[currentDebugStacks.length - 1];
    // Take the innermost executing frame (e.g. <Foo>),
    var frame = stack[stack.length - 1];
    // and record that it has one more element associated with it.
    frame.debugElementStack.push(element);
    // We only need this because we tail-optimize single-element
    // children and directly handle them in an inner loop instead of
    // creating separate frames for them.
  };

  popCurrentDebugStack = function () {
    currentDebugStacks.pop();

    if (currentDebugStacks.length === 0) {
      // We are exiting the server renderer.
      // Restore the previous (e.g. client) global stack implementation.
      ReactDebugCurrentFrame.getCurrentStack = prevGetCurrentStackImpl;
      prevGetCurrentStackImpl = null;
    }
  };

  getCurrentServerStackImpl = function () {
    if (currentDebugStacks.length === 0) {
      // Nothing is currently rendering.
      return '';
    }
    // ReactDOMServer is reentrant so there may be multiple calls at the same time.
    // Take the frames from the innermost call which is the last in the array.
    var frames = currentDebugStacks[currentDebugStacks.length - 1];
    var stack = '';
    // Go through every frame in the stack from the innermost one.
    for (var i = frames.length - 1; i >= 0; i--) {
      var frame = frames[i];
      // Every frame might have more than one debug element stack entry associated with it.
      // This is because single-child nesting doesn't create materialized frames.
      // Instead it would push them through `pushElementToDebugStack()`.
      var _debugElementStack = frame.debugElementStack;
      for (var ii = _debugElementStack.length - 1; ii >= 0; ii--) {
        stack += describeStackFrame(_debugElementStack[ii]);
      }
    }
    return stack;
  };
}

var didWarnDefaultInputValue = false;
var didWarnDefaultChecked = false;
var didWarnDefaultSelectValue = false;
var didWarnDefaultTextareaValue = false;
var didWarnInvalidOptionChildren = false;
var didWarnAboutNoopUpdateForComponent = {};
var didWarnAboutBadClass = {};
var didWarnAboutDeprecatedWillMount = {};
var didWarnAboutUndefinedDerivedState = {};
var didWarnAboutUninitializedState = {};
var valuePropNames = ['value', 'defaultValue'];
var newlineEatingTags = {
  listing: true,
  pre: true,
  textarea: true
};

// We accept any tag to be rendered but since this gets injected into arbitrary
// HTML, we want to make sure that it's a safe tag.
// http://www.w3.org/TR/REC-xml/#NT-Name
var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/; // Simplified subset
var validatedTagCache = {};
function validateDangerousTag(tag) {
  if (!validatedTagCache.hasOwnProperty(tag)) {
    !VALID_TAG_REGEX.test(tag) ? invariant(false, 'Invalid tag: %s', tag) : void 0;
    validatedTagCache[tag] = true;
  }
}

var styleNameCache = {};
var processStyleName = function (styleName) {
  if (styleNameCache.hasOwnProperty(styleName)) {
    return styleNameCache[styleName];
  }
  var result = hyphenateStyleName(styleName);
  styleNameCache[styleName] = result;
  return result;
};

function createMarkupForStyles(styles) {
  var serialized = '';
  var delimiter = '';
  for (var styleName in styles) {
    if (!styles.hasOwnProperty(styleName)) {
      continue;
    }
    var isCustomProperty = styleName.indexOf('--') === 0;
    var styleValue = styles[styleName];
    {
      if (!isCustomProperty) {
        warnValidStyle$1(styleName, styleValue);
      }
    }
    if (styleValue != null) {
      serialized += delimiter + processStyleName(styleName) + ':';
      serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);

      delimiter = ';';
    }
  }
  return serialized || null;
}

function warnNoop(publicInstance, callerName) {
  {
    var _constructor = publicInstance.constructor;
    var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';
    var warningKey = componentName + '.' + callerName;
    if (didWarnAboutNoopUpdateForComponent[warningKey]) {
      return;
    }

    warningWithoutStack$1(false, '%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\n\nPlease check the code for the %s component.', callerName, callerName, componentName);
    didWarnAboutNoopUpdateForComponent[warningKey] = true;
  }
}

function shouldConstruct(Component) {
  return Component.prototype && Component.prototype.isReactComponent;
}

function getNonChildrenInnerMarkup(props) {
  var innerHTML = props.dangerouslySetInnerHTML;
  if (innerHTML != null) {
    if (innerHTML.__html != null) {
      return innerHTML.__html;
    }
  } else {
    var content = props.children;
    if (typeof content === 'string' || typeof content === 'number') {
      return escapeTextForBrowser(content);
    }
  }
  return null;
}

function flattenTopLevelChildren(children) {
  if (!React.isValidElement(children)) {
    return toArray(children);
  }
  var element = children;
  if (element.type !== REACT_FRAGMENT_TYPE) {
    return [element];
  }
  var fragmentChildren = element.props.children;
  if (!React.isValidElement(fragmentChildren)) {
    return toArray(fragmentChildren);
  }
  var fragmentChildElement = fragmentChildren;
  return [fragmentChildElement];
}

function flattenOptionChildren(children) {
  if (children === undefined || children === null) {
    return children;
  }
  var content = '';
  // Flatten children and warn if they aren't strings or numbers;
  // invalid types are ignored.
  React.Children.forEach(children, function (child) {
    if (child == null) {
      return;
    }
    content += child;
    {
      if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {
        didWarnInvalidOptionChildren = true;
        warning$1(false, 'Only strings and numbers are supported as <option> children.');
      }
    }
  });
  return content;
}

var hasOwnProperty = Object.prototype.hasOwnProperty;
var STYLE = 'style';
var RESERVED_PROPS = {
  children: null,
  dangerouslySetInnerHTML: null,
  suppressContentEditableWarning: null,
  suppressHydrationWarning: null
};

function createOpenTagMarkup(tagVerbatim, tagLowercase, props, namespace, makeStaticMarkup, isRootElement) {
  var ret = '<' + tagVerbatim;

  for (var propKey in props) {
    if (!hasOwnProperty.call(props, propKey)) {
      continue;
    }
    var propValue = props[propKey];
    if (propValue == null) {
      continue;
    }
    if (propKey === STYLE) {
      propValue = createMarkupForStyles(propValue);
    }
    var markup = null;
    if (isCustomComponent(tagLowercase, props)) {
      if (!RESERVED_PROPS.hasOwnProperty(propKey)) {
        markup = createMarkupForCustomAttribute(propKey, propValue);
      }
    } else {
      markup = createMarkupForProperty(propKey, propValue);
    }
    if (markup) {
      ret += ' ' + markup;
    }
  }

  // For static pages, no need to put React ID and checksum. Saves lots of
  // bytes.
  if (makeStaticMarkup) {
    return ret;
  }

  if (isRootElement) {
    ret += ' ' + createMarkupForRoot();
  }
  return ret;
}

function validateRenderResult(child, type) {
  if (child === undefined) {
    invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', getComponentName(type) || 'Component');
  }
}

function resolve(child, context, threadID) {
  while (React.isValidElement(child)) {
    // Safe because we just checked it's an element.
    var element = child;
    var Component = element.type;
    {
      pushElementToDebugStack(element);
    }
    if (typeof Component !== 'function') {
      break;
    }
    processChild(element, Component);
  }

  // Extra closure so queue and replace can be captured properly
  function processChild(element, Component) {
    var publicContext = processContext(Component, context, threadID);

    var queue = [];
    var replace = false;
    var updater = {
      isMounted: function (publicInstance) {
        return false;
      },
      enqueueForceUpdate: function (publicInstance) {
        if (queue === null) {
          warnNoop(publicInstance, 'forceUpdate');
          return null;
        }
      },
      enqueueReplaceState: function (publicInstance, completeState) {
        replace = true;
        queue = [completeState];
      },
      enqueueSetState: function (publicInstance, currentPartialState) {
        if (queue === null) {
          warnNoop(publicInstance, 'setState');
          return null;
        }
        queue.push(currentPartialState);
      }
    };

    var inst = void 0;
    if (shouldConstruct(Component)) {
      inst = new Component(element.props, publicContext, updater);

      if (typeof Component.getDerivedStateFromProps === 'function') {
        {
          if (inst.state === null || inst.state === undefined) {
            var componentName = getComponentName(Component) || 'Unknown';
            if (!didWarnAboutUninitializedState[componentName]) {
              warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, inst.state === null ? 'null' : 'undefined', componentName);
              didWarnAboutUninitializedState[componentName] = true;
            }
          }
        }

        var partialState = Component.getDerivedStateFromProps.call(null, element.props, inst.state);

        {
          if (partialState === undefined) {
            var _componentName = getComponentName(Component) || 'Unknown';
            if (!didWarnAboutUndefinedDerivedState[_componentName]) {
              warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', _componentName);
              didWarnAboutUndefinedDerivedState[_componentName] = true;
            }
          }
        }

        if (partialState != null) {
          inst.state = _assign({}, inst.state, partialState);
        }
      }
    } else {
      {
        if (Component.prototype && typeof Component.prototype.render === 'function') {
          var _componentName2 = getComponentName(Component) || 'Unknown';

          if (!didWarnAboutBadClass[_componentName2]) {
            warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', _componentName2, _componentName2);
            didWarnAboutBadClass[_componentName2] = true;
          }
        }
      }
      var componentIdentity = {};
      prepareToUseHooks(componentIdentity);
      inst = Component(element.props, publicContext, updater);
      inst = finishHooks(Component, element.props, inst, publicContext);

      if (inst == null || inst.render == null) {
        child = inst;
        validateRenderResult(child, Component);
        return;
      }
    }

    inst.props = element.props;
    inst.context = publicContext;
    inst.updater = updater;

    var initialState = inst.state;
    if (initialState === undefined) {
      inst.state = initialState = null;
    }
    if (typeof inst.UNSAFE_componentWillMount === 'function' || typeof inst.componentWillMount === 'function') {
      if (typeof inst.componentWillMount === 'function') {
        {
          if (warnAboutDeprecatedLifecycles && inst.componentWillMount.__suppressDeprecationWarning !== true) {
            var _componentName3 = getComponentName(Component) || 'Unknown';

            if (!didWarnAboutDeprecatedWillMount[_componentName3]) {
              lowPriorityWarning$1(false, '%s: componentWillMount() is deprecated and will be ' + 'removed in the next major version. Read about the motivations ' + 'behind this change: ' + 'https://fb.me/react-async-component-lifecycle-hooks' + '\n\n' + 'As a temporary workaround, you can rename to ' + 'UNSAFE_componentWillMount instead.', _componentName3);
              didWarnAboutDeprecatedWillMount[_componentName3] = true;
            }
          }
        }

        // In order to support react-lifecycles-compat polyfilled components,
        // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
        if (typeof Component.getDerivedStateFromProps !== 'function') {
          inst.componentWillMount();
        }
      }
      if (typeof inst.UNSAFE_componentWillMount === 'function' && typeof Component.getDerivedStateFromProps !== 'function') {
        // In order to support react-lifecycles-compat polyfilled components,
        // Unsafe lifecycles should not be invoked for any component with the new gDSFP.
        inst.UNSAFE_componentWillMount();
      }
      if (queue.length) {
        var oldQueue = queue;
        var oldReplace = replace;
        queue = null;
        replace = false;

        if (oldReplace && oldQueue.length === 1) {
          inst.state = oldQueue[0];
        } else {
          var nextState = oldReplace ? oldQueue[0] : inst.state;
          var dontMutate = true;
          for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) {
            var partial = oldQueue[i];
            var _partialState = typeof partial === 'function' ? partial.call(inst, nextState, element.props, publicContext) : partial;
            if (_partialState != null) {
              if (dontMutate) {
                dontMutate = false;
                nextState = _assign({}, nextState, _partialState);
              } else {
                _assign(nextState, _partialState);
              }
            }
          }
          inst.state = nextState;
        }
      } else {
        queue = null;
      }
    }
    child = inst.render();

    {
      if (child === undefined && inst.render._isMockFunction) {
        // This is probably bad practice. Consider warning here and
        // deprecating this convenience.
        child = null;
      }
    }
    validateRenderResult(child, Component);

    var childContext = void 0;
    if (typeof inst.getChildContext === 'function') {
      var childContextTypes = Component.childContextTypes;
      if (typeof childContextTypes === 'object') {
        childContext = inst.getChildContext();
        for (var contextKey in childContext) {
          !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(Component) || 'Unknown', contextKey) : void 0;
        }
      } else {
        warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', getComponentName(Component) || 'Unknown');
      }
    }
    if (childContext) {
      context = _assign({}, context, childContext);
    }
  }
  return { child: child, context: context };
}

var ReactDOMServerRenderer = function () {
  // DEV-only

  // TODO: type this more strictly:
  function ReactDOMServerRenderer(children, makeStaticMarkup) {
    _classCallCheck(this, ReactDOMServerRenderer);

    var flatChildren = flattenTopLevelChildren(children);

    var topFrame = {
      type: null,
      // Assume all trees start in the HTML namespace (not totally true, but
      // this is what we did historically)
      domNamespace: Namespaces.html,
      children: flatChildren,
      childIndex: 0,
      context: emptyObject,
      footer: ''
    };
    {
      topFrame.debugElementStack = [];
    }
    this.threadID = allocThreadID();
    this.stack = [topFrame];
    this.exhausted = false;
    this.currentSelectValue = null;
    this.previousWasTextNode = false;
    this.makeStaticMarkup = makeStaticMarkup;
    this.suspenseDepth = 0;

    // Context (new API)
    this.contextIndex = -1;
    this.contextStack = [];
    this.contextValueStack = [];
    {
      this.contextProviderStack = [];
    }
  }

  ReactDOMServerRenderer.prototype.destroy = function destroy() {
    if (!this.exhausted) {
      this.exhausted = true;
      this.clearProviders();
      freeThreadID(this.threadID);
    }
  };

  /**
   * Note: We use just two stacks regardless of how many context providers you have.
   * Providers are always popped in the reverse order to how they were pushed
   * so we always know on the way down which provider you'll encounter next on the way up.
   * On the way down, we push the current provider, and its context value *before*
   * we mutated it, onto the stacks. Therefore, on the way up, we always know which
   * provider needs to be "restored" to which value.
   * https://github.com/facebook/react/pull/12985#issuecomment-396301248
   */

  ReactDOMServerRenderer.prototype.pushProvider = function pushProvider(provider) {
    var index = ++this.contextIndex;
    var context = provider.type._context;
    var threadID = this.threadID;
    validateContextBounds(context, threadID);
    var previousValue = context[threadID];

    // Remember which value to restore this context to on our way up.
    this.contextStack[index] = context;
    this.contextValueStack[index] = previousValue;
    {
      // Only used for push/pop mismatch warnings.
      this.contextProviderStack[index] = provider;
    }

    // Mutate the current value.
    context[threadID] = provider.props.value;
  };

  ReactDOMServerRenderer.prototype.popProvider = function popProvider(provider) {
    var index = this.contextIndex;
    {
      !(index > -1 && provider === this.contextProviderStack[index]) ? warningWithoutStack$1(false, 'Unexpected pop.') : void 0;
    }

    var context = this.contextStack[index];
    var previousValue = this.contextValueStack[index];

    // "Hide" these null assignments from Flow by using `any`
    // because conceptually they are deletions--as long as we
    // promise to never access values beyond `this.contextIndex`.
    this.contextStack[index] = null;
    this.contextValueStack[index] = null;
    {
      this.contextProviderStack[index] = null;
    }
    this.contextIndex--;

    // Restore to the previous value we stored as we were walking down.
    // We've already verified that this context has been expanded to accommodate
    // this thread id, so we don't need to do it again.
    context[this.threadID] = previousValue;
  };

  ReactDOMServerRenderer.prototype.clearProviders = function clearProviders() {
    // Restore any remaining providers on the stack to previous values
    for (var index = this.contextIndex; index >= 0; index--) {
      var _context = this.contextStack[index];
      var previousValue = this.contextValueStack[index];
      _context[this.threadID] = previousValue;
    }
  };

  ReactDOMServerRenderer.prototype.read = function read(bytes) {
    if (this.exhausted) {
      return null;
    }

    var prevThreadID = currentThreadID;
    setCurrentThreadID(this.threadID);
    var prevDispatcher = ReactCurrentDispatcher.current;
    ReactCurrentDispatcher.current = Dispatcher;
    try {
      // Markup generated within <Suspense> ends up buffered until we know
      // nothing in that boundary suspended
      var out = [''];
      var suspended = false;
      while (out[0].length < bytes) {
        if (this.stack.length === 0) {
          this.exhausted = true;
          freeThreadID(this.threadID);
          break;
        }
        var frame = this.stack[this.stack.length - 1];
        if (suspended || frame.childIndex >= frame.children.length) {
          var _footer = frame.footer;
          if (_footer !== '') {
            this.previousWasTextNode = false;
          }
          this.stack.pop();
          if (frame.type === 'select') {
            this.currentSelectValue = null;
          } else if (frame.type != null && frame.type.type != null && frame.type.type.$$typeof === REACT_PROVIDER_TYPE) {
            var provider = frame.type;
            this.popProvider(provider);
          } else if (frame.type === REACT_SUSPENSE_TYPE) {
            this.suspenseDepth--;
            var buffered = out.pop();

            if (suspended) {
              suspended = false;
              // If rendering was suspended at this boundary, render the fallbackFrame
              var _fallbackFrame = frame.fallbackFrame;
              !_fallbackFrame ? invariant(false, 'suspense fallback not found, something is broken') : void 0;
              this.stack.push(_fallbackFrame);
              // Skip flushing output since we're switching to the fallback
              continue;
            } else {
              out[this.suspenseDepth] += buffered;
            }
          }

          // Flush output
          out[this.suspenseDepth] += _footer;
          continue;
        }
        var child = frame.children[frame.childIndex++];

        var outBuffer = '';
        {
          pushCurrentDebugStack(this.stack);
          // We're starting work on this frame, so reset its inner stack.
          frame.debugElementStack.length = 0;
        }
        try {
          outBuffer += this.render(child, frame.context, frame.domNamespace);
        } catch (err) {
          if (enableSuspenseServerRenderer && typeof err.then === 'function') {
            suspended = true;
          } else {
            throw err;
          }
        } finally {
          {
            popCurrentDebugStack();
          }
        }
        if (out.length <= this.suspenseDepth) {
          out.push('');
        }
        out[this.suspenseDepth] += outBuffer;
      }
      return out[0];
    } finally {
      ReactCurrentDispatcher.current = prevDispatcher;
      setCurrentThreadID(prevThreadID);
    }
  };

  ReactDOMServerRenderer.prototype.render = function render(child, context, parentNamespace) {
    if (typeof child === 'string' || typeof child === 'number') {
      var text = '' + child;
      if (text === '') {
        return '';
      }
      if (this.makeStaticMarkup) {
        return escapeTextForBrowser(text);
      }
      if (this.previousWasTextNode) {
        return '<!-- -->' + escapeTextForBrowser(text);
      }
      this.previousWasTextNode = true;
      return escapeTextForBrowser(text);
    } else {
      var nextChild = void 0;

      var _resolve = resolve(child, context, this.threadID);

      nextChild = _resolve.child;
      context = _resolve.context;

      if (nextChild === null || nextChild === false) {
        return '';
      } else if (!React.isValidElement(nextChild)) {
        if (nextChild != null && nextChild.$$typeof != null) {
          // Catch unexpected special types early.
          var $$typeof = nextChild.$$typeof;
          !($$typeof !== REACT_PORTAL_TYPE) ? invariant(false, 'Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.') : void 0;
          // Catch-all to prevent an infinite loop if React.Children.toArray() supports some new type.
          invariant(false, 'Unknown element-like object type: %s. This is likely a bug in React. Please file an issue.', $$typeof.toString());
        }
        var nextChildren = toArray(nextChild);
        var frame = {
          type: null,
          domNamespace: parentNamespace,
          children: nextChildren,
          childIndex: 0,
          context: context,
          footer: ''
        };
        {
          frame.debugElementStack = [];
        }
        this.stack.push(frame);
        return '';
      }
      // Safe because we just checked it's an element.
      var nextElement = nextChild;
      var elementType = nextElement.type;

      if (typeof elementType === 'string') {
        return this.renderDOM(nextElement, context, parentNamespace);
      }

      switch (elementType) {
        case REACT_STRICT_MODE_TYPE:
        case REACT_CONCURRENT_MODE_TYPE:
        case REACT_PROFILER_TYPE:
        case REACT_FRAGMENT_TYPE:
          {
            var _nextChildren = toArray(nextChild.props.children);
            var _frame = {
              type: null,
              domNamespace: parentNamespace,
              children: _nextChildren,
              childIndex: 0,
              context: context,
              footer: ''
            };
            {
              _frame.debugElementStack = [];
            }
            this.stack.push(_frame);
            return '';
          }
        case REACT_SUSPENSE_TYPE:
          {
            if (enableSuspenseServerRenderer) {
              var fallback = nextChild.props.fallback;
              if (fallback === undefined) {
                // If there is no fallback, then this just behaves as a fragment.
                var _nextChildren3 = toArray(nextChild.props.children);
                var _frame3 = {
                  type: null,
                  domNamespace: parentNamespace,
                  children: _nextChildren3,
                  childIndex: 0,
                  context: context,
                  footer: ''
                };
                {
                  _frame3.debugElementStack = [];
                }
                this.stack.push(_frame3);
                return '';
              }
              var fallbackChildren = toArray(fallback);
              var _nextChildren2 = toArray(nextChild.props.children);
              var _fallbackFrame2 = {
                type: null,
                domNamespace: parentNamespace,
                children: fallbackChildren,
                childIndex: 0,
                context: context,
                footer: '',
                out: ''
              };
              var _frame2 = {
                fallbackFrame: _fallbackFrame2,
                type: REACT_SUSPENSE_TYPE,
                domNamespace: parentNamespace,
                children: _nextChildren2,
                childIndex: 0,
                context: context,
                footer: '<!--/$-->'
              };
              {
                _frame2.debugElementStack = [];
                _fallbackFrame2.debugElementStack = [];
              }
              this.stack.push(_frame2);
              this.suspenseDepth++;
              return '<!--$-->';
            } else {
              invariant(false, 'ReactDOMServer does not yet support Suspense.');
            }
          }
        // eslint-disable-next-line-no-fallthrough
        default:
          break;
      }
      if (typeof elementType === 'object' && elementType !== null) {
        switch (elementType.$$typeof) {
          case REACT_FORWARD_REF_TYPE:
            {
              var element = nextChild;
              var _nextChildren4 = void 0;
              var componentIdentity = {};
              prepareToUseHooks(componentIdentity);
              _nextChildren4 = elementType.render(element.props, element.ref);
              _nextChildren4 = finishHooks(elementType.render, element.props, _nextChildren4, element.ref);
              _nextChildren4 = toArray(_nextChildren4);
              var _frame4 = {
                type: null,
                domNamespace: parentNamespace,
                children: _nextChildren4,
                childIndex: 0,
                context: context,
                footer: ''
              };
              {
                _frame4.debugElementStack = [];
              }
              this.stack.push(_frame4);
              return '';
            }
          case REACT_MEMO_TYPE:
            {
              var _element = nextChild;
              var _nextChildren5 = [React.createElement(elementType.type, _assign({ ref: _element.ref }, _element.props))];
              var _frame5 = {
                type: null,
                domNamespace: parentNamespace,
                children: _nextChildren5,
                childIndex: 0,
                context: context,
                footer: ''
              };
              {
                _frame5.debugElementStack = [];
              }
              this.stack.push(_frame5);
              return '';
            }
          case REACT_PROVIDER_TYPE:
            {
              var provider = nextChild;
              var nextProps = provider.props;
              var _nextChildren6 = toArray(nextProps.children);
              var _frame6 = {
                type: provider,
                domNamespace: parentNamespace,
                children: _nextChildren6,
                childIndex: 0,
                context: context,
                footer: ''
              };
              {
                _frame6.debugElementStack = [];
              }

              this.pushProvider(provider);

              this.stack.push(_frame6);
              return '';
            }
          case REACT_CONTEXT_TYPE:
            {
              var reactContext = nextChild.type;
              // The logic below for Context differs depending on PROD or DEV mode. In
              // DEV mode, we create a separate object for Context.Consumer that acts
              // like a proxy to Context. This proxy object adds unnecessary code in PROD
              // so we use the old behaviour (Context.Consumer references Context) to
              // reduce size and overhead. The separate object references context via
              // a property called "_context", which also gives us the ability to check
              // in DEV mode if this property exists or not and warn if it does not.
              {
                if (reactContext._context === undefined) {
                  // This may be because it's a Context (rather than a Consumer).
                  // Or it may be because it's older React where they're the same thing.
                  // We only want to warn if we're sure it's a new React.
                  if (reactContext !== reactContext.Consumer) {
                    if (!hasWarnedAboutUsingContextAsConsumer) {
                      hasWarnedAboutUsingContextAsConsumer = true;
                      warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
                    }
                  }
                } else {
                  reactContext = reactContext._context;
                }
              }
              var _nextProps = nextChild.props;
              var threadID = this.threadID;
              validateContextBounds(reactContext, threadID);
              var nextValue = reactContext[threadID];

              var _nextChildren7 = toArray(_nextProps.children(nextValue));
              var _frame7 = {
                type: nextChild,
                domNamespace: parentNamespace,
                children: _nextChildren7,
                childIndex: 0,
                context: context,
                footer: ''
              };
              {
                _frame7.debugElementStack = [];
              }
              this.stack.push(_frame7);
              return '';
            }
          case REACT_LAZY_TYPE:
            invariant(false, 'ReactDOMServer does not yet support lazy-loaded components.');
        }
      }

      var info = '';
      {
        var owner = nextElement._owner;
        if (elementType === undefined || typeof elementType === 'object' && elementType !== null && Object.keys(elementType).length === 0) {
          info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
        }
        var ownerName = owner ? getComponentName(owner) : null;
        if (ownerName) {
          info += '\n\nCheck the render method of `' + ownerName + '`.';
        }
      }
      invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', elementType == null ? elementType : typeof elementType, info);
    }
  };

  ReactDOMServerRenderer.prototype.renderDOM = function renderDOM(element, context, parentNamespace) {
    var tag = element.type.toLowerCase();

    var namespace = parentNamespace;
    if (parentNamespace === Namespaces.html) {
      namespace = getIntrinsicNamespace(tag);
    }

    {
      if (namespace === Namespaces.html) {
        // Should this check be gated by parent namespace? Not sure we want to
        // allow <SVG> or <mATH>.
        !(tag === element.type) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', element.type) : void 0;
      }
    }

    validateDangerousTag(tag);

    var props = element.props;
    if (tag === 'input') {
      {
        ReactControlledValuePropTypes.checkPropTypes('input', props);

        if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnDefaultChecked) {
          warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
          didWarnDefaultChecked = true;
        }
        if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultInputValue) {
          warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', 'A component', props.type);
          didWarnDefaultInputValue = true;
        }
      }

      props = _assign({
        type: undefined
      }, props, {
        defaultChecked: undefined,
        defaultValue: undefined,
        value: props.value != null ? props.value : props.defaultValue,
        checked: props.checked != null ? props.checked : props.defaultChecked
      });
    } else if (tag === 'textarea') {
      {
        ReactControlledValuePropTypes.checkPropTypes('textarea', props);
        if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultTextareaValue) {
          warning$1(false, 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
          didWarnDefaultTextareaValue = true;
        }
      }

      var initialValue = props.value;
      if (initialValue == null) {
        var defaultValue = props.defaultValue;
        // TODO (yungsters): Remove support for children content in <textarea>.
        var textareaChildren = props.children;
        if (textareaChildren != null) {
          {
            warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
          }
          !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
          if (Array.isArray(textareaChildren)) {
            !(textareaChildren.length <= 1) ? invariant(false, '<textarea> can only have at most one child.') : void 0;
            textareaChildren = textareaChildren[0];
          }

          defaultValue = '' + textareaChildren;
        }
        if (defaultValue == null) {
          defaultValue = '';
        }
        initialValue = defaultValue;
      }

      props = _assign({}, props, {
        value: undefined,
        children: '' + initialValue
      });
    } else if (tag === 'select') {
      {
        ReactControlledValuePropTypes.checkPropTypes('select', props);

        for (var i = 0; i < valuePropNames.length; i++) {
          var propName = valuePropNames[i];
          if (props[propName] == null) {
            continue;
          }
          var isArray = Array.isArray(props[propName]);
          if (props.multiple && !isArray) {
            warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.', propName);
          } else if (!props.multiple && isArray) {
            warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.', propName);
          }
        }

        if (props.value !== undefined && props.defaultValue !== undefined && !didWarnDefaultSelectValue) {
          warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
          didWarnDefaultSelectValue = true;
        }
      }
      this.currentSelectValue = props.value != null ? props.value : props.defaultValue;
      props = _assign({}, props, {
        value: undefined
      });
    } else if (tag === 'option') {
      var selected = null;
      var selectValue = this.currentSelectValue;
      var optionChildren = flattenOptionChildren(props.children);
      if (selectValue != null) {
        var value = void 0;
        if (props.value != null) {
          value = props.value + '';
        } else {
          value = optionChildren;
        }
        selected = false;
        if (Array.isArray(selectValue)) {
          // multiple
          for (var j = 0; j < selectValue.length; j++) {
            if ('' + selectValue[j] === value) {
              selected = true;
              break;
            }
          }
        } else {
          selected = '' + selectValue === value;
        }

        props = _assign({
          selected: undefined,
          children: undefined
        }, props, {
          selected: selected,
          children: optionChildren
        });
      }
    }

    {
      validatePropertiesInDevelopment(tag, props);
    }

    assertValidProps(tag, props);

    var out = createOpenTagMarkup(element.type, tag, props, namespace, this.makeStaticMarkup, this.stack.length === 1);
    var footer = '';
    if (omittedCloseTags.hasOwnProperty(tag)) {
      out += '/>';
    } else {
      out += '>';
      footer = '</' + element.type + '>';
    }
    var children = void 0;
    var innerMarkup = getNonChildrenInnerMarkup(props);
    if (innerMarkup != null) {
      children = [];
      if (newlineEatingTags[tag] && innerMarkup.charAt(0) === '\n') {
        // text/html ignores the first character in these tags if it's a newline
        // Prefer to break application/xml over text/html (for now) by adding
        // a newline specifically to get eaten by the parser. (Alternately for
        // textareas, replacing "^\n" with "\r\n" doesn't get eaten, and the first
        // \r is normalized out by HTMLTextAreaElement#value.)
        // See: <http://www.w3.org/TR/html-polyglot/#newlines-in-textarea-and-pre>
        // See: <http://www.w3.org/TR/html5/syntax.html#element-restrictions>
        // See: <http://www.w3.org/TR/html5/syntax.html#newlines>
        // See: Parsing of "textarea" "listing" and "pre" elements
        //  from <http://www.w3.org/TR/html5/syntax.html#parsing-main-inbody>
        out += '\n';
      }
      out += innerMarkup;
    } else {
      children = toArray(props.children);
    }
    var frame = {
      domNamespace: getChildNamespace(parentNamespace, element.type),
      type: tag,
      children: children,
      childIndex: 0,
      context: context,
      footer: footer
    };
    {
      frame.debugElementStack = [];
    }
    this.stack.push(frame);
    this.previousWasTextNode = false;
    return out;
  };

  return ReactDOMServerRenderer;
}();

/**
 * Render a ReactElement to its initial HTML. This should only be used on the
 * server.
 * See https://reactjs.org/docs/react-dom-server.html#rendertostring
 */
function renderToString(element) {
  var renderer = new ReactDOMServerRenderer(element, false);
  try {
    var markup = renderer.read(Infinity);
    return markup;
  } finally {
    renderer.destroy();
  }
}

/**
 * Similar to renderToString, except this doesn't create extra DOM attributes
 * such as data-react-id that React uses internally.
 * See https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup
 */
function renderToStaticMarkup(element) {
  var renderer = new ReactDOMServerRenderer(element, true);
  try {
    var markup = renderer.read(Infinity);
    return markup;
  } finally {
    renderer.destroy();
  }
}

function renderToNodeStream() {
  invariant(false, 'ReactDOMServer.renderToNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToString() instead.');
}

function renderToStaticNodeStream() {
  invariant(false, 'ReactDOMServer.renderToStaticNodeStream(): The streaming API is not available in the browser. Use ReactDOMServer.renderToStaticMarkup() instead.');
}

// Note: when changing this, also consider https://github.com/facebook/react/issues/11526
var ReactDOMServerBrowser = {
  renderToString: renderToString,
  renderToStaticMarkup: renderToStaticMarkup,
  renderToNodeStream: renderToNodeStream,
  renderToStaticNodeStream: renderToStaticNodeStream,
  version: ReactVersion
};

var ReactDOMServerBrowser$1 = Object.freeze({
	default: ReactDOMServerBrowser
});

var ReactDOMServer = ( ReactDOMServerBrowser$1 && ReactDOMServerBrowser ) || ReactDOMServerBrowser$1;

// TODO: decide on the top-level export form.
// This is hacky but makes it work with both Rollup and Jest
var server_browser = ReactDOMServer.default || ReactDOMServer;

module.exports = server_browser;
  })();
}


/***/ }),
/* 1359 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v16.8.6
 * react-dom.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

var React = __webpack_require__(0);
var _assign = __webpack_require__(140);
var checkPropTypes = __webpack_require__(182);
var scheduler = __webpack_require__(1380);
var tracing = __webpack_require__(1381);

/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

var validateFormat = function () {};

{
  validateFormat = function (format) {
    if (format === undefined) {
      throw new Error('invariant requires an error message argument');
    }
  };
}

function invariant(condition, format, a, b, c, d, e, f) {
  validateFormat(format);

  if (!condition) {
    var error = void 0;
    if (format === undefined) {
      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
    } else {
      var args = [a, b, c, d, e, f];
      var argIndex = 0;
      error = new Error(format.replace(/%s/g, function () {
        return args[argIndex++];
      }));
      error.name = 'Invariant Violation';
    }

    error.framesToPop = 1; // we don't care about invariant's own frame
    throw error;
  }
}

// Relying on the `invariant()` implementation lets us
// preserve the format and params in the www builds.

!React ? invariant(false, 'ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.') : void 0;

var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
  var funcArgs = Array.prototype.slice.call(arguments, 3);
  try {
    func.apply(context, funcArgs);
  } catch (error) {
    this.onError(error);
  }
};

{
  // In DEV mode, we swap out invokeGuardedCallback for a special version
  // that plays more nicely with the browser's DevTools. The idea is to preserve
  // "Pause on exceptions" behavior. Because React wraps all user-provided
  // functions in invokeGuardedCallback, and the production version of
  // invokeGuardedCallback uses a try-catch, all user exceptions are treated
  // like caught exceptions, and the DevTools won't pause unless the developer
  // takes the extra step of enabling pause on caught exceptions. This is
  // unintuitive, though, because even though React has caught the error, from
  // the developer's perspective, the error is uncaught.
  //
  // To preserve the expected "Pause on exceptions" behavior, we don't use a
  // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
  // DOM node, and call the user-provided callback from inside an event handler
  // for that fake event. If the callback throws, the error is "captured" using
  // a global event handler. But because the error happens in a different
  // event loop context, it does not interrupt the normal program flow.
  // Effectively, this gives us try-catch behavior without actually using
  // try-catch. Neat!

  // Check that the browser supports the APIs we need to implement our special
  // DEV version of invokeGuardedCallback
  if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
    var fakeNode = document.createElement('react');

    var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
      // If document doesn't exist we know for sure we will crash in this method
      // when we call document.createEvent(). However this can cause confusing
      // errors: https://github.com/facebookincubator/create-react-app/issues/3482
      // So we preemptively throw with a better message instead.
      !(typeof document !== 'undefined') ? invariant(false, 'The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.') : void 0;
      var evt = document.createEvent('Event');

      // Keeps track of whether the user-provided callback threw an error. We
      // set this to true at the beginning, then set it to false right after
      // calling the function. If the function errors, `didError` will never be
      // set to false. This strategy works even if the browser is flaky and
      // fails to call our global error handler, because it doesn't rely on
      // the error event at all.
      var didError = true;

      // Keeps track of the value of window.event so that we can reset it
      // during the callback to let user code access window.event in the
      // browsers that support it.
      var windowEvent = window.event;

      // Keeps track of the descriptor of window.event to restore it after event
      // dispatching: https://github.com/facebook/react/issues/13688
      var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');

      // Create an event handler for our fake event. We will synchronously
      // dispatch our fake event using `dispatchEvent`. Inside the handler, we
      // call the user-provided callback.
      var funcArgs = Array.prototype.slice.call(arguments, 3);
      function callCallback() {
        // We immediately remove the callback from event listeners so that
        // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
        // nested call would trigger the fake event handlers of any call higher
        // in the stack.
        fakeNode.removeEventListener(evtType, callCallback, false);

        // We check for window.hasOwnProperty('event') to prevent the
        // window.event assignment in both IE <= 10 as they throw an error
        // "Member not found" in strict mode, and in Firefox which does not
        // support window.event.
        if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
          window.event = windowEvent;
        }

        func.apply(context, funcArgs);
        didError = false;
      }

      // Create a global error event handler. We use this to capture the value
      // that was thrown. It's possible that this error handler will fire more
      // than once; for example, if non-React code also calls `dispatchEvent`
      // and a handler for that event throws. We should be resilient to most of
      // those cases. Even if our error event handler fires more than once, the
      // last error event is always used. If the callback actually does error,
      // we know that the last error event is the correct one, because it's not
      // possible for anything else to have happened in between our callback
      // erroring and the code that follows the `dispatchEvent` call below. If
      // the callback doesn't error, but the error event was fired, we know to
      // ignore it because `didError` will be false, as described above.
      var error = void 0;
      // Use this to track whether the error event is ever called.
      var didSetError = false;
      var isCrossOriginError = false;

      function handleWindowError(event) {
        error = event.error;
        didSetError = true;
        if (error === null && event.colno === 0 && event.lineno === 0) {
          isCrossOriginError = true;
        }
        if (event.defaultPrevented) {
          // Some other error handler has prevented default.
          // Browsers silence the error report if this happens.
          // We'll remember this to later decide whether to log it or not.
          if (error != null && typeof error === 'object') {
            try {
              error._suppressLogging = true;
            } catch (inner) {
              // Ignore.
            }
          }
        }
      }

      // Create a fake event type.
      var evtType = 'react-' + (name ? name : 'invokeguardedcallback');

      // Attach our event handlers
      window.addEventListener('error', handleWindowError);
      fakeNode.addEventListener(evtType, callCallback, false);

      // Synchronously dispatch our fake event. If the user-provided function
      // errors, it will trigger our global error handler.
      evt.initEvent(evtType, false, false);
      fakeNode.dispatchEvent(evt);

      if (windowEventDescriptor) {
        Object.defineProperty(window, 'event', windowEventDescriptor);
      }

      if (didError) {
        if (!didSetError) {
          // The callback errored, but the error event never fired.
          error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
        } else if (isCrossOriginError) {
          error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
        }
        this.onError(error);
      }

      // Remove our event listeners
      window.removeEventListener('error', handleWindowError);
    };

    invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
  }
}

var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;

// Used by Fiber to simulate a try-catch.
var hasError = false;
var caughtError = null;

// Used by event system to capture/rethrow the first error.
var hasRethrowError = false;
var rethrowError = null;

var reporter = {
  onError: function (error) {
    hasError = true;
    caughtError = error;
  }
};

/**
 * Call a function while guarding against errors that happens within it.
 * Returns an error if it throws, otherwise null.
 *
 * In production, this is implemented using a try-catch. The reason we don't
 * use a try-catch directly is so that we can swap out a different
 * implementation in DEV mode.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */
function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
  hasError = false;
  caughtError = null;
  invokeGuardedCallbackImpl$1.apply(reporter, arguments);
}

/**
 * Same as invokeGuardedCallback, but instead of returning an error, it stores
 * it in a global so it can be rethrown by `rethrowCaughtError` later.
 * TODO: See if caughtError and rethrowError can be unified.
 *
 * @param {String} name of the guard to use for logging or debugging
 * @param {Function} func The function to invoke
 * @param {*} context The context to use when calling the function
 * @param {...*} args Arguments for function
 */
function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
  invokeGuardedCallback.apply(this, arguments);
  if (hasError) {
    var error = clearCaughtError();
    if (!hasRethrowError) {
      hasRethrowError = true;
      rethrowError = error;
    }
  }
}

/**
 * During execution of guarded functions we will capture the first error which
 * we will rethrow to be handled by the top level error handler.
 */
function rethrowCaughtError() {
  if (hasRethrowError) {
    var error = rethrowError;
    hasRethrowError = false;
    rethrowError = null;
    throw error;
  }
}

function hasCaughtError() {
  return hasError;
}

function clearCaughtError() {
  if (hasError) {
    var error = caughtError;
    hasError = false;
    caughtError = null;
    return error;
  } else {
    invariant(false, 'clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.');
  }
}

/**
 * Injectable ordering of event plugins.
 */
var eventPluginOrder = null;

/**
 * Injectable mapping from names to event plugin modules.
 */
var namesToPlugins = {};

/**
 * Recomputes the plugin list using the injected plugins and plugin ordering.
 *
 * @private
 */
function recomputePluginOrdering() {
  if (!eventPluginOrder) {
    // Wait until an `eventPluginOrder` is injected.
    return;
  }
  for (var pluginName in namesToPlugins) {
    var pluginModule = namesToPlugins[pluginName];
    var pluginIndex = eventPluginOrder.indexOf(pluginName);
    !(pluginIndex > -1) ? invariant(false, 'EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `%s`.', pluginName) : void 0;
    if (plugins[pluginIndex]) {
      continue;
    }
    !pluginModule.extractEvents ? invariant(false, 'EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `%s` does not.', pluginName) : void 0;
    plugins[pluginIndex] = pluginModule;
    var publishedEvents = pluginModule.eventTypes;
    for (var eventName in publishedEvents) {
      !publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName) ? invariant(false, 'EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.', eventName, pluginName) : void 0;
    }
  }
}

/**
 * Publishes an event so that it can be dispatched by the supplied plugin.
 *
 * @param {object} dispatchConfig Dispatch configuration for the event.
 * @param {object} PluginModule Plugin publishing the event.
 * @return {boolean} True if the event was successfully published.
 * @private
 */
function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
  !!eventNameDispatchConfigs.hasOwnProperty(eventName) ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same event name, `%s`.', eventName) : void 0;
  eventNameDispatchConfigs[eventName] = dispatchConfig;

  var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
  if (phasedRegistrationNames) {
    for (var phaseName in phasedRegistrationNames) {
      if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
        var phasedRegistrationName = phasedRegistrationNames[phaseName];
        publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
      }
    }
    return true;
  } else if (dispatchConfig.registrationName) {
    publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
    return true;
  }
  return false;
}

/**
 * Publishes a registration name that is used to identify dispatched events.
 *
 * @param {string} registrationName Registration name to add.
 * @param {object} PluginModule Plugin publishing the event.
 * @private
 */
function publishRegistrationName(registrationName, pluginModule, eventName) {
  !!registrationNameModules[registrationName] ? invariant(false, 'EventPluginHub: More than one plugin attempted to publish the same registration name, `%s`.', registrationName) : void 0;
  registrationNameModules[registrationName] = pluginModule;
  registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;

  {
    var lowerCasedName = registrationName.toLowerCase();
    possibleRegistrationNames[lowerCasedName] = registrationName;

    if (registrationName === 'onDoubleClick') {
      possibleRegistrationNames.ondblclick = registrationName;
    }
  }
}

/**
 * Registers plugins so that they can extract and dispatch events.
 *
 * @see {EventPluginHub}
 */

/**
 * Ordered list of injected plugins.
 */
var plugins = [];

/**
 * Mapping from event name to dispatch config
 */
var eventNameDispatchConfigs = {};

/**
 * Mapping from registration name to plugin module
 */
var registrationNameModules = {};

/**
 * Mapping from registration name to event name
 */
var registrationNameDependencies = {};

/**
 * Mapping from lowercase registration names to the properly cased version,
 * used to warn in the case of missing event handlers. Available
 * only in true.
 * @type {Object}
 */
var possibleRegistrationNames = {};
// Trust the developer to only use possibleRegistrationNames in true

/**
 * Injects an ordering of plugins (by plugin name). This allows the ordering
 * to be decoupled from injection of the actual plugins so that ordering is
 * always deterministic regardless of packaging, on-the-fly injection, etc.
 *
 * @param {array} InjectedEventPluginOrder
 * @internal
 * @see {EventPluginHub.injection.injectEventPluginOrder}
 */
function injectEventPluginOrder(injectedEventPluginOrder) {
  !!eventPluginOrder ? invariant(false, 'EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.') : void 0;
  // Clone the ordering so it cannot be dynamically mutated.
  eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
  recomputePluginOrdering();
}

/**
 * Injects plugins to be used by `EventPluginHub`. The plugin names must be
 * in the ordering injected by `injectEventPluginOrder`.
 *
 * Plugins can be injected as part of page initialization or on-the-fly.
 *
 * @param {object} injectedNamesToPlugins Map from names to plugin modules.
 * @internal
 * @see {EventPluginHub.injection.injectEventPluginsByName}
 */
function injectEventPluginsByName(injectedNamesToPlugins) {
  var isOrderingDirty = false;
  for (var pluginName in injectedNamesToPlugins) {
    if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
      continue;
    }
    var pluginModule = injectedNamesToPlugins[pluginName];
    if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
      !!namesToPlugins[pluginName] ? invariant(false, 'EventPluginRegistry: Cannot inject two different event plugins using the same name, `%s`.', pluginName) : void 0;
      namesToPlugins[pluginName] = pluginModule;
      isOrderingDirty = true;
    }
  }
  if (isOrderingDirty) {
    recomputePluginOrdering();
  }
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warningWithoutStack = function () {};

{
  warningWithoutStack = function (condition, format) {
    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    if (format === undefined) {
      throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (args.length > 8) {
      // Check before the condition to catch violations early.
      throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
    }
    if (condition) {
      return;
    }
    if (typeof console !== 'undefined') {
      var argsWithFormat = args.map(function (item) {
        return '' + item;
      });
      argsWithFormat.unshift('Warning: ' + format);

      // We intentionally don't use spread (or .apply) directly because it
      // breaks IE9: https://github.com/facebook/react/issues/13610
      Function.prototype.apply.call(console.error, console, argsWithFormat);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      var argIndex = 0;
      var message = 'Warning: ' + format.replace(/%s/g, function () {
        return args[argIndex++];
      });
      throw new Error(message);
    } catch (x) {}
  };
}

var warningWithoutStack$1 = warningWithoutStack;

var getFiberCurrentPropsFromNode = null;
var getInstanceFromNode = null;
var getNodeFromInstance = null;

function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
  getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
  getInstanceFromNode = getInstanceFromNodeImpl;
  getNodeFromInstance = getNodeFromInstanceImpl;
  {
    !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
  }
}

var validateEventDispatches = void 0;
{
  validateEventDispatches = function (event) {
    var dispatchListeners = event._dispatchListeners;
    var dispatchInstances = event._dispatchInstances;

    var listenersIsArr = Array.isArray(dispatchListeners);
    var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;

    var instancesIsArr = Array.isArray(dispatchInstances);
    var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;

    !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
  };
}

/**
 * Dispatch the event to the listener.
 * @param {SyntheticEvent} event SyntheticEvent to handle
 * @param {function} listener Application-level callback
 * @param {*} inst Internal component instance
 */
function executeDispatch(event, listener, inst) {
  var type = event.type || 'unknown-event';
  event.currentTarget = getNodeFromInstance(inst);
  invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
  event.currentTarget = null;
}

/**
 * Standard/simple iteration through an event's collected dispatches.
 */
function executeDispatchesInOrder(event) {
  var dispatchListeners = event._dispatchListeners;
  var dispatchInstances = event._dispatchInstances;
  {
    validateEventDispatches(event);
  }
  if (Array.isArray(dispatchListeners)) {
    for (var i = 0; i < dispatchListeners.length; i++) {
      if (event.isPropagationStopped()) {
        break;
      }
      // Listeners and Instances are two parallel arrays that are always in sync.
      executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
    }
  } else if (dispatchListeners) {
    executeDispatch(event, dispatchListeners, dispatchInstances);
  }
  event._dispatchListeners = null;
  event._dispatchInstances = null;
}

/**
 * @see executeDispatchesInOrderStopAtTrueImpl
 */


/**
 * Execution of a "direct" dispatch - there must be at most one dispatch
 * accumulated on the event or it is considered an error. It doesn't really make
 * sense for an event with multiple dispatches (bubbled) to keep track of the
 * return values at each dispatch execution, but it does tend to make sense when
 * dealing with "direct" dispatches.
 *
 * @return {*} The return value of executing the single dispatch.
 */


/**
 * @param {SyntheticEvent} event
 * @return {boolean} True iff number of dispatches accumulated is greater than 0.
 */

/**
 * Accumulates items that must not be null or undefined into the first one. This
 * is used to conserve memory by avoiding array allocations, and thus sacrifices
 * API cleanness. Since `current` can be null before being passed in and not
 * null after this function, make sure to assign it back to `current`:
 *
 * `a = accumulateInto(a, b);`
 *
 * This API should be sparingly used. Try `accumulate` for something cleaner.
 *
 * @return {*|array<*>} An accumulation of items.
 */

function accumulateInto(current, next) {
  !(next != null) ? invariant(false, 'accumulateInto(...): Accumulated items must not be null or undefined.') : void 0;

  if (current == null) {
    return next;
  }

  // Both are not empty. Warning: Never call x.concat(y) when you are not
  // certain that x is an Array (x could be a string with concat method).
  if (Array.isArray(current)) {
    if (Array.isArray(next)) {
      current.push.apply(current, next);
      return current;
    }
    current.push(next);
    return current;
  }

  if (Array.isArray(next)) {
    // A bit too dangerous to mutate `next`.
    return [current].concat(next);
  }

  return [current, next];
}

/**
 * @param {array} arr an "accumulation" of items which is either an Array or
 * a single item. Useful when paired with the `accumulate` module. This is a
 * simple utility that allows us to reason about a collection of items, but
 * handling the case when there is exactly one item (and we do not need to
 * allocate an array).
 * @param {function} cb Callback invoked with each element or a collection.
 * @param {?} [scope] Scope used as `this` in a callback.
 */
function forEachAccumulated(arr, cb, scope) {
  if (Array.isArray(arr)) {
    arr.forEach(cb, scope);
  } else if (arr) {
    cb.call(scope, arr);
  }
}

/**
 * Internal queue of events that have accumulated their dispatches and are
 * waiting to have their dispatches executed.
 */
var eventQueue = null;

/**
 * Dispatches an event and releases it back into the pool, unless persistent.
 *
 * @param {?object} event Synthetic event to be dispatched.
 * @private
 */
var executeDispatchesAndRelease = function (event) {
  if (event) {
    executeDispatchesInOrder(event);

    if (!event.isPersistent()) {
      event.constructor.release(event);
    }
  }
};
var executeDispatchesAndReleaseTopLevel = function (e) {
  return executeDispatchesAndRelease(e);
};

function isInteractive(tag) {
  return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
}

function shouldPreventMouseEvent(name, type, props) {
  switch (name) {
    case 'onClick':
    case 'onClickCapture':
    case 'onDoubleClick':
    case 'onDoubleClickCapture':
    case 'onMouseDown':
    case 'onMouseDownCapture':
    case 'onMouseMove':
    case 'onMouseMoveCapture':
    case 'onMouseUp':
    case 'onMouseUpCapture':
      return !!(props.disabled && isInteractive(type));
    default:
      return false;
  }
}

/**
 * This is a unified interface for event plugins to be installed and configured.
 *
 * Event plugins can implement the following properties:
 *
 *   `extractEvents` {function(string, DOMEventTarget, string, object): *}
 *     Required. When a top-level event is fired, this method is expected to
 *     extract synthetic events that will in turn be queued and dispatched.
 *
 *   `eventTypes` {object}
 *     Optional, plugins that fire events must publish a mapping of registration
 *     names that are used to register listeners. Values of this mapping must
 *     be objects that contain `registrationName` or `phasedRegistrationNames`.
 *
 *   `executeDispatch` {function(object, function, string)}
 *     Optional, allows plugins to override how an event gets dispatched. By
 *     default, the listener is simply invoked.
 *
 * Each plugin that is injected into `EventsPluginHub` is immediately operable.
 *
 * @public
 */

/**
 * Methods for injecting dependencies.
 */
var injection = {
  /**
   * @param {array} InjectedEventPluginOrder
   * @public
   */
  injectEventPluginOrder: injectEventPluginOrder,

  /**
   * @param {object} injectedNamesToPlugins Map from names to plugin modules.
   */
  injectEventPluginsByName: injectEventPluginsByName
};

/**
 * @param {object} inst The instance, which is the source of events.
 * @param {string} registrationName Name of listener (e.g. `onClick`).
 * @return {?function} The stored callback.
 */
function getListener(inst, registrationName) {
  var listener = void 0;

  // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
  // live here; needs to be moved to a better place soon
  var stateNode = inst.stateNode;
  if (!stateNode) {
    // Work in progress (ex: onload events in incremental mode).
    return null;
  }
  var props = getFiberCurrentPropsFromNode(stateNode);
  if (!props) {
    // Work in progress.
    return null;
  }
  listener = props[registrationName];
  if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
    return null;
  }
  !(!listener || typeof listener === 'function') ? invariant(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener) : void 0;
  return listener;
}

/**
 * Allows registered plugins an opportunity to extract events from top-level
 * native browser events.
 *
 * @return {*} An accumulation of synthetic events.
 * @internal
 */
function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var events = null;
  for (var i = 0; i < plugins.length; i++) {
    // Not every plugin in the ordering may be loaded at runtime.
    var possiblePlugin = plugins[i];
    if (possiblePlugin) {
      var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
      if (extractedEvents) {
        events = accumulateInto(events, extractedEvents);
      }
    }
  }
  return events;
}

function runEventsInBatch(events) {
  if (events !== null) {
    eventQueue = accumulateInto(eventQueue, events);
  }

  // Set `eventQueue` to null before processing it so that we can tell if more
  // events get enqueued while processing.
  var processingEventQueue = eventQueue;
  eventQueue = null;

  if (!processingEventQueue) {
    return;
  }

  forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
  !!eventQueue ? invariant(false, 'processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.') : void 0;
  // This would be a good time to rethrow if any of the event handlers threw.
  rethrowCaughtError();
}

function runExtractedEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var events = extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget);
  runEventsInBatch(events);
}

var FunctionComponent = 0;
var ClassComponent = 1;
var IndeterminateComponent = 2; // Before we know whether it is function or class
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
var HostComponent = 5;
var HostText = 6;
var Fragment = 7;
var Mode = 8;
var ContextConsumer = 9;
var ContextProvider = 10;
var ForwardRef = 11;
var Profiler = 12;
var SuspenseComponent = 13;
var MemoComponent = 14;
var SimpleMemoComponent = 15;
var LazyComponent = 16;
var IncompleteClassComponent = 17;
var DehydratedSuspenseComponent = 18;

var randomKey = Math.random().toString(36).slice(2);
var internalInstanceKey = '__reactInternalInstance$' + randomKey;
var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;

function precacheFiberNode(hostInst, node) {
  node[internalInstanceKey] = hostInst;
}

/**
 * Given a DOM node, return the closest ReactDOMComponent or
 * ReactDOMTextComponent instance ancestor.
 */
function getClosestInstanceFromNode(node) {
  if (node[internalInstanceKey]) {
    return node[internalInstanceKey];
  }

  while (!node[internalInstanceKey]) {
    if (node.parentNode) {
      node = node.parentNode;
    } else {
      // Top of the tree. This node must not be part of a React tree (or is
      // unmounted, potentially).
      return null;
    }
  }

  var inst = node[internalInstanceKey];
  if (inst.tag === HostComponent || inst.tag === HostText) {
    // In Fiber, this will always be the deepest root.
    return inst;
  }

  return null;
}

/**
 * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
 * instance, or null if the node was not rendered by this React.
 */
function getInstanceFromNode$1(node) {
  var inst = node[internalInstanceKey];
  if (inst) {
    if (inst.tag === HostComponent || inst.tag === HostText) {
      return inst;
    } else {
      return null;
    }
  }
  return null;
}

/**
 * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
 * DOM node.
 */
function getNodeFromInstance$1(inst) {
  if (inst.tag === HostComponent || inst.tag === HostText) {
    // In Fiber this, is just the state node right now. We assume it will be
    // a host component or host text.
    return inst.stateNode;
  }

  // Without this first invariant, passing a non-DOM-component triggers the next
  // invariant for a missing parent, which is super confusing.
  invariant(false, 'getNodeFromInstance: Invalid argument.');
}

function getFiberCurrentPropsFromNode$1(node) {
  return node[internalEventHandlersKey] || null;
}

function updateFiberProps(node, props) {
  node[internalEventHandlersKey] = props;
}

function getParent(inst) {
  do {
    inst = inst.return;
    // TODO: If this is a HostRoot we might want to bail out.
    // That is depending on if we want nested subtrees (layers) to bubble
    // events to their parent. We could also go through parentNode on the
    // host node but that wouldn't work for React Native and doesn't let us
    // do the portal feature.
  } while (inst && inst.tag !== HostComponent);
  if (inst) {
    return inst;
  }
  return null;
}

/**
 * Return the lowest common ancestor of A and B, or null if they are in
 * different trees.
 */
function getLowestCommonAncestor(instA, instB) {
  var depthA = 0;
  for (var tempA = instA; tempA; tempA = getParent(tempA)) {
    depthA++;
  }
  var depthB = 0;
  for (var tempB = instB; tempB; tempB = getParent(tempB)) {
    depthB++;
  }

  // If A is deeper, crawl up.
  while (depthA - depthB > 0) {
    instA = getParent(instA);
    depthA--;
  }

  // If B is deeper, crawl up.
  while (depthB - depthA > 0) {
    instB = getParent(instB);
    depthB--;
  }

  // Walk in lockstep until we find a match.
  var depth = depthA;
  while (depth--) {
    if (instA === instB || instA === instB.alternate) {
      return instA;
    }
    instA = getParent(instA);
    instB = getParent(instB);
  }
  return null;
}

/**
 * Return if A is an ancestor of B.
 */


/**
 * Return the parent instance of the passed-in instance.
 */


/**
 * Simulates the traversal of a two-phase, capture/bubble event dispatch.
 */
function traverseTwoPhase(inst, fn, arg) {
  var path = [];
  while (inst) {
    path.push(inst);
    inst = getParent(inst);
  }
  var i = void 0;
  for (i = path.length; i-- > 0;) {
    fn(path[i], 'captured', arg);
  }
  for (i = 0; i < path.length; i++) {
    fn(path[i], 'bubbled', arg);
  }
}

/**
 * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
 * should would receive a `mouseEnter` or `mouseLeave` event.
 *
 * Does not invoke the callback on the nearest common ancestor because nothing
 * "entered" or "left" that element.
 */
function traverseEnterLeave(from, to, fn, argFrom, argTo) {
  var common = from && to ? getLowestCommonAncestor(from, to) : null;
  var pathFrom = [];
  while (true) {
    if (!from) {
      break;
    }
    if (from === common) {
      break;
    }
    var alternate = from.alternate;
    if (alternate !== null && alternate === common) {
      break;
    }
    pathFrom.push(from);
    from = getParent(from);
  }
  var pathTo = [];
  while (true) {
    if (!to) {
      break;
    }
    if (to === common) {
      break;
    }
    var _alternate = to.alternate;
    if (_alternate !== null && _alternate === common) {
      break;
    }
    pathTo.push(to);
    to = getParent(to);
  }
  for (var i = 0; i < pathFrom.length; i++) {
    fn(pathFrom[i], 'bubbled', argFrom);
  }
  for (var _i = pathTo.length; _i-- > 0;) {
    fn(pathTo[_i], 'captured', argTo);
  }
}

/**
 * Some event types have a notion of different registration names for different
 * "phases" of propagation. This finds listeners by a given phase.
 */
function listenerAtPhase(inst, event, propagationPhase) {
  var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
  return getListener(inst, registrationName);
}

/**
 * A small set of propagation patterns, each of which will accept a small amount
 * of information, and generate a set of "dispatch ready event objects" - which
 * are sets of events that have already been annotated with a set of dispatched
 * listener functions/ids. The API is designed this way to discourage these
 * propagation strategies from actually executing the dispatches, since we
 * always want to collect the entire set of dispatches before executing even a
 * single one.
 */

/**
 * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
 * here, allows us to not have to bind or create functions for each event.
 * Mutating the event's members allows us to not have to create a wrapping
 * "dispatch" object that pairs the event with the listener.
 */
function accumulateDirectionalDispatches(inst, phase, event) {
  {
    !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
  }
  var listener = listenerAtPhase(inst, event, phase);
  if (listener) {
    event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
    event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
  }
}

/**
 * Collect dispatches (must be entirely collected before dispatching - see unit
 * tests). Lazily allocate the array to conserve memory.  We must loop through
 * each event and perform the traversal for each one. We cannot perform a
 * single traversal for the entire collection of events because each event may
 * have a different target.
 */
function accumulateTwoPhaseDispatchesSingle(event) {
  if (event && event.dispatchConfig.phasedRegistrationNames) {
    traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
  }
}

/**
 * Accumulates without regard to direction, does not look for phased
 * registration names. Same as `accumulateDirectDispatchesSingle` but without
 * requiring that the `dispatchMarker` be the same as the dispatched ID.
 */
function accumulateDispatches(inst, ignoredDirection, event) {
  if (inst && event && event.dispatchConfig.registrationName) {
    var registrationName = event.dispatchConfig.registrationName;
    var listener = getListener(inst, registrationName);
    if (listener) {
      event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
      event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
    }
  }
}

/**
 * Accumulates dispatches on an `SyntheticEvent`, but only for the
 * `dispatchMarker`.
 * @param {SyntheticEvent} event
 */
function accumulateDirectDispatchesSingle(event) {
  if (event && event.dispatchConfig.registrationName) {
    accumulateDispatches(event._targetInst, null, event);
  }
}

function accumulateTwoPhaseDispatches(events) {
  forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
}



function accumulateEnterLeaveDispatches(leave, enter, from, to) {
  traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
}

function accumulateDirectDispatches(events) {
  forEachAccumulated(events, accumulateDirectDispatchesSingle);
}

var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);

// Do not uses the below two methods directly!
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
// (It is the only module that is allowed to access these methods.)

function unsafeCastStringToDOMTopLevelType(topLevelType) {
  return topLevelType;
}

function unsafeCastDOMTopLevelTypeToString(topLevelType) {
  return topLevelType;
}

/**
 * Generate a mapping of standard vendor prefixes using the defined style property and event name.
 *
 * @param {string} styleProp
 * @param {string} eventName
 * @returns {object}
 */
function makePrefixMap(styleProp, eventName) {
  var prefixes = {};

  prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
  prefixes['Webkit' + styleProp] = 'webkit' + eventName;
  prefixes['Moz' + styleProp] = 'moz' + eventName;

  return prefixes;
}

/**
 * A list of event names to a configurable list of vendor prefixes.
 */
var vendorPrefixes = {
  animationend: makePrefixMap('Animation', 'AnimationEnd'),
  animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
  animationstart: makePrefixMap('Animation', 'AnimationStart'),
  transitionend: makePrefixMap('Transition', 'TransitionEnd')
};

/**
 * Event names that have already been detected and prefixed (if applicable).
 */
var prefixedEventNames = {};

/**
 * Element to check for prefixes on.
 */
var style = {};

/**
 * Bootstrap if a DOM exists.
 */
if (canUseDOM) {
  style = document.createElement('div').style;

  // On some platforms, in particular some releases of Android 4.x,
  // the un-prefixed "animation" and "transition" properties are defined on the
  // style object but the events that fire will still be prefixed, so we need
  // to check if the un-prefixed events are usable, and if not remove them from the map.
  if (!('AnimationEvent' in window)) {
    delete vendorPrefixes.animationend.animation;
    delete vendorPrefixes.animationiteration.animation;
    delete vendorPrefixes.animationstart.animation;
  }

  // Same as above
  if (!('TransitionEvent' in window)) {
    delete vendorPrefixes.transitionend.transition;
  }
}

/**
 * Attempts to determine the correct vendor prefixed event name.
 *
 * @param {string} eventName
 * @returns {string}
 */
function getVendorPrefixedEventName(eventName) {
  if (prefixedEventNames[eventName]) {
    return prefixedEventNames[eventName];
  } else if (!vendorPrefixes[eventName]) {
    return eventName;
  }

  var prefixMap = vendorPrefixes[eventName];

  for (var styleProp in prefixMap) {
    if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
      return prefixedEventNames[eventName] = prefixMap[styleProp];
    }
  }

  return eventName;
}

/**
 * To identify top level events in ReactDOM, we use constants defined by this
 * module. This is the only module that uses the unsafe* methods to express
 * that the constants actually correspond to the browser event names. This lets
 * us save some bundle size by avoiding a top level type -> event name map.
 * The rest of ReactDOM code should import top level types from this file.
 */
var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');


var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');

// List of events that need to be individually attached to media elements.
// Note that events in this list will *not* be listened to at the top level
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];

function getRawEventName(topLevelType) {
  return unsafeCastDOMTopLevelTypeToString(topLevelType);
}

/**
 * These variables store information about text content of a target node,
 * allowing comparison of content before and after a given event.
 *
 * Identify the node where selection currently begins, then observe
 * both its text content and its current position in the DOM. Since the
 * browser may natively replace the target node during composition, we can
 * use its position to find its replacement.
 *
 *
 */

var root = null;
var startText = null;
var fallbackText = null;

function initialize(nativeEventTarget) {
  root = nativeEventTarget;
  startText = getText();
  return true;
}

function reset() {
  root = null;
  startText = null;
  fallbackText = null;
}

function getData() {
  if (fallbackText) {
    return fallbackText;
  }

  var start = void 0;
  var startValue = startText;
  var startLength = startValue.length;
  var end = void 0;
  var endValue = getText();
  var endLength = endValue.length;

  for (start = 0; start < startLength; start++) {
    if (startValue[start] !== endValue[start]) {
      break;
    }
  }

  var minEnd = startLength - start;
  for (end = 1; end <= minEnd; end++) {
    if (startValue[startLength - end] !== endValue[endLength - end]) {
      break;
    }
  }

  var sliceTail = end > 1 ? 1 - end : undefined;
  fallbackText = endValue.slice(start, sliceTail);
  return fallbackText;
}

function getText() {
  if ('value' in root) {
    return root.value;
  }
  return root.textContent;
}

/* eslint valid-typeof: 0 */

var EVENT_POOL_SIZE = 10;

/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var EventInterface = {
  type: null,
  target: null,
  // currentTarget is set when dispatching; no use in copying it here
  currentTarget: function () {
    return null;
  },
  eventPhase: null,
  bubbles: null,
  cancelable: null,
  timeStamp: function (event) {
    return event.timeStamp || Date.now();
  },
  defaultPrevented: null,
  isTrusted: null
};

function functionThatReturnsTrue() {
  return true;
}

function functionThatReturnsFalse() {
  return false;
}

/**
 * Synthetic events are dispatched by event plugins, typically in response to a
 * top-level event delegation handler.
 *
 * These systems should generally use pooling to reduce the frequency of garbage
 * collection. The system should check `isPersistent` to determine whether the
 * event should be released into the pool after being dispatched. Users that
 * need a persisted event should invoke `persist`.
 *
 * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
 * normalizing browser quirks. Subclasses do not necessarily have to implement a
 * DOM interface; custom application-specific events can also subclass this.
 *
 * @param {object} dispatchConfig Configuration used to dispatch this event.
 * @param {*} targetInst Marker identifying the event target.
 * @param {object} nativeEvent Native browser event.
 * @param {DOMEventTarget} nativeEventTarget Target node.
 */
function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
  {
    // these have a getter/setter for warnings
    delete this.nativeEvent;
    delete this.preventDefault;
    delete this.stopPropagation;
    delete this.isDefaultPrevented;
    delete this.isPropagationStopped;
  }

  this.dispatchConfig = dispatchConfig;
  this._targetInst = targetInst;
  this.nativeEvent = nativeEvent;

  var Interface = this.constructor.Interface;
  for (var propName in Interface) {
    if (!Interface.hasOwnProperty(propName)) {
      continue;
    }
    {
      delete this[propName]; // this has a getter/setter for warnings
    }
    var normalize = Interface[propName];
    if (normalize) {
      this[propName] = normalize(nativeEvent);
    } else {
      if (propName === 'target') {
        this.target = nativeEventTarget;
      } else {
        this[propName] = nativeEvent[propName];
      }
    }
  }

  var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
  if (defaultPrevented) {
    this.isDefaultPrevented = functionThatReturnsTrue;
  } else {
    this.isDefaultPrevented = functionThatReturnsFalse;
  }
  this.isPropagationStopped = functionThatReturnsFalse;
  return this;
}

_assign(SyntheticEvent.prototype, {
  preventDefault: function () {
    this.defaultPrevented = true;
    var event = this.nativeEvent;
    if (!event) {
      return;
    }

    if (event.preventDefault) {
      event.preventDefault();
    } else if (typeof event.returnValue !== 'unknown') {
      event.returnValue = false;
    }
    this.isDefaultPrevented = functionThatReturnsTrue;
  },

  stopPropagation: function () {
    var event = this.nativeEvent;
    if (!event) {
      return;
    }

    if (event.stopPropagation) {
      event.stopPropagation();
    } else if (typeof event.cancelBubble !== 'unknown') {
      // The ChangeEventPlugin registers a "propertychange" event for
      // IE. This event does not support bubbling or cancelling, and
      // any references to cancelBubble throw "Member not found".  A
      // typeof check of "unknown" circumvents this issue (and is also
      // IE specific).
      event.cancelBubble = true;
    }

    this.isPropagationStopped = functionThatReturnsTrue;
  },

  /**
   * We release all dispatched `SyntheticEvent`s after each event loop, adding
   * them back into the pool. This allows a way to hold onto a reference that
   * won't be added back into the pool.
   */
  persist: function () {
    this.isPersistent = functionThatReturnsTrue;
  },

  /**
   * Checks if this event should be released back into the pool.
   *
   * @return {boolean} True if this should not be released, false otherwise.
   */
  isPersistent: functionThatReturnsFalse,

  /**
   * `PooledClass` looks for `destructor` on each instance it releases.
   */
  destructor: function () {
    var Interface = this.constructor.Interface;
    for (var propName in Interface) {
      {
        Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
      }
    }
    this.dispatchConfig = null;
    this._targetInst = null;
    this.nativeEvent = null;
    this.isDefaultPrevented = functionThatReturnsFalse;
    this.isPropagationStopped = functionThatReturnsFalse;
    this._dispatchListeners = null;
    this._dispatchInstances = null;
    {
      Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
      Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
      Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
      Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
      Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
    }
  }
});

SyntheticEvent.Interface = EventInterface;

/**
 * Helper to reduce boilerplate when creating subclasses.
 */
SyntheticEvent.extend = function (Interface) {
  var Super = this;

  var E = function () {};
  E.prototype = Super.prototype;
  var prototype = new E();

  function Class() {
    return Super.apply(this, arguments);
  }
  _assign(prototype, Class.prototype);
  Class.prototype = prototype;
  Class.prototype.constructor = Class;

  Class.Interface = _assign({}, Super.Interface, Interface);
  Class.extend = Super.extend;
  addEventPoolingTo(Class);

  return Class;
};

addEventPoolingTo(SyntheticEvent);

/**
 * Helper to nullify syntheticEvent instance properties when destructing
 *
 * @param {String} propName
 * @param {?object} getVal
 * @return {object} defineProperty object
 */
function getPooledWarningPropertyDefinition(propName, getVal) {
  var isFunction = typeof getVal === 'function';
  return {
    configurable: true,
    set: set,
    get: get
  };

  function set(val) {
    var action = isFunction ? 'setting the method' : 'setting the property';
    warn(action, 'This is effectively a no-op');
    return val;
  }

  function get() {
    var action = isFunction ? 'accessing the method' : 'accessing the property';
    var result = isFunction ? 'This is a no-op function' : 'This is set to null';
    warn(action, result);
    return getVal;
  }

  function warn(action, result) {
    var warningCondition = false;
    !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
  }
}

function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
  var EventConstructor = this;
  if (EventConstructor.eventPool.length) {
    var instance = EventConstructor.eventPool.pop();
    EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
    return instance;
  }
  return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
}

function releasePooledEvent(event) {
  var EventConstructor = this;
  !(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
  event.destructor();
  if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
    EventConstructor.eventPool.push(event);
  }
}

function addEventPoolingTo(EventConstructor) {
  EventConstructor.eventPool = [];
  EventConstructor.getPooled = getPooledEvent;
  EventConstructor.release = releasePooledEvent;
}

/**
 * @interface Event
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
 */
var SyntheticCompositionEvent = SyntheticEvent.extend({
  data: null
});

/**
 * @interface Event
 * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
 *      /#events-inputevents
 */
var SyntheticInputEvent = SyntheticEvent.extend({
  data: null
});

var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
var START_KEYCODE = 229;

var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;

var documentMode = null;
if (canUseDOM && 'documentMode' in document) {
  documentMode = document.documentMode;
}

// Webkit offers a very useful `textInput` event that can be used to
// directly represent `beforeInput`. The IE `textinput` event is not as
// useful, so we don't use it.
var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode;

// In IE9+, we have access to composition events, but the data supplied
// by the native compositionend event may be incorrect. Japanese ideographic
// spaces, for instance (\u3000) are not recorded correctly.
var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);

var SPACEBAR_CODE = 32;
var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);

// Events and their corresponding property names.
var eventTypes = {
  beforeInput: {
    phasedRegistrationNames: {
      bubbled: 'onBeforeInput',
      captured: 'onBeforeInputCapture'
    },
    dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
  },
  compositionEnd: {
    phasedRegistrationNames: {
      bubbled: 'onCompositionEnd',
      captured: 'onCompositionEndCapture'
    },
    dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  },
  compositionStart: {
    phasedRegistrationNames: {
      bubbled: 'onCompositionStart',
      captured: 'onCompositionStartCapture'
    },
    dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  },
  compositionUpdate: {
    phasedRegistrationNames: {
      bubbled: 'onCompositionUpdate',
      captured: 'onCompositionUpdateCapture'
    },
    dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
  }
};

// Track whether we've ever handled a keypress on the space key.
var hasSpaceKeypress = false;

/**
 * Return whether a native keypress event is assumed to be a command.
 * This is required because Firefox fires `keypress` events for key commands
 * (cut, copy, select-all, etc.) even though no character is inserted.
 */
function isKeypressCommand(nativeEvent) {
  return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&
  // ctrlKey && altKey is equivalent to AltGr, and is not a command.
  !(nativeEvent.ctrlKey && nativeEvent.altKey);
}

/**
 * Translate native top level events into event types.
 *
 * @param {string} topLevelType
 * @return {object}
 */
function getCompositionEventType(topLevelType) {
  switch (topLevelType) {
    case TOP_COMPOSITION_START:
      return eventTypes.compositionStart;
    case TOP_COMPOSITION_END:
      return eventTypes.compositionEnd;
    case TOP_COMPOSITION_UPDATE:
      return eventTypes.compositionUpdate;
  }
}

/**
 * Does our fallback best-guess model think this event signifies that
 * composition has begun?
 *
 * @param {string} topLevelType
 * @param {object} nativeEvent
 * @return {boolean}
 */
function isFallbackCompositionStart(topLevelType, nativeEvent) {
  return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
}

/**
 * Does our fallback mode think that this event is the end of composition?
 *
 * @param {string} topLevelType
 * @param {object} nativeEvent
 * @return {boolean}
 */
function isFallbackCompositionEnd(topLevelType, nativeEvent) {
  switch (topLevelType) {
    case TOP_KEY_UP:
      // Command keys insert or clear IME input.
      return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
    case TOP_KEY_DOWN:
      // Expect IME keyCode on each keydown. If we get any other
      // code we must have exited earlier.
      return nativeEvent.keyCode !== START_KEYCODE;
    case TOP_KEY_PRESS:
    case TOP_MOUSE_DOWN:
    case TOP_BLUR:
      // Events are not possible without cancelling IME.
      return true;
    default:
      return false;
  }
}

/**
 * Google Input Tools provides composition data via a CustomEvent,
 * with the `data` property populated in the `detail` object. If this
 * is available on the event object, use it. If not, this is a plain
 * composition event and we have nothing special to extract.
 *
 * @param {object} nativeEvent
 * @return {?string}
 */
function getDataFromCustomEvent(nativeEvent) {
  var detail = nativeEvent.detail;
  if (typeof detail === 'object' && 'data' in detail) {
    return detail.data;
  }
  return null;
}

/**
 * Check if a composition event was triggered by Korean IME.
 * Our fallback mode does not work well with IE's Korean IME,
 * so just use native composition events when Korean IME is used.
 * Although CompositionEvent.locale property is deprecated,
 * it is available in IE, where our fallback mode is enabled.
 *
 * @param {object} nativeEvent
 * @return {boolean}
 */
function isUsingKoreanIME(nativeEvent) {
  return nativeEvent.locale === 'ko';
}

// Track the current IME composition status, if any.
var isComposing = false;

/**
 * @return {?object} A SyntheticCompositionEvent.
 */
function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var eventType = void 0;
  var fallbackData = void 0;

  if (canUseCompositionEvent) {
    eventType = getCompositionEventType(topLevelType);
  } else if (!isComposing) {
    if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
      eventType = eventTypes.compositionStart;
    }
  } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
    eventType = eventTypes.compositionEnd;
  }

  if (!eventType) {
    return null;
  }

  if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
    // The current composition is stored statically and must not be
    // overwritten while composition continues.
    if (!isComposing && eventType === eventTypes.compositionStart) {
      isComposing = initialize(nativeEventTarget);
    } else if (eventType === eventTypes.compositionEnd) {
      if (isComposing) {
        fallbackData = getData();
      }
    }
  }

  var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);

  if (fallbackData) {
    // Inject data generated from fallback path into the synthetic event.
    // This matches the property of native CompositionEventInterface.
    event.data = fallbackData;
  } else {
    var customData = getDataFromCustomEvent(nativeEvent);
    if (customData !== null) {
      event.data = customData;
    }
  }

  accumulateTwoPhaseDispatches(event);
  return event;
}

/**
 * @param {TopLevelType} topLevelType Number from `TopLevelType`.
 * @param {object} nativeEvent Native browser event.
 * @return {?string} The string corresponding to this `beforeInput` event.
 */
function getNativeBeforeInputChars(topLevelType, nativeEvent) {
  switch (topLevelType) {
    case TOP_COMPOSITION_END:
      return getDataFromCustomEvent(nativeEvent);
    case TOP_KEY_PRESS:
      /**
       * If native `textInput` events are available, our goal is to make
       * use of them. However, there is a special case: the spacebar key.
       * In Webkit, preventing default on a spacebar `textInput` event
       * cancels character insertion, but it *also* causes the browser
       * to fall back to its default spacebar behavior of scrolling the
       * page.
       *
       * Tracking at:
       * https://code.google.com/p/chromium/issues/detail?id=355103
       *
       * To avoid this issue, use the keypress event as if no `textInput`
       * event is available.
       */
      var which = nativeEvent.which;
      if (which !== SPACEBAR_CODE) {
        return null;
      }

      hasSpaceKeypress = true;
      return SPACEBAR_CHAR;

    case TOP_TEXT_INPUT:
      // Record the characters to be added to the DOM.
      var chars = nativeEvent.data;

      // If it's a spacebar character, assume that we have already handled
      // it at the keypress level and bail immediately. Android Chrome
      // doesn't give us keycodes, so we need to ignore it.
      if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
        return null;
      }

      return chars;

    default:
      // For other native event types, do nothing.
      return null;
  }
}

/**
 * For browsers that do not provide the `textInput` event, extract the
 * appropriate string to use for SyntheticInputEvent.
 *
 * @param {number} topLevelType Number from `TopLevelEventTypes`.
 * @param {object} nativeEvent Native browser event.
 * @return {?string} The fallback string for this `beforeInput` event.
 */
function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
  // If we are currently composing (IME) and using a fallback to do so,
  // try to extract the composed characters from the fallback object.
  // If composition event is available, we extract a string only at
  // compositionevent, otherwise extract it at fallback events.
  if (isComposing) {
    if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
      var chars = getData();
      reset();
      isComposing = false;
      return chars;
    }
    return null;
  }

  switch (topLevelType) {
    case TOP_PASTE:
      // If a paste event occurs after a keypress, throw out the input
      // chars. Paste events should not lead to BeforeInput events.
      return null;
    case TOP_KEY_PRESS:
      /**
       * As of v27, Firefox may fire keypress events even when no character
       * will be inserted. A few possibilities:
       *
       * - `which` is `0`. Arrow keys, Esc key, etc.
       *
       * - `which` is the pressed key code, but no char is available.
       *   Ex: 'AltGr + d` in Polish. There is no modified character for
       *   this key combination and no character is inserted into the
       *   document, but FF fires the keypress for char code `100` anyway.
       *   No `input` event will occur.
       *
       * - `which` is the pressed key code, but a command combination is
       *   being used. Ex: `Cmd+C`. No character is inserted, and no
       *   `input` event will occur.
       */
      if (!isKeypressCommand(nativeEvent)) {
        // IE fires the `keypress` event when a user types an emoji via
        // Touch keyboard of Windows.  In such a case, the `char` property
        // holds an emoji character like `\uD83D\uDE0A`.  Because its length
        // is 2, the property `which` does not represent an emoji correctly.
        // In such a case, we directly return the `char` property instead of
        // using `which`.
        if (nativeEvent.char && nativeEvent.char.length > 1) {
          return nativeEvent.char;
        } else if (nativeEvent.which) {
          return String.fromCharCode(nativeEvent.which);
        }
      }
      return null;
    case TOP_COMPOSITION_END:
      return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
    default:
      return null;
  }
}

/**
 * Extract a SyntheticInputEvent for `beforeInput`, based on either native
 * `textInput` or fallback behavior.
 *
 * @return {?object} A SyntheticInputEvent.
 */
function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
  var chars = void 0;

  if (canUseTextInputEvent) {
    chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
  } else {
    chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
  }

  // If no characters are being inserted, no BeforeInput event should
  // be fired.
  if (!chars) {
    return null;
  }

  var event = SyntheticInputEvent.getPooled(eventTypes.beforeInput, targetInst, nativeEvent, nativeEventTarget);

  event.data = chars;
  accumulateTwoPhaseDispatches(event);
  return event;
}

/**
 * Create an `onBeforeInput` event to match
 * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
 *
 * This event plugin is based on the native `textInput` event
 * available in Chrome, Safari, Opera, and IE. This event fires after
 * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
 *
 * `beforeInput` is spec'd but not implemented in any browsers, and
 * the `input` event does not provide any useful information about what has
 * actually been added, contrary to the spec. Thus, `textInput` is the best
 * available event to identify the characters that have actually been inserted
 * into the target node.
 *
 * This plugin is also responsible for emitting `composition` events, thus
 * allowing us to share composition fallback code for both `beforeInput` and
 * `composition` event types.
 */
var BeforeInputEventPlugin = {
  eventTypes: eventTypes,

  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);

    var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);

    if (composition === null) {
      return beforeInput;
    }

    if (beforeInput === null) {
      return composition;
    }

    return [composition, beforeInput];
  }
};

// Use to restore controlled state after a change event has fired.

var restoreImpl = null;
var restoreTarget = null;
var restoreQueue = null;

function restoreStateOfTarget(target) {
  // We perform this translation at the end of the event loop so that we
  // always receive the correct fiber here
  var internalInstance = getInstanceFromNode(target);
  if (!internalInstance) {
    // Unmounted
    return;
  }
  !(typeof restoreImpl === 'function') ? invariant(false, 'setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
  restoreImpl(internalInstance.stateNode, internalInstance.type, props);
}

function setRestoreImplementation(impl) {
  restoreImpl = impl;
}

function enqueueStateRestore(target) {
  if (restoreTarget) {
    if (restoreQueue) {
      restoreQueue.push(target);
    } else {
      restoreQueue = [target];
    }
  } else {
    restoreTarget = target;
  }
}

function needsStateRestore() {
  return restoreTarget !== null || restoreQueue !== null;
}

function restoreStateIfNeeded() {
  if (!restoreTarget) {
    return;
  }
  var target = restoreTarget;
  var queuedTargets = restoreQueue;
  restoreTarget = null;
  restoreQueue = null;

  restoreStateOfTarget(target);
  if (queuedTargets) {
    for (var i = 0; i < queuedTargets.length; i++) {
      restoreStateOfTarget(queuedTargets[i]);
    }
  }
}

// Used as a way to call batchedUpdates when we don't have a reference to
// the renderer. Such as when we're dispatching events or if third party
// libraries need to call batchedUpdates. Eventually, this API will go away when
// everything is batched by default. We'll then have a similar API to opt-out of
// scheduled work and instead do synchronous work.

// Defaults
var _batchedUpdatesImpl = function (fn, bookkeeping) {
  return fn(bookkeeping);
};
var _interactiveUpdatesImpl = function (fn, a, b) {
  return fn(a, b);
};
var _flushInteractiveUpdatesImpl = function () {};

var isBatching = false;
function batchedUpdates(fn, bookkeeping) {
  if (isBatching) {
    // If we are currently inside another batch, we need to wait until it
    // fully completes before restoring state.
    return fn(bookkeeping);
  }
  isBatching = true;
  try {
    return _batchedUpdatesImpl(fn, bookkeeping);
  } finally {
    // Here we wait until all updates have propagated, which is important
    // when using controlled components within layers:
    // https://github.com/facebook/react/issues/1698
    // Then we restore state of any controlled component.
    isBatching = false;
    var controlledComponentsHavePendingUpdates = needsStateRestore();
    if (controlledComponentsHavePendingUpdates) {
      // If a controlled event was fired, we may need to restore the state of
      // the DOM node back to the controlled value. This is necessary when React
      // bails out of the update without touching the DOM.
      _flushInteractiveUpdatesImpl();
      restoreStateIfNeeded();
    }
  }
}

function interactiveUpdates(fn, a, b) {
  return _interactiveUpdatesImpl(fn, a, b);
}



function setBatchingImplementation(batchedUpdatesImpl, interactiveUpdatesImpl, flushInteractiveUpdatesImpl) {
  _batchedUpdatesImpl = batchedUpdatesImpl;
  _interactiveUpdatesImpl = interactiveUpdatesImpl;
  _flushInteractiveUpdatesImpl = flushInteractiveUpdatesImpl;
}

/**
 * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
 */
var supportedInputTypes = {
  color: true,
  date: true,
  datetime: true,
  'datetime-local': true,
  email: true,
  month: true,
  number: true,
  password: true,
  range: true,
  search: true,
  tel: true,
  text: true,
  time: true,
  url: true,
  week: true
};

function isTextInputElement(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();

  if (nodeName === 'input') {
    return !!supportedInputTypes[elem.type];
  }

  if (nodeName === 'textarea') {
    return true;
  }

  return false;
}

/**
 * HTML nodeType values that represent the type of the node
 */

var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COMMENT_NODE = 8;
var DOCUMENT_NODE = 9;
var DOCUMENT_FRAGMENT_NODE = 11;

/**
 * Gets the target node from a native browser event by accounting for
 * inconsistencies in browser DOM APIs.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {DOMEventTarget} Target node.
 */
function getEventTarget(nativeEvent) {
  // Fallback to nativeEvent.srcElement for IE9
  // https://github.com/facebook/react/issues/12506
  var target = nativeEvent.target || nativeEvent.srcElement || window;

  // Normalize SVG <use> element events #4963
  if (target.correspondingUseElement) {
    target = target.correspondingUseElement;
  }

  // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
  // @see http://www.quirksmode.org/js/events_properties.html
  return target.nodeType === TEXT_NODE ? target.parentNode : target;
}

/**
 * Checks if an event is supported in the current execution environment.
 *
 * NOTE: This will not work correctly for non-generic events such as `change`,
 * `reset`, `load`, `error`, and `select`.
 *
 * Borrows from Modernizr.
 *
 * @param {string} eventNameSuffix Event name, e.g. "click".
 * @return {boolean} True if the event is supported.
 * @internal
 * @license Modernizr 3.0.0pre (Custom Build) | MIT
 */
function isEventSupported(eventNameSuffix) {
  if (!canUseDOM) {
    return false;
  }

  var eventName = 'on' + eventNameSuffix;
  var isSupported = eventName in document;

  if (!isSupported) {
    var element = document.createElement('div');
    element.setAttribute(eventName, 'return;');
    isSupported = typeof element[eventName] === 'function';
  }

  return isSupported;
}

function isCheckable(elem) {
  var type = elem.type;
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
}

function getTracker(node) {
  return node._valueTracker;
}

function detachTracker(node) {
  node._valueTracker = null;
}

function getValueFromNode(node) {
  var value = '';
  if (!node) {
    return value;
  }

  if (isCheckable(node)) {
    value = node.checked ? 'true' : 'false';
  } else {
    value = node.value;
  }

  return value;
}

function trackValueOnNode(node) {
  var valueField = isCheckable(node) ? 'checked' : 'value';
  var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);

  var currentValue = '' + node[valueField];

  // if someone has already defined a value or Safari, then bail
  // and don't track value will cause over reporting of changes,
  // but it's better then a hard failure
  // (needed for certain tests that spyOn input values and Safari)
  if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
    return;
  }
  var get = descriptor.get,
      set = descriptor.set;

  Object.defineProperty(node, valueField, {
    configurable: true,
    get: function () {
      return get.call(this);
    },
    set: function (value) {
      currentValue = '' + value;
      set.call(this, value);
    }
  });
  // We could've passed this the first time
  // but it triggers a bug in IE11 and Edge 14/15.
  // Calling defineProperty() again should be equivalent.
  // https://github.com/facebook/react/issues/11768
  Object.defineProperty(node, valueField, {
    enumerable: descriptor.enumerable
  });

  var tracker = {
    getValue: function () {
      return currentValue;
    },
    setValue: function (value) {
      currentValue = '' + value;
    },
    stopTracking: function () {
      detachTracker(node);
      delete node[valueField];
    }
  };
  return tracker;
}

function track(node) {
  if (getTracker(node)) {
    return;
  }

  // TODO: Once it's just Fiber we can move this to node._wrapperState
  node._valueTracker = trackValueOnNode(node);
}

function updateValueIfChanged(node) {
  if (!node) {
    return false;
  }

  var tracker = getTracker(node);
  // if there is no tracker at this point it's unlikely
  // that trying again will succeed
  if (!tracker) {
    return true;
  }

  var lastValue = tracker.getValue();
  var nextValue = getValueFromNode(node);
  if (nextValue !== lastValue) {
    tracker.setValue(nextValue);
    return true;
  }
  return false;
}

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

// Prevent newer renderers from RTE when used with older react package versions.
// Current owner and dispatcher used to share the same ref,
// but PR #14548 split them out to better support the react-debug-tools package.
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
  ReactSharedInternals.ReactCurrentDispatcher = {
    current: null
  };
}

var BEFORE_SLASH_RE = /^(.*)[\\\/]/;

var describeComponentFrame = function (name, source, ownerName) {
  var sourceInfo = '';
  if (source) {
    var path = source.fileName;
    var fileName = path.replace(BEFORE_SLASH_RE, '');
    {
      // In DEV, include code for a common special case:
      // prefer "folder/index.js" instead of just "index.js".
      if (/^index\./.test(fileName)) {
        var match = path.match(BEFORE_SLASH_RE);
        if (match) {
          var pathBeforeSlash = match[1];
          if (pathBeforeSlash) {
            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
            fileName = folderName + '/' + fileName;
          }
        }
      }
    }
    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  } else if (ownerName) {
    sourceInfo = ' (created by ' + ownerName + ')';
  }
  return '\n    in ' + (name || 'Unknown') + sourceInfo;
};

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;

var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;

var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';

function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }
  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }
  return null;
}

var Pending = 0;
var Resolved = 1;
var Rejected = 2;

function refineResolvedLazyComponent(lazyComponent) {
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }
  {
    if (typeof type.tag === 'number') {
      warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }
  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }
  if (typeof type === 'string') {
    return type;
  }
  switch (type) {
    case REACT_CONCURRENT_MODE_TYPE:
      return 'ConcurrentMode';
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';
    case REACT_PORTAL_TYPE:
      return 'Portal';
    case REACT_PROFILER_TYPE:
      return 'Profiler';
    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';
    case REACT_SUSPENSE_TYPE:
      return 'Suspense';
  }
  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        return 'Context.Consumer';
      case REACT_PROVIDER_TYPE:
        return 'Context.Provider';
      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');
      case REACT_MEMO_TYPE:
        return getComponentName(type.type);
      case REACT_LAZY_TYPE:
        {
          var thenable = type;
          var resolvedThenable = refineResolvedLazyComponent(thenable);
          if (resolvedThenable) {
            return getComponentName(resolvedThenable);
          }
        }
    }
  }
  return null;
}

var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;

function describeFiber(fiber) {
  switch (fiber.tag) {
    case HostRoot:
    case HostPortal:
    case HostText:
    case Fragment:
    case ContextProvider:
    case ContextConsumer:
      return '';
    default:
      var owner = fiber._debugOwner;
      var source = fiber._debugSource;
      var name = getComponentName(fiber.type);
      var ownerName = null;
      if (owner) {
        ownerName = getComponentName(owner.type);
      }
      return describeComponentFrame(name, source, ownerName);
  }
}

function getStackByFiberInDevAndProd(workInProgress) {
  var info = '';
  var node = workInProgress;
  do {
    info += describeFiber(node);
    node = node.return;
  } while (node);
  return info;
}

var current = null;
var phase = null;

function getCurrentFiberOwnerNameInDevOrNull() {
  {
    if (current === null) {
      return null;
    }
    var owner = current._debugOwner;
    if (owner !== null && typeof owner !== 'undefined') {
      return getComponentName(owner.type);
    }
  }
  return null;
}

function getCurrentFiberStackInDev() {
  {
    if (current === null) {
      return '';
    }
    // Safe because if current fiber exists, we are reconciling,
    // and it is guaranteed to be the work-in-progress version.
    return getStackByFiberInDevAndProd(current);
  }
  return '';
}

function resetCurrentFiber() {
  {
    ReactDebugCurrentFrame.getCurrentStack = null;
    current = null;
    phase = null;
  }
}

function setCurrentFiber(fiber) {
  {
    ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
    current = fiber;
    phase = null;
  }
}

function setCurrentPhase(lifeCyclePhase) {
  {
    phase = lifeCyclePhase;
  }
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warning = warningWithoutStack$1;

{
  warning = function (condition, format) {
    if (condition) {
      return;
    }
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();
    // eslint-disable-next-line react-internal/warning-and-invariant-args

    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
  };
}

var warning$1 = warning;

// A reserved attribute.
// It is handled by React separately and shouldn't be written to the DOM.
var RESERVED = 0;

// A simple string attribute.
// Attributes that aren't in the whitelist are presumed to have this type.
var STRING = 1;

// A string attribute that accepts booleans in React. In HTML, these are called
// "enumerated" attributes with "true" and "false" as possible values.
// When true, it should be set to a "true" string.
// When false, it should be set to a "false" string.
var BOOLEANISH_STRING = 2;

// A real boolean attribute.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
var BOOLEAN = 3;

// An attribute that can be used as a flag as well as with a value.
// When true, it should be present (set either to an empty string or its name).
// When false, it should be omitted.
// For any other value, should be present with that value.
var OVERLOADED_BOOLEAN = 4;

// An attribute that must be numeric or parse as a numeric.
// When falsy, it should be removed.
var NUMERIC = 5;

// An attribute that must be positive numeric or parse as a positive numeric.
// When falsy, it should be removed.
var POSITIVE_NUMERIC = 6;

/* eslint-disable max-len */
var ATTRIBUTE_NAME_START_CHAR = ':A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
/* eslint-enable max-len */
var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + '\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040';


var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');

var hasOwnProperty = Object.prototype.hasOwnProperty;
var illegalAttributeNameCache = {};
var validatedAttributeNameCache = {};

function isAttributeNameSafe(attributeName) {
  if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
    return true;
  }
  if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
    return false;
  }
  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
    validatedAttributeNameCache[attributeName] = true;
    return true;
  }
  illegalAttributeNameCache[attributeName] = true;
  {
    warning$1(false, 'Invalid attribute name: `%s`', attributeName);
  }
  return false;
}

function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null) {
    return propertyInfo.type === RESERVED;
  }
  if (isCustomComponentTag) {
    return false;
  }
  if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
    return true;
  }
  return false;
}

function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
  if (propertyInfo !== null && propertyInfo.type === RESERVED) {
    return false;
  }
  switch (typeof value) {
    case 'function':
    // $FlowIssue symbol is perfectly valid here
    case 'symbol':
      // eslint-disable-line
      return true;
    case 'boolean':
      {
        if (isCustomComponentTag) {
          return false;
        }
        if (propertyInfo !== null) {
          return !propertyInfo.acceptsBooleans;
        } else {
          var prefix = name.toLowerCase().slice(0, 5);
          return prefix !== 'data-' && prefix !== 'aria-';
        }
      }
    default:
      return false;
  }
}

function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
  if (value === null || typeof value === 'undefined') {
    return true;
  }
  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
    return true;
  }
  if (isCustomComponentTag) {
    return false;
  }
  if (propertyInfo !== null) {
    switch (propertyInfo.type) {
      case BOOLEAN:
        return !value;
      case OVERLOADED_BOOLEAN:
        return value === false;
      case NUMERIC:
        return isNaN(value);
      case POSITIVE_NUMERIC:
        return isNaN(value) || value < 1;
    }
  }
  return false;
}

function getPropertyInfo(name) {
  return properties.hasOwnProperty(name) ? properties[name] : null;
}

function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace) {
  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
  this.attributeName = attributeName;
  this.attributeNamespace = attributeNamespace;
  this.mustUseProperty = mustUseProperty;
  this.propertyName = name;
  this.type = type;
}

// When adding attributes to this list, be sure to also add them to
// the `possibleStandardNames` module to ensure casing and incorrect
// name warnings.
var properties = {};

// These props are reserved by React. They shouldn't be written to the DOM.
['children', 'dangerouslySetInnerHTML',
// TODO: This prevents the assignment of defaultValue to regular
// elements (not just inputs). Now that ReactDOMInput assigns to the
// defaultValue property -- do we need this?
'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// A few React string attributes have a different name.
// This is a mapping from React prop names to the attribute names.
[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
  var name = _ref[0],
      attributeName = _ref[1];

  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, // attributeName
  null);
} // attributeNamespace
);

// These are "enumerated" HTML attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

// These are "enumerated" SVG attributes that accept "true" and "false".
// In React, we let users pass `true` and `false` even though technically
// these aren't boolean attributes (they are coerced to strings).
// Since these are SVG attributes, their attribute names are case-sensitive.
['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML boolean attributes.
['allowFullScreen', 'async',
// Note: there is a special case that prevents it from being written to the DOM
// on the client side because the browsers are inconsistent. Instead we call focus().
'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',
// Microdata
'itemScope'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

// These are the few React props that we set as DOM properties
// rather than attributes. These are all booleans.
['checked',
// Note: `option.selected` is not updated if `select.multiple` is
// disabled with `removeAttribute`. We have special logic for handling this.
'multiple', 'muted', 'selected'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML attributes that are "overloaded booleans": they behave like
// booleans, but can also accept a string value.
['capture', 'download'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML attributes that must be positive numbers.
['cols', 'rows', 'size', 'span'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
  name, // attributeName
  null);
} // attributeNamespace
);

// These are HTML attributes that must be numbers.
['rowSpan', 'start'].forEach(function (name) {
  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
  name.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

var CAMELIZE = /[\-\:]([a-z])/g;
var capitalize = function (token) {
  return token[1].toUpperCase();
};

// This is a list of all SVG attributes that need special casing, namespacing,
// or boolean value assignment. Regular attributes that just accept strings
// and have the same names are omitted, just like in the HTML whitelist.
// Some of these attributes can be hard to find. This list was created by
// scrapping the MDN documentation.
['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, null);
} // attributeNamespace
);

// String SVG attributes with the xlink namespace.
['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/1999/xlink');
});

// String SVG attributes with the xml namespace.
['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
  var name = attributeName.replace(CAMELIZE, capitalize);
  properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
  attributeName, 'http://www.w3.org/XML/1998/namespace');
});

// These attribute exists both in HTML and SVG.
// The attribute name is case-sensitive in SVG so we can't just use
// the React name like we do for attributes that exist only in HTML.
['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
  properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
  attributeName.toLowerCase(), // attributeName
  null);
} // attributeNamespace
);

/**
 * Get the value for a property on a node. Only used in DEV for SSR validation.
 * The "expected" argument is used as a hint of what the expected value is.
 * Some properties have multiple equivalent values.
 */
function getValueForProperty(node, name, expected, propertyInfo) {
  {
    if (propertyInfo.mustUseProperty) {
      var propertyName = propertyInfo.propertyName;

      return node[propertyName];
    } else {
      var attributeName = propertyInfo.attributeName;

      var stringValue = null;

      if (propertyInfo.type === OVERLOADED_BOOLEAN) {
        if (node.hasAttribute(attributeName)) {
          var value = node.getAttribute(attributeName);
          if (value === '') {
            return true;
          }
          if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
            return value;
          }
          if (value === '' + expected) {
            return expected;
          }
          return value;
        }
      } else if (node.hasAttribute(attributeName)) {
        if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
          // We had an attribute but shouldn't have had one, so read it
          // for the error message.
          return node.getAttribute(attributeName);
        }
        if (propertyInfo.type === BOOLEAN) {
          // If this was a boolean, it doesn't matter what the value is
          // the fact that we have it is the same as the expected.
          return expected;
        }
        // Even if this property uses a namespace we use getAttribute
        // because we assume its namespaced name is the same as our config.
        // To use getAttributeNS we need the local name which we don't have
        // in our config atm.
        stringValue = node.getAttribute(attributeName);
      }

      if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
        return stringValue === null ? expected : stringValue;
      } else if (stringValue === '' + expected) {
        return expected;
      } else {
        return stringValue;
      }
    }
  }
}

/**
 * Get the value for a attribute on a node. Only used in DEV for SSR validation.
 * The third argument is used as a hint of what the expected value is. Some
 * attributes have multiple equivalent values.
 */
function getValueForAttribute(node, name, expected) {
  {
    if (!isAttributeNameSafe(name)) {
      return;
    }
    if (!node.hasAttribute(name)) {
      return expected === undefined ? undefined : null;
    }
    var value = node.getAttribute(name);
    if (value === '' + expected) {
      return expected;
    }
    return value;
  }
}

/**
 * Sets the value for a property on a node.
 *
 * @param {DOMElement} node
 * @param {string} name
 * @param {*} value
 */
function setValueForProperty(node, name, value, isCustomComponentTag) {
  var propertyInfo = getPropertyInfo(name);
  if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
    return;
  }
  if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
    value = null;
  }
  // If the prop isn't in the special list, treat it as a simple attribute.
  if (isCustomComponentTag || propertyInfo === null) {
    if (isAttributeNameSafe(name)) {
      var _attributeName = name;
      if (value === null) {
        node.removeAttribute(_attributeName);
      } else {
        node.setAttribute(_attributeName, '' + value);
      }
    }
    return;
  }
  var mustUseProperty = propertyInfo.mustUseProperty;

  if (mustUseProperty) {
    var propertyName = propertyInfo.propertyName;

    if (value === null) {
      var type = propertyInfo.type;

      node[propertyName] = type === BOOLEAN ? false : '';
    } else {
      // Contrary to `setAttribute`, object properties are properly
      // `toString`ed by IE8/9.
      node[propertyName] = value;
    }
    return;
  }
  // The rest are treated as attributes with special cases.
  var attributeName = propertyInfo.attributeName,
      attributeNamespace = propertyInfo.attributeNamespace;

  if (value === null) {
    node.removeAttribute(attributeName);
  } else {
    var _type = propertyInfo.type;

    var attributeValue = void 0;
    if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
      attributeValue = '';
    } else {
      // `setAttribute` with objects becomes only `[object]` in IE8/9,
      // ('' + value) makes it output the correct toString()-value.
      attributeValue = '' + value;
    }
    if (attributeNamespace) {
      node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
    } else {
      node.setAttribute(attributeName, attributeValue);
    }
  }
}

// Flow does not allow string concatenation of most non-string types. To work
// around this limitation, we use an opaque type that can only be obtained by
// passing the value through getToStringValue first.
function toString(value) {
  return '' + value;
}

function getToStringValue(value) {
  switch (typeof value) {
    case 'boolean':
    case 'number':
    case 'object':
    case 'string':
    case 'undefined':
      return value;
    default:
      // function, symbol are assigned as empty strings
      return '';
  }
}

var ReactDebugCurrentFrame$1 = null;

var ReactControlledValuePropTypes = {
  checkPropTypes: null
};

{
  ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;

  var hasReadOnlyValue = {
    button: true,
    checkbox: true,
    image: true,
    hidden: true,
    radio: true,
    reset: true,
    submit: true
  };

  var propTypes = {
    value: function (props, propName, componentName) {
      if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null) {
        return null;
      }
      return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    },
    checked: function (props, propName, componentName) {
      if (props.onChange || props.readOnly || props.disabled || props[propName] == null) {
        return null;
      }
      return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
    }
  };

  /**
   * Provide a linked `value` attribute for controlled forms. You should not use
   * this outside of the ReactDOM controlled form components.
   */
  ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
    checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$1.getStackAddendum);
  };
}

var enableUserTimingAPI = true;

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
var debugRenderPhaseSideEffects = false;

// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:
var debugRenderPhaseSideEffectsForStrictMode = true;

// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.
var replayFailedUnitOfWorkWithInvokeGuardedCallback = true;

// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
var warnAboutDeprecatedLifecycles = false;

// Gather advanced timing metrics for Profiler subtrees.
var enableProfilerTimer = true;

// Trace which interactions trigger each commit.
var enableSchedulerTracing = true;

// Only used in www builds.
var enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties
var disableInputAttributeSyncing = false;

// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
var enableStableConcurrentModeAPIs = false;

var warnAboutShorthandPropertyCollision = false;

// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnValueDefaultValue = false;
var didWarnCheckedDefaultChecked = false;
var didWarnControlledToUncontrolled = false;
var didWarnUncontrolledToControlled = false;

function isControlled(props) {
  var usesChecked = props.type === 'checkbox' || props.type === 'radio';
  return usesChecked ? props.checked != null : props.value != null;
}

/**
 * Implements an <input> host component that allows setting these optional
 * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
 *
 * If `checked` or `value` are not supplied (or null/undefined), user actions
 * that affect the checked state or value will trigger updates to the element.
 *
 * If they are supplied (and not null/undefined), the rendered element will not
 * trigger updates to the element. Instead, the props must change in order for
 * the rendered element to be updated.
 *
 * The rendered element will be initialized as unchecked (or `defaultChecked`)
 * with an empty value (or `defaultValue`).
 *
 * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
 */

function getHostProps(element, props) {
  var node = element;
  var checked = props.checked;

  var hostProps = _assign({}, props, {
    defaultChecked: undefined,
    defaultValue: undefined,
    value: undefined,
    checked: checked != null ? checked : node._wrapperState.initialChecked
  });

  return hostProps;
}

function initWrapperState(element, props) {
  {
    ReactControlledValuePropTypes.checkPropTypes('input', props);

    if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
      warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
      didWarnCheckedDefaultChecked = true;
    }
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
      warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
      didWarnValueDefaultValue = true;
    }
  }

  var node = element;
  var defaultValue = props.defaultValue == null ? '' : props.defaultValue;

  node._wrapperState = {
    initialChecked: props.checked != null ? props.checked : props.defaultChecked,
    initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
    controlled: isControlled(props)
  };
}

function updateChecked(element, props) {
  var node = element;
  var checked = props.checked;
  if (checked != null) {
    setValueForProperty(node, 'checked', checked, false);
  }
}

function updateWrapper(element, props) {
  var node = element;
  {
    var _controlled = isControlled(props);

    if (!node._wrapperState.controlled && _controlled && !didWarnUncontrolledToControlled) {
      warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
      didWarnUncontrolledToControlled = true;
    }
    if (node._wrapperState.controlled && !_controlled && !didWarnControlledToUncontrolled) {
      warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
      didWarnControlledToUncontrolled = true;
    }
  }

  updateChecked(element, props);

  var value = getToStringValue(props.value);
  var type = props.type;

  if (value != null) {
    if (type === 'number') {
      if (value === 0 && node.value === '' ||
      // We explicitly want to coerce to number here if possible.
      // eslint-disable-next-line
      node.value != value) {
        node.value = toString(value);
      }
    } else if (node.value !== toString(value)) {
      node.value = toString(value);
    }
  } else if (type === 'submit' || type === 'reset') {
    // Submit/reset inputs need the attribute removed completely to avoid
    // blank-text buttons.
    node.removeAttribute('value');
    return;
  }

  if (disableInputAttributeSyncing) {
    // When not syncing the value attribute, React only assigns a new value
    // whenever the defaultValue React prop has changed. When not present,
    // React does nothing
    if (props.hasOwnProperty('defaultValue')) {
      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
    }
  } else {
    // When syncing the value attribute, the value comes from a cascade of
    // properties:
    //  1. The value React property
    //  2. The defaultValue React property
    //  3. Otherwise there should be no change
    if (props.hasOwnProperty('value')) {
      setDefaultValue(node, props.type, value);
    } else if (props.hasOwnProperty('defaultValue')) {
      setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
    }
  }

  if (disableInputAttributeSyncing) {
    // When not syncing the checked attribute, the attribute is directly
    // controllable from the defaultValue React property. It needs to be
    // updated as new props come in.
    if (props.defaultChecked == null) {
      node.removeAttribute('checked');
    } else {
      node.defaultChecked = !!props.defaultChecked;
    }
  } else {
    // When syncing the checked attribute, it only changes when it needs
    // to be removed, such as transitioning from a checkbox into a text input
    if (props.checked == null && props.defaultChecked != null) {
      node.defaultChecked = !!props.defaultChecked;
    }
  }
}

function postMountWrapper(element, props, isHydrating) {
  var node = element;

  // Do not assign value if it is already set. This prevents user text input
  // from being lost during SSR hydration.
  if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
    var type = props.type;
    var isButton = type === 'submit' || type === 'reset';

    // Avoid setting value attribute on submit/reset inputs as it overrides the
    // default value provided by the browser. See: #12872
    if (isButton && (props.value === undefined || props.value === null)) {
      return;
    }

    var _initialValue = toString(node._wrapperState.initialValue);

    // Do not assign value if it is already set. This prevents user text input
    // from being lost during SSR hydration.
    if (!isHydrating) {
      if (disableInputAttributeSyncing) {
        var value = getToStringValue(props.value);

        // When not syncing the value attribute, the value property points
        // directly to the React prop. Only assign it if it exists.
        if (value != null) {
          // Always assign on buttons so that it is possible to assign an
          // empty string to clear button text.
          //
          // Otherwise, do not re-assign the value property if is empty. This
          // potentially avoids a DOM write and prevents Firefox (~60.0.1) from
          // prematurely marking required inputs as invalid. Equality is compared
          // to the current value in case the browser provided value is not an
          // empty string.
          if (isButton || value !== node.value) {
            node.value = toString(value);
          }
        }
      } else {
        // When syncing the value attribute, the value property should use
        // the wrapperState._initialValue property. This uses:
        //
        //   1. The value React property when present
        //   2. The defaultValue React property when present
        //   3. An empty string
        if (_initialValue !== node.value) {
          node.value = _initialValue;
        }
      }
    }

    if (disableInputAttributeSyncing) {
      // When not syncing the value attribute, assign the value attribute
      // directly from the defaultValue React property (when present)
      var defaultValue = getToStringValue(props.defaultValue);
      if (defaultValue != null) {
        node.defaultValue = toString(defaultValue);
      }
    } else {
      // Otherwise, the value attribute is synchronized to the property,
      // so we assign defaultValue to the same thing as the value property
      // assignment step above.
      node.defaultValue = _initialValue;
    }
  }

  // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
  // this is needed to work around a chrome bug where setting defaultChecked
  // will sometimes influence the value of checked (even after detachment).
  // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
  // We need to temporarily unset name to avoid disrupting radio button groups.
  var name = node.name;
  if (name !== '') {
    node.name = '';
  }

  if (disableInputAttributeSyncing) {
    // When not syncing the checked attribute, the checked property
    // never gets assigned. It must be manually set. We don't want
    // to do this when hydrating so that existing user input isn't
    // modified
    if (!isHydrating) {
      updateChecked(element, props);
    }

    // Only assign the checked attribute if it is defined. This saves
    // a DOM write when controlling the checked attribute isn't needed
    // (text inputs, submit/reset)
    if (props.hasOwnProperty('defaultChecked')) {
      node.defaultChecked = !node.defaultChecked;
      node.defaultChecked = !!props.defaultChecked;
    }
  } else {
    // When syncing the checked attribute, both the checked property and
    // attribute are assigned at the same time using defaultChecked. This uses:
    //
    //   1. The checked React property when present
    //   2. The defaultChecked React property when present
    //   3. Otherwise, false
    node.defaultChecked = !node.defaultChecked;
    node.defaultChecked = !!node._wrapperState.initialChecked;
  }

  if (name !== '') {
    node.name = name;
  }
}

function restoreControlledState(element, props) {
  var node = element;
  updateWrapper(node, props);
  updateNamedCousins(node, props);
}

function updateNamedCousins(rootNode, props) {
  var name = props.name;
  if (props.type === 'radio' && name != null) {
    var queryRoot = rootNode;

    while (queryRoot.parentNode) {
      queryRoot = queryRoot.parentNode;
    }

    // If `rootNode.form` was non-null, then we could try `form.elements`,
    // but that sometimes behaves strangely in IE8. We could also try using
    // `form.getElementsByName`, but that will only return direct children
    // and won't include inputs that use the HTML5 `form=` attribute. Since
    // the input might not even be in a form. It might not even be in the
    // document. Let's just use the local `querySelectorAll` to ensure we don't
    // miss anything.
    var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');

    for (var i = 0; i < group.length; i++) {
      var otherNode = group[i];
      if (otherNode === rootNode || otherNode.form !== rootNode.form) {
        continue;
      }
      // This will throw if radio buttons rendered by different copies of React
      // and the same name are rendered into the same form (same as #1939).
      // That's probably okay; we don't support it just as we don't support
      // mixing React radio buttons with non-React ones.
      var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
      !otherProps ? invariant(false, 'ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.') : void 0;

      // We need update the tracked value on the named cousin since the value
      // was changed but the input saw no event or value set
      updateValueIfChanged(otherNode);

      // If this is a controlled radio button group, forcing the input that
      // was previously checked to update will cause it to be come re-checked
      // as appropriate.
      updateWrapper(otherNode, otherProps);
    }
  }
}

// In Chrome, assigning defaultValue to certain input types triggers input validation.
// For number inputs, the display value loses trailing decimal points. For email inputs,
// Chrome raises "The specified value <x> is not a valid email address".
//
// Here we check to see if the defaultValue has actually changed, avoiding these problems
// when the user is inputting text
//
// https://github.com/facebook/react/issues/7253
function setDefaultValue(node, type, value) {
  if (
  // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
  type !== 'number' || node.ownerDocument.activeElement !== node) {
    if (value == null) {
      node.defaultValue = toString(node._wrapperState.initialValue);
    } else if (node.defaultValue !== toString(value)) {
      node.defaultValue = toString(value);
    }
  }
}

var eventTypes$1 = {
  change: {
    phasedRegistrationNames: {
      bubbled: 'onChange',
      captured: 'onChangeCapture'
    },
    dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
  }
};

function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
  var event = SyntheticEvent.getPooled(eventTypes$1.change, inst, nativeEvent, target);
  event.type = 'change';
  // Flag this event loop as needing state restore.
  enqueueStateRestore(target);
  accumulateTwoPhaseDispatches(event);
  return event;
}
/**
 * For IE shims
 */
var activeElement = null;
var activeElementInst = null;

/**
 * SECTION: handle `change` event
 */
function shouldUseChangeEvent(elem) {
  var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
}

function manualDispatchChangeEvent(nativeEvent) {
  var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent));

  // If change and propertychange bubbled, we'd just bind to it like all the
  // other events and have it go through ReactBrowserEventEmitter. Since it
  // doesn't, we manually listen for the events and so we have to enqueue and
  // process the abstract event manually.
  //
  // Batching is necessary here in order to ensure that all event handlers run
  // before the next rerender (including event handlers attached to ancestor
  // elements instead of directly on the input). Without this, controlled
  // components don't work properly in conjunction with event bubbling because
  // the component is rerendered and the value reverted before all the event
  // handlers can run. See https://github.com/facebook/react/issues/708.
  batchedUpdates(runEventInBatch, event);
}

function runEventInBatch(event) {
  runEventsInBatch(event);
}

function getInstIfValueChanged(targetInst) {
  var targetNode = getNodeFromInstance$1(targetInst);
  if (updateValueIfChanged(targetNode)) {
    return targetInst;
  }
}

function getTargetInstForChangeEvent(topLevelType, targetInst) {
  if (topLevelType === TOP_CHANGE) {
    return targetInst;
  }
}

/**
 * SECTION: handle `input` event
 */
var isInputEventSupported = false;
if (canUseDOM) {
  // IE9 claims to support the input event but fails to trigger it when
  // deleting text, so we ignore its input events.
  isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
}

/**
 * (For IE <=9) Starts tracking propertychange events on the passed-in element
 * and override the value property so that we can distinguish user events from
 * value changes in JS.
 */
function startWatchingForValueChange(target, targetInst) {
  activeElement = target;
  activeElementInst = targetInst;
  activeElement.attachEvent('onpropertychange', handlePropertyChange);
}

/**
 * (For IE <=9) Removes the event listeners from the currently-tracked element,
 * if any exists.
 */
function stopWatchingForValueChange() {
  if (!activeElement) {
    return;
  }
  activeElement.detachEvent('onpropertychange', handlePropertyChange);
  activeElement = null;
  activeElementInst = null;
}

/**
 * (For IE <=9) Handles a propertychange event, sending a `change` event if
 * the value of the active element has changed.
 */
function handlePropertyChange(nativeEvent) {
  if (nativeEvent.propertyName !== 'value') {
    return;
  }
  if (getInstIfValueChanged(activeElementInst)) {
    manualDispatchChangeEvent(nativeEvent);
  }
}

function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
  if (topLevelType === TOP_FOCUS) {
    // In IE9, propertychange fires for most input events but is buggy and
    // doesn't fire when text is deleted, but conveniently, selectionchange
    // appears to fire in all of the remaining cases so we catch those and
    // forward the event if the value has changed
    // In either case, we don't want to call the event handler if the value
    // is changed from JS so we redefine a setter for `.value` that updates
    // our activeElementValue variable, allowing us to ignore those changes
    //
    // stopWatching() should be a noop here but we call it just in case we
    // missed a blur event somehow.
    stopWatchingForValueChange();
    startWatchingForValueChange(target, targetInst);
  } else if (topLevelType === TOP_BLUR) {
    stopWatchingForValueChange();
  }
}

// For IE8 and IE9.
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
  if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
    // On the selectionchange event, the target is just document which isn't
    // helpful for us so just check activeElement instead.
    //
    // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
    // propertychange on the first input event after setting `value` from a
    // script and fires only keydown, keypress, keyup. Catching keyup usually
    // gets it and catching keydown lets us fire an event for the first
    // keystroke if user does a key repeat (it'll be a little delayed: right
    // before the second keystroke). Other input methods (e.g., paste) seem to
    // fire selectionchange normally.
    return getInstIfValueChanged(activeElementInst);
  }
}

/**
 * SECTION: handle `click` event
 */
function shouldUseClickEvent(elem) {
  // Use the `click` event to detect changes to checkbox and radio inputs.
  // This approach works across all browsers, whereas `change` does not fire
  // until `blur` in IE8.
  var nodeName = elem.nodeName;
  return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
}

function getTargetInstForClickEvent(topLevelType, targetInst) {
  if (topLevelType === TOP_CLICK) {
    return getInstIfValueChanged(targetInst);
  }
}

function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
  if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
    return getInstIfValueChanged(targetInst);
  }
}

function handleControlledInputBlur(node) {
  var state = node._wrapperState;

  if (!state || !state.controlled || node.type !== 'number') {
    return;
  }

  if (!disableInputAttributeSyncing) {
    // If controlled, assign the value attribute to the current value on blur
    setDefaultValue(node, 'number', node.value);
  }
}

/**
 * This plugin creates an `onChange` event that normalizes change events
 * across form elements. This event fires at a time when it's possible to
 * change the element's value without seeing a flicker.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - select
 */
var ChangeEventPlugin = {
  eventTypes: eventTypes$1,

  _isInputEventSupported: isInputEventSupported,

  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;

    var getTargetInstFunc = void 0,
        handleEventFunc = void 0;
    if (shouldUseChangeEvent(targetNode)) {
      getTargetInstFunc = getTargetInstForChangeEvent;
    } else if (isTextInputElement(targetNode)) {
      if (isInputEventSupported) {
        getTargetInstFunc = getTargetInstForInputOrChangeEvent;
      } else {
        getTargetInstFunc = getTargetInstForInputEventPolyfill;
        handleEventFunc = handleEventsForInputEventPolyfill;
      }
    } else if (shouldUseClickEvent(targetNode)) {
      getTargetInstFunc = getTargetInstForClickEvent;
    }

    if (getTargetInstFunc) {
      var inst = getTargetInstFunc(topLevelType, targetInst);
      if (inst) {
        var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
        return event;
      }
    }

    if (handleEventFunc) {
      handleEventFunc(topLevelType, targetNode, targetInst);
    }

    // When blurring, set the value attribute for number inputs
    if (topLevelType === TOP_BLUR) {
      handleControlledInputBlur(targetNode);
    }
  }
};

/**
 * Module that is injectable into `EventPluginHub`, that specifies a
 * deterministic ordering of `EventPlugin`s. A convenient way to reason about
 * plugins, without having to package every one of them. This is better than
 * having plugins be ordered in the same order that they are injected because
 * that ordering would be influenced by the packaging order.
 * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
 * preventing default on events is convenient in `SimpleEventPlugin` handlers.
 */
var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];

var SyntheticUIEvent = SyntheticEvent.extend({
  view: null,
  detail: null
});

var modifierKeyToProp = {
  Alt: 'altKey',
  Control: 'ctrlKey',
  Meta: 'metaKey',
  Shift: 'shiftKey'
};

// Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
// getModifierState. If getModifierState is not supported, we map it to a set of
// modifier keys exposed by the event. In this case, Lock-keys are not supported.
/**
 * Translation from modifier key to the associated property in the event.
 * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
 */

function modifierStateGetter(keyArg) {
  var syntheticEvent = this;
  var nativeEvent = syntheticEvent.nativeEvent;
  if (nativeEvent.getModifierState) {
    return nativeEvent.getModifierState(keyArg);
  }
  var keyProp = modifierKeyToProp[keyArg];
  return keyProp ? !!nativeEvent[keyProp] : false;
}

function getEventModifierState(nativeEvent) {
  return modifierStateGetter;
}

var previousScreenX = 0;
var previousScreenY = 0;
// Use flags to signal movementX/Y has already been set
var isMovementXSet = false;
var isMovementYSet = false;

/**
 * @interface MouseEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticMouseEvent = SyntheticUIEvent.extend({
  screenX: null,
  screenY: null,
  clientX: null,
  clientY: null,
  pageX: null,
  pageY: null,
  ctrlKey: null,
  shiftKey: null,
  altKey: null,
  metaKey: null,
  getModifierState: getEventModifierState,
  button: null,
  buttons: null,
  relatedTarget: function (event) {
    return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
  },
  movementX: function (event) {
    if ('movementX' in event) {
      return event.movementX;
    }

    var screenX = previousScreenX;
    previousScreenX = event.screenX;

    if (!isMovementXSet) {
      isMovementXSet = true;
      return 0;
    }

    return event.type === 'mousemove' ? event.screenX - screenX : 0;
  },
  movementY: function (event) {
    if ('movementY' in event) {
      return event.movementY;
    }

    var screenY = previousScreenY;
    previousScreenY = event.screenY;

    if (!isMovementYSet) {
      isMovementYSet = true;
      return 0;
    }

    return event.type === 'mousemove' ? event.screenY - screenY : 0;
  }
});

/**
 * @interface PointerEvent
 * @see http://www.w3.org/TR/pointerevents/
 */
var SyntheticPointerEvent = SyntheticMouseEvent.extend({
  pointerId: null,
  width: null,
  height: null,
  pressure: null,
  tangentialPressure: null,
  tiltX: null,
  tiltY: null,
  twist: null,
  pointerType: null,
  isPrimary: null
});

var eventTypes$2 = {
  mouseEnter: {
    registrationName: 'onMouseEnter',
    dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  },
  mouseLeave: {
    registrationName: 'onMouseLeave',
    dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
  },
  pointerEnter: {
    registrationName: 'onPointerEnter',
    dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  },
  pointerLeave: {
    registrationName: 'onPointerLeave',
    dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
  }
};

var EnterLeaveEventPlugin = {
  eventTypes: eventTypes$2,

  /**
   * For almost every interaction we care about, there will be both a top-level
   * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
   * we do not extract duplicate events. However, moving the mouse into the
   * browser from outside will not fire a `mouseout` event. In this case, we use
   * the `mouseover` top-level event.
   */
  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
    var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;

    if (isOverEvent && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
      return null;
    }

    if (!isOutEvent && !isOverEvent) {
      // Must not be a mouse or pointer in or out - ignoring.
      return null;
    }

    var win = void 0;
    if (nativeEventTarget.window === nativeEventTarget) {
      // `nativeEventTarget` is probably a window object.
      win = nativeEventTarget;
    } else {
      // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
      var doc = nativeEventTarget.ownerDocument;
      if (doc) {
        win = doc.defaultView || doc.parentWindow;
      } else {
        win = window;
      }
    }

    var from = void 0;
    var to = void 0;
    if (isOutEvent) {
      from = targetInst;
      var related = nativeEvent.relatedTarget || nativeEvent.toElement;
      to = related ? getClosestInstanceFromNode(related) : null;
    } else {
      // Moving to a node from outside the window.
      from = null;
      to = targetInst;
    }

    if (from === to) {
      // Nothing pertains to our managed components.
      return null;
    }

    var eventInterface = void 0,
        leaveEventType = void 0,
        enterEventType = void 0,
        eventTypePrefix = void 0;

    if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
      eventInterface = SyntheticMouseEvent;
      leaveEventType = eventTypes$2.mouseLeave;
      enterEventType = eventTypes$2.mouseEnter;
      eventTypePrefix = 'mouse';
    } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
      eventInterface = SyntheticPointerEvent;
      leaveEventType = eventTypes$2.pointerLeave;
      enterEventType = eventTypes$2.pointerEnter;
      eventTypePrefix = 'pointer';
    }

    var fromNode = from == null ? win : getNodeFromInstance$1(from);
    var toNode = to == null ? win : getNodeFromInstance$1(to);

    var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
    leave.type = eventTypePrefix + 'leave';
    leave.target = fromNode;
    leave.relatedTarget = toNode;

    var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
    enter.type = eventTypePrefix + 'enter';
    enter.target = toNode;
    enter.relatedTarget = fromNode;

    accumulateEnterLeaveDispatches(leave, enter, from, to);

    return [leave, enter];
  }
};

/**
 * inlined Object.is polyfill to avoid requiring consumers ship their own
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
 */
function is(x, y) {
  return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
  ;
}

var hasOwnProperty$1 = Object.prototype.hasOwnProperty;

/**
 * Performs equality by iterating through keys on an object and returning false
 * when any key has values which are not strictly equal between the arguments.
 * Returns true when the values of all keys are strictly equal.
 */
function shallowEqual(objA, objB) {
  if (is(objA, objB)) {
    return true;
  }

  if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
    return false;
  }

  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  }

  // Test for A's keys different from B.
  for (var i = 0; i < keysA.length; i++) {
    if (!hasOwnProperty$1.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
      return false;
    }
  }

  return true;
}

/**
 * `ReactInstanceMap` maintains a mapping from a public facing stateful
 * instance (key) and the internal representation (value). This allows public
 * methods to accept the user facing instance as an argument and map them back
 * to internal methods.
 *
 * Note that this module is currently shared and assumed to be stateless.
 * If this becomes an actual Map, that will break.
 */

/**
 * This API should be called `delete` but we'd have to make sure to always
 * transform these to strings for IE support. When this transform is fully
 * supported we can rename it.
 */


function get(key) {
  return key._reactInternalFiber;
}

function has(key) {
  return key._reactInternalFiber !== undefined;
}

function set(key, value) {
  key._reactInternalFiber = value;
}

// Don't change these two values. They're used by React Dev Tools.
var NoEffect = /*              */0;
var PerformedWork = /*         */1;

// You can change the rest (and add more).
var Placement = /*             */2;
var Update = /*                */4;
var PlacementAndUpdate = /*    */6;
var Deletion = /*              */8;
var ContentReset = /*          */16;
var Callback = /*              */32;
var DidCapture = /*            */64;
var Ref = /*                   */128;
var Snapshot = /*              */256;
var Passive = /*               */512;

// Passive & Update & Callback & Ref & Snapshot
var LifecycleEffectMask = /*   */932;

// Union of all host effects
var HostEffectMask = /*        */1023;

var Incomplete = /*            */1024;
var ShouldCapture = /*         */2048;

var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;

var MOUNTING = 1;
var MOUNTED = 2;
var UNMOUNTED = 3;

function isFiberMountedImpl(fiber) {
  var node = fiber;
  if (!fiber.alternate) {
    // If there is no alternate, this might be a new tree that isn't inserted
    // yet. If it is, then it will have a pending insertion effect on it.
    if ((node.effectTag & Placement) !== NoEffect) {
      return MOUNTING;
    }
    while (node.return) {
      node = node.return;
      if ((node.effectTag & Placement) !== NoEffect) {
        return MOUNTING;
      }
    }
  } else {
    while (node.return) {
      node = node.return;
    }
  }
  if (node.tag === HostRoot) {
    // TODO: Check if this was a nested HostRoot when used with
    // renderContainerIntoSubtree.
    return MOUNTED;
  }
  // If we didn't hit the root, that means that we're in an disconnected tree
  // that has been unmounted.
  return UNMOUNTED;
}

function isFiberMounted(fiber) {
  return isFiberMountedImpl(fiber) === MOUNTED;
}

function isMounted(component) {
  {
    var owner = ReactCurrentOwner$1.current;
    if (owner !== null && owner.tag === ClassComponent) {
      var ownerFiber = owner;
      var instance = ownerFiber.stateNode;
      !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
      instance._warnedAboutRefsInRender = true;
    }
  }

  var fiber = get(component);
  if (!fiber) {
    return false;
  }
  return isFiberMountedImpl(fiber) === MOUNTED;
}

function assertIsMounted(fiber) {
  !(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
}

function findCurrentFiberUsingSlowPath(fiber) {
  var alternate = fiber.alternate;
  if (!alternate) {
    // If there is no alternate, then we only need to check if it is mounted.
    var state = isFiberMountedImpl(fiber);
    !(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
    if (state === MOUNTING) {
      return null;
    }
    return fiber;
  }
  // If we have two possible branches, we'll walk backwards up to the root
  // to see what path the root points to. On the way we may hit one of the
  // special cases and we'll deal with them.
  var a = fiber;
  var b = alternate;
  while (true) {
    var parentA = a.return;
    var parentB = parentA ? parentA.alternate : null;
    if (!parentA || !parentB) {
      // We're at the root.
      break;
    }

    // If both copies of the parent fiber point to the same child, we can
    // assume that the child is current. This happens when we bailout on low
    // priority: the bailed out fiber's child reuses the current child.
    if (parentA.child === parentB.child) {
      var child = parentA.child;
      while (child) {
        if (child === a) {
          // We've determined that A is the current branch.
          assertIsMounted(parentA);
          return fiber;
        }
        if (child === b) {
          // We've determined that B is the current branch.
          assertIsMounted(parentA);
          return alternate;
        }
        child = child.sibling;
      }
      // We should never have an alternate for any mounting node. So the only
      // way this could possibly happen is if this was unmounted, if at all.
      invariant(false, 'Unable to find node on an unmounted component.');
    }

    if (a.return !== b.return) {
      // The return pointer of A and the return pointer of B point to different
      // fibers. We assume that return pointers never criss-cross, so A must
      // belong to the child set of A.return, and B must belong to the child
      // set of B.return.
      a = parentA;
      b = parentB;
    } else {
      // The return pointers point to the same fiber. We'll have to use the
      // default, slow path: scan the child sets of each parent alternate to see
      // which child belongs to which set.
      //
      // Search parent A's child set
      var didFindChild = false;
      var _child = parentA.child;
      while (_child) {
        if (_child === a) {
          didFindChild = true;
          a = parentA;
          b = parentB;
          break;
        }
        if (_child === b) {
          didFindChild = true;
          b = parentA;
          a = parentB;
          break;
        }
        _child = _child.sibling;
      }
      if (!didFindChild) {
        // Search parent B's child set
        _child = parentB.child;
        while (_child) {
          if (_child === a) {
            didFindChild = true;
            a = parentB;
            b = parentA;
            break;
          }
          if (_child === b) {
            didFindChild = true;
            b = parentB;
            a = parentA;
            break;
          }
          _child = _child.sibling;
        }
        !didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
      }
    }

    !(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  }
  // If the root is not a host container, we're in a disconnected tree. I.e.
  // unmounted.
  !(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
  if (a.stateNode.current === a) {
    // We've determined that A is the current branch.
    return fiber;
  }
  // Otherwise B has to be current branch.
  return alternate;
}

function findCurrentHostFiber(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);
  if (!currentParent) {
    return null;
  }

  // Next we'll drill down this component to find the first HostComponent/Text.
  var node = currentParent;
  while (true) {
    if (node.tag === HostComponent || node.tag === HostText) {
      return node;
    } else if (node.child) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === currentParent) {
      return null;
    }
    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
  // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable
  return null;
}

function findCurrentHostFiberWithNoPortals(parent) {
  var currentParent = findCurrentFiberUsingSlowPath(parent);
  if (!currentParent) {
    return null;
  }

  // Next we'll drill down this component to find the first HostComponent/Text.
  var node = currentParent;
  while (true) {
    if (node.tag === HostComponent || node.tag === HostText) {
      return node;
    } else if (node.child && node.tag !== HostPortal) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === currentParent) {
      return null;
    }
    while (!node.sibling) {
      if (!node.return || node.return === currentParent) {
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
  // Flow needs the return null here, but ESLint complains about it.
  // eslint-disable-next-line no-unreachable
  return null;
}

function addEventBubbleListener(element, eventType, listener) {
  element.addEventListener(eventType, listener, false);
}

function addEventCaptureListener(element, eventType, listener) {
  element.addEventListener(eventType, listener, true);
}

/**
 * @interface Event
 * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
 * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
 */
var SyntheticAnimationEvent = SyntheticEvent.extend({
  animationName: null,
  elapsedTime: null,
  pseudoElement: null
});

/**
 * @interface Event
 * @see http://www.w3.org/TR/clipboard-apis/
 */
var SyntheticClipboardEvent = SyntheticEvent.extend({
  clipboardData: function (event) {
    return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
  }
});

/**
 * @interface FocusEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticFocusEvent = SyntheticUIEvent.extend({
  relatedTarget: null
});

/**
 * `charCode` represents the actual "character code" and is safe to use with
 * `String.fromCharCode`. As such, only keys that correspond to printable
 * characters produce a valid `charCode`, the only exception to this is Enter.
 * The Tab-key is considered non-printable and does not have a `charCode`,
 * presumably because it does not produce a tab-character in browsers.
 *
 * @param {object} nativeEvent Native browser event.
 * @return {number} Normalized `charCode` property.
 */
function getEventCharCode(nativeEvent) {
  var charCode = void 0;
  var keyCode = nativeEvent.keyCode;

  if ('charCode' in nativeEvent) {
    charCode = nativeEvent.charCode;

    // FF does not set `charCode` for the Enter-key, check against `keyCode`.
    if (charCode === 0 && keyCode === 13) {
      charCode = 13;
    }
  } else {
    // IE8 does not implement `charCode`, but `keyCode` has the correct value.
    charCode = keyCode;
  }

  // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
  // report Enter as charCode 10 when ctrl is pressed.
  if (charCode === 10) {
    charCode = 13;
  }

  // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
  // Must not discard the (non-)printable Enter-key.
  if (charCode >= 32 || charCode === 13) {
    return charCode;
  }

  return 0;
}

/**
 * Normalization of deprecated HTML5 `key` values
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */
var normalizeKey = {
  Esc: 'Escape',
  Spacebar: ' ',
  Left: 'ArrowLeft',
  Up: 'ArrowUp',
  Right: 'ArrowRight',
  Down: 'ArrowDown',
  Del: 'Delete',
  Win: 'OS',
  Menu: 'ContextMenu',
  Apps: 'ContextMenu',
  Scroll: 'ScrollLock',
  MozPrintableKey: 'Unidentified'
};

/**
 * Translation from legacy `keyCode` to HTML5 `key`
 * Only special keys supported, all others depend on keyboard layout or browser
 * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
 */
var translateToKey = {
  '8': 'Backspace',
  '9': 'Tab',
  '12': 'Clear',
  '13': 'Enter',
  '16': 'Shift',
  '17': 'Control',
  '18': 'Alt',
  '19': 'Pause',
  '20': 'CapsLock',
  '27': 'Escape',
  '32': ' ',
  '33': 'PageUp',
  '34': 'PageDown',
  '35': 'End',
  '36': 'Home',
  '37': 'ArrowLeft',
  '38': 'ArrowUp',
  '39': 'ArrowRight',
  '40': 'ArrowDown',
  '45': 'Insert',
  '46': 'Delete',
  '112': 'F1',
  '113': 'F2',
  '114': 'F3',
  '115': 'F4',
  '116': 'F5',
  '117': 'F6',
  '118': 'F7',
  '119': 'F8',
  '120': 'F9',
  '121': 'F10',
  '122': 'F11',
  '123': 'F12',
  '144': 'NumLock',
  '145': 'ScrollLock',
  '224': 'Meta'
};

/**
 * @param {object} nativeEvent Native browser event.
 * @return {string} Normalized `key` property.
 */
function getEventKey(nativeEvent) {
  if (nativeEvent.key) {
    // Normalize inconsistent values reported by browsers due to
    // implementations of a working draft specification.

    // FireFox implements `key` but returns `MozPrintableKey` for all
    // printable characters (normalized to `Unidentified`), ignore it.
    var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
    if (key !== 'Unidentified') {
      return key;
    }
  }

  // Browser does not implement `key`, polyfill as much of it as we can.
  if (nativeEvent.type === 'keypress') {
    var charCode = getEventCharCode(nativeEvent);

    // The enter-key is technically both printable and non-printable and can
    // thus be captured by `keypress`, no other non-printable key should.
    return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
  }
  if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
    // While user keyboard layout determines the actual meaning of each
    // `keyCode` value, almost all function keys have a universal value.
    return translateToKey[nativeEvent.keyCode] || 'Unidentified';
  }
  return '';
}

/**
 * @interface KeyboardEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
  key: getEventKey,
  location: null,
  ctrlKey: null,
  shiftKey: null,
  altKey: null,
  metaKey: null,
  repeat: null,
  locale: null,
  getModifierState: getEventModifierState,
  // Legacy Interface
  charCode: function (event) {
    // `charCode` is the result of a KeyPress event and represents the value of
    // the actual printable character.

    // KeyPress is deprecated, but its replacement is not yet final and not
    // implemented in any major browser. Only KeyPress has charCode.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }
    return 0;
  },
  keyCode: function (event) {
    // `keyCode` is the result of a KeyDown/Up event and represents the value of
    // physical keyboard key.

    // The actual meaning of the value depends on the users' keyboard layout
    // which cannot be detected. Assuming that it is a US keyboard layout
    // provides a surprisingly accurate mapping for US and European users.
    // Due to this, it is left to the user to implement at this time.
    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }
    return 0;
  },
  which: function (event) {
    // `which` is an alias for either `keyCode` or `charCode` depending on the
    // type of the event.
    if (event.type === 'keypress') {
      return getEventCharCode(event);
    }
    if (event.type === 'keydown' || event.type === 'keyup') {
      return event.keyCode;
    }
    return 0;
  }
});

/**
 * @interface DragEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticDragEvent = SyntheticMouseEvent.extend({
  dataTransfer: null
});

/**
 * @interface TouchEvent
 * @see http://www.w3.org/TR/touch-events/
 */
var SyntheticTouchEvent = SyntheticUIEvent.extend({
  touches: null,
  targetTouches: null,
  changedTouches: null,
  altKey: null,
  metaKey: null,
  ctrlKey: null,
  shiftKey: null,
  getModifierState: getEventModifierState
});

/**
 * @interface Event
 * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
 * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
 */
var SyntheticTransitionEvent = SyntheticEvent.extend({
  propertyName: null,
  elapsedTime: null,
  pseudoElement: null
});

/**
 * @interface WheelEvent
 * @see http://www.w3.org/TR/DOM-Level-3-Events/
 */
var SyntheticWheelEvent = SyntheticMouseEvent.extend({
  deltaX: function (event) {
    return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
    'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
  },
  deltaY: function (event) {
    return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
    'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
    'wheelDelta' in event ? -event.wheelDelta : 0;
  },

  deltaZ: null,

  // Browsers without "deltaMode" is reporting in raw wheel delta where one
  // notch on the scroll is always +/- 120, roughly equivalent to pixels.
  // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
  // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
  deltaMode: null
});

/**
 * Turns
 * ['abort', ...]
 * into
 * eventTypes = {
 *   'abort': {
 *     phasedRegistrationNames: {
 *       bubbled: 'onAbort',
 *       captured: 'onAbortCapture',
 *     },
 *     dependencies: [TOP_ABORT],
 *   },
 *   ...
 * };
 * topLevelEventsToDispatchConfig = new Map([
 *   [TOP_ABORT, { sameConfig }],
 * ]);
 */

var interactiveEventTypeNames = [[TOP_BLUR, 'blur'], [TOP_CANCEL, 'cancel'], [TOP_CLICK, 'click'], [TOP_CLOSE, 'close'], [TOP_CONTEXT_MENU, 'contextMenu'], [TOP_COPY, 'copy'], [TOP_CUT, 'cut'], [TOP_AUX_CLICK, 'auxClick'], [TOP_DOUBLE_CLICK, 'doubleClick'], [TOP_DRAG_END, 'dragEnd'], [TOP_DRAG_START, 'dragStart'], [TOP_DROP, 'drop'], [TOP_FOCUS, 'focus'], [TOP_INPUT, 'input'], [TOP_INVALID, 'invalid'], [TOP_KEY_DOWN, 'keyDown'], [TOP_KEY_PRESS, 'keyPress'], [TOP_KEY_UP, 'keyUp'], [TOP_MOUSE_DOWN, 'mouseDown'], [TOP_MOUSE_UP, 'mouseUp'], [TOP_PASTE, 'paste'], [TOP_PAUSE, 'pause'], [TOP_PLAY, 'play'], [TOP_POINTER_CANCEL, 'pointerCancel'], [TOP_POINTER_DOWN, 'pointerDown'], [TOP_POINTER_UP, 'pointerUp'], [TOP_RATE_CHANGE, 'rateChange'], [TOP_RESET, 'reset'], [TOP_SEEKED, 'seeked'], [TOP_SUBMIT, 'submit'], [TOP_TOUCH_CANCEL, 'touchCancel'], [TOP_TOUCH_END, 'touchEnd'], [TOP_TOUCH_START, 'touchStart'], [TOP_VOLUME_CHANGE, 'volumeChange']];
var nonInteractiveEventTypeNames = [[TOP_ABORT, 'abort'], [TOP_ANIMATION_END, 'animationEnd'], [TOP_ANIMATION_ITERATION, 'animationIteration'], [TOP_ANIMATION_START, 'animationStart'], [TOP_CAN_PLAY, 'canPlay'], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough'], [TOP_DRAG, 'drag'], [TOP_DRAG_ENTER, 'dragEnter'], [TOP_DRAG_EXIT, 'dragExit'], [TOP_DRAG_LEAVE, 'dragLeave'], [TOP_DRAG_OVER, 'dragOver'], [TOP_DURATION_CHANGE, 'durationChange'], [TOP_EMPTIED, 'emptied'], [TOP_ENCRYPTED, 'encrypted'], [TOP_ENDED, 'ended'], [TOP_ERROR, 'error'], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture'], [TOP_LOAD, 'load'], [TOP_LOADED_DATA, 'loadedData'], [TOP_LOADED_METADATA, 'loadedMetadata'], [TOP_LOAD_START, 'loadStart'], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture'], [TOP_MOUSE_MOVE, 'mouseMove'], [TOP_MOUSE_OUT, 'mouseOut'], [TOP_MOUSE_OVER, 'mouseOver'], [TOP_PLAYING, 'playing'], [TOP_POINTER_MOVE, 'pointerMove'], [TOP_POINTER_OUT, 'pointerOut'], [TOP_POINTER_OVER, 'pointerOver'], [TOP_PROGRESS, 'progress'], [TOP_SCROLL, 'scroll'], [TOP_SEEKING, 'seeking'], [TOP_STALLED, 'stalled'], [TOP_SUSPEND, 'suspend'], [TOP_TIME_UPDATE, 'timeUpdate'], [TOP_TOGGLE, 'toggle'], [TOP_TOUCH_MOVE, 'touchMove'], [TOP_TRANSITION_END, 'transitionEnd'], [TOP_WAITING, 'waiting'], [TOP_WHEEL, 'wheel']];

var eventTypes$4 = {};
var topLevelEventsToDispatchConfig = {};

function addEventTypeNameToConfig(_ref, isInteractive) {
  var topEvent = _ref[0],
      event = _ref[1];

  var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
  var onEvent = 'on' + capitalizedEvent;

  var type = {
    phasedRegistrationNames: {
      bubbled: onEvent,
      captured: onEvent + 'Capture'
    },
    dependencies: [topEvent],
    isInteractive: isInteractive
  };
  eventTypes$4[event] = type;
  topLevelEventsToDispatchConfig[topEvent] = type;
}

interactiveEventTypeNames.forEach(function (eventTuple) {
  addEventTypeNameToConfig(eventTuple, true);
});
nonInteractiveEventTypeNames.forEach(function (eventTuple) {
  addEventTypeNameToConfig(eventTuple, false);
});

// Only used in DEV for exhaustiveness validation.
var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];

var SimpleEventPlugin = {
  eventTypes: eventTypes$4,

  isInteractiveTopLevelEventType: function (topLevelType) {
    var config = topLevelEventsToDispatchConfig[topLevelType];
    return config !== undefined && config.isInteractive === true;
  },


  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
    if (!dispatchConfig) {
      return null;
    }
    var EventConstructor = void 0;
    switch (topLevelType) {
      case TOP_KEY_PRESS:
        // Firefox creates a keypress event for function keys too. This removes
        // the unwanted keypress events. Enter is however both printable and
        // non-printable. One would expect Tab to be as well (but it isn't).
        if (getEventCharCode(nativeEvent) === 0) {
          return null;
        }
      /* falls through */
      case TOP_KEY_DOWN:
      case TOP_KEY_UP:
        EventConstructor = SyntheticKeyboardEvent;
        break;
      case TOP_BLUR:
      case TOP_FOCUS:
        EventConstructor = SyntheticFocusEvent;
        break;
      case TOP_CLICK:
        // Firefox creates a click event on right mouse clicks. This removes the
        // unwanted click events.
        if (nativeEvent.button === 2) {
          return null;
        }
      /* falls through */
      case TOP_AUX_CLICK:
      case TOP_DOUBLE_CLICK:
      case TOP_MOUSE_DOWN:
      case TOP_MOUSE_MOVE:
      case TOP_MOUSE_UP:
      // TODO: Disabled elements should not respond to mouse events
      /* falls through */
      case TOP_MOUSE_OUT:
      case TOP_MOUSE_OVER:
      case TOP_CONTEXT_MENU:
        EventConstructor = SyntheticMouseEvent;
        break;
      case TOP_DRAG:
      case TOP_DRAG_END:
      case TOP_DRAG_ENTER:
      case TOP_DRAG_EXIT:
      case TOP_DRAG_LEAVE:
      case TOP_DRAG_OVER:
      case TOP_DRAG_START:
      case TOP_DROP:
        EventConstructor = SyntheticDragEvent;
        break;
      case TOP_TOUCH_CANCEL:
      case TOP_TOUCH_END:
      case TOP_TOUCH_MOVE:
      case TOP_TOUCH_START:
        EventConstructor = SyntheticTouchEvent;
        break;
      case TOP_ANIMATION_END:
      case TOP_ANIMATION_ITERATION:
      case TOP_ANIMATION_START:
        EventConstructor = SyntheticAnimationEvent;
        break;
      case TOP_TRANSITION_END:
        EventConstructor = SyntheticTransitionEvent;
        break;
      case TOP_SCROLL:
        EventConstructor = SyntheticUIEvent;
        break;
      case TOP_WHEEL:
        EventConstructor = SyntheticWheelEvent;
        break;
      case TOP_COPY:
      case TOP_CUT:
      case TOP_PASTE:
        EventConstructor = SyntheticClipboardEvent;
        break;
      case TOP_GOT_POINTER_CAPTURE:
      case TOP_LOST_POINTER_CAPTURE:
      case TOP_POINTER_CANCEL:
      case TOP_POINTER_DOWN:
      case TOP_POINTER_MOVE:
      case TOP_POINTER_OUT:
      case TOP_POINTER_OVER:
      case TOP_POINTER_UP:
        EventConstructor = SyntheticPointerEvent;
        break;
      default:
        {
          if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
            warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
          }
        }
        // HTML Events
        // @see http://www.w3.org/TR/html5/index.html#events-0
        EventConstructor = SyntheticEvent;
        break;
    }
    var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
    accumulateTwoPhaseDispatches(event);
    return event;
  }
};

var isInteractiveTopLevelEventType = SimpleEventPlugin.isInteractiveTopLevelEventType;


var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
var callbackBookkeepingPool = [];

/**
 * Find the deepest React component completely containing the root of the
 * passed-in instance (for use when entire React trees are nested within each
 * other). If React trees are not nested, returns null.
 */
function findRootContainerNode(inst) {
  // TODO: It may be a good idea to cache this to prevent unnecessary DOM
  // traversal, but caching is difficult to do correctly without using a
  // mutation observer to listen for all DOM changes.
  while (inst.return) {
    inst = inst.return;
  }
  if (inst.tag !== HostRoot) {
    // This can happen if we're in a detached tree.
    return null;
  }
  return inst.stateNode.containerInfo;
}

// Used to store ancestor hierarchy in top level callback
function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst) {
  if (callbackBookkeepingPool.length) {
    var instance = callbackBookkeepingPool.pop();
    instance.topLevelType = topLevelType;
    instance.nativeEvent = nativeEvent;
    instance.targetInst = targetInst;
    return instance;
  }
  return {
    topLevelType: topLevelType,
    nativeEvent: nativeEvent,
    targetInst: targetInst,
    ancestors: []
  };
}

function releaseTopLevelCallbackBookKeeping(instance) {
  instance.topLevelType = null;
  instance.nativeEvent = null;
  instance.targetInst = null;
  instance.ancestors.length = 0;
  if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
    callbackBookkeepingPool.push(instance);
  }
}

function handleTopLevel(bookKeeping) {
  var targetInst = bookKeeping.targetInst;

  // Loop through the hierarchy, in case there's any nested components.
  // It's important that we build the array of ancestors before calling any
  // event handlers, because event handlers can modify the DOM, leading to
  // inconsistencies with ReactMount's node cache. See #1105.
  var ancestor = targetInst;
  do {
    if (!ancestor) {
      bookKeeping.ancestors.push(ancestor);
      break;
    }
    var root = findRootContainerNode(ancestor);
    if (!root) {
      break;
    }
    bookKeeping.ancestors.push(ancestor);
    ancestor = getClosestInstanceFromNode(root);
  } while (ancestor);

  for (var i = 0; i < bookKeeping.ancestors.length; i++) {
    targetInst = bookKeeping.ancestors[i];
    runExtractedEventsInBatch(bookKeeping.topLevelType, targetInst, bookKeeping.nativeEvent, getEventTarget(bookKeeping.nativeEvent));
  }
}

// TODO: can we stop exporting these?
var _enabled = true;

function setEnabled(enabled) {
  _enabled = !!enabled;
}

function isEnabled() {
  return _enabled;
}

/**
 * Traps top-level events by using event bubbling.
 *
 * @param {number} topLevelType Number from `TopLevelEventTypes`.
 * @param {object} element Element on which to attach listener.
 * @return {?object} An object with a remove function which will forcefully
 *                  remove the listener.
 * @internal
 */
function trapBubbledEvent(topLevelType, element) {
  if (!element) {
    return null;
  }
  var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;

  addEventBubbleListener(element, getRawEventName(topLevelType),
  // Check if interactive and wrap in interactiveUpdates
  dispatch.bind(null, topLevelType));
}

/**
 * Traps a top-level event by using event capturing.
 *
 * @param {number} topLevelType Number from `TopLevelEventTypes`.
 * @param {object} element Element on which to attach listener.
 * @return {?object} An object with a remove function which will forcefully
 *                  remove the listener.
 * @internal
 */
function trapCapturedEvent(topLevelType, element) {
  if (!element) {
    return null;
  }
  var dispatch = isInteractiveTopLevelEventType(topLevelType) ? dispatchInteractiveEvent : dispatchEvent;

  addEventCaptureListener(element, getRawEventName(topLevelType),
  // Check if interactive and wrap in interactiveUpdates
  dispatch.bind(null, topLevelType));
}

function dispatchInteractiveEvent(topLevelType, nativeEvent) {
  interactiveUpdates(dispatchEvent, topLevelType, nativeEvent);
}

function dispatchEvent(topLevelType, nativeEvent) {
  if (!_enabled) {
    return;
  }

  var nativeEventTarget = getEventTarget(nativeEvent);
  var targetInst = getClosestInstanceFromNode(nativeEventTarget);
  if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) {
    // If we get an event (ex: img onload) before committing that
    // component's mount, ignore it for now (that is, treat it as if it was an
    // event on a non-React tree). We might also consider queueing events and
    // dispatching them after the mount.
    targetInst = null;
  }

  var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst);

  try {
    // Event queue being processed in the same cycle allows
    // `preventDefault`.
    batchedUpdates(handleTopLevel, bookKeeping);
  } finally {
    releaseTopLevelCallbackBookKeeping(bookKeeping);
  }
}

/**
 * Summary of `ReactBrowserEventEmitter` event handling:
 *
 *  - Top-level delegation is used to trap most native browser events. This
 *    may only occur in the main thread and is the responsibility of
 *    ReactDOMEventListener, which is injected and can therefore support
 *    pluggable event sources. This is the only work that occurs in the main
 *    thread.
 *
 *  - We normalize and de-duplicate events to account for browser quirks. This
 *    may be done in the worker thread.
 *
 *  - Forward these native events (with the associated top-level type used to
 *    trap it) to `EventPluginHub`, which in turn will ask plugins if they want
 *    to extract any synthetic events.
 *
 *  - The `EventPluginHub` will then process each event by annotating them with
 *    "dispatches", a sequence of listeners and IDs that care about that event.
 *
 *  - The `EventPluginHub` then dispatches the events.
 *
 * Overview of React and the event system:
 *
 * +------------+    .
 * |    DOM     |    .
 * +------------+    .
 *       |           .
 *       v           .
 * +------------+    .
 * | ReactEvent |    .
 * |  Listener  |    .
 * +------------+    .                         +-----------+
 *       |           .               +--------+|SimpleEvent|
 *       |           .               |         |Plugin     |
 * +-----|------+    .               v         +-----------+
 * |     |      |    .    +--------------+                    +------------+
 * |     +-----------.--->|EventPluginHub|                    |    Event   |
 * |            |    .    |              |     +-----------+  | Propagators|
 * | ReactEvent |    .    |              |     |TapEvent   |  |------------|
 * |  Emitter   |    .    |              |<---+|Plugin     |  |other plugin|
 * |            |    .    |              |     +-----------+  |  utilities |
 * |     +-----------.--->|              |                    +------------+
 * |     |      |    .    +--------------+
 * +-----|------+    .                ^        +-----------+
 *       |           .                |        |Enter/Leave|
 *       +           .                +-------+|Plugin     |
 * +-------------+   .                         +-----------+
 * | application |   .
 * |-------------|   .
 * |             |   .
 * |             |   .
 * +-------------+   .
 *                   .
 *    React Core     .  General Purpose Event Plugin System
 */

var alreadyListeningTo = {};
var reactTopListenersCounter = 0;

/**
 * To ensure no conflicts with other potential React instances on the page
 */
var topListenersIDKey = '_reactListenersID' + ('' + Math.random()).slice(2);

function getListeningForDocument(mountAt) {
  // In IE8, `mountAt` is a host object and doesn't have `hasOwnProperty`
  // directly.
  if (!Object.prototype.hasOwnProperty.call(mountAt, topListenersIDKey)) {
    mountAt[topListenersIDKey] = reactTopListenersCounter++;
    alreadyListeningTo[mountAt[topListenersIDKey]] = {};
  }
  return alreadyListeningTo[mountAt[topListenersIDKey]];
}

/**
 * We listen for bubbled touch events on the document object.
 *
 * Firefox v8.01 (and possibly others) exhibited strange behavior when
 * mounting `onmousemove` events at some node that was not the document
 * element. The symptoms were that if your mouse is not moving over something
 * contained within that mount point (for example on the background) the
 * top-level listeners for `onmousemove` won't be called. However, if you
 * register the `mousemove` on the document object, then it will of course
 * catch all `mousemove`s. This along with iOS quirks, justifies restricting
 * top-level listeners to the document object only, at least for these
 * movement types of events and possibly all events.
 *
 * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
 *
 * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
 * they bubble to document.
 *
 * @param {string} registrationName Name of listener (e.g. `onClick`).
 * @param {object} mountAt Container where to mount the listener
 */
function listenTo(registrationName, mountAt) {
  var isListening = getListeningForDocument(mountAt);
  var dependencies = registrationNameDependencies[registrationName];

  for (var i = 0; i < dependencies.length; i++) {
    var dependency = dependencies[i];
    if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
      switch (dependency) {
        case TOP_SCROLL:
          trapCapturedEvent(TOP_SCROLL, mountAt);
          break;
        case TOP_FOCUS:
        case TOP_BLUR:
          trapCapturedEvent(TOP_FOCUS, mountAt);
          trapCapturedEvent(TOP_BLUR, mountAt);
          // We set the flag for a single dependency later in this function,
          // but this ensures we mark both as attached rather than just one.
          isListening[TOP_BLUR] = true;
          isListening[TOP_FOCUS] = true;
          break;
        case TOP_CANCEL:
        case TOP_CLOSE:
          if (isEventSupported(getRawEventName(dependency))) {
            trapCapturedEvent(dependency, mountAt);
          }
          break;
        case TOP_INVALID:
        case TOP_SUBMIT:
        case TOP_RESET:
          // We listen to them on the target DOM elements.
          // Some of them bubble so we don't want them to fire twice.
          break;
        default:
          // By default, listen on the top level to all non-media events.
          // Media events don't bubble so adding the listener wouldn't do anything.
          var isMediaEvent = mediaEventTypes.indexOf(dependency) !== -1;
          if (!isMediaEvent) {
            trapBubbledEvent(dependency, mountAt);
          }
          break;
      }
      isListening[dependency] = true;
    }
  }
}

function isListeningToAllDependencies(registrationName, mountAt) {
  var isListening = getListeningForDocument(mountAt);
  var dependencies = registrationNameDependencies[registrationName];
  for (var i = 0; i < dependencies.length; i++) {
    var dependency = dependencies[i];
    if (!(isListening.hasOwnProperty(dependency) && isListening[dependency])) {
      return false;
    }
  }
  return true;
}

function getActiveElement(doc) {
  doc = doc || (typeof document !== 'undefined' ? document : undefined);
  if (typeof doc === 'undefined') {
    return null;
  }
  try {
    return doc.activeElement || doc.body;
  } catch (e) {
    return doc.body;
  }
}

/**
 * Given any node return the first leaf node without children.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {DOMElement|DOMTextNode}
 */
function getLeafNode(node) {
  while (node && node.firstChild) {
    node = node.firstChild;
  }
  return node;
}

/**
 * Get the next sibling within a container. This will walk up the
 * DOM if a node's siblings have been exhausted.
 *
 * @param {DOMElement|DOMTextNode} node
 * @return {?DOMElement|DOMTextNode}
 */
function getSiblingNode(node) {
  while (node) {
    if (node.nextSibling) {
      return node.nextSibling;
    }
    node = node.parentNode;
  }
}

/**
 * Get object describing the nodes which contain characters at offset.
 *
 * @param {DOMElement|DOMTextNode} root
 * @param {number} offset
 * @return {?object}
 */
function getNodeForCharacterOffset(root, offset) {
  var node = getLeafNode(root);
  var nodeStart = 0;
  var nodeEnd = 0;

  while (node) {
    if (node.nodeType === TEXT_NODE) {
      nodeEnd = nodeStart + node.textContent.length;

      if (nodeStart <= offset && nodeEnd >= offset) {
        return {
          node: node,
          offset: offset - nodeStart
        };
      }

      nodeStart = nodeEnd;
    }

    node = getLeafNode(getSiblingNode(node));
  }
}

/**
 * @param {DOMElement} outerNode
 * @return {?object}
 */
function getOffsets(outerNode) {
  var ownerDocument = outerNode.ownerDocument;

  var win = ownerDocument && ownerDocument.defaultView || window;
  var selection = win.getSelection && win.getSelection();

  if (!selection || selection.rangeCount === 0) {
    return null;
  }

  var anchorNode = selection.anchorNode,
      anchorOffset = selection.anchorOffset,
      focusNode = selection.focusNode,
      focusOffset = selection.focusOffset;

  // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
  // up/down buttons on an <input type="number">. Anonymous divs do not seem to
  // expose properties, triggering a "Permission denied error" if any of its
  // properties are accessed. The only seemingly possible way to avoid erroring
  // is to access a property that typically works for non-anonymous divs and
  // catch any error that may otherwise arise. See
  // https://bugzilla.mozilla.org/show_bug.cgi?id=208427

  try {
    /* eslint-disable no-unused-expressions */
    anchorNode.nodeType;
    focusNode.nodeType;
    /* eslint-enable no-unused-expressions */
  } catch (e) {
    return null;
  }

  return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
}

/**
 * Returns {start, end} where `start` is the character/codepoint index of
 * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
 * `end` is the index of (focusNode, focusOffset).
 *
 * Returns null if you pass in garbage input but we should probably just crash.
 *
 * Exported only for testing.
 */
function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
  var length = 0;
  var start = -1;
  var end = -1;
  var indexWithinAnchor = 0;
  var indexWithinFocus = 0;
  var node = outerNode;
  var parentNode = null;

  outer: while (true) {
    var next = null;

    while (true) {
      if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
        start = length + anchorOffset;
      }
      if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
        end = length + focusOffset;
      }

      if (node.nodeType === TEXT_NODE) {
        length += node.nodeValue.length;
      }

      if ((next = node.firstChild) === null) {
        break;
      }
      // Moving from `node` to its first child `next`.
      parentNode = node;
      node = next;
    }

    while (true) {
      if (node === outerNode) {
        // If `outerNode` has children, this is always the second time visiting
        // it. If it has no children, this is still the first loop, and the only
        // valid selection is anchorNode and focusNode both equal to this node
        // and both offsets 0, in which case we will have handled above.
        break outer;
      }
      if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
        start = length;
      }
      if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
        end = length;
      }
      if ((next = node.nextSibling) !== null) {
        break;
      }
      node = parentNode;
      parentNode = node.parentNode;
    }

    // Moving from `node` to its next sibling `next`.
    node = next;
  }

  if (start === -1 || end === -1) {
    // This should never happen. (Would happen if the anchor/focus nodes aren't
    // actually inside the passed-in node.)
    return null;
  }

  return {
    start: start,
    end: end
  };
}

/**
 * In modern non-IE browsers, we can support both forward and backward
 * selections.
 *
 * Note: IE10+ supports the Selection object, but it does not support
 * the `extend` method, which means that even in modern IE, it's not possible
 * to programmatically create a backward selection. Thus, for all IE
 * versions, we use the old IE API to create our selections.
 *
 * @param {DOMElement|DOMTextNode} node
 * @param {object} offsets
 */
function setOffsets(node, offsets) {
  var doc = node.ownerDocument || document;
  var win = doc && doc.defaultView || window;

  // Edge fails with "Object expected" in some scenarios.
  // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
  // fails when pasting 100+ items)
  if (!win.getSelection) {
    return;
  }

  var selection = win.getSelection();
  var length = node.textContent.length;
  var start = Math.min(offsets.start, length);
  var end = offsets.end === undefined ? start : Math.min(offsets.end, length);

  // IE 11 uses modern selection, but doesn't support the extend method.
  // Flip backward selections, so we can set with a single range.
  if (!selection.extend && start > end) {
    var temp = end;
    end = start;
    start = temp;
  }

  var startMarker = getNodeForCharacterOffset(node, start);
  var endMarker = getNodeForCharacterOffset(node, end);

  if (startMarker && endMarker) {
    if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
      return;
    }
    var range = doc.createRange();
    range.setStart(startMarker.node, startMarker.offset);
    selection.removeAllRanges();

    if (start > end) {
      selection.addRange(range);
      selection.extend(endMarker.node, endMarker.offset);
    } else {
      range.setEnd(endMarker.node, endMarker.offset);
      selection.addRange(range);
    }
  }
}

function isTextNode(node) {
  return node && node.nodeType === TEXT_NODE;
}

function containsNode(outerNode, innerNode) {
  if (!outerNode || !innerNode) {
    return false;
  } else if (outerNode === innerNode) {
    return true;
  } else if (isTextNode(outerNode)) {
    return false;
  } else if (isTextNode(innerNode)) {
    return containsNode(outerNode, innerNode.parentNode);
  } else if ('contains' in outerNode) {
    return outerNode.contains(innerNode);
  } else if (outerNode.compareDocumentPosition) {
    return !!(outerNode.compareDocumentPosition(innerNode) & 16);
  } else {
    return false;
  }
}

function isInDocument(node) {
  return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
}

function isSameOriginFrame(iframe) {
  try {
    // Accessing the contentDocument of a HTMLIframeElement can cause the browser
    // to throw, e.g. if it has a cross-origin src attribute.
    // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
    // iframe.contentDocument.defaultView;
    // A safety way is to access one of the cross origin properties: Window or Location
    // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
    // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl

    return typeof iframe.contentWindow.location.href === 'string';
  } catch (err) {
    return false;
  }
}

function getActiveElementDeep() {
  var win = window;
  var element = getActiveElement();
  while (element instanceof win.HTMLIFrameElement) {
    if (isSameOriginFrame(element)) {
      win = element.contentWindow;
    } else {
      return element;
    }
    element = getActiveElement(win.document);
  }
  return element;
}

/**
 * @ReactInputSelection: React input selection module. Based on Selection.js,
 * but modified to be suitable for react and has a couple of bug fixes (doesn't
 * assume buttons have range selections allowed).
 * Input selection module for React.
 */

/**
 * @hasSelectionCapabilities: we get the element types that support selection
 * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
 * and `selectionEnd` rows.
 */
function hasSelectionCapabilities(elem) {
  var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
  return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
}

function getSelectionInformation() {
  var focusedElem = getActiveElementDeep();
  return {
    focusedElem: focusedElem,
    selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection$1(focusedElem) : null
  };
}

/**
 * @restoreSelection: If any selection information was potentially lost,
 * restore it. This is useful when performing operations that could remove dom
 * nodes and place them back in, resulting in focus being lost.
 */
function restoreSelection(priorSelectionInformation) {
  var curFocusedElem = getActiveElementDeep();
  var priorFocusedElem = priorSelectionInformation.focusedElem;
  var priorSelectionRange = priorSelectionInformation.selectionRange;
  if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
    if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
      setSelection(priorFocusedElem, priorSelectionRange);
    }

    // Focusing a node can change the scroll position, which is undesirable
    var ancestors = [];
    var ancestor = priorFocusedElem;
    while (ancestor = ancestor.parentNode) {
      if (ancestor.nodeType === ELEMENT_NODE) {
        ancestors.push({
          element: ancestor,
          left: ancestor.scrollLeft,
          top: ancestor.scrollTop
        });
      }
    }

    if (typeof priorFocusedElem.focus === 'function') {
      priorFocusedElem.focus();
    }

    for (var i = 0; i < ancestors.length; i++) {
      var info = ancestors[i];
      info.element.scrollLeft = info.left;
      info.element.scrollTop = info.top;
    }
  }
}

/**
 * @getSelection: Gets the selection bounds of a focused textarea, input or
 * contentEditable node.
 * -@input: Look up selection bounds of this input
 * -@return {start: selectionStart, end: selectionEnd}
 */
function getSelection$1(input) {
  var selection = void 0;

  if ('selectionStart' in input) {
    // Modern browser with input or textarea.
    selection = {
      start: input.selectionStart,
      end: input.selectionEnd
    };
  } else {
    // Content editable or old IE textarea.
    selection = getOffsets(input);
  }

  return selection || { start: 0, end: 0 };
}

/**
 * @setSelection: Sets the selection bounds of a textarea or input and focuses
 * the input.
 * -@input     Set selection bounds of this input or textarea
 * -@offsets   Object of same form that is returned from get*
 */
function setSelection(input, offsets) {
  var start = offsets.start,
      end = offsets.end;

  if (end === undefined) {
    end = start;
  }

  if ('selectionStart' in input) {
    input.selectionStart = start;
    input.selectionEnd = Math.min(end, input.value.length);
  } else {
    setOffsets(input, offsets);
  }
}

var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;

var eventTypes$3 = {
  select: {
    phasedRegistrationNames: {
      bubbled: 'onSelect',
      captured: 'onSelectCapture'
    },
    dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
  }
};

var activeElement$1 = null;
var activeElementInst$1 = null;
var lastSelection = null;
var mouseDown = false;

/**
 * Get an object which is a unique representation of the current selection.
 *
 * The return value will not be consistent across nodes or browsers, but
 * two identical selections on the same node will return identical objects.
 *
 * @param {DOMElement} node
 * @return {object}
 */
function getSelection(node) {
  if ('selectionStart' in node && hasSelectionCapabilities(node)) {
    return {
      start: node.selectionStart,
      end: node.selectionEnd
    };
  } else {
    var win = node.ownerDocument && node.ownerDocument.defaultView || window;
    var selection = win.getSelection();
    return {
      anchorNode: selection.anchorNode,
      anchorOffset: selection.anchorOffset,
      focusNode: selection.focusNode,
      focusOffset: selection.focusOffset
    };
  }
}

/**
 * Get document associated with the event target.
 *
 * @param {object} nativeEventTarget
 * @return {Document}
 */
function getEventTargetDocument(eventTarget) {
  return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
}

/**
 * Poll selection to see whether it's changed.
 *
 * @param {object} nativeEvent
 * @param {object} nativeEventTarget
 * @return {?SyntheticEvent}
 */
function constructSelectEvent(nativeEvent, nativeEventTarget) {
  // Ensure we have the right element, and that the user is not dragging a
  // selection (this matches native `select` event behavior). In HTML5, select
  // fires only on input and textarea thus if there's no focused element we
  // won't dispatch.
  var doc = getEventTargetDocument(nativeEventTarget);

  if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
    return null;
  }

  // Only fire when selection has actually changed.
  var currentSelection = getSelection(activeElement$1);
  if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
    lastSelection = currentSelection;

    var syntheticEvent = SyntheticEvent.getPooled(eventTypes$3.select, activeElementInst$1, nativeEvent, nativeEventTarget);

    syntheticEvent.type = 'select';
    syntheticEvent.target = activeElement$1;

    accumulateTwoPhaseDispatches(syntheticEvent);

    return syntheticEvent;
  }

  return null;
}

/**
 * This plugin creates an `onSelect` event that normalizes select events
 * across form elements.
 *
 * Supported elements are:
 * - input (see `isTextInputElement`)
 * - textarea
 * - contentEditable
 *
 * This differs from native browser implementations in the following ways:
 * - Fires on contentEditable fields as well as inputs.
 * - Fires for collapsed selection.
 * - Fires after user input.
 */
var SelectEventPlugin = {
  eventTypes: eventTypes$3,

  extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget) {
    var doc = getEventTargetDocument(nativeEventTarget);
    // Track whether all listeners exists for this plugin. If none exist, we do
    // not extract events. See #3639.
    if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
      return null;
    }

    var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;

    switch (topLevelType) {
      // Track the input node that has focus.
      case TOP_FOCUS:
        if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
          activeElement$1 = targetNode;
          activeElementInst$1 = targetInst;
          lastSelection = null;
        }
        break;
      case TOP_BLUR:
        activeElement$1 = null;
        activeElementInst$1 = null;
        lastSelection = null;
        break;
      // Don't fire the event while the user is dragging. This matches the
      // semantics of the native select event.
      case TOP_MOUSE_DOWN:
        mouseDown = true;
        break;
      case TOP_CONTEXT_MENU:
      case TOP_MOUSE_UP:
      case TOP_DRAG_END:
        mouseDown = false;
        return constructSelectEvent(nativeEvent, nativeEventTarget);
      // Chrome and IE fire non-standard event when selection is changed (and
      // sometimes when it hasn't). IE's event fires out of order with respect
      // to key and input events on deletion, so we discard it.
      //
      // Firefox doesn't support selectionchange, so check selection status
      // after each key entry. The selection changes after keydown and before
      // keyup, but we check on keydown as well in the case of holding down a
      // key, when multiple keydown events are fired but only one keyup is.
      // This is also our approach for IE handling, for the reason above.
      case TOP_SELECTION_CHANGE:
        if (skipSelectionChangeEvent) {
          break;
        }
      // falls through
      case TOP_KEY_DOWN:
      case TOP_KEY_UP:
        return constructSelectEvent(nativeEvent, nativeEventTarget);
    }

    return null;
  }
};

/**
 * Inject modules for resolving DOM hierarchy and plugin ordering.
 */
injection.injectEventPluginOrder(DOMEventPluginOrder);
setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);

/**
 * Some important event plugins included by default (without having to require
 * them).
 */
injection.injectEventPluginsByName({
  SimpleEventPlugin: SimpleEventPlugin,
  EnterLeaveEventPlugin: EnterLeaveEventPlugin,
  ChangeEventPlugin: ChangeEventPlugin,
  SelectEventPlugin: SelectEventPlugin,
  BeforeInputEventPlugin: BeforeInputEventPlugin
});

var didWarnSelectedSetOnOption = false;
var didWarnInvalidChild = false;

function flattenChildren(children) {
  var content = '';

  // Flatten children. We'll warn if they are invalid
  // during validateProps() which runs for hydration too.
  // Note that this would throw on non-element objects.
  // Elements are stringified (which is normally irrelevant
  // but matters for <fbt>).
  React.Children.forEach(children, function (child) {
    if (child == null) {
      return;
    }
    content += child;
    // Note: we don't warn about invalid children here.
    // Instead, this is done separately below so that
    // it happens during the hydration codepath too.
  });

  return content;
}

/**
 * Implements an <option> host component that warns when `selected` is set.
 */

function validateProps(element, props) {
  {
    // This mirrors the codepath above, but runs for hydration too.
    // Warn about invalid children here so that client and hydration are consistent.
    // TODO: this seems like it could cause a DEV-only throw for hydration
    // if children contains a non-element object. We should try to avoid that.
    if (typeof props.children === 'object' && props.children !== null) {
      React.Children.forEach(props.children, function (child) {
        if (child == null) {
          return;
        }
        if (typeof child === 'string' || typeof child === 'number') {
          return;
        }
        if (typeof child.type !== 'string') {
          return;
        }
        if (!didWarnInvalidChild) {
          didWarnInvalidChild = true;
          warning$1(false, 'Only strings and numbers are supported as <option> children.');
        }
      });
    }

    // TODO: Remove support for `selected` in <option>.
    if (props.selected != null && !didWarnSelectedSetOnOption) {
      warning$1(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
      didWarnSelectedSetOnOption = true;
    }
  }
}

function postMountWrapper$1(element, props) {
  // value="" should make a value attribute (#6219)
  if (props.value != null) {
    element.setAttribute('value', toString(getToStringValue(props.value)));
  }
}

function getHostProps$1(element, props) {
  var hostProps = _assign({ children: undefined }, props);
  var content = flattenChildren(props.children);

  if (content) {
    hostProps.children = content;
  }

  return hostProps;
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnValueDefaultValue$1 = void 0;

{
  didWarnValueDefaultValue$1 = false;
}

function getDeclarationErrorAddendum() {
  var ownerName = getCurrentFiberOwnerNameInDevOrNull();
  if (ownerName) {
    return '\n\nCheck the render method of `' + ownerName + '`.';
  }
  return '';
}

var valuePropNames = ['value', 'defaultValue'];

/**
 * Validation function for `value` and `defaultValue`.
 */
function checkSelectPropTypes(props) {
  ReactControlledValuePropTypes.checkPropTypes('select', props);

  for (var i = 0; i < valuePropNames.length; i++) {
    var propName = valuePropNames[i];
    if (props[propName] == null) {
      continue;
    }
    var isArray = Array.isArray(props[propName]);
    if (props.multiple && !isArray) {
      warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
    } else if (!props.multiple && isArray) {
      warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
    }
  }
}

function updateOptions(node, multiple, propValue, setDefaultSelected) {
  var options = node.options;

  if (multiple) {
    var selectedValues = propValue;
    var selectedValue = {};
    for (var i = 0; i < selectedValues.length; i++) {
      // Prefix to avoid chaos with special keys.
      selectedValue['$' + selectedValues[i]] = true;
    }
    for (var _i = 0; _i < options.length; _i++) {
      var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
      if (options[_i].selected !== selected) {
        options[_i].selected = selected;
      }
      if (selected && setDefaultSelected) {
        options[_i].defaultSelected = true;
      }
    }
  } else {
    // Do not set `select.value` as exact behavior isn't consistent across all
    // browsers for all cases.
    var _selectedValue = toString(getToStringValue(propValue));
    var defaultSelected = null;
    for (var _i2 = 0; _i2 < options.length; _i2++) {
      if (options[_i2].value === _selectedValue) {
        options[_i2].selected = true;
        if (setDefaultSelected) {
          options[_i2].defaultSelected = true;
        }
        return;
      }
      if (defaultSelected === null && !options[_i2].disabled) {
        defaultSelected = options[_i2];
      }
    }
    if (defaultSelected !== null) {
      defaultSelected.selected = true;
    }
  }
}

/**
 * Implements a <select> host component that allows optionally setting the
 * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
 * stringable. If `multiple` is true, the prop must be an array of stringables.
 *
 * If `value` is not supplied (or null/undefined), user actions that change the
 * selected option will trigger updates to the rendered options.
 *
 * If it is supplied (and not null/undefined), the rendered options will not
 * update in response to user actions. Instead, the `value` prop must change in
 * order for the rendered options to update.
 *
 * If `defaultValue` is provided, any options with the supplied values will be
 * selected.
 */

function getHostProps$2(element, props) {
  return _assign({}, props, {
    value: undefined
  });
}

function initWrapperState$1(element, props) {
  var node = element;
  {
    checkSelectPropTypes(props);
  }

  node._wrapperState = {
    wasMultiple: !!props.multiple
  };

  {
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
      warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
      didWarnValueDefaultValue$1 = true;
    }
  }
}

function postMountWrapper$2(element, props) {
  var node = element;
  node.multiple = !!props.multiple;
  var value = props.value;
  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (props.defaultValue != null) {
    updateOptions(node, !!props.multiple, props.defaultValue, true);
  }
}

function postUpdateWrapper(element, props) {
  var node = element;
  var wasMultiple = node._wrapperState.wasMultiple;
  node._wrapperState.wasMultiple = !!props.multiple;

  var value = props.value;
  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  } else if (wasMultiple !== !!props.multiple) {
    // For simplicity, reapply `defaultValue` if `multiple` is toggled.
    if (props.defaultValue != null) {
      updateOptions(node, !!props.multiple, props.defaultValue, true);
    } else {
      // Revert the select back to its default unselected state.
      updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
    }
  }
}

function restoreControlledState$2(element, props) {
  var node = element;
  var value = props.value;

  if (value != null) {
    updateOptions(node, !!props.multiple, value, false);
  }
}

var didWarnValDefaultVal = false;

/**
 * Implements a <textarea> host component that allows setting `value`, and
 * `defaultValue`. This differs from the traditional DOM API because value is
 * usually set as PCDATA children.
 *
 * If `value` is not supplied (or null/undefined), user actions that affect the
 * value will trigger updates to the element.
 *
 * If `value` is supplied (and not null/undefined), the rendered element will
 * not trigger updates to the element. Instead, the `value` prop must change in
 * order for the rendered element to be updated.
 *
 * The rendered element will be initialized with an empty value, the prop
 * `defaultValue` if specified, or the children content (deprecated).
 */

function getHostProps$3(element, props) {
  var node = element;
  !(props.dangerouslySetInnerHTML == null) ? invariant(false, '`dangerouslySetInnerHTML` does not make sense on <textarea>.') : void 0;

  // Always set children to the same thing. In IE9, the selection range will
  // get reset if `textContent` is mutated.  We could add a check in setTextContent
  // to only set the value if/when the value differs from the node value (which would
  // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
  // solution. The value can be a boolean or object so that's why it's forced
  // to be a string.
  var hostProps = _assign({}, props, {
    value: undefined,
    defaultValue: undefined,
    children: toString(node._wrapperState.initialValue)
  });

  return hostProps;
}

function initWrapperState$2(element, props) {
  var node = element;
  {
    ReactControlledValuePropTypes.checkPropTypes('textarea', props);
    if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
      warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
      didWarnValDefaultVal = true;
    }
  }

  var initialValue = props.value;

  // Only bother fetching default value if we're going to use it
  if (initialValue == null) {
    var defaultValue = props.defaultValue;
    // TODO (yungsters): Remove support for children content in <textarea>.
    var children = props.children;
    if (children != null) {
      {
        warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
      }
      !(defaultValue == null) ? invariant(false, 'If you supply `defaultValue` on a <textarea>, do not pass children.') : void 0;
      if (Array.isArray(children)) {
        !(children.length <= 1) ? invariant(false, '<textarea> can only have at most one child.') : void 0;
        children = children[0];
      }

      defaultValue = children;
    }
    if (defaultValue == null) {
      defaultValue = '';
    }
    initialValue = defaultValue;
  }

  node._wrapperState = {
    initialValue: getToStringValue(initialValue)
  };
}

function updateWrapper$1(element, props) {
  var node = element;
  var value = getToStringValue(props.value);
  var defaultValue = getToStringValue(props.defaultValue);
  if (value != null) {
    // Cast `value` to a string to ensure the value is set correctly. While
    // browsers typically do this as necessary, jsdom doesn't.
    var newValue = toString(value);
    // To avoid side effects (such as losing text selection), only set value if changed
    if (newValue !== node.value) {
      node.value = newValue;
    }
    if (props.defaultValue == null && node.defaultValue !== newValue) {
      node.defaultValue = newValue;
    }
  }
  if (defaultValue != null) {
    node.defaultValue = toString(defaultValue);
  }
}

function postMountWrapper$3(element, props) {
  var node = element;
  // This is in postMount because we need access to the DOM node, which is not
  // available until after the component has mounted.
  var textContent = node.textContent;

  // Only set node.value if textContent is equal to the expected
  // initial value. In IE10/IE11 there is a bug where the placeholder attribute
  // will populate textContent as well.
  // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
  if (textContent === node._wrapperState.initialValue) {
    node.value = textContent;
  }
}

function restoreControlledState$3(element, props) {
  // DOM component is still mounted; update
  updateWrapper$1(element, props);
}

var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';

var Namespaces = {
  html: HTML_NAMESPACE$1,
  mathml: MATH_NAMESPACE,
  svg: SVG_NAMESPACE
};

// Assumes there is no parent namespace.
function getIntrinsicNamespace(type) {
  switch (type) {
    case 'svg':
      return SVG_NAMESPACE;
    case 'math':
      return MATH_NAMESPACE;
    default:
      return HTML_NAMESPACE$1;
  }
}

function getChildNamespace(parentNamespace, type) {
  if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
    // No (or default) parent namespace: potential entry point.
    return getIntrinsicNamespace(type);
  }
  if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
    // We're leaving SVG.
    return HTML_NAMESPACE$1;
  }
  // By default, pass namespace below.
  return parentNamespace;
}

/* globals MSApp */

/**
 * Create a function which has 'unsafe' privileges (required by windows8 apps)
 */
var createMicrosoftUnsafeLocalFunction = function (func) {
  if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
    return function (arg0, arg1, arg2, arg3) {
      MSApp.execUnsafeLocalFunction(function () {
        return func(arg0, arg1, arg2, arg3);
      });
    };
  } else {
    return func;
  }
};

// SVG temp container for IE lacking innerHTML
var reusableSVGContainer = void 0;

/**
 * Set the innerHTML property of a node
 *
 * @param {DOMElement} node
 * @param {string} html
 * @internal
 */
var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
  // IE does not have innerHTML for SVG nodes, so instead we inject the
  // new markup in a temp node and then move the child nodes across into
  // the target node

  if (node.namespaceURI === Namespaces.svg && !('innerHTML' in node)) {
    reusableSVGContainer = reusableSVGContainer || document.createElement('div');
    reusableSVGContainer.innerHTML = '<svg>' + html + '</svg>';
    var svgNode = reusableSVGContainer.firstChild;
    while (node.firstChild) {
      node.removeChild(node.firstChild);
    }
    while (svgNode.firstChild) {
      node.appendChild(svgNode.firstChild);
    }
  } else {
    node.innerHTML = html;
  }
});

/**
 * Set the textContent property of a node. For text updates, it's faster
 * to set the `nodeValue` of the Text node directly instead of using
 * `.textContent` which will remove the existing node and create a new one.
 *
 * @param {DOMElement} node
 * @param {string} text
 * @internal
 */
var setTextContent = function (node, text) {
  if (text) {
    var firstChild = node.firstChild;

    if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
      firstChild.nodeValue = text;
      return;
    }
  }
  node.textContent = text;
};

// List derived from Gecko source code:
// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
var shorthandToLonghand = {
  animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
  background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
  backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
  border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
  borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
  borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
  borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
  borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
  borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
  borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
  borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
  borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
  borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
  borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
  borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
  borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
  columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
  columns: ['columnCount', 'columnWidth'],
  flex: ['flexBasis', 'flexGrow', 'flexShrink'],
  flexFlow: ['flexDirection', 'flexWrap'],
  font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
  fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
  gap: ['columnGap', 'rowGap'],
  grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
  gridColumn: ['gridColumnEnd', 'gridColumnStart'],
  gridColumnGap: ['columnGap'],
  gridGap: ['columnGap', 'rowGap'],
  gridRow: ['gridRowEnd', 'gridRowStart'],
  gridRowGap: ['rowGap'],
  gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
  listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
  margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
  marker: ['markerEnd', 'markerMid', 'markerStart'],
  mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
  maskPosition: ['maskPositionX', 'maskPositionY'],
  outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
  overflow: ['overflowX', 'overflowY'],
  padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
  placeContent: ['alignContent', 'justifyContent'],
  placeItems: ['alignItems', 'justifyItems'],
  placeSelf: ['alignSelf', 'justifySelf'],
  textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
  textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
  transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
  wordWrap: ['overflowWrap']
};

/**
 * CSS properties which accept numbers but are not in units of "px".
 */
var isUnitlessNumber = {
  animationIterationCount: true,
  borderImageOutset: true,
  borderImageSlice: true,
  borderImageWidth: true,
  boxFlex: true,
  boxFlexGroup: true,
  boxOrdinalGroup: true,
  columnCount: true,
  columns: true,
  flex: true,
  flexGrow: true,
  flexPositive: true,
  flexShrink: true,
  flexNegative: true,
  flexOrder: true,
  gridArea: true,
  gridRow: true,
  gridRowEnd: true,
  gridRowSpan: true,
  gridRowStart: true,
  gridColumn: true,
  gridColumnEnd: true,
  gridColumnSpan: true,
  gridColumnStart: true,
  fontWeight: true,
  lineClamp: true,
  lineHeight: true,
  opacity: true,
  order: true,
  orphans: true,
  tabSize: true,
  widows: true,
  zIndex: true,
  zoom: true,

  // SVG-related properties
  fillOpacity: true,
  floodOpacity: true,
  stopOpacity: true,
  strokeDasharray: true,
  strokeDashoffset: true,
  strokeMiterlimit: true,
  strokeOpacity: true,
  strokeWidth: true
};

/**
 * @param {string} prefix vendor-specific prefix, eg: Webkit
 * @param {string} key style name, eg: transitionDuration
 * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
 * WebkitTransitionDuration
 */
function prefixKey(prefix, key) {
  return prefix + key.charAt(0).toUpperCase() + key.substring(1);
}

/**
 * Support style names that may come passed in prefixed by adding permutations
 * of vendor prefixes.
 */
var prefixes = ['Webkit', 'ms', 'Moz', 'O'];

// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
// infinite loop, because it iterates over the newly added props too.
Object.keys(isUnitlessNumber).forEach(function (prop) {
  prefixes.forEach(function (prefix) {
    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
  });
});

/**
 * Convert a value into the proper css writable value. The style name `name`
 * should be logical (no hyphens), as specified
 * in `CSSProperty.isUnitlessNumber`.
 *
 * @param {string} name CSS property name such as `topMargin`.
 * @param {*} value CSS property value such as `10px`.
 * @return {string} Normalized style value with dimensions applied.
 */
function dangerousStyleValue(name, value, isCustomProperty) {
  // Note that we've removed escapeTextForBrowser() calls here since the
  // whole string will be escaped when the attribute is injected into
  // the markup. If you provide unsafe user data here they can inject
  // arbitrary CSS which may be problematic (I couldn't repro this):
  // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
  // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
  // This is not an XSS hole but instead a potential CSS injection issue
  // which has lead to a greater discussion about how we're going to
  // trust URLs moving forward. See #2115901

  var isEmpty = value == null || typeof value === 'boolean' || value === '';
  if (isEmpty) {
    return '';
  }

  if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
    return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
  }

  return ('' + value).trim();
}

var uppercasePattern = /([A-Z])/g;
var msPattern = /^ms-/;

/**
 * Hyphenates a camelcased CSS property name, for example:
 *
 *   > hyphenateStyleName('backgroundColor')
 *   < "background-color"
 *   > hyphenateStyleName('MozTransition')
 *   < "-moz-transition"
 *   > hyphenateStyleName('msTransition')
 *   < "-ms-transition"
 *
 * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
 * is converted to `-ms-`.
 */
function hyphenateStyleName(name) {
  return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
}

var warnValidStyle = function () {};

{
  // 'msTransform' is correct, but the other prefixes should be capitalized
  var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
  var msPattern$1 = /^-ms-/;
  var hyphenPattern = /-(.)/g;

  // style values shouldn't contain a semicolon
  var badStyleValueWithSemicolonPattern = /;\s*$/;

  var warnedStyleNames = {};
  var warnedStyleValues = {};
  var warnedForNaNValue = false;
  var warnedForInfinityValue = false;

  var camelize = function (string) {
    return string.replace(hyphenPattern, function (_, character) {
      return character.toUpperCase();
    });
  };

  var warnHyphenatedStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;
    warning$1(false, 'Unsupported style property %s. Did you mean %s?', name,
    // As Andi Smith suggests
    // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
    // is converted to lowercase `ms`.
    camelize(name.replace(msPattern$1, 'ms-')));
  };

  var warnBadVendoredStyleName = function (name) {
    if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
      return;
    }

    warnedStyleNames[name] = true;
    warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
  };

  var warnStyleValueWithSemicolon = function (name, value) {
    if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
      return;
    }

    warnedStyleValues[value] = true;
    warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
  };

  var warnStyleValueIsNaN = function (name, value) {
    if (warnedForNaNValue) {
      return;
    }

    warnedForNaNValue = true;
    warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
  };

  var warnStyleValueIsInfinity = function (name, value) {
    if (warnedForInfinityValue) {
      return;
    }

    warnedForInfinityValue = true;
    warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
  };

  warnValidStyle = function (name, value) {
    if (name.indexOf('-') > -1) {
      warnHyphenatedStyleName(name);
    } else if (badVendoredStyleNamePattern.test(name)) {
      warnBadVendoredStyleName(name);
    } else if (badStyleValueWithSemicolonPattern.test(value)) {
      warnStyleValueWithSemicolon(name, value);
    }

    if (typeof value === 'number') {
      if (isNaN(value)) {
        warnStyleValueIsNaN(name, value);
      } else if (!isFinite(value)) {
        warnStyleValueIsInfinity(name, value);
      }
    }
  };
}

var warnValidStyle$1 = warnValidStyle;

/**
 * Operations for dealing with CSS properties.
 */

/**
 * This creates a string that is expected to be equivalent to the style
 * attribute generated by server-side rendering. It by-passes warnings and
 * security checks so it's not safe to use this value for anything other than
 * comparison. It is only used in DEV for SSR validation.
 */
function createDangerousStringForStyles(styles) {
  {
    var serialized = '';
    var delimiter = '';
    for (var styleName in styles) {
      if (!styles.hasOwnProperty(styleName)) {
        continue;
      }
      var styleValue = styles[styleName];
      if (styleValue != null) {
        var isCustomProperty = styleName.indexOf('--') === 0;
        serialized += delimiter + hyphenateStyleName(styleName) + ':';
        serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);

        delimiter = ';';
      }
    }
    return serialized || null;
  }
}

/**
 * Sets the value for multiple styles on a node.  If a value is specified as
 * '' (empty string), the corresponding style property will be unset.
 *
 * @param {DOMElement} node
 * @param {object} styles
 */
function setValueForStyles(node, styles) {
  var style = node.style;
  for (var styleName in styles) {
    if (!styles.hasOwnProperty(styleName)) {
      continue;
    }
    var isCustomProperty = styleName.indexOf('--') === 0;
    {
      if (!isCustomProperty) {
        warnValidStyle$1(styleName, styles[styleName]);
      }
    }
    var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
    if (styleName === 'float') {
      styleName = 'cssFloat';
    }
    if (isCustomProperty) {
      style.setProperty(styleName, styleValue);
    } else {
      style[styleName] = styleValue;
    }
  }
}

function isValueEmpty(value) {
  return value == null || typeof value === 'boolean' || value === '';
}

/**
 * Given {color: 'red', overflow: 'hidden'} returns {
 *   color: 'color',
 *   overflowX: 'overflow',
 *   overflowY: 'overflow',
 * }. This can be read as "the overflowY property was set by the overflow
 * shorthand". That is, the values are the property that each was derived from.
 */
function expandShorthandMap(styles) {
  var expanded = {};
  for (var key in styles) {
    var longhands = shorthandToLonghand[key] || [key];
    for (var i = 0; i < longhands.length; i++) {
      expanded[longhands[i]] = key;
    }
  }
  return expanded;
}

/**
 * When mixing shorthand and longhand property names, we warn during updates if
 * we expect an incorrect result to occur. In particular, we warn for:
 *
 * Updating a shorthand property (longhand gets overwritten):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
 *   becomes .style.font = 'baz'
 * Removing a shorthand property (longhand gets lost too):
 *   {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
 *   becomes .style.font = ''
 * Removing a longhand property (should revert to shorthand; doesn't):
 *   {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
 *   becomes .style.fontVariant = ''
 */
function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
  if (!warnAboutShorthandPropertyCollision) {
    return;
  }

  if (!nextStyles) {
    return;
  }

  var expandedUpdates = expandShorthandMap(styleUpdates);
  var expandedStyles = expandShorthandMap(nextStyles);
  var warnedAbout = {};
  for (var key in expandedUpdates) {
    var originalKey = expandedUpdates[key];
    var correctOriginalKey = expandedStyles[key];
    if (correctOriginalKey && originalKey !== correctOriginalKey) {
      var warningKey = originalKey + ',' + correctOriginalKey;
      if (warnedAbout[warningKey]) {
        continue;
      }
      warnedAbout[warningKey] = true;
      warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
    }
  }
}

// For HTML, certain tags should omit their close tag. We keep a whitelist for
// those special-case tags.

var omittedCloseTags = {
  area: true,
  base: true,
  br: true,
  col: true,
  embed: true,
  hr: true,
  img: true,
  input: true,
  keygen: true,
  link: true,
  meta: true,
  param: true,
  source: true,
  track: true,
  wbr: true
  // NOTE: menuitem's close tag should be omitted, but that causes problems.
};

// For HTML, certain tags cannot have children. This has the same purpose as
// `omittedCloseTags` except that `menuitem` should still have its closing tag.

var voidElementTags = _assign({
  menuitem: true
}, omittedCloseTags);

// TODO: We can remove this if we add invariantWithStack()
// or add stack by default to invariants where possible.
var HTML$1 = '__html';

var ReactDebugCurrentFrame$2 = null;
{
  ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
}

function assertValidProps(tag, props) {
  if (!props) {
    return;
  }
  // Note the use of `==` which checks for null or undefined.
  if (voidElementTags[tag]) {
    !(props.children == null && props.dangerouslySetInnerHTML == null) ? invariant(false, '%s is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.%s', tag, ReactDebugCurrentFrame$2.getStackAddendum()) : void 0;
  }
  if (props.dangerouslySetInnerHTML != null) {
    !(props.children == null) ? invariant(false, 'Can only set one of `children` or `props.dangerouslySetInnerHTML`.') : void 0;
    !(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML) ? invariant(false, '`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.') : void 0;
  }
  {
    !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
  }
  !(props.style == null || typeof props.style === 'object') ? invariant(false, 'The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + \'em\'}} when using JSX.%s', ReactDebugCurrentFrame$2.getStackAddendum()) : void 0;
}

function isCustomComponent(tagName, props) {
  if (tagName.indexOf('-') === -1) {
    return typeof props.is === 'string';
  }
  switch (tagName) {
    // These are reserved SVG and MathML elements.
    // We don't mind this whitelist too much because we expect it to never grow.
    // The alternative is to track the namespace in a few places which is convoluted.
    // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
    case 'annotation-xml':
    case 'color-profile':
    case 'font-face':
    case 'font-face-src':
    case 'font-face-uri':
    case 'font-face-format':
    case 'font-face-name':
    case 'missing-glyph':
      return false;
    default:
      return true;
  }
}

// When adding attributes to the HTML or SVG whitelist, be sure to
// also add them to this module to ensure casing and incorrect name
// warnings.
var possibleStandardNames = {
  // HTML
  accept: 'accept',
  acceptcharset: 'acceptCharset',
  'accept-charset': 'acceptCharset',
  accesskey: 'accessKey',
  action: 'action',
  allowfullscreen: 'allowFullScreen',
  alt: 'alt',
  as: 'as',
  async: 'async',
  autocapitalize: 'autoCapitalize',
  autocomplete: 'autoComplete',
  autocorrect: 'autoCorrect',
  autofocus: 'autoFocus',
  autoplay: 'autoPlay',
  autosave: 'autoSave',
  capture: 'capture',
  cellpadding: 'cellPadding',
  cellspacing: 'cellSpacing',
  challenge: 'challenge',
  charset: 'charSet',
  checked: 'checked',
  children: 'children',
  cite: 'cite',
  class: 'className',
  classid: 'classID',
  classname: 'className',
  cols: 'cols',
  colspan: 'colSpan',
  content: 'content',
  contenteditable: 'contentEditable',
  contextmenu: 'contextMenu',
  controls: 'controls',
  controlslist: 'controlsList',
  coords: 'coords',
  crossorigin: 'crossOrigin',
  dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
  data: 'data',
  datetime: 'dateTime',
  default: 'default',
  defaultchecked: 'defaultChecked',
  defaultvalue: 'defaultValue',
  defer: 'defer',
  dir: 'dir',
  disabled: 'disabled',
  download: 'download',
  draggable: 'draggable',
  enctype: 'encType',
  for: 'htmlFor',
  form: 'form',
  formmethod: 'formMethod',
  formaction: 'formAction',
  formenctype: 'formEncType',
  formnovalidate: 'formNoValidate',
  formtarget: 'formTarget',
  frameborder: 'frameBorder',
  headers: 'headers',
  height: 'height',
  hidden: 'hidden',
  high: 'high',
  href: 'href',
  hreflang: 'hrefLang',
  htmlfor: 'htmlFor',
  httpequiv: 'httpEquiv',
  'http-equiv': 'httpEquiv',
  icon: 'icon',
  id: 'id',
  innerhtml: 'innerHTML',
  inputmode: 'inputMode',
  integrity: 'integrity',
  is: 'is',
  itemid: 'itemID',
  itemprop: 'itemProp',
  itemref: 'itemRef',
  itemscope: 'itemScope',
  itemtype: 'itemType',
  keyparams: 'keyParams',
  keytype: 'keyType',
  kind: 'kind',
  label: 'label',
  lang: 'lang',
  list: 'list',
  loop: 'loop',
  low: 'low',
  manifest: 'manifest',
  marginwidth: 'marginWidth',
  marginheight: 'marginHeight',
  max: 'max',
  maxlength: 'maxLength',
  media: 'media',
  mediagroup: 'mediaGroup',
  method: 'method',
  min: 'min',
  minlength: 'minLength',
  multiple: 'multiple',
  muted: 'muted',
  name: 'name',
  nomodule: 'noModule',
  nonce: 'nonce',
  novalidate: 'noValidate',
  open: 'open',
  optimum: 'optimum',
  pattern: 'pattern',
  placeholder: 'placeholder',
  playsinline: 'playsInline',
  poster: 'poster',
  preload: 'preload',
  profile: 'profile',
  radiogroup: 'radioGroup',
  readonly: 'readOnly',
  referrerpolicy: 'referrerPolicy',
  rel: 'rel',
  required: 'required',
  reversed: 'reversed',
  role: 'role',
  rows: 'rows',
  rowspan: 'rowSpan',
  sandbox: 'sandbox',
  scope: 'scope',
  scoped: 'scoped',
  scrolling: 'scrolling',
  seamless: 'seamless',
  selected: 'selected',
  shape: 'shape',
  size: 'size',
  sizes: 'sizes',
  span: 'span',
  spellcheck: 'spellCheck',
  src: 'src',
  srcdoc: 'srcDoc',
  srclang: 'srcLang',
  srcset: 'srcSet',
  start: 'start',
  step: 'step',
  style: 'style',
  summary: 'summary',
  tabindex: 'tabIndex',
  target: 'target',
  title: 'title',
  type: 'type',
  usemap: 'useMap',
  value: 'value',
  width: 'width',
  wmode: 'wmode',
  wrap: 'wrap',

  // SVG
  about: 'about',
  accentheight: 'accentHeight',
  'accent-height': 'accentHeight',
  accumulate: 'accumulate',
  additive: 'additive',
  alignmentbaseline: 'alignmentBaseline',
  'alignment-baseline': 'alignmentBaseline',
  allowreorder: 'allowReorder',
  alphabetic: 'alphabetic',
  amplitude: 'amplitude',
  arabicform: 'arabicForm',
  'arabic-form': 'arabicForm',
  ascent: 'ascent',
  attributename: 'attributeName',
  attributetype: 'attributeType',
  autoreverse: 'autoReverse',
  azimuth: 'azimuth',
  basefrequency: 'baseFrequency',
  baselineshift: 'baselineShift',
  'baseline-shift': 'baselineShift',
  baseprofile: 'baseProfile',
  bbox: 'bbox',
  begin: 'begin',
  bias: 'bias',
  by: 'by',
  calcmode: 'calcMode',
  capheight: 'capHeight',
  'cap-height': 'capHeight',
  clip: 'clip',
  clippath: 'clipPath',
  'clip-path': 'clipPath',
  clippathunits: 'clipPathUnits',
  cliprule: 'clipRule',
  'clip-rule': 'clipRule',
  color: 'color',
  colorinterpolation: 'colorInterpolation',
  'color-interpolation': 'colorInterpolation',
  colorinterpolationfilters: 'colorInterpolationFilters',
  'color-interpolation-filters': 'colorInterpolationFilters',
  colorprofile: 'colorProfile',
  'color-profile': 'colorProfile',
  colorrendering: 'colorRendering',
  'color-rendering': 'colorRendering',
  contentscripttype: 'contentScriptType',
  contentstyletype: 'contentStyleType',
  cursor: 'cursor',
  cx: 'cx',
  cy: 'cy',
  d: 'd',
  datatype: 'datatype',
  decelerate: 'decelerate',
  descent: 'descent',
  diffuseconstant: 'diffuseConstant',
  direction: 'direction',
  display: 'display',
  divisor: 'divisor',
  dominantbaseline: 'dominantBaseline',
  'dominant-baseline': 'dominantBaseline',
  dur: 'dur',
  dx: 'dx',
  dy: 'dy',
  edgemode: 'edgeMode',
  elevation: 'elevation',
  enablebackground: 'enableBackground',
  'enable-background': 'enableBackground',
  end: 'end',
  exponent: 'exponent',
  externalresourcesrequired: 'externalResourcesRequired',
  fill: 'fill',
  fillopacity: 'fillOpacity',
  'fill-opacity': 'fillOpacity',
  fillrule: 'fillRule',
  'fill-rule': 'fillRule',
  filter: 'filter',
  filterres: 'filterRes',
  filterunits: 'filterUnits',
  floodopacity: 'floodOpacity',
  'flood-opacity': 'floodOpacity',
  floodcolor: 'floodColor',
  'flood-color': 'floodColor',
  focusable: 'focusable',
  fontfamily: 'fontFamily',
  'font-family': 'fontFamily',
  fontsize: 'fontSize',
  'font-size': 'fontSize',
  fontsizeadjust: 'fontSizeAdjust',
  'font-size-adjust': 'fontSizeAdjust',
  fontstretch: 'fontStretch',
  'font-stretch': 'fontStretch',
  fontstyle: 'fontStyle',
  'font-style': 'fontStyle',
  fontvariant: 'fontVariant',
  'font-variant': 'fontVariant',
  fontweight: 'fontWeight',
  'font-weight': 'fontWeight',
  format: 'format',
  from: 'from',
  fx: 'fx',
  fy: 'fy',
  g1: 'g1',
  g2: 'g2',
  glyphname: 'glyphName',
  'glyph-name': 'glyphName',
  glyphorientationhorizontal: 'glyphOrientationHorizontal',
  'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
  glyphorientationvertical: 'glyphOrientationVertical',
  'glyph-orientation-vertical': 'glyphOrientationVertical',
  glyphref: 'glyphRef',
  gradienttransform: 'gradientTransform',
  gradientunits: 'gradientUnits',
  hanging: 'hanging',
  horizadvx: 'horizAdvX',
  'horiz-adv-x': 'horizAdvX',
  horizoriginx: 'horizOriginX',
  'horiz-origin-x': 'horizOriginX',
  ideographic: 'ideographic',
  imagerendering: 'imageRendering',
  'image-rendering': 'imageRendering',
  in2: 'in2',
  in: 'in',
  inlist: 'inlist',
  intercept: 'intercept',
  k1: 'k1',
  k2: 'k2',
  k3: 'k3',
  k4: 'k4',
  k: 'k',
  kernelmatrix: 'kernelMatrix',
  kernelunitlength: 'kernelUnitLength',
  kerning: 'kerning',
  keypoints: 'keyPoints',
  keysplines: 'keySplines',
  keytimes: 'keyTimes',
  lengthadjust: 'lengthAdjust',
  letterspacing: 'letterSpacing',
  'letter-spacing': 'letterSpacing',
  lightingcolor: 'lightingColor',
  'lighting-color': 'lightingColor',
  limitingconeangle: 'limitingConeAngle',
  local: 'local',
  markerend: 'markerEnd',
  'marker-end': 'markerEnd',
  markerheight: 'markerHeight',
  markermid: 'markerMid',
  'marker-mid': 'markerMid',
  markerstart: 'markerStart',
  'marker-start': 'markerStart',
  markerunits: 'markerUnits',
  markerwidth: 'markerWidth',
  mask: 'mask',
  maskcontentunits: 'maskContentUnits',
  maskunits: 'maskUnits',
  mathematical: 'mathematical',
  mode: 'mode',
  numoctaves: 'numOctaves',
  offset: 'offset',
  opacity: 'opacity',
  operator: 'operator',
  order: 'order',
  orient: 'orient',
  orientation: 'orientation',
  origin: 'origin',
  overflow: 'overflow',
  overlineposition: 'overlinePosition',
  'overline-position': 'overlinePosition',
  overlinethickness: 'overlineThickness',
  'overline-thickness': 'overlineThickness',
  paintorder: 'paintOrder',
  'paint-order': 'paintOrder',
  panose1: 'panose1',
  'panose-1': 'panose1',
  pathlength: 'pathLength',
  patterncontentunits: 'patternContentUnits',
  patterntransform: 'patternTransform',
  patternunits: 'patternUnits',
  pointerevents: 'pointerEvents',
  'pointer-events': 'pointerEvents',
  points: 'points',
  pointsatx: 'pointsAtX',
  pointsaty: 'pointsAtY',
  pointsatz: 'pointsAtZ',
  prefix: 'prefix',
  preservealpha: 'preserveAlpha',
  preserveaspectratio: 'preserveAspectRatio',
  primitiveunits: 'primitiveUnits',
  property: 'property',
  r: 'r',
  radius: 'radius',
  refx: 'refX',
  refy: 'refY',
  renderingintent: 'renderingIntent',
  'rendering-intent': 'renderingIntent',
  repeatcount: 'repeatCount',
  repeatdur: 'repeatDur',
  requiredextensions: 'requiredExtensions',
  requiredfeatures: 'requiredFeatures',
  resource: 'resource',
  restart: 'restart',
  result: 'result',
  results: 'results',
  rotate: 'rotate',
  rx: 'rx',
  ry: 'ry',
  scale: 'scale',
  security: 'security',
  seed: 'seed',
  shaperendering: 'shapeRendering',
  'shape-rendering': 'shapeRendering',
  slope: 'slope',
  spacing: 'spacing',
  specularconstant: 'specularConstant',
  specularexponent: 'specularExponent',
  speed: 'speed',
  spreadmethod: 'spreadMethod',
  startoffset: 'startOffset',
  stddeviation: 'stdDeviation',
  stemh: 'stemh',
  stemv: 'stemv',
  stitchtiles: 'stitchTiles',
  stopcolor: 'stopColor',
  'stop-color': 'stopColor',
  stopopacity: 'stopOpacity',
  'stop-opacity': 'stopOpacity',
  strikethroughposition: 'strikethroughPosition',
  'strikethrough-position': 'strikethroughPosition',
  strikethroughthickness: 'strikethroughThickness',
  'strikethrough-thickness': 'strikethroughThickness',
  string: 'string',
  stroke: 'stroke',
  strokedasharray: 'strokeDasharray',
  'stroke-dasharray': 'strokeDasharray',
  strokedashoffset: 'strokeDashoffset',
  'stroke-dashoffset': 'strokeDashoffset',
  strokelinecap: 'strokeLinecap',
  'stroke-linecap': 'strokeLinecap',
  strokelinejoin: 'strokeLinejoin',
  'stroke-linejoin': 'strokeLinejoin',
  strokemiterlimit: 'strokeMiterlimit',
  'stroke-miterlimit': 'strokeMiterlimit',
  strokewidth: 'strokeWidth',
  'stroke-width': 'strokeWidth',
  strokeopacity: 'strokeOpacity',
  'stroke-opacity': 'strokeOpacity',
  suppresscontenteditablewarning: 'suppressContentEditableWarning',
  suppresshydrationwarning: 'suppressHydrationWarning',
  surfacescale: 'surfaceScale',
  systemlanguage: 'systemLanguage',
  tablevalues: 'tableValues',
  targetx: 'targetX',
  targety: 'targetY',
  textanchor: 'textAnchor',
  'text-anchor': 'textAnchor',
  textdecoration: 'textDecoration',
  'text-decoration': 'textDecoration',
  textlength: 'textLength',
  textrendering: 'textRendering',
  'text-rendering': 'textRendering',
  to: 'to',
  transform: 'transform',
  typeof: 'typeof',
  u1: 'u1',
  u2: 'u2',
  underlineposition: 'underlinePosition',
  'underline-position': 'underlinePosition',
  underlinethickness: 'underlineThickness',
  'underline-thickness': 'underlineThickness',
  unicode: 'unicode',
  unicodebidi: 'unicodeBidi',
  'unicode-bidi': 'unicodeBidi',
  unicoderange: 'unicodeRange',
  'unicode-range': 'unicodeRange',
  unitsperem: 'unitsPerEm',
  'units-per-em': 'unitsPerEm',
  unselectable: 'unselectable',
  valphabetic: 'vAlphabetic',
  'v-alphabetic': 'vAlphabetic',
  values: 'values',
  vectoreffect: 'vectorEffect',
  'vector-effect': 'vectorEffect',
  version: 'version',
  vertadvy: 'vertAdvY',
  'vert-adv-y': 'vertAdvY',
  vertoriginx: 'vertOriginX',
  'vert-origin-x': 'vertOriginX',
  vertoriginy: 'vertOriginY',
  'vert-origin-y': 'vertOriginY',
  vhanging: 'vHanging',
  'v-hanging': 'vHanging',
  videographic: 'vIdeographic',
  'v-ideographic': 'vIdeographic',
  viewbox: 'viewBox',
  viewtarget: 'viewTarget',
  visibility: 'visibility',
  vmathematical: 'vMathematical',
  'v-mathematical': 'vMathematical',
  vocab: 'vocab',
  widths: 'widths',
  wordspacing: 'wordSpacing',
  'word-spacing': 'wordSpacing',
  writingmode: 'writingMode',
  'writing-mode': 'writingMode',
  x1: 'x1',
  x2: 'x2',
  x: 'x',
  xchannelselector: 'xChannelSelector',
  xheight: 'xHeight',
  'x-height': 'xHeight',
  xlinkactuate: 'xlinkActuate',
  'xlink:actuate': 'xlinkActuate',
  xlinkarcrole: 'xlinkArcrole',
  'xlink:arcrole': 'xlinkArcrole',
  xlinkhref: 'xlinkHref',
  'xlink:href': 'xlinkHref',
  xlinkrole: 'xlinkRole',
  'xlink:role': 'xlinkRole',
  xlinkshow: 'xlinkShow',
  'xlink:show': 'xlinkShow',
  xlinktitle: 'xlinkTitle',
  'xlink:title': 'xlinkTitle',
  xlinktype: 'xlinkType',
  'xlink:type': 'xlinkType',
  xmlbase: 'xmlBase',
  'xml:base': 'xmlBase',
  xmllang: 'xmlLang',
  'xml:lang': 'xmlLang',
  xmlns: 'xmlns',
  'xml:space': 'xmlSpace',
  xmlnsxlink: 'xmlnsXlink',
  'xmlns:xlink': 'xmlnsXlink',
  xmlspace: 'xmlSpace',
  y1: 'y1',
  y2: 'y2',
  y: 'y',
  ychannelselector: 'yChannelSelector',
  z: 'z',
  zoomandpan: 'zoomAndPan'
};

var ariaProperties = {
  'aria-current': 0, // state
  'aria-details': 0,
  'aria-disabled': 0, // state
  'aria-hidden': 0, // state
  'aria-invalid': 0, // state
  'aria-keyshortcuts': 0,
  'aria-label': 0,
  'aria-roledescription': 0,
  // Widget Attributes
  'aria-autocomplete': 0,
  'aria-checked': 0,
  'aria-expanded': 0,
  'aria-haspopup': 0,
  'aria-level': 0,
  'aria-modal': 0,
  'aria-multiline': 0,
  'aria-multiselectable': 0,
  'aria-orientation': 0,
  'aria-placeholder': 0,
  'aria-pressed': 0,
  'aria-readonly': 0,
  'aria-required': 0,
  'aria-selected': 0,
  'aria-sort': 0,
  'aria-valuemax': 0,
  'aria-valuemin': 0,
  'aria-valuenow': 0,
  'aria-valuetext': 0,
  // Live Region Attributes
  'aria-atomic': 0,
  'aria-busy': 0,
  'aria-live': 0,
  'aria-relevant': 0,
  // Drag-and-Drop Attributes
  'aria-dropeffect': 0,
  'aria-grabbed': 0,
  // Relationship Attributes
  'aria-activedescendant': 0,
  'aria-colcount': 0,
  'aria-colindex': 0,
  'aria-colspan': 0,
  'aria-controls': 0,
  'aria-describedby': 0,
  'aria-errormessage': 0,
  'aria-flowto': 0,
  'aria-labelledby': 0,
  'aria-owns': 0,
  'aria-posinset': 0,
  'aria-rowcount': 0,
  'aria-rowindex': 0,
  'aria-rowspan': 0,
  'aria-setsize': 0
};

var warnedProperties = {};
var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

var hasOwnProperty$2 = Object.prototype.hasOwnProperty;

function validateProperty(tagName, name) {
  if (hasOwnProperty$2.call(warnedProperties, name) && warnedProperties[name]) {
    return true;
  }

  if (rARIACamel.test(name)) {
    var ariaName = 'aria-' + name.slice(4).toLowerCase();
    var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null;

    // If this is an aria-* attribute, but is not listed in the known DOM
    // DOM properties, then it is an invalid aria-* attribute.
    if (correctName == null) {
      warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
      warnedProperties[name] = true;
      return true;
    }
    // aria-* attributes should be lowercase; suggest the lowercase version.
    if (name !== correctName) {
      warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
      warnedProperties[name] = true;
      return true;
    }
  }

  if (rARIA.test(name)) {
    var lowerCasedName = name.toLowerCase();
    var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null;

    // If this is an aria-* attribute, but is not listed in the known DOM
    // DOM properties, then it is an invalid aria-* attribute.
    if (standardName == null) {
      warnedProperties[name] = true;
      return false;
    }
    // aria-* attributes should be lowercase; suggest the lowercase version.
    if (name !== standardName) {
      warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
      warnedProperties[name] = true;
      return true;
    }
  }

  return true;
}

function warnInvalidARIAProps(type, props) {
  var invalidProps = [];

  for (var key in props) {
    var isValid = validateProperty(type, key);
    if (!isValid) {
      invalidProps.push(key);
    }
  }

  var unknownPropString = invalidProps.map(function (prop) {
    return '`' + prop + '`';
  }).join(', ');

  if (invalidProps.length === 1) {
    warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  } else if (invalidProps.length > 1) {
    warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
  }
}

function validateProperties(type, props) {
  if (isCustomComponent(type, props)) {
    return;
  }
  warnInvalidARIAProps(type, props);
}

var didWarnValueNull = false;

function validateProperties$1(type, props) {
  if (type !== 'input' && type !== 'textarea' && type !== 'select') {
    return;
  }

  if (props != null && props.value === null && !didWarnValueNull) {
    didWarnValueNull = true;
    if (type === 'select' && props.multiple) {
      warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
    } else {
      warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
    }
  }
}

var validateProperty$1 = function () {};

{
  var warnedProperties$1 = {};
  var _hasOwnProperty = Object.prototype.hasOwnProperty;
  var EVENT_NAME_REGEX = /^on./;
  var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
  var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
  var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');

  validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
    if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
      return true;
    }

    var lowerCasedName = name.toLowerCase();
    if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
      warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
      warnedProperties$1[name] = true;
      return true;
    }

    // We can't rely on the event system being injected on the server.
    if (canUseEventSystem) {
      if (registrationNameModules.hasOwnProperty(name)) {
        return true;
      }
      var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
      if (registrationName != null) {
        warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
        warnedProperties$1[name] = true;
        return true;
      }
      if (EVENT_NAME_REGEX.test(name)) {
        warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
        warnedProperties$1[name] = true;
        return true;
      }
    } else if (EVENT_NAME_REGEX.test(name)) {
      // If no event plugins have been injected, we are in a server environment.
      // So we can't tell if the event name is correct for sure, but we can filter
      // out known bad ones like `onclick`. We can't suggest a specific replacement though.
      if (INVALID_EVENT_NAME_REGEX.test(name)) {
        warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
      }
      warnedProperties$1[name] = true;
      return true;
    }

    // Let the ARIA attribute hook validate ARIA attributes
    if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
      return true;
    }

    if (lowerCasedName === 'innerhtml') {
      warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'aria') {
      warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
      warnedProperties$1[name] = true;
      return true;
    }

    if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
      warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'number' && isNaN(value)) {
      warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
      warnedProperties$1[name] = true;
      return true;
    }

    var propertyInfo = getPropertyInfo(name);
    var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED;

    // Known attributes should match the casing specified in the property config.
    if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      var standardName = possibleStandardNames[lowerCasedName];
      if (standardName !== name) {
        warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
        warnedProperties$1[name] = true;
        return true;
      }
    } else if (!isReserved && name !== lowerCasedName) {
      // Unknown attributes should have lowercase casing since that's how they
      // will be cased anyway with server rendering.
      warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
      warnedProperties$1[name] = true;
      return true;
    }

    if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      if (value) {
        warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
      } else {
        warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
      }
      warnedProperties$1[name] = true;
      return true;
    }

    // Now that we've validated casing, do not validate
    // data types for reserved props
    if (isReserved) {
      return true;
    }

    // Warn when a known attribute is a bad type
    if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
      warnedProperties$1[name] = true;
      return false;
    }

    // Warn when passing the strings 'false' or 'true' into a boolean prop
    if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
      warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
      warnedProperties$1[name] = true;
      return true;
    }

    return true;
  };
}

var warnUnknownProperties = function (type, props, canUseEventSystem) {
  var unknownProps = [];
  for (var key in props) {
    var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
    if (!isValid) {
      unknownProps.push(key);
    }
  }

  var unknownPropString = unknownProps.map(function (prop) {
    return '`' + prop + '`';
  }).join(', ');
  if (unknownProps.length === 1) {
    warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  } else if (unknownProps.length > 1) {
    warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
  }
};

function validateProperties$2(type, props, canUseEventSystem) {
  if (isCustomComponent(type, props)) {
    return;
  }
  warnUnknownProperties(type, props, canUseEventSystem);
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var didWarnInvalidHydration = false;
var didWarnShadyDOM = false;

var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
var AUTOFOCUS = 'autoFocus';
var CHILDREN = 'children';
var STYLE$1 = 'style';
var HTML = '__html';

var HTML_NAMESPACE = Namespaces.html;


var warnedUnknownTags = void 0;
var suppressHydrationWarning = void 0;

var validatePropertiesInDevelopment = void 0;
var warnForTextDifference = void 0;
var warnForPropDifference = void 0;
var warnForExtraAttributes = void 0;
var warnForInvalidEventListener = void 0;
var canDiffStyleForHydrationWarning = void 0;

var normalizeMarkupForTextOrAttribute = void 0;
var normalizeHTML = void 0;

{
  warnedUnknownTags = {
    // Chrome is the only major browser not shipping <time>. But as of July
    // 2017 it intends to ship it due to widespread usage. We intentionally
    // *don't* warn for <time> even if it's unrecognized by Chrome because
    // it soon will be, and many apps have been using it anyway.
    time: true,
    // There are working polyfills for <dialog>. Let people use it.
    dialog: true,
    // Electron ships a custom <webview> tag to display external web content in
    // an isolated frame and process.
    // This tag is not present in non Electron environments such as JSDom which
    // is often used for testing purposes.
    // @see https://electronjs.org/docs/api/webview-tag
    webview: true
  };

  validatePropertiesInDevelopment = function (type, props) {
    validateProperties(type, props);
    validateProperties$1(type, props);
    validateProperties$2(type, props, /* canUseEventSystem */true);
  };

  // IE 11 parses & normalizes the style attribute as opposed to other
  // browsers. It adds spaces and sorts the properties in some
  // non-alphabetical order. Handling that would require sorting CSS
  // properties in the client & server versions or applying
  // `expectedStyle` to a temporary DOM node to read its `style` attribute
  // normalized. Since it only affects IE, we're skipping style warnings
  // in that browser completely in favor of doing all that work.
  // See https://github.com/facebook/react/issues/11807
  canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;

  // HTML parsing normalizes CR and CRLF to LF.
  // It also can turn \u0000 into \uFFFD inside attributes.
  // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
  // If we have a mismatch, it might be caused by that.
  // We will still patch up in this case but not fire the warning.
  var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
  var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;

  normalizeMarkupForTextOrAttribute = function (markup) {
    var markupString = typeof markup === 'string' ? markup : '' + markup;
    return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
  };

  warnForTextDifference = function (serverText, clientText) {
    if (didWarnInvalidHydration) {
      return;
    }
    var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
    var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
    if (normalizedServerText === normalizedClientText) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
  };

  warnForPropDifference = function (propName, serverValue, clientValue) {
    if (didWarnInvalidHydration) {
      return;
    }
    var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
    var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
    if (normalizedServerValue === normalizedClientValue) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
  };

  warnForExtraAttributes = function (attributeNames) {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    var names = [];
    attributeNames.forEach(function (name) {
      names.push(name);
    });
    warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);
  };

  warnForInvalidEventListener = function (registrationName, listener) {
    if (listener === false) {
      warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
    } else {
      warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
    }
  };

  // Parse the HTML and read it back to normalize the HTML string so that it
  // can be used for comparison.
  normalizeHTML = function (parent, html) {
    // We could have created a separate document here to avoid
    // re-initializing custom elements if they exist. But this breaks
    // how <noscript> is being handled. So we use the same document.
    // See the discussion in https://github.com/facebook/react/pull/11157.
    var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
    testElement.innerHTML = html;
    return testElement.innerHTML;
  };
}

function ensureListeningTo(rootContainerElement, registrationName) {
  var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
  var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
  listenTo(registrationName, doc);
}

function getOwnerDocumentFromRootContainer(rootContainerElement) {
  return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
}

function noop() {}

function trapClickOnNonInteractiveElement(node) {
  // Mobile Safari does not fire properly bubble click events on
  // non-interactive elements, which means delegated click listeners do not
  // fire. The workaround for this bug involves attaching an empty click
  // listener on the target node.
  // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
  // Just set it using the onclick property so that we don't have to manage any
  // bookkeeping for it. Not sure if we need to clear it when the listener is
  // removed.
  // TODO: Only do this for the relevant Safaris maybe?
  node.onclick = noop;
}

function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
  for (var propKey in nextProps) {
    if (!nextProps.hasOwnProperty(propKey)) {
      continue;
    }
    var nextProp = nextProps[propKey];
    if (propKey === STYLE$1) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      }
      // Relies on `updateStylesByID` not mutating `styleUpdates`.
      setValueForStyles(domElement, nextProp);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML] : undefined;
      if (nextHtml != null) {
        setInnerHTML(domElement, nextHtml);
      }
    } else if (propKey === CHILDREN) {
      if (typeof nextProp === 'string') {
        // Avoid setting initial textContent when the text is empty. In IE11 setting
        // textContent on a <textarea> will cause the placeholder to not
        // show within the <textarea> until it has been focused and blurred again.
        // https://github.com/facebook/react/issues/6731#issuecomment-254874553
        var canSetTextContent = tag !== 'textarea' || nextProp !== '';
        if (canSetTextContent) {
          setTextContent(domElement, nextProp);
        }
      } else if (typeof nextProp === 'number') {
        setTextContent(domElement, '' + nextProp);
      }
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
      // Noop
    } else if (propKey === AUTOFOCUS) {
      // We polyfill it separately on the client during commit.
      // We could have excluded it in the property list instead of
      // adding a special case here, but then it wouldn't be emitted
      // on server rendering (but we *do* want to emit it in SSR).
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if (true && typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }
        ensureListeningTo(rootContainerElement, propKey);
      }
    } else if (nextProp != null) {
      setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
    }
  }
}

function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
  // TODO: Handle wasCustomComponentTag
  for (var i = 0; i < updatePayload.length; i += 2) {
    var propKey = updatePayload[i];
    var propValue = updatePayload[i + 1];
    if (propKey === STYLE$1) {
      setValueForStyles(domElement, propValue);
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      setInnerHTML(domElement, propValue);
    } else if (propKey === CHILDREN) {
      setTextContent(domElement, propValue);
    } else {
      setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
    }
  }
}

function createElement(type, props, rootContainerElement, parentNamespace) {
  var isCustomComponentTag = void 0;

  // We create tags in the namespace of their parent container, except HTML
  // tags get no namespace.
  var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
  var domElement = void 0;
  var namespaceURI = parentNamespace;
  if (namespaceURI === HTML_NAMESPACE) {
    namespaceURI = getIntrinsicNamespace(type);
  }
  if (namespaceURI === HTML_NAMESPACE) {
    {
      isCustomComponentTag = isCustomComponent(type, props);
      // Should this check be gated by parent namespace? Not sure we want to
      // allow <SVG> or <mATH>.
      !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
    }

    if (type === 'script') {
      // Create the script via .innerHTML so its "parser-inserted" flag is
      // set to true and it does not execute
      var div = ownerDocument.createElement('div');
      div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
      // This is guaranteed to yield a script element.
      var firstChild = div.firstChild;
      domElement = div.removeChild(firstChild);
    } else if (typeof props.is === 'string') {
      // $FlowIssue `createElement` should be updated for Web Components
      domElement = ownerDocument.createElement(type, { is: props.is });
    } else {
      // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
      // See discussion in https://github.com/facebook/react/pull/6896
      // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
      domElement = ownerDocument.createElement(type);
      // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
      // attributes on `select`s needs to be added before `option`s are inserted.
      // This prevents:
      // - a bug where the `select` does not scroll to the correct option because singular
      //  `select` elements automatically pick the first item #13222
      // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
      // See https://github.com/facebook/react/issues/13222
      // and https://github.com/facebook/react/issues/14239
      if (type === 'select') {
        var node = domElement;
        if (props.multiple) {
          node.multiple = true;
        } else if (props.size) {
          // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
          // it is possible that no option is selected.
          //
          // This is only necessary when a select in "single selection mode".
          node.size = props.size;
        }
      }
    }
  } else {
    domElement = ownerDocument.createElementNS(namespaceURI, type);
  }

  {
    if (namespaceURI === HTML_NAMESPACE) {
      if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
        warnedUnknownTags[type] = true;
        warning$1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
      }
    }
  }

  return domElement;
}

function createTextNode(text, rootContainerElement) {
  return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
}

function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
  var isCustomComponentTag = isCustomComponent(tag, rawProps);
  {
    validatePropertiesInDevelopment(tag, rawProps);
    if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
      warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
      didWarnShadyDOM = true;
    }
  }

  // TODO: Make sure that we check isMounted before firing any of these events.
  var props = void 0;
  switch (tag) {
    case 'iframe':
    case 'object':
      trapBubbledEvent(TOP_LOAD, domElement);
      props = rawProps;
      break;
    case 'video':
    case 'audio':
      // Create listener for each media event
      for (var i = 0; i < mediaEventTypes.length; i++) {
        trapBubbledEvent(mediaEventTypes[i], domElement);
      }
      props = rawProps;
      break;
    case 'source':
      trapBubbledEvent(TOP_ERROR, domElement);
      props = rawProps;
      break;
    case 'img':
    case 'image':
    case 'link':
      trapBubbledEvent(TOP_ERROR, domElement);
      trapBubbledEvent(TOP_LOAD, domElement);
      props = rawProps;
      break;
    case 'form':
      trapBubbledEvent(TOP_RESET, domElement);
      trapBubbledEvent(TOP_SUBMIT, domElement);
      props = rawProps;
      break;
    case 'details':
      trapBubbledEvent(TOP_TOGGLE, domElement);
      props = rawProps;
      break;
    case 'input':
      initWrapperState(domElement, rawProps);
      props = getHostProps(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'option':
      validateProps(domElement, rawProps);
      props = getHostProps$1(domElement, rawProps);
      break;
    case 'select':
      initWrapperState$1(domElement, rawProps);
      props = getHostProps$2(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'textarea':
      initWrapperState$2(domElement, rawProps);
      props = getHostProps$3(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    default:
      props = rawProps;
  }

  assertValidProps(tag, props);

  setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, false);
      break;
    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement, rawProps);
      break;
    case 'option':
      postMountWrapper$1(domElement, rawProps);
      break;
    case 'select':
      postMountWrapper$2(domElement, rawProps);
      break;
    default:
      if (typeof props.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }
      break;
  }
}

// Calculate the diff between the two objects.
function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
  {
    validatePropertiesInDevelopment(tag, nextRawProps);
  }

  var updatePayload = null;

  var lastProps = void 0;
  var nextProps = void 0;
  switch (tag) {
    case 'input':
      lastProps = getHostProps(domElement, lastRawProps);
      nextProps = getHostProps(domElement, nextRawProps);
      updatePayload = [];
      break;
    case 'option':
      lastProps = getHostProps$1(domElement, lastRawProps);
      nextProps = getHostProps$1(domElement, nextRawProps);
      updatePayload = [];
      break;
    case 'select':
      lastProps = getHostProps$2(domElement, lastRawProps);
      nextProps = getHostProps$2(domElement, nextRawProps);
      updatePayload = [];
      break;
    case 'textarea':
      lastProps = getHostProps$3(domElement, lastRawProps);
      nextProps = getHostProps$3(domElement, nextRawProps);
      updatePayload = [];
      break;
    default:
      lastProps = lastRawProps;
      nextProps = nextRawProps;
      if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }
      break;
  }

  assertValidProps(tag, nextProps);

  var propKey = void 0;
  var styleName = void 0;
  var styleUpdates = null;
  for (propKey in lastProps) {
    if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
      continue;
    }
    if (propKey === STYLE$1) {
      var lastStyle = lastProps[propKey];
      for (styleName in lastStyle) {
        if (lastStyle.hasOwnProperty(styleName)) {
          if (!styleUpdates) {
            styleUpdates = {};
          }
          styleUpdates[styleName] = '';
        }
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {
      // Noop. This is handled by the clear text mechanism.
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
      // Noop
    } else if (propKey === AUTOFOCUS) {
      // Noop. It doesn't work on updates anyway.
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      // This is a special case. If any listener updates we need to ensure
      // that the "current" fiber pointer gets updated so we need a commit
      // to update this element.
      if (!updatePayload) {
        updatePayload = [];
      }
    } else {
      // For all other deleted properties we add it to the queue. We use
      // the whitelist in the commit phase instead.
      (updatePayload = updatePayload || []).push(propKey, null);
    }
  }
  for (propKey in nextProps) {
    var nextProp = nextProps[propKey];
    var lastProp = lastProps != null ? lastProps[propKey] : undefined;
    if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
      continue;
    }
    if (propKey === STYLE$1) {
      {
        if (nextProp) {
          // Freeze the next style object so that we can assume it won't be
          // mutated. We have already warned for this in the past.
          Object.freeze(nextProp);
        }
      }
      if (lastProp) {
        // Unset styles on `lastProp` but not on `nextProp`.
        for (styleName in lastProp) {
          if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
            if (!styleUpdates) {
              styleUpdates = {};
            }
            styleUpdates[styleName] = '';
          }
        }
        // Update styles that changed since `lastProp`.
        for (styleName in nextProp) {
          if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
            if (!styleUpdates) {
              styleUpdates = {};
            }
            styleUpdates[styleName] = nextProp[styleName];
          }
        }
      } else {
        // Relies on `updateStylesByID` not mutating `styleUpdates`.
        if (!styleUpdates) {
          if (!updatePayload) {
            updatePayload = [];
          }
          updatePayload.push(propKey, styleUpdates);
        }
        styleUpdates = nextProp;
      }
    } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
      var nextHtml = nextProp ? nextProp[HTML] : undefined;
      var lastHtml = lastProp ? lastProp[HTML] : undefined;
      if (nextHtml != null) {
        if (lastHtml !== nextHtml) {
          (updatePayload = updatePayload || []).push(propKey, '' + nextHtml);
        }
      } else {
        // TODO: It might be too late to clear this if we have children
        // inserted already.
      }
    } else if (propKey === CHILDREN) {
      if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
        (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
      }
    } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {
      // Noop
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        // We eagerly listen to this even though we haven't committed yet.
        if (true && typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }
        ensureListeningTo(rootContainerElement, propKey);
      }
      if (!updatePayload && lastProp !== nextProp) {
        // This is a special case. If any listener updates we need to ensure
        // that the "current" props pointer gets updated so we need a commit
        // to update this element.
        updatePayload = [];
      }
    } else {
      // For any other property we always add it to the queue and then we
      // filter it out using the whitelist during the commit.
      (updatePayload = updatePayload || []).push(propKey, nextProp);
    }
  }
  if (styleUpdates) {
    {
      validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
    }
    (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
  }
  return updatePayload;
}

// Apply the diff.
function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
  // Update checked *before* name.
  // In the middle of an update, it is possible to have multiple checked.
  // When a checked radio tries to change name, browser makes another radio's checked false.
  if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
    updateChecked(domElement, nextRawProps);
  }

  var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
  var isCustomComponentTag = isCustomComponent(tag, nextRawProps);
  // Apply the diff.
  updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag);

  // TODO: Ensure that an update gets scheduled if any of the special props
  // changed.
  switch (tag) {
    case 'input':
      // Update the wrapper around inputs *after* updating props. This has to
      // happen after `updateDOMProperties`. Otherwise HTML5 input validations
      // raise warnings and prevent the new value from being assigned.
      updateWrapper(domElement, nextRawProps);
      break;
    case 'textarea':
      updateWrapper$1(domElement, nextRawProps);
      break;
    case 'select':
      // <select> value update needs to occur after <option> children
      // reconciliation
      postUpdateWrapper(domElement, nextRawProps);
      break;
  }
}

function getPossibleStandardName(propName) {
  {
    var lowerCasedName = propName.toLowerCase();
    if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
      return null;
    }
    return possibleStandardNames[lowerCasedName] || null;
  }
  return null;
}

function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
  var isCustomComponentTag = void 0;
  var extraAttributeNames = void 0;

  {
    suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
    isCustomComponentTag = isCustomComponent(tag, rawProps);
    validatePropertiesInDevelopment(tag, rawProps);
    if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
      warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
      didWarnShadyDOM = true;
    }
  }

  // TODO: Make sure that we check isMounted before firing any of these events.
  switch (tag) {
    case 'iframe':
    case 'object':
      trapBubbledEvent(TOP_LOAD, domElement);
      break;
    case 'video':
    case 'audio':
      // Create listener for each media event
      for (var i = 0; i < mediaEventTypes.length; i++) {
        trapBubbledEvent(mediaEventTypes[i], domElement);
      }
      break;
    case 'source':
      trapBubbledEvent(TOP_ERROR, domElement);
      break;
    case 'img':
    case 'image':
    case 'link':
      trapBubbledEvent(TOP_ERROR, domElement);
      trapBubbledEvent(TOP_LOAD, domElement);
      break;
    case 'form':
      trapBubbledEvent(TOP_RESET, domElement);
      trapBubbledEvent(TOP_SUBMIT, domElement);
      break;
    case 'details':
      trapBubbledEvent(TOP_TOGGLE, domElement);
      break;
    case 'input':
      initWrapperState(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'option':
      validateProps(domElement, rawProps);
      break;
    case 'select':
      initWrapperState$1(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
    case 'textarea':
      initWrapperState$2(domElement, rawProps);
      trapBubbledEvent(TOP_INVALID, domElement);
      // For controlled components we always need to ensure we're listening
      // to onChange. Even if there is no listener.
      ensureListeningTo(rootContainerElement, 'onChange');
      break;
  }

  assertValidProps(tag, rawProps);

  {
    extraAttributeNames = new Set();
    var attributes = domElement.attributes;
    for (var _i = 0; _i < attributes.length; _i++) {
      var name = attributes[_i].name.toLowerCase();
      switch (name) {
        // Built-in SSR attribute is whitelisted
        case 'data-reactroot':
          break;
        // Controlled attributes are not validated
        // TODO: Only ignore them on controlled tags.
        case 'value':
          break;
        case 'checked':
          break;
        case 'selected':
          break;
        default:
          // Intentionally use the original name.
          // See discussion in https://github.com/facebook/react/pull/10676.
          extraAttributeNames.add(attributes[_i].name);
      }
    }
  }

  var updatePayload = null;
  for (var propKey in rawProps) {
    if (!rawProps.hasOwnProperty(propKey)) {
      continue;
    }
    var nextProp = rawProps[propKey];
    if (propKey === CHILDREN) {
      // For text content children we compare against textContent. This
      // might match additional HTML that is hidden when we read it using
      // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
      // satisfies our requirement. Our requirement is not to produce perfect
      // HTML and attributes. Ideally we should preserve structure but it's
      // ok not to if the visible content is still enough to indicate what
      // even listeners these nodes might be wired up to.
      // TODO: Warn if there is more than a single textNode as a child.
      // TODO: Should we use domElement.firstChild.nodeValue to compare?
      if (typeof nextProp === 'string') {
        if (domElement.textContent !== nextProp) {
          if (true && !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }
          updatePayload = [CHILDREN, nextProp];
        }
      } else if (typeof nextProp === 'number') {
        if (domElement.textContent !== '' + nextProp) {
          if (true && !suppressHydrationWarning) {
            warnForTextDifference(domElement.textContent, nextProp);
          }
          updatePayload = [CHILDREN, '' + nextProp];
        }
      }
    } else if (registrationNameModules.hasOwnProperty(propKey)) {
      if (nextProp != null) {
        if (true && typeof nextProp !== 'function') {
          warnForInvalidEventListener(propKey, nextProp);
        }
        ensureListeningTo(rootContainerElement, propKey);
      }
    } else if (true &&
    // Convince Flow we've calculated it (it's DEV-only in this method.)
    typeof isCustomComponentTag === 'boolean') {
      // Validate that the properties correspond to their expected values.
      var serverValue = void 0;
      var propertyInfo = getPropertyInfo(propKey);
      if (suppressHydrationWarning) {
        // Don't bother comparing. We're ignoring all these warnings.
      } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 ||
      // Controlled attributes are not validated
      // TODO: Only ignore them on controlled tags.
      propKey === 'value' || propKey === 'checked' || propKey === 'selected') {
        // Noop
      } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
        var serverHTML = domElement.innerHTML;
        var nextHtml = nextProp ? nextProp[HTML] : undefined;
        var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
        if (expectedHTML !== serverHTML) {
          warnForPropDifference(propKey, serverHTML, expectedHTML);
        }
      } else if (propKey === STYLE$1) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey);

        if (canDiffStyleForHydrationWarning) {
          var expectedStyle = createDangerousStringForStyles(nextProp);
          serverValue = domElement.getAttribute('style');
          if (expectedStyle !== serverValue) {
            warnForPropDifference(propKey, serverValue, expectedStyle);
          }
        }
      } else if (isCustomComponentTag) {
        // $FlowFixMe - Should be inferred as not undefined.
        extraAttributeNames.delete(propKey.toLowerCase());
        serverValue = getValueForAttribute(domElement, propKey, nextProp);

        if (nextProp !== serverValue) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
        var isMismatchDueToBadCasing = false;
        if (propertyInfo !== null) {
          // $FlowFixMe - Should be inferred as not undefined.
          extraAttributeNames.delete(propertyInfo.attributeName);
          serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
        } else {
          var ownNamespace = parentNamespace;
          if (ownNamespace === HTML_NAMESPACE) {
            ownNamespace = getIntrinsicNamespace(tag);
          }
          if (ownNamespace === HTML_NAMESPACE) {
            // $FlowFixMe - Should be inferred as not undefined.
            extraAttributeNames.delete(propKey.toLowerCase());
          } else {
            var standardName = getPossibleStandardName(propKey);
            if (standardName !== null && standardName !== propKey) {
              // If an SVG prop is supplied with bad casing, it will
              // be successfully parsed from HTML, but will produce a mismatch
              // (and would be incorrectly rendered on the client).
              // However, we already warn about bad casing elsewhere.
              // So we'll skip the misleading extra mismatch warning in this case.
              isMismatchDueToBadCasing = true;
              // $FlowFixMe - Should be inferred as not undefined.
              extraAttributeNames.delete(standardName);
            }
            // $FlowFixMe - Should be inferred as not undefined.
            extraAttributeNames.delete(propKey);
          }
          serverValue = getValueForAttribute(domElement, propKey, nextProp);
        }

        if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
          warnForPropDifference(propKey, serverValue, nextProp);
        }
      }
    }
  }

  {
    // $FlowFixMe - Should be inferred as not undefined.
    if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
      // $FlowFixMe - Should be inferred as not undefined.
      warnForExtraAttributes(extraAttributeNames);
    }
  }

  switch (tag) {
    case 'input':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper(domElement, rawProps, true);
      break;
    case 'textarea':
      // TODO: Make sure we check if this is still unmounted or do any clean
      // up necessary since we never stop tracking anymore.
      track(domElement);
      postMountWrapper$3(domElement, rawProps);
      break;
    case 'select':
    case 'option':
      // For input and textarea we current always set the value property at
      // post mount to force it to diverge from attributes. However, for
      // option and select we don't quite do the same thing and select
      // is not resilient to the DOM state changing so we don't do that here.
      // TODO: Consider not doing this for input and textarea.
      break;
    default:
      if (typeof rawProps.onClick === 'function') {
        // TODO: This cast may not be sound for SVG, MathML or custom elements.
        trapClickOnNonInteractiveElement(domElement);
      }
      break;
  }

  return updatePayload;
}

function diffHydratedText(textNode, text) {
  var isDifferent = textNode.nodeValue !== text;
  return isDifferent;
}

function warnForUnmatchedText(textNode, text) {
  {
    warnForTextDifference(textNode.nodeValue, text);
  }
}

function warnForDeletedHydratableElement(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
  }
}

function warnForDeletedHydratableText(parentNode, child) {
  {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
  }
}

function warnForInsertedHydratedElement(parentNode, tag, props) {
  {
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
  }
}

function warnForInsertedHydratedText(parentNode, text) {
  {
    if (text === '') {
      // We expect to insert empty text nodes since they're not represented in
      // the HTML.
      // TODO: Remove this special case if we can just avoid inserting empty
      // text nodes.
      return;
    }
    if (didWarnInvalidHydration) {
      return;
    }
    didWarnInvalidHydration = true;
    warningWithoutStack$1(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
  }
}

function restoreControlledState$1(domElement, tag, props) {
  switch (tag) {
    case 'input':
      restoreControlledState(domElement, props);
      return;
    case 'textarea':
      restoreControlledState$3(domElement, props);
      return;
    case 'select':
      restoreControlledState$2(domElement, props);
      return;
  }
}

// TODO: direct imports like some-package/src/* are bad. Fix me.
var validateDOMNesting = function () {};
var updatedAncestorInfo = function () {};

{
  // This validation code was written based on the HTML5 parsing spec:
  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  //
  // Note: this does not catch all invalid nesting, nor does it try to (as it's
  // not clear what practical benefit doing so provides); instead, we warn only
  // for cases where the parser will give a parse tree differing from what React
  // intended. For example, <b><div></div></b> is invalid but we don't warn
  // because it still parses correctly; we do warn for other cases like nested
  // <p> tags where the beginning of the second element implicitly closes the
  // first, causing a confusing mess.

  // https://html.spec.whatwg.org/multipage/syntax.html#special
  var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp'];

  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
  var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template',

  // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
  // TODO: Distinguish by namespace here -- for <title>, including it here
  // errs on the side of fewer warnings
  'foreignObject', 'desc', 'title'];

  // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
  var buttonScopeTags = inScopeTags.concat(['button']);

  // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
  var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];

  var emptyAncestorInfo = {
    current: null,

    formTag: null,
    aTagInScope: null,
    buttonTagInScope: null,
    nobrTagInScope: null,
    pTagInButtonScope: null,

    listItemTagAutoclosing: null,
    dlItemTagAutoclosing: null
  };

  updatedAncestorInfo = function (oldInfo, tag) {
    var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
    var info = { tag: tag };

    if (inScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.aTagInScope = null;
      ancestorInfo.buttonTagInScope = null;
      ancestorInfo.nobrTagInScope = null;
    }
    if (buttonScopeTags.indexOf(tag) !== -1) {
      ancestorInfo.pTagInButtonScope = null;
    }

    // See rules for 'li', 'dd', 'dt' start tags in
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
    if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
      ancestorInfo.listItemTagAutoclosing = null;
      ancestorInfo.dlItemTagAutoclosing = null;
    }

    ancestorInfo.current = info;

    if (tag === 'form') {
      ancestorInfo.formTag = info;
    }
    if (tag === 'a') {
      ancestorInfo.aTagInScope = info;
    }
    if (tag === 'button') {
      ancestorInfo.buttonTagInScope = info;
    }
    if (tag === 'nobr') {
      ancestorInfo.nobrTagInScope = info;
    }
    if (tag === 'p') {
      ancestorInfo.pTagInButtonScope = info;
    }
    if (tag === 'li') {
      ancestorInfo.listItemTagAutoclosing = info;
    }
    if (tag === 'dd' || tag === 'dt') {
      ancestorInfo.dlItemTagAutoclosing = info;
    }

    return ancestorInfo;
  };

  /**
   * Returns whether
   */
  var isTagValidWithParent = function (tag, parentTag) {
    // First, let's check if we're in an unusual parsing mode...
    switch (parentTag) {
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
      case 'select':
        return tag === 'option' || tag === 'optgroup' || tag === '#text';
      case 'optgroup':
        return tag === 'option' || tag === '#text';
      // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
      // but
      case 'option':
        return tag === '#text';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
      // No special behavior since these rules fall back to "in body" mode for
      // all except special table nodes which cause bad parsing behavior anyway.

      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
      case 'tr':
        return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
      case 'tbody':
      case 'thead':
      case 'tfoot':
        return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
      case 'colgroup':
        return tag === 'col' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
      case 'table':
        return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
      case 'head':
        return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
      // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
      case 'html':
        return tag === 'head' || tag === 'body';
      case '#document':
        return tag === 'html';
    }

    // Probably in the "in body" parsing mode, so we outlaw only tag combos
    // where the parsing rules cause implicit opens or closes to be added.
    // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
    switch (tag) {
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';

      case 'rp':
      case 'rt':
        return impliedEndTags.indexOf(parentTag) === -1;

      case 'body':
      case 'caption':
      case 'col':
      case 'colgroup':
      case 'frame':
      case 'head':
      case 'html':
      case 'tbody':
      case 'td':
      case 'tfoot':
      case 'th':
      case 'thead':
      case 'tr':
        // These tags are only valid with a few parents that have special child
        // parsing rules -- if we're down here, then none of those matched and
        // so we allow it only if we don't know what the parent is, as all other
        // cases are invalid.
        return parentTag == null;
    }

    return true;
  };

  /**
   * Returns whether
   */
  var findInvalidAncestorForTag = function (tag, ancestorInfo) {
    switch (tag) {
      case 'address':
      case 'article':
      case 'aside':
      case 'blockquote':
      case 'center':
      case 'details':
      case 'dialog':
      case 'dir':
      case 'div':
      case 'dl':
      case 'fieldset':
      case 'figcaption':
      case 'figure':
      case 'footer':
      case 'header':
      case 'hgroup':
      case 'main':
      case 'menu':
      case 'nav':
      case 'ol':
      case 'p':
      case 'section':
      case 'summary':
      case 'ul':
      case 'pre':
      case 'listing':
      case 'table':
      case 'hr':
      case 'xmp':
      case 'h1':
      case 'h2':
      case 'h3':
      case 'h4':
      case 'h5':
      case 'h6':
        return ancestorInfo.pTagInButtonScope;

      case 'form':
        return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;

      case 'li':
        return ancestorInfo.listItemTagAutoclosing;

      case 'dd':
      case 'dt':
        return ancestorInfo.dlItemTagAutoclosing;

      case 'button':
        return ancestorInfo.buttonTagInScope;

      case 'a':
        // Spec says something about storing a list of markers, but it sounds
        // equivalent to this check.
        return ancestorInfo.aTagInScope;

      case 'nobr':
        return ancestorInfo.nobrTagInScope;
    }

    return null;
  };

  var didWarn = {};

  validateDOMNesting = function (childTag, childText, ancestorInfo) {
    ancestorInfo = ancestorInfo || emptyAncestorInfo;
    var parentInfo = ancestorInfo.current;
    var parentTag = parentInfo && parentInfo.tag;

    if (childText != null) {
      !(childTag == null) ? warningWithoutStack$1(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
      childTag = '#text';
    }

    var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
    var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
    var invalidParentOrAncestor = invalidParent || invalidAncestor;
    if (!invalidParentOrAncestor) {
      return;
    }

    var ancestorTag = invalidParentOrAncestor.tag;
    var addendum = getCurrentFiberStackInDev();

    var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
    if (didWarn[warnKey]) {
      return;
    }
    didWarn[warnKey] = true;

    var tagDisplayName = childTag;
    var whitespaceInfo = '';
    if (childTag === '#text') {
      if (/\S/.test(childText)) {
        tagDisplayName = 'Text nodes';
      } else {
        tagDisplayName = 'Whitespace text nodes';
        whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
      }
    } else {
      tagDisplayName = '<' + childTag + '>';
    }

    if (invalidParent) {
      var info = '';
      if (ancestorTag === 'table' && childTag === 'tr') {
        info += ' Add a <tbody> to your code to match the DOM tree generated by ' + 'the browser.';
      }
      warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
    } else {
      warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
    }
  };
}

// Renderers that don't support persistence
// can re-export everything from this module.

function shim() {
  invariant(false, 'The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.');
}

// Persistence (when unsupported)
var supportsPersistence = false;
var cloneInstance = shim;
var createContainerChildSet = shim;
var appendChildToContainerChildSet = shim;
var finalizeContainerChildren = shim;
var replaceContainerChildren = shim;
var cloneHiddenInstance = shim;
var cloneUnhiddenInstance = shim;
var createHiddenTextInstance = shim;

var SUPPRESS_HYDRATION_WARNING = void 0;
{
  SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
}

var SUSPENSE_START_DATA = '$';
var SUSPENSE_END_DATA = '/$';

var STYLE = 'style';

var eventsEnabled = null;
var selectionInformation = null;

function shouldAutoFocusHostComponent(type, props) {
  switch (type) {
    case 'button':
    case 'input':
    case 'select':
    case 'textarea':
      return !!props.autoFocus;
  }
  return false;
}

function getRootHostContext(rootContainerInstance) {
  var type = void 0;
  var namespace = void 0;
  var nodeType = rootContainerInstance.nodeType;
  switch (nodeType) {
    case DOCUMENT_NODE:
    case DOCUMENT_FRAGMENT_NODE:
      {
        type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
        var root = rootContainerInstance.documentElement;
        namespace = root ? root.namespaceURI : getChildNamespace(null, '');
        break;
      }
    default:
      {
        var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
        var ownNamespace = container.namespaceURI || null;
        type = container.tagName;
        namespace = getChildNamespace(ownNamespace, type);
        break;
      }
  }
  {
    var validatedTag = type.toLowerCase();
    var _ancestorInfo = updatedAncestorInfo(null, validatedTag);
    return { namespace: namespace, ancestorInfo: _ancestorInfo };
  }
  return namespace;
}

function getChildHostContext(parentHostContext, type, rootContainerInstance) {
  {
    var parentHostContextDev = parentHostContext;
    var _namespace = getChildNamespace(parentHostContextDev.namespace, type);
    var _ancestorInfo2 = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
    return { namespace: _namespace, ancestorInfo: _ancestorInfo2 };
  }
  var parentNamespace = parentHostContext;
  return getChildNamespace(parentNamespace, type);
}

function getPublicInstance(instance) {
  return instance;
}

function prepareForCommit(containerInfo) {
  eventsEnabled = isEnabled();
  selectionInformation = getSelectionInformation();
  setEnabled(false);
}

function resetAfterCommit(containerInfo) {
  restoreSelection(selectionInformation);
  selectionInformation = null;
  setEnabled(eventsEnabled);
  eventsEnabled = null;
}

function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  var parentNamespace = void 0;
  {
    // TODO: take namespace into account when validating.
    var hostContextDev = hostContext;
    validateDOMNesting(type, null, hostContextDev.ancestorInfo);
    if (typeof props.children === 'string' || typeof props.children === 'number') {
      var string = '' + props.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }
    parentNamespace = hostContextDev.namespace;
  }
  var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
  precacheFiberNode(internalInstanceHandle, domElement);
  updateFiberProps(domElement, props);
  return domElement;
}

function appendInitialChild(parentInstance, child) {
  parentInstance.appendChild(child);
}

function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
  setInitialProperties(domElement, type, props, rootContainerInstance);
  return shouldAutoFocusHostComponent(type, props);
}

function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
  {
    var hostContextDev = hostContext;
    if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
      var string = '' + newProps.children;
      var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
      validateDOMNesting(null, string, ownAncestorInfo);
    }
  }
  return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
}

function shouldSetTextContent(type, props) {
  return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
}

function shouldDeprioritizeSubtree(type, props) {
  return !!props.hidden;
}

function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
  {
    var hostContextDev = hostContext;
    validateDOMNesting(null, text, hostContextDev.ancestorInfo);
  }
  var textNode = createTextNode(text, rootContainerInstance);
  precacheFiberNode(internalInstanceHandle, textNode);
  return textNode;
}

var isPrimaryRenderer = true;
// This initialization code may run even on server environments
// if a component just imports ReactDOM (e.g. for findDOMNode).
// Some environments might not have setTimeout or clearTimeout.
var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
var noTimeout = -1;
var schedulePassiveEffects = scheduler.unstable_scheduleCallback;
var cancelPassiveEffects = scheduler.unstable_cancelCallback;

// -------------------
//     Mutation
// -------------------

var supportsMutation = true;

function commitMount(domElement, type, newProps, internalInstanceHandle) {
  // Despite the naming that might imply otherwise, this method only
  // fires if there is an `Update` effect scheduled during mounting.
  // This happens if `finalizeInitialChildren` returns `true` (which it
  // does to implement the `autoFocus` attribute on the client). But
  // there are also other cases when this might happen (such as patching
  // up text content during hydration mismatch). So we'll check this again.
  if (shouldAutoFocusHostComponent(type, newProps)) {
    domElement.focus();
  }
}

function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
  // Update the props handle so that we know which props are the ones with
  // with current event handlers.
  updateFiberProps(domElement, newProps);
  // Apply the diff to the DOM node.
  updateProperties(domElement, updatePayload, type, oldProps, newProps);
}

function resetTextContent(domElement) {
  setTextContent(domElement, '');
}

function commitTextUpdate(textInstance, oldText, newText) {
  textInstance.nodeValue = newText;
}

function appendChild(parentInstance, child) {
  parentInstance.appendChild(child);
}

function appendChildToContainer(container, child) {
  var parentNode = void 0;
  if (container.nodeType === COMMENT_NODE) {
    parentNode = container.parentNode;
    parentNode.insertBefore(child, container);
  } else {
    parentNode = container;
    parentNode.appendChild(child);
  }
  // This container might be used for a portal.
  // If something inside a portal is clicked, that click should bubble
  // through the React tree. However, on Mobile Safari the click would
  // never bubble through the *DOM* tree unless an ancestor with onclick
  // event exists. So we wouldn't see it and dispatch it.
  // This is why we ensure that non React root containers have inline onclick
  // defined.
  // https://github.com/facebook/react/issues/11918
  var reactRootContainer = container._reactRootContainer;
  if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
    // TODO: This cast may not be sound for SVG, MathML or custom elements.
    trapClickOnNonInteractiveElement(parentNode);
  }
}

function insertBefore(parentInstance, child, beforeChild) {
  parentInstance.insertBefore(child, beforeChild);
}

function insertInContainerBefore(container, child, beforeChild) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.insertBefore(child, beforeChild);
  } else {
    container.insertBefore(child, beforeChild);
  }
}

function removeChild(parentInstance, child) {
  parentInstance.removeChild(child);
}

function removeChildFromContainer(container, child) {
  if (container.nodeType === COMMENT_NODE) {
    container.parentNode.removeChild(child);
  } else {
    container.removeChild(child);
  }
}

function clearSuspenseBoundary(parentInstance, suspenseInstance) {
  var node = suspenseInstance;
  // Delete all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.
  var depth = 0;
  do {
    var nextNode = node.nextSibling;
    parentInstance.removeChild(node);
    if (nextNode && nextNode.nodeType === COMMENT_NODE) {
      var data = nextNode.data;
      if (data === SUSPENSE_END_DATA) {
        if (depth === 0) {
          parentInstance.removeChild(nextNode);
          return;
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_START_DATA) {
        depth++;
      }
    }
    node = nextNode;
  } while (node);
  // TODO: Warn, we didn't find the end comment boundary.
}

function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
  if (container.nodeType === COMMENT_NODE) {
    clearSuspenseBoundary(container.parentNode, suspenseInstance);
  } else if (container.nodeType === ELEMENT_NODE) {
    clearSuspenseBoundary(container, suspenseInstance);
  } else {
    // Document nodes should never contain suspense boundaries.
  }
}

function hideInstance(instance) {
  // TODO: Does this work for all element types? What about MathML? Should we
  // pass host context to this method?
  instance = instance;
  instance.style.display = 'none';
}

function hideTextInstance(textInstance) {
  textInstance.nodeValue = '';
}

function unhideInstance(instance, props) {
  instance = instance;
  var styleProp = props[STYLE];
  var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
  instance.style.display = dangerousStyleValue('display', display);
}

function unhideTextInstance(textInstance, text) {
  textInstance.nodeValue = text;
}

// -------------------
//     Hydration
// -------------------

var supportsHydration = true;

function canHydrateInstance(instance, type, props) {
  if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
    return null;
  }
  // This has now been refined to an element node.
  return instance;
}

function canHydrateTextInstance(instance, text) {
  if (text === '' || instance.nodeType !== TEXT_NODE) {
    // Empty strings are not parsed by HTML so there won't be a correct match here.
    return null;
  }
  // This has now been refined to a text node.
  return instance;
}

function canHydrateSuspenseInstance(instance) {
  if (instance.nodeType !== COMMENT_NODE) {
    // Empty strings are not parsed by HTML so there won't be a correct match here.
    return null;
  }
  // This has now been refined to a suspense node.
  return instance;
}

function getNextHydratableSibling(instance) {
  var node = instance.nextSibling;
  // Skip non-hydratable nodes.
  while (node && node.nodeType !== ELEMENT_NODE && node.nodeType !== TEXT_NODE && (!enableSuspenseServerRenderer || node.nodeType !== COMMENT_NODE || node.data !== SUSPENSE_START_DATA)) {
    node = node.nextSibling;
  }
  return node;
}

function getFirstHydratableChild(parentInstance) {
  var next = parentInstance.firstChild;
  // Skip non-hydratable nodes.
  while (next && next.nodeType !== ELEMENT_NODE && next.nodeType !== TEXT_NODE && (!enableSuspenseServerRenderer || next.nodeType !== COMMENT_NODE || next.data !== SUSPENSE_START_DATA)) {
    next = next.nextSibling;
  }
  return next;
}

function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, instance);
  // TODO: Possibly defer this until the commit phase where all the events
  // get attached.
  updateFiberProps(instance, props);
  var parentNamespace = void 0;
  {
    var hostContextDev = hostContext;
    parentNamespace = hostContextDev.namespace;
  }
  return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
}

function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
  precacheFiberNode(internalInstanceHandle, textInstance);
  return diffHydratedText(textInstance, text);
}

function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
  var node = suspenseInstance.nextSibling;
  // Skip past all nodes within this suspense boundary.
  // There might be nested nodes so we need to keep track of how
  // deep we are and only break out when we're back on top.
  var depth = 0;
  while (node) {
    if (node.nodeType === COMMENT_NODE) {
      var data = node.data;
      if (data === SUSPENSE_END_DATA) {
        if (depth === 0) {
          return getNextHydratableSibling(node);
        } else {
          depth--;
        }
      } else if (data === SUSPENSE_START_DATA) {
        depth++;
      }
    }
    node = node.nextSibling;
  }
  // TODO: Warn, we didn't find the end comment boundary.
  return null;
}

function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
  {
    warnForUnmatchedText(textInstance, text);
  }
}

function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
  if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    warnForUnmatchedText(textInstance, text);
  }
}

function didNotHydrateContainerInstance(parentContainer, instance) {
  {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentContainer, instance);
    } else if (instance.nodeType === COMMENT_NODE) {
      // TODO: warnForDeletedHydratableSuspenseBoundary
    } else {
      warnForDeletedHydratableText(parentContainer, instance);
    }
  }
}

function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
  if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    if (instance.nodeType === ELEMENT_NODE) {
      warnForDeletedHydratableElement(parentInstance, instance);
    } else if (instance.nodeType === COMMENT_NODE) {
      // TODO: warnForDeletedHydratableSuspenseBoundary
    } else {
      warnForDeletedHydratableText(parentInstance, instance);
    }
  }
}

function didNotFindHydratableContainerInstance(parentContainer, type, props) {
  {
    warnForInsertedHydratedElement(parentContainer, type, props);
  }
}

function didNotFindHydratableContainerTextInstance(parentContainer, text) {
  {
    warnForInsertedHydratedText(parentContainer, text);
  }
}



function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
  if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    warnForInsertedHydratedElement(parentInstance, type, props);
  }
}

function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
  if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    warnForInsertedHydratedText(parentInstance, text);
  }
}

function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
  if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
    // TODO: warnForInsertedHydratedSuspense(parentInstance);
  }
}

// Prefix measurements so that it's possible to filter them.
// Longer prefixes are hard to read in DevTools.
var reactEmoji = '\u269B';
var warningEmoji = '\u26D4';
var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function';

// Keep track of current fiber so that we know the path to unwind on pause.
// TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
var currentFiber = null;
// If we're in the middle of user code, which fiber and method is it?
// Reusing `currentFiber` would be confusing for this because user code fiber
// can change during commit phase too, but we don't need to unwind it (since
// lifecycles in the commit phase don't resemble a tree).
var currentPhase = null;
var currentPhaseFiber = null;
// Did lifecycle hook schedule an update? This is often a performance problem,
// so we will keep track of it, and include it in the report.
// Track commits caused by cascading updates.
var isCommitting = false;
var hasScheduledUpdateInCurrentCommit = false;
var hasScheduledUpdateInCurrentPhase = false;
var commitCountInCurrentWorkLoop = 0;
var effectCountInCurrentCommit = 0;
var isWaitingForCallback = false;
// During commits, we only show a measurement once per method name
// to avoid stretch the commit phase with measurement overhead.
var labelsInCurrentCommit = new Set();

var formatMarkName = function (markName) {
  return reactEmoji + ' ' + markName;
};

var formatLabel = function (label, warning) {
  var prefix = warning ? warningEmoji + ' ' : reactEmoji + ' ';
  var suffix = warning ? ' Warning: ' + warning : '';
  return '' + prefix + label + suffix;
};

var beginMark = function (markName) {
  performance.mark(formatMarkName(markName));
};

var clearMark = function (markName) {
  performance.clearMarks(formatMarkName(markName));
};

var endMark = function (label, markName, warning) {
  var formattedMarkName = formatMarkName(markName);
  var formattedLabel = formatLabel(label, warning);
  try {
    performance.measure(formattedLabel, formattedMarkName);
  } catch (err) {}
  // If previous mark was missing for some reason, this will throw.
  // This could only happen if React crashed in an unexpected place earlier.
  // Don't pile on with more errors.

  // Clear marks immediately to avoid growing buffer.
  performance.clearMarks(formattedMarkName);
  performance.clearMeasures(formattedLabel);
};

var getFiberMarkName = function (label, debugID) {
  return label + ' (#' + debugID + ')';
};

var getFiberLabel = function (componentName, isMounted, phase) {
  if (phase === null) {
    // These are composite component total time measurements.
    return componentName + ' [' + (isMounted ? 'update' : 'mount') + ']';
  } else {
    // Composite component methods.
    return componentName + '.' + phase;
  }
};

var beginFiberMark = function (fiber, phase) {
  var componentName = getComponentName(fiber.type) || 'Unknown';
  var debugID = fiber._debugID;
  var isMounted = fiber.alternate !== null;
  var label = getFiberLabel(componentName, isMounted, phase);

  if (isCommitting && labelsInCurrentCommit.has(label)) {
    // During the commit phase, we don't show duplicate labels because
    // there is a fixed overhead for every measurement, and we don't
    // want to stretch the commit phase beyond necessary.
    return false;
  }
  labelsInCurrentCommit.add(label);

  var markName = getFiberMarkName(label, debugID);
  beginMark(markName);
  return true;
};

var clearFiberMark = function (fiber, phase) {
  var componentName = getComponentName(fiber.type) || 'Unknown';
  var debugID = fiber._debugID;
  var isMounted = fiber.alternate !== null;
  var label = getFiberLabel(componentName, isMounted, phase);
  var markName = getFiberMarkName(label, debugID);
  clearMark(markName);
};

var endFiberMark = function (fiber, phase, warning) {
  var componentName = getComponentName(fiber.type) || 'Unknown';
  var debugID = fiber._debugID;
  var isMounted = fiber.alternate !== null;
  var label = getFiberLabel(componentName, isMounted, phase);
  var markName = getFiberMarkName(label, debugID);
  endMark(label, markName, warning);
};

var shouldIgnoreFiber = function (fiber) {
  // Host components should be skipped in the timeline.
  // We could check typeof fiber.type, but does this work with RN?
  switch (fiber.tag) {
    case HostRoot:
    case HostComponent:
    case HostText:
    case HostPortal:
    case Fragment:
    case ContextProvider:
    case ContextConsumer:
    case Mode:
      return true;
    default:
      return false;
  }
};

var clearPendingPhaseMeasurement = function () {
  if (currentPhase !== null && currentPhaseFiber !== null) {
    clearFiberMark(currentPhaseFiber, currentPhase);
  }
  currentPhaseFiber = null;
  currentPhase = null;
  hasScheduledUpdateInCurrentPhase = false;
};

var pauseTimers = function () {
  // Stops all currently active measurements so that they can be resumed
  // if we continue in a later deferred loop from the same unit of work.
  var fiber = currentFiber;
  while (fiber) {
    if (fiber._debugIsCurrentlyTiming) {
      endFiberMark(fiber, null, null);
    }
    fiber = fiber.return;
  }
};

var resumeTimersRecursively = function (fiber) {
  if (fiber.return !== null) {
    resumeTimersRecursively(fiber.return);
  }
  if (fiber._debugIsCurrentlyTiming) {
    beginFiberMark(fiber, null);
  }
};

var resumeTimers = function () {
  // Resumes all measurements that were active during the last deferred loop.
  if (currentFiber !== null) {
    resumeTimersRecursively(currentFiber);
  }
};

function recordEffect() {
  if (enableUserTimingAPI) {
    effectCountInCurrentCommit++;
  }
}

function recordScheduleUpdate() {
  if (enableUserTimingAPI) {
    if (isCommitting) {
      hasScheduledUpdateInCurrentCommit = true;
    }
    if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
      hasScheduledUpdateInCurrentPhase = true;
    }
  }
}

function startRequestCallbackTimer() {
  if (enableUserTimingAPI) {
    if (supportsUserTiming && !isWaitingForCallback) {
      isWaitingForCallback = true;
      beginMark('(Waiting for async callback...)');
    }
  }
}

function stopRequestCallbackTimer(didExpire, expirationTime) {
  if (enableUserTimingAPI) {
    if (supportsUserTiming) {
      isWaitingForCallback = false;
      var warning = didExpire ? 'React was blocked by main thread' : null;
      endMark('(Waiting for async callback... will force flush in ' + expirationTime + ' ms)', '(Waiting for async callback...)', warning);
    }
  }
}

function startWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // If we pause, this is the fiber to unwind from.
    currentFiber = fiber;
    if (!beginFiberMark(fiber, null)) {
      return;
    }
    fiber._debugIsCurrentlyTiming = true;
  }
}

function cancelWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // Remember we shouldn't complete measurement for this fiber.
    // Otherwise flamechart will be deep even for small updates.
    fiber._debugIsCurrentlyTiming = false;
    clearFiberMark(fiber, null);
  }
}

function stopWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // If we pause, its parent is the fiber to unwind from.
    currentFiber = fiber.return;
    if (!fiber._debugIsCurrentlyTiming) {
      return;
    }
    fiber._debugIsCurrentlyTiming = false;
    endFiberMark(fiber, null, null);
  }
}

function stopFailedWorkTimer(fiber) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
      return;
    }
    // If we pause, its parent is the fiber to unwind from.
    currentFiber = fiber.return;
    if (!fiber._debugIsCurrentlyTiming) {
      return;
    }
    fiber._debugIsCurrentlyTiming = false;
    var warning = fiber.tag === SuspenseComponent || fiber.tag === DehydratedSuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
    endFiberMark(fiber, null, warning);
  }
}

function startPhaseTimer(fiber, phase) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    clearPendingPhaseMeasurement();
    if (!beginFiberMark(fiber, phase)) {
      return;
    }
    currentPhaseFiber = fiber;
    currentPhase = phase;
  }
}

function stopPhaseTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    if (currentPhase !== null && currentPhaseFiber !== null) {
      var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
      endFiberMark(currentPhaseFiber, currentPhase, warning);
    }
    currentPhase = null;
    currentPhaseFiber = null;
  }
}

function startWorkLoopTimer(nextUnitOfWork) {
  if (enableUserTimingAPI) {
    currentFiber = nextUnitOfWork;
    if (!supportsUserTiming) {
      return;
    }
    commitCountInCurrentWorkLoop = 0;
    // This is top level call.
    // Any other measurements are performed within.
    beginMark('(React Tree Reconciliation)');
    // Resume any measurements that were in progress during the last loop.
    resumeTimers();
  }
}

function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var warning = null;
    if (interruptedBy !== null) {
      if (interruptedBy.tag === HostRoot) {
        warning = 'A top-level update interrupted the previous render';
      } else {
        var componentName = getComponentName(interruptedBy.type) || 'Unknown';
        warning = 'An update to ' + componentName + ' interrupted the previous render';
      }
    } else if (commitCountInCurrentWorkLoop > 1) {
      warning = 'There were cascading updates';
    }
    commitCountInCurrentWorkLoop = 0;
    var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)';
    // Pause any measurements until the next loop.
    pauseTimers();
    endMark(label, '(React Tree Reconciliation)', warning);
  }
}

function startCommitTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    isCommitting = true;
    hasScheduledUpdateInCurrentCommit = false;
    labelsInCurrentCommit.clear();
    beginMark('(Committing Changes)');
  }
}

function stopCommitTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }

    var warning = null;
    if (hasScheduledUpdateInCurrentCommit) {
      warning = 'Lifecycle hook scheduled a cascading update';
    } else if (commitCountInCurrentWorkLoop > 0) {
      warning = 'Caused by a cascading update in earlier commit';
    }
    hasScheduledUpdateInCurrentCommit = false;
    commitCountInCurrentWorkLoop++;
    isCommitting = false;
    labelsInCurrentCommit.clear();

    endMark('(Committing Changes)', '(Committing Changes)', warning);
  }
}

function startCommitSnapshotEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    effectCountInCurrentCommit = 0;
    beginMark('(Committing Snapshot Effects)');
  }
}

function stopCommitSnapshotEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var count = effectCountInCurrentCommit;
    effectCountInCurrentCommit = 0;
    endMark('(Committing Snapshot Effects: ' + count + ' Total)', '(Committing Snapshot Effects)', null);
  }
}

function startCommitHostEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    effectCountInCurrentCommit = 0;
    beginMark('(Committing Host Effects)');
  }
}

function stopCommitHostEffectsTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var count = effectCountInCurrentCommit;
    effectCountInCurrentCommit = 0;
    endMark('(Committing Host Effects: ' + count + ' Total)', '(Committing Host Effects)', null);
  }
}

function startCommitLifeCyclesTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    effectCountInCurrentCommit = 0;
    beginMark('(Calling Lifecycle Methods)');
  }
}

function stopCommitLifeCyclesTimer() {
  if (enableUserTimingAPI) {
    if (!supportsUserTiming) {
      return;
    }
    var count = effectCountInCurrentCommit;
    effectCountInCurrentCommit = 0;
    endMark('(Calling Lifecycle Methods: ' + count + ' Total)', '(Calling Lifecycle Methods)', null);
  }
}

var valueStack = [];

var fiberStack = void 0;

{
  fiberStack = [];
}

var index = -1;

function createCursor(defaultValue) {
  return {
    current: defaultValue
  };
}

function pop(cursor, fiber) {
  if (index < 0) {
    {
      warningWithoutStack$1(false, 'Unexpected pop.');
    }
    return;
  }

  {
    if (fiber !== fiberStack[index]) {
      warningWithoutStack$1(false, 'Unexpected Fiber popped.');
    }
  }

  cursor.current = valueStack[index];

  valueStack[index] = null;

  {
    fiberStack[index] = null;
  }

  index--;
}

function push(cursor, value, fiber) {
  index++;

  valueStack[index] = cursor.current;

  {
    fiberStack[index] = fiber;
  }

  cursor.current = value;
}

function checkThatStackIsEmpty() {
  {
    if (index !== -1) {
      warningWithoutStack$1(false, 'Expected an empty stack. Something was not reset properly.');
    }
  }
}

function resetStackAfterFatalErrorInDev() {
  {
    index = -1;
    valueStack.length = 0;
    fiberStack.length = 0;
  }
}

var warnedAboutMissingGetChildContext = void 0;

{
  warnedAboutMissingGetChildContext = {};
}

var emptyContextObject = {};
{
  Object.freeze(emptyContextObject);
}

// A cursor to the current merged context object on the stack.
var contextStackCursor = createCursor(emptyContextObject);
// A cursor to a boolean indicating whether the context has changed.
var didPerformWorkStackCursor = createCursor(false);
// Keep track of the previous context object that was on the stack.
// We use this to get access to the parent context after we have already
// pushed the next context provider, and now need to merge their contexts.
var previousContext = emptyContextObject;

function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
  if (didPushOwnContextIfProvider && isContextProvider(Component)) {
    // If the fiber is a context provider itself, when we read its context
    // we may have already pushed its own child context on the stack. A context
    // provider should not "see" its own child context. Therefore we read the
    // previous (parent) context instead for a context provider.
    return previousContext;
  }
  return contextStackCursor.current;
}

function cacheContext(workInProgress, unmaskedContext, maskedContext) {
  var instance = workInProgress.stateNode;
  instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
  instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
}

function getMaskedContext(workInProgress, unmaskedContext) {
  var type = workInProgress.type;
  var contextTypes = type.contextTypes;
  if (!contextTypes) {
    return emptyContextObject;
  }

  // Avoid recreating masked context unless unmasked context has changed.
  // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
  // This may trigger infinite loops if componentWillReceiveProps calls setState.
  var instance = workInProgress.stateNode;
  if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
    return instance.__reactInternalMemoizedMaskedChildContext;
  }

  var context = {};
  for (var key in contextTypes) {
    context[key] = unmaskedContext[key];
  }

  {
    var name = getComponentName(type) || 'Unknown';
    checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
  }

  // Cache unmasked context so we can avoid recreating masked context unless necessary.
  // Context is created before the class component is instantiated so check for instance.
  if (instance) {
    cacheContext(workInProgress, unmaskedContext, context);
  }

  return context;
}

function hasContextChanged() {
  return didPerformWorkStackCursor.current;
}

function isContextProvider(type) {
  var childContextTypes = type.childContextTypes;
  return childContextTypes !== null && childContextTypes !== undefined;
}

function popContext(fiber) {
  pop(didPerformWorkStackCursor, fiber);
  pop(contextStackCursor, fiber);
}

function popTopLevelContextObject(fiber) {
  pop(didPerformWorkStackCursor, fiber);
  pop(contextStackCursor, fiber);
}

function pushTopLevelContextObject(fiber, context, didChange) {
  !(contextStackCursor.current === emptyContextObject) ? invariant(false, 'Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.') : void 0;

  push(contextStackCursor, context, fiber);
  push(didPerformWorkStackCursor, didChange, fiber);
}

function processChildContext(fiber, type, parentContext) {
  var instance = fiber.stateNode;
  var childContextTypes = type.childContextTypes;

  // TODO (bvaughn) Replace this behavior with an invariant() in the future.
  // It has only been added in Fiber to match the (unintentional) behavior in Stack.
  if (typeof instance.getChildContext !== 'function') {
    {
      var componentName = getComponentName(type) || 'Unknown';

      if (!warnedAboutMissingGetChildContext[componentName]) {
        warnedAboutMissingGetChildContext[componentName] = true;
        warningWithoutStack$1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
      }
    }
    return parentContext;
  }

  var childContext = void 0;
  {
    setCurrentPhase('getChildContext');
  }
  startPhaseTimer(fiber, 'getChildContext');
  childContext = instance.getChildContext();
  stopPhaseTimer();
  {
    setCurrentPhase(null);
  }
  for (var contextKey in childContext) {
    !(contextKey in childContextTypes) ? invariant(false, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName(type) || 'Unknown', contextKey) : void 0;
  }
  {
    var name = getComponentName(type) || 'Unknown';
    checkPropTypes(childContextTypes, childContext, 'child context', name,
    // In practice, there is one case in which we won't get a stack. It's when
    // somebody calls unstable_renderSubtreeIntoContainer() and we process
    // context from the parent component instance. The stack will be missing
    // because it's outside of the reconciliation, and so the pointer has not
    // been set. This is rare and doesn't matter. We'll also remove that API.
    getCurrentFiberStackInDev);
  }

  return _assign({}, parentContext, childContext);
}

function pushContextProvider(workInProgress) {
  var instance = workInProgress.stateNode;
  // We push the context as early as possible to ensure stack integrity.
  // If the instance does not exist yet, we will push null at first,
  // and replace it on the stack later when invalidating the context.
  var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject;

  // Remember the parent context so we can merge with it later.
  // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
  previousContext = contextStackCursor.current;
  push(contextStackCursor, memoizedMergedChildContext, workInProgress);
  push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);

  return true;
}

function invalidateContextProvider(workInProgress, type, didChange) {
  var instance = workInProgress.stateNode;
  !instance ? invariant(false, 'Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.') : void 0;

  if (didChange) {
    // Merge parent and own context.
    // Skip this if we're not updating due to sCU.
    // This avoids unnecessarily recomputing memoized values.
    var mergedContext = processChildContext(workInProgress, type, previousContext);
    instance.__reactInternalMemoizedMergedChildContext = mergedContext;

    // Replace the old (or empty) context with the new one.
    // It is important to unwind the context in the reverse order.
    pop(didPerformWorkStackCursor, workInProgress);
    pop(contextStackCursor, workInProgress);
    // Now push the new context and mark that it has changed.
    push(contextStackCursor, mergedContext, workInProgress);
    push(didPerformWorkStackCursor, didChange, workInProgress);
  } else {
    pop(didPerformWorkStackCursor, workInProgress);
    push(didPerformWorkStackCursor, didChange, workInProgress);
  }
}

function findCurrentUnmaskedContext(fiber) {
  // Currently this is only used with renderSubtreeIntoContainer; not sure if it
  // makes sense elsewhere
  !(isFiberMounted(fiber) && fiber.tag === ClassComponent) ? invariant(false, 'Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.') : void 0;

  var node = fiber;
  do {
    switch (node.tag) {
      case HostRoot:
        return node.stateNode.context;
      case ClassComponent:
        {
          var Component = node.type;
          if (isContextProvider(Component)) {
            return node.stateNode.__reactInternalMemoizedMergedChildContext;
          }
          break;
        }
    }
    node = node.return;
  } while (node !== null);
  invariant(false, 'Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.');
}

var onCommitFiberRoot = null;
var onCommitFiberUnmount = null;
var hasLoggedError = false;

function catchErrors(fn) {
  return function (arg) {
    try {
      return fn(arg);
    } catch (err) {
      if (true && !hasLoggedError) {
        hasLoggedError = true;
        warningWithoutStack$1(false, 'React DevTools encountered an error: %s', err);
      }
    }
  };
}

var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';

function injectInternals(internals) {
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
    // No DevTools
    return false;
  }
  var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
  if (hook.isDisabled) {
    // This isn't a real property on the hook, but it can be set to opt out
    // of DevTools integration and associated warnings and logs.
    // https://github.com/facebook/react/issues/3877
    return true;
  }
  if (!hook.supportsFiber) {
    {
      warningWithoutStack$1(false, 'The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://fb.me/react-devtools');
    }
    // DevTools exists, even though it doesn't support Fiber.
    return true;
  }
  try {
    var rendererID = hook.inject(internals);
    // We have successfully injected, so now it is safe to set up hooks.
    onCommitFiberRoot = catchErrors(function (root) {
      return hook.onCommitFiberRoot(rendererID, root);
    });
    onCommitFiberUnmount = catchErrors(function (fiber) {
      return hook.onCommitFiberUnmount(rendererID, fiber);
    });
  } catch (err) {
    // Catch all errors because it is unsafe to throw during initialization.
    {
      warningWithoutStack$1(false, 'React DevTools encountered an error: %s.', err);
    }
  }
  // DevTools exists
  return true;
}

function onCommitRoot(root) {
  if (typeof onCommitFiberRoot === 'function') {
    onCommitFiberRoot(root);
  }
}

function onCommitUnmount(fiber) {
  if (typeof onCommitFiberUnmount === 'function') {
    onCommitFiberUnmount(fiber);
  }
}

// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111
var maxSigned31BitInt = 1073741823;

var NoWork = 0;
var Never = 1;
var Sync = maxSigned31BitInt;

var UNIT_SIZE = 10;
var MAGIC_NUMBER_OFFSET = maxSigned31BitInt - 1;

// 1 unit of expiration time represents 10ms.
function msToExpirationTime(ms) {
  // Always add an offset so that we don't clash with the magic number for NoWork.
  return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
}

function expirationTimeToMs(expirationTime) {
  return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
}

function ceiling(num, precision) {
  return ((num / precision | 0) + 1) * precision;
}

function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
  return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
}

var LOW_PRIORITY_EXPIRATION = 5000;
var LOW_PRIORITY_BATCH_SIZE = 250;

function computeAsyncExpiration(currentTime) {
  return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
}

// We intentionally set a higher expiration time for interactive updates in
// dev than in production.
//
// If the main thread is being blocked so long that you hit the expiration,
// it's a problem that could be solved with better scheduling.
//
// People will be more likely to notice this and fix it with the long
// expiration time in development.
//
// In production we opt for better UX at the risk of masking scheduling
// problems, by expiring fast.
var HIGH_PRIORITY_EXPIRATION = 500;
var HIGH_PRIORITY_BATCH_SIZE = 100;

function computeInteractiveExpiration(currentTime) {
  return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
}

var NoContext = 0;
var ConcurrentMode = 1;
var StrictMode = 2;
var ProfileMode = 4;

var hasBadMapPolyfill = void 0;

{
  hasBadMapPolyfill = false;
  try {
    var nonExtensibleObject = Object.preventExtensions({});
    var testMap = new Map([[nonExtensibleObject, null]]);
    var testSet = new Set([nonExtensibleObject]);
    // This is necessary for Rollup to not consider these unused.
    // https://github.com/rollup/rollup/issues/1771
    // TODO: we can remove these if Rollup fixes the bug.
    testMap.set(0, 0);
    testSet.add(0);
  } catch (e) {
    // TODO: Consider warning about bad polyfills
    hasBadMapPolyfill = true;
  }
}

// A Fiber is work on a Component that needs to be done or was done. There can
// be more than one per component.


var debugCounter = void 0;

{
  debugCounter = 1;
}

function FiberNode(tag, pendingProps, key, mode) {
  // Instance
  this.tag = tag;
  this.key = key;
  this.elementType = null;
  this.type = null;
  this.stateNode = null;

  // Fiber
  this.return = null;
  this.child = null;
  this.sibling = null;
  this.index = 0;

  this.ref = null;

  this.pendingProps = pendingProps;
  this.memoizedProps = null;
  this.updateQueue = null;
  this.memoizedState = null;
  this.contextDependencies = null;

  this.mode = mode;

  // Effects
  this.effectTag = NoEffect;
  this.nextEffect = null;

  this.firstEffect = null;
  this.lastEffect = null;

  this.expirationTime = NoWork;
  this.childExpirationTime = NoWork;

  this.alternate = null;

  if (enableProfilerTimer) {
    // Note: The following is done to avoid a v8 performance cliff.
    //
    // Initializing the fields below to smis and later updating them with
    // double values will cause Fibers to end up having separate shapes.
    // This behavior/bug has something to do with Object.preventExtension().
    // Fortunately this only impacts DEV builds.
    // Unfortunately it makes React unusably slow for some applications.
    // To work around this, initialize the fields below with doubles.
    //
    // Learn more about this here:
    // https://github.com/facebook/react/issues/14365
    // https://bugs.chromium.org/p/v8/issues/detail?id=8538
    this.actualDuration = Number.NaN;
    this.actualStartTime = Number.NaN;
    this.selfBaseDuration = Number.NaN;
    this.treeBaseDuration = Number.NaN;

    // It's okay to replace the initial doubles with smis after initialization.
    // This won't trigger the performance cliff mentioned above,
    // and it simplifies other profiler code (including DevTools).
    this.actualDuration = 0;
    this.actualStartTime = -1;
    this.selfBaseDuration = 0;
    this.treeBaseDuration = 0;
  }

  {
    this._debugID = debugCounter++;
    this._debugSource = null;
    this._debugOwner = null;
    this._debugIsCurrentlyTiming = false;
    this._debugHookTypes = null;
    if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {
      Object.preventExtensions(this);
    }
  }
}

// This is a constructor function, rather than a POJO constructor, still
// please ensure we do the following:
// 1) Nobody should add any instance methods on this. Instance methods can be
//    more difficult to predict when they get optimized and they are almost
//    never inlined properly in static compilers.
// 2) Nobody should rely on `instanceof Fiber` for type testing. We should
//    always know when it is a fiber.
// 3) We might want to experiment with using numeric keys since they are easier
//    to optimize in a non-JIT environment.
// 4) We can easily go from a constructor to a createFiber object literal if that
//    is faster.
// 5) It should be easy to port this to a C struct and keep a C implementation
//    compatible.
var createFiber = function (tag, pendingProps, key, mode) {
  // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors
  return new FiberNode(tag, pendingProps, key, mode);
};

function shouldConstruct(Component) {
  var prototype = Component.prototype;
  return !!(prototype && prototype.isReactComponent);
}

function isSimpleFunctionComponent(type) {
  return typeof type === 'function' && !shouldConstruct(type) && type.defaultProps === undefined;
}

function resolveLazyComponentTag(Component) {
  if (typeof Component === 'function') {
    return shouldConstruct(Component) ? ClassComponent : FunctionComponent;
  } else if (Component !== undefined && Component !== null) {
    var $$typeof = Component.$$typeof;
    if ($$typeof === REACT_FORWARD_REF_TYPE) {
      return ForwardRef;
    }
    if ($$typeof === REACT_MEMO_TYPE) {
      return MemoComponent;
    }
  }
  return IndeterminateComponent;
}

// This is used to create an alternate fiber to do work on.
function createWorkInProgress(current, pendingProps, expirationTime) {
  var workInProgress = current.alternate;
  if (workInProgress === null) {
    // We use a double buffering pooling technique because we know that we'll
    // only ever need at most two versions of a tree. We pool the "other" unused
    // node that we're free to reuse. This is lazily created to avoid allocating
    // extra objects for things that are never updated. It also allow us to
    // reclaim the extra memory if needed.
    workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);
    workInProgress.elementType = current.elementType;
    workInProgress.type = current.type;
    workInProgress.stateNode = current.stateNode;

    {
      // DEV-only fields
      workInProgress._debugID = current._debugID;
      workInProgress._debugSource = current._debugSource;
      workInProgress._debugOwner = current._debugOwner;
      workInProgress._debugHookTypes = current._debugHookTypes;
    }

    workInProgress.alternate = current;
    current.alternate = workInProgress;
  } else {
    workInProgress.pendingProps = pendingProps;

    // We already have an alternate.
    // Reset the effect tag.
    workInProgress.effectTag = NoEffect;

    // The effect list is no longer valid.
    workInProgress.nextEffect = null;
    workInProgress.firstEffect = null;
    workInProgress.lastEffect = null;

    if (enableProfilerTimer) {
      // We intentionally reset, rather than copy, actualDuration & actualStartTime.
      // This prevents time from endlessly accumulating in new commits.
      // This has the downside of resetting values for different priority renders,
      // But works for yielding (the common case) and should support resuming.
      workInProgress.actualDuration = 0;
      workInProgress.actualStartTime = -1;
    }
  }

  workInProgress.childExpirationTime = current.childExpirationTime;
  workInProgress.expirationTime = current.expirationTime;

  workInProgress.child = current.child;
  workInProgress.memoizedProps = current.memoizedProps;
  workInProgress.memoizedState = current.memoizedState;
  workInProgress.updateQueue = current.updateQueue;
  workInProgress.contextDependencies = current.contextDependencies;

  // These will be overridden during the parent's reconciliation
  workInProgress.sibling = current.sibling;
  workInProgress.index = current.index;
  workInProgress.ref = current.ref;

  if (enableProfilerTimer) {
    workInProgress.selfBaseDuration = current.selfBaseDuration;
    workInProgress.treeBaseDuration = current.treeBaseDuration;
  }

  return workInProgress;
}

function createHostRootFiber(isConcurrent) {
  var mode = isConcurrent ? ConcurrentMode | StrictMode : NoContext;

  if (enableProfilerTimer && isDevToolsPresent) {
    // Always collect profile timings when DevTools are present.
    // This enables DevTools to start capturing timing at any point–
    // Without some nodes in the tree having empty base times.
    mode |= ProfileMode;
  }

  return createFiber(HostRoot, null, null, mode);
}

function createFiberFromTypeAndProps(type, // React$ElementType
key, pendingProps, owner, mode, expirationTime) {
  var fiber = void 0;

  var fiberTag = IndeterminateComponent;
  // The resolved type is set if we know what the final type will be. I.e. it's not lazy.
  var resolvedType = type;
  if (typeof type === 'function') {
    if (shouldConstruct(type)) {
      fiberTag = ClassComponent;
    }
  } else if (typeof type === 'string') {
    fiberTag = HostComponent;
  } else {
    getTag: switch (type) {
      case REACT_FRAGMENT_TYPE:
        return createFiberFromFragment(pendingProps.children, mode, expirationTime, key);
      case REACT_CONCURRENT_MODE_TYPE:
        return createFiberFromMode(pendingProps, mode | ConcurrentMode | StrictMode, expirationTime, key);
      case REACT_STRICT_MODE_TYPE:
        return createFiberFromMode(pendingProps, mode | StrictMode, expirationTime, key);
      case REACT_PROFILER_TYPE:
        return createFiberFromProfiler(pendingProps, mode, expirationTime, key);
      case REACT_SUSPENSE_TYPE:
        return createFiberFromSuspense(pendingProps, mode, expirationTime, key);
      default:
        {
          if (typeof type === 'object' && type !== null) {
            switch (type.$$typeof) {
              case REACT_PROVIDER_TYPE:
                fiberTag = ContextProvider;
                break getTag;
              case REACT_CONTEXT_TYPE:
                // This is a consumer
                fiberTag = ContextConsumer;
                break getTag;
              case REACT_FORWARD_REF_TYPE:
                fiberTag = ForwardRef;
                break getTag;
              case REACT_MEMO_TYPE:
                fiberTag = MemoComponent;
                break getTag;
              case REACT_LAZY_TYPE:
                fiberTag = LazyComponent;
                resolvedType = null;
                break getTag;
            }
          }
          var info = '';
          {
            if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
              info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.';
            }
            var ownerName = owner ? getComponentName(owner.type) : null;
            if (ownerName) {
              info += '\n\nCheck the render method of `' + ownerName + '`.';
            }
          }
          invariant(false, 'Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s', type == null ? type : typeof type, info);
        }
    }
  }

  fiber = createFiber(fiberTag, pendingProps, key, mode);
  fiber.elementType = type;
  fiber.type = resolvedType;
  fiber.expirationTime = expirationTime;

  return fiber;
}

function createFiberFromElement(element, mode, expirationTime) {
  var owner = null;
  {
    owner = element._owner;
  }
  var type = element.type;
  var key = element.key;
  var pendingProps = element.props;
  var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, expirationTime);
  {
    fiber._debugSource = element._source;
    fiber._debugOwner = element._owner;
  }
  return fiber;
}

function createFiberFromFragment(elements, mode, expirationTime, key) {
  var fiber = createFiber(Fragment, elements, key, mode);
  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromProfiler(pendingProps, mode, expirationTime, key) {
  {
    if (typeof pendingProps.id !== 'string' || typeof pendingProps.onRender !== 'function') {
      warningWithoutStack$1(false, 'Profiler must specify an "id" string and "onRender" function as props');
    }
  }

  var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode);
  // TODO: The Profiler fiber shouldn't have a type. It has a tag.
  fiber.elementType = REACT_PROFILER_TYPE;
  fiber.type = REACT_PROFILER_TYPE;
  fiber.expirationTime = expirationTime;

  return fiber;
}

function createFiberFromMode(pendingProps, mode, expirationTime, key) {
  var fiber = createFiber(Mode, pendingProps, key, mode);

  // TODO: The Mode fiber shouldn't have a type. It has a tag.
  var type = (mode & ConcurrentMode) === NoContext ? REACT_STRICT_MODE_TYPE : REACT_CONCURRENT_MODE_TYPE;
  fiber.elementType = type;
  fiber.type = type;

  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromSuspense(pendingProps, mode, expirationTime, key) {
  var fiber = createFiber(SuspenseComponent, pendingProps, key, mode);

  // TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.
  var type = REACT_SUSPENSE_TYPE;
  fiber.elementType = type;
  fiber.type = type;

  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromText(content, mode, expirationTime) {
  var fiber = createFiber(HostText, content, null, mode);
  fiber.expirationTime = expirationTime;
  return fiber;
}

function createFiberFromHostInstanceForDeletion() {
  var fiber = createFiber(HostComponent, null, null, NoContext);
  // TODO: These should not need a type.
  fiber.elementType = 'DELETED';
  fiber.type = 'DELETED';
  return fiber;
}

function createFiberFromPortal(portal, mode, expirationTime) {
  var pendingProps = portal.children !== null ? portal.children : [];
  var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);
  fiber.expirationTime = expirationTime;
  fiber.stateNode = {
    containerInfo: portal.containerInfo,
    pendingChildren: null, // Used by persistent updates
    implementation: portal.implementation
  };
  return fiber;
}

// Used for stashing WIP properties to replay failed work in DEV.
function assignFiberPropertiesInDEV(target, source) {
  if (target === null) {
    // This Fiber's initial properties will always be overwritten.
    // We only use a Fiber to ensure the same hidden class so DEV isn't slow.
    target = createFiber(IndeterminateComponent, null, null, NoContext);
  }

  // This is intentionally written as a list of all properties.
  // We tried to use Object.assign() instead but this is called in
  // the hottest path, and Object.assign() was too slow:
  // https://github.com/facebook/react/issues/12502
  // This code is DEV-only so size is not a concern.

  target.tag = source.tag;
  target.key = source.key;
  target.elementType = source.elementType;
  target.type = source.type;
  target.stateNode = source.stateNode;
  target.return = source.return;
  target.child = source.child;
  target.sibling = source.sibling;
  target.index = source.index;
  target.ref = source.ref;
  target.pendingProps = source.pendingProps;
  target.memoizedProps = source.memoizedProps;
  target.updateQueue = source.updateQueue;
  target.memoizedState = source.memoizedState;
  target.contextDependencies = source.contextDependencies;
  target.mode = source.mode;
  target.effectTag = source.effectTag;
  target.nextEffect = source.nextEffect;
  target.firstEffect = source.firstEffect;
  target.lastEffect = source.lastEffect;
  target.expirationTime = source.expirationTime;
  target.childExpirationTime = source.childExpirationTime;
  target.alternate = source.alternate;
  if (enableProfilerTimer) {
    target.actualDuration = source.actualDuration;
    target.actualStartTime = source.actualStartTime;
    target.selfBaseDuration = source.selfBaseDuration;
    target.treeBaseDuration = source.treeBaseDuration;
  }
  target._debugID = source._debugID;
  target._debugSource = source._debugSource;
  target._debugOwner = source._debugOwner;
  target._debugIsCurrentlyTiming = source._debugIsCurrentlyTiming;
  target._debugHookTypes = source._debugHookTypes;
  return target;
}

// TODO: This should be lifted into the renderer.


// The following attributes are only used by interaction tracing builds.
// They enable interactions to be associated with their async work,
// And expose interaction metadata to the React DevTools Profiler plugin.
// Note that these attributes are only defined when the enableSchedulerTracing flag is enabled.


// Exported FiberRoot type includes all properties,
// To avoid requiring potentially error-prone :any casts throughout the project.
// Profiling properties are only safe to access in profiling builds (when enableSchedulerTracing is true).
// The types are defined separately within this file to ensure they stay in sync.
// (We don't have to use an inline :any cast when enableSchedulerTracing is disabled.)


function createFiberRoot(containerInfo, isConcurrent, hydrate) {
  // Cyclic construction. This cheats the type system right now because
  // stateNode is any.
  var uninitializedFiber = createHostRootFiber(isConcurrent);

  var root = void 0;
  if (enableSchedulerTracing) {
    root = {
      current: uninitializedFiber,
      containerInfo: containerInfo,
      pendingChildren: null,

      earliestPendingTime: NoWork,
      latestPendingTime: NoWork,
      earliestSuspendedTime: NoWork,
      latestSuspendedTime: NoWork,
      latestPingedTime: NoWork,

      pingCache: null,

      didError: false,

      pendingCommitExpirationTime: NoWork,
      finishedWork: null,
      timeoutHandle: noTimeout,
      context: null,
      pendingContext: null,
      hydrate: hydrate,
      nextExpirationTimeToWorkOn: NoWork,
      expirationTime: NoWork,
      firstBatch: null,
      nextScheduledRoot: null,

      interactionThreadID: tracing.unstable_getThreadID(),
      memoizedInteractions: new Set(),
      pendingInteractionMap: new Map()
    };
  } else {
    root = {
      current: uninitializedFiber,
      containerInfo: containerInfo,
      pendingChildren: null,

      pingCache: null,

      earliestPendingTime: NoWork,
      latestPendingTime: NoWork,
      earliestSuspendedTime: NoWork,
      latestSuspendedTime: NoWork,
      latestPingedTime: NoWork,

      didError: false,

      pendingCommitExpirationTime: NoWork,
      finishedWork: null,
      timeoutHandle: noTimeout,
      context: null,
      pendingContext: null,
      hydrate: hydrate,
      nextExpirationTimeToWorkOn: NoWork,
      expirationTime: NoWork,
      firstBatch: null,
      nextScheduledRoot: null
    };
  }

  uninitializedFiber.stateNode = root;

  // The reason for the way the Flow types are structured in this file,
  // Is to avoid needing :any casts everywhere interaction tracing fields are used.
  // Unfortunately that requires an :any cast for non-interaction tracing capable builds.
  // $FlowFixMe Remove this :any cast and replace it with something better.
  return root;
}

/**
 * Forked from fbjs/warning:
 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
 *
 * Only change is we use console.warn instead of console.error,
 * and do nothing when 'console' is not supported.
 * This really simplifies the code.
 * ---
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var lowPriorityWarning = function () {};

{
  var printWarning = function (format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.warn(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  lowPriorityWarning = function (condition, format) {
    if (format === undefined) {
      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

var lowPriorityWarning$1 = lowPriorityWarning;

var ReactStrictModeWarnings = {
  discardPendingWarnings: function () {},
  flushPendingDeprecationWarnings: function () {},
  flushPendingUnsafeLifecycleWarnings: function () {},
  recordDeprecationWarnings: function (fiber, instance) {},
  recordUnsafeLifecycleWarnings: function (fiber, instance) {},
  recordLegacyContextWarning: function (fiber, instance) {},
  flushLegacyContextWarning: function () {}
};

{
  var LIFECYCLE_SUGGESTIONS = {
    UNSAFE_componentWillMount: 'componentDidMount',
    UNSAFE_componentWillReceiveProps: 'static getDerivedStateFromProps',
    UNSAFE_componentWillUpdate: 'componentDidUpdate'
  };

  var pendingComponentWillMountWarnings = [];
  var pendingComponentWillReceivePropsWarnings = [];
  var pendingComponentWillUpdateWarnings = [];
  var pendingUnsafeLifecycleWarnings = new Map();
  var pendingLegacyContextWarning = new Map();

  // Tracks components we have already warned about.
  var didWarnAboutDeprecatedLifecycles = new Set();
  var didWarnAboutUnsafeLifecycles = new Set();
  var didWarnAboutLegacyContext = new Set();

  var setToSortedString = function (set) {
    var array = [];
    set.forEach(function (value) {
      array.push(value);
    });
    return array.sort().join(', ');
  };

  ReactStrictModeWarnings.discardPendingWarnings = function () {
    pendingComponentWillMountWarnings = [];
    pendingComponentWillReceivePropsWarnings = [];
    pendingComponentWillUpdateWarnings = [];
    pendingUnsafeLifecycleWarnings = new Map();
    pendingLegacyContextWarning = new Map();
  };

  ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
    pendingUnsafeLifecycleWarnings.forEach(function (lifecycleWarningsMap, strictRoot) {
      var lifecyclesWarningMessages = [];

      Object.keys(lifecycleWarningsMap).forEach(function (lifecycle) {
        var lifecycleWarnings = lifecycleWarningsMap[lifecycle];
        if (lifecycleWarnings.length > 0) {
          var componentNames = new Set();
          lifecycleWarnings.forEach(function (fiber) {
            componentNames.add(getComponentName(fiber.type) || 'Component');
            didWarnAboutUnsafeLifecycles.add(fiber.type);
          });

          var formatted = lifecycle.replace('UNSAFE_', '');
          var suggestion = LIFECYCLE_SUGGESTIONS[lifecycle];
          var sortedComponentNames = setToSortedString(componentNames);

          lifecyclesWarningMessages.push(formatted + ': Please update the following components to use ' + (suggestion + ' instead: ' + sortedComponentNames));
        }
      });

      if (lifecyclesWarningMessages.length > 0) {
        var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);

        warningWithoutStack$1(false, 'Unsafe lifecycle methods were found within a strict-mode tree:%s' + '\n\n%s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, lifecyclesWarningMessages.join('\n\n'));
      }
    });

    pendingUnsafeLifecycleWarnings = new Map();
  };

  var findStrictRoot = function (fiber) {
    var maybeStrictRoot = null;

    var node = fiber;
    while (node !== null) {
      if (node.mode & StrictMode) {
        maybeStrictRoot = node;
      }
      node = node.return;
    }

    return maybeStrictRoot;
  };

  ReactStrictModeWarnings.flushPendingDeprecationWarnings = function () {
    if (pendingComponentWillMountWarnings.length > 0) {
      var uniqueNames = new Set();
      pendingComponentWillMountWarnings.forEach(function (fiber) {
        uniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutDeprecatedLifecycles.add(fiber.type);
      });

      var sortedNames = setToSortedString(uniqueNames);

      lowPriorityWarning$1(false, 'componentWillMount is deprecated and will be removed in the next major version. ' + 'Use componentDidMount instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillMount.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', sortedNames);

      pendingComponentWillMountWarnings = [];
    }

    if (pendingComponentWillReceivePropsWarnings.length > 0) {
      var _uniqueNames = new Set();
      pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
        _uniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutDeprecatedLifecycles.add(fiber.type);
      });

      var _sortedNames = setToSortedString(_uniqueNames);

      lowPriorityWarning$1(false, 'componentWillReceiveProps is deprecated and will be removed in the next major version. ' + 'Use static getDerivedStateFromProps instead.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames);

      pendingComponentWillReceivePropsWarnings = [];
    }

    if (pendingComponentWillUpdateWarnings.length > 0) {
      var _uniqueNames2 = new Set();
      pendingComponentWillUpdateWarnings.forEach(function (fiber) {
        _uniqueNames2.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutDeprecatedLifecycles.add(fiber.type);
      });

      var _sortedNames2 = setToSortedString(_uniqueNames2);

      lowPriorityWarning$1(false, 'componentWillUpdate is deprecated and will be removed in the next major version. ' + 'Use componentDidUpdate instead. As a temporary workaround, ' + 'you can rename to UNSAFE_componentWillUpdate.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-async-component-lifecycle-hooks', _sortedNames2);

      pendingComponentWillUpdateWarnings = [];
    }
  };

  ReactStrictModeWarnings.recordDeprecationWarnings = function (fiber, instance) {
    // Dedup strategy: Warn once per component.
    if (didWarnAboutDeprecatedLifecycles.has(fiber.type)) {
      return;
    }

    // Don't warn about react-lifecycles-compat polyfilled components.
    if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
      pendingComponentWillMountWarnings.push(fiber);
    }
    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
      pendingComponentWillReceivePropsWarnings.push(fiber);
    }
    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
      pendingComponentWillUpdateWarnings.push(fiber);
    }
  };

  ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
    var strictRoot = findStrictRoot(fiber);
    if (strictRoot === null) {
      warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
      return;
    }

    // Dedup strategy: Warn once per component.
    // This is difficult to track any other way since component names
    // are often vague and are likely to collide between 3rd party libraries.
    // An expand property is probably okay to use here since it's DEV-only,
    // and will only be set in the event of serious warnings.
    if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
      return;
    }

    var warningsForRoot = void 0;
    if (!pendingUnsafeLifecycleWarnings.has(strictRoot)) {
      warningsForRoot = {
        UNSAFE_componentWillMount: [],
        UNSAFE_componentWillReceiveProps: [],
        UNSAFE_componentWillUpdate: []
      };

      pendingUnsafeLifecycleWarnings.set(strictRoot, warningsForRoot);
    } else {
      warningsForRoot = pendingUnsafeLifecycleWarnings.get(strictRoot);
    }

    var unsafeLifecycles = [];
    if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true || typeof instance.UNSAFE_componentWillMount === 'function') {
      unsafeLifecycles.push('UNSAFE_componentWillMount');
    }
    if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true || typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
      unsafeLifecycles.push('UNSAFE_componentWillReceiveProps');
    }
    if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true || typeof instance.UNSAFE_componentWillUpdate === 'function') {
      unsafeLifecycles.push('UNSAFE_componentWillUpdate');
    }

    if (unsafeLifecycles.length > 0) {
      unsafeLifecycles.forEach(function (lifecycle) {
        warningsForRoot[lifecycle].push(fiber);
      });
    }
  };

  ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
    var strictRoot = findStrictRoot(fiber);
    if (strictRoot === null) {
      warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
      return;
    }

    // Dedup strategy: Warn once per component.
    if (didWarnAboutLegacyContext.has(fiber.type)) {
      return;
    }

    var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);

    if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
      if (warningsForRoot === undefined) {
        warningsForRoot = [];
        pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
      }
      warningsForRoot.push(fiber);
    }
  };

  ReactStrictModeWarnings.flushLegacyContextWarning = function () {
    pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
      var uniqueNames = new Set();
      fiberArray.forEach(function (fiber) {
        uniqueNames.add(getComponentName(fiber.type) || 'Component');
        didWarnAboutLegacyContext.add(fiber.type);
      });

      var sortedNames = setToSortedString(uniqueNames);
      var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);

      warningWithoutStack$1(false, 'Legacy context API has been detected within a strict-mode tree: %s' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here:' + '\nhttps://fb.me/react-strict-mode-warnings', strictRootComponentStack, sortedNames);
    });
  };
}

// This lets us hook into Fiber to debug what it's doing.
// See https://github.com/facebook/react/pull/8033.
// This is not part of the public API, not even for React DevTools.
// You may only inject a debugTool if you work on React Fiber itself.
var ReactFiberInstrumentation = {
  debugTool: null
};

var ReactFiberInstrumentation_1 = ReactFiberInstrumentation;

// TODO: Offscreen updates should never suspend. However, a promise that
// suspended inside an offscreen subtree should be able to ping at the priority
// of the outer render.

function markPendingPriorityLevel(root, expirationTime) {
  // If there's a gap between completing a failed root and retrying it,
  // additional updates may be scheduled. Clear `didError`, in case the update
  // is sufficient to fix the error.
  root.didError = false;

  // Update the latest and earliest pending times
  var earliestPendingTime = root.earliestPendingTime;
  if (earliestPendingTime === NoWork) {
    // No other pending updates.
    root.earliestPendingTime = root.latestPendingTime = expirationTime;
  } else {
    if (earliestPendingTime < expirationTime) {
      // This is the earliest pending update.
      root.earliestPendingTime = expirationTime;
    } else {
      var latestPendingTime = root.latestPendingTime;
      if (latestPendingTime > expirationTime) {
        // This is the latest pending update
        root.latestPendingTime = expirationTime;
      }
    }
  }
  findNextExpirationTimeToWorkOn(expirationTime, root);
}

function markCommittedPriorityLevels(root, earliestRemainingTime) {
  root.didError = false;

  if (earliestRemainingTime === NoWork) {
    // Fast path. There's no remaining work. Clear everything.
    root.earliestPendingTime = NoWork;
    root.latestPendingTime = NoWork;
    root.earliestSuspendedTime = NoWork;
    root.latestSuspendedTime = NoWork;
    root.latestPingedTime = NoWork;
    findNextExpirationTimeToWorkOn(NoWork, root);
    return;
  }

  if (earliestRemainingTime < root.latestPingedTime) {
    root.latestPingedTime = NoWork;
  }

  // Let's see if the previous latest known pending level was just flushed.
  var latestPendingTime = root.latestPendingTime;
  if (latestPendingTime !== NoWork) {
    if (latestPendingTime > earliestRemainingTime) {
      // We've flushed all the known pending levels.
      root.earliestPendingTime = root.latestPendingTime = NoWork;
    } else {
      var earliestPendingTime = root.earliestPendingTime;
      if (earliestPendingTime > earliestRemainingTime) {
        // We've flushed the earliest known pending level. Set this to the
        // latest pending time.
        root.earliestPendingTime = root.latestPendingTime;
      }
    }
  }

  // Now let's handle the earliest remaining level in the whole tree. We need to
  // decide whether to treat it as a pending level or as suspended. Check
  // it falls within the range of known suspended levels.

  var earliestSuspendedTime = root.earliestSuspendedTime;
  if (earliestSuspendedTime === NoWork) {
    // There's no suspended work. Treat the earliest remaining level as a
    // pending level.
    markPendingPriorityLevel(root, earliestRemainingTime);
    findNextExpirationTimeToWorkOn(NoWork, root);
    return;
  }

  var latestSuspendedTime = root.latestSuspendedTime;
  if (earliestRemainingTime < latestSuspendedTime) {
    // The earliest remaining level is later than all the suspended work. That
    // means we've flushed all the suspended work.
    root.earliestSuspendedTime = NoWork;
    root.latestSuspendedTime = NoWork;
    root.latestPingedTime = NoWork;

    // There's no suspended work. Treat the earliest remaining level as a
    // pending level.
    markPendingPriorityLevel(root, earliestRemainingTime);
    findNextExpirationTimeToWorkOn(NoWork, root);
    return;
  }

  if (earliestRemainingTime > earliestSuspendedTime) {
    // The earliest remaining time is earlier than all the suspended work.
    // Treat it as a pending update.
    markPendingPriorityLevel(root, earliestRemainingTime);
    findNextExpirationTimeToWorkOn(NoWork, root);
    return;
  }

  // The earliest remaining time falls within the range of known suspended
  // levels. We should treat this as suspended work.
  findNextExpirationTimeToWorkOn(NoWork, root);
}

function hasLowerPriorityWork(root, erroredExpirationTime) {
  var latestPendingTime = root.latestPendingTime;
  var latestSuspendedTime = root.latestSuspendedTime;
  var latestPingedTime = root.latestPingedTime;
  return latestPendingTime !== NoWork && latestPendingTime < erroredExpirationTime || latestSuspendedTime !== NoWork && latestSuspendedTime < erroredExpirationTime || latestPingedTime !== NoWork && latestPingedTime < erroredExpirationTime;
}

function isPriorityLevelSuspended(root, expirationTime) {
  var earliestSuspendedTime = root.earliestSuspendedTime;
  var latestSuspendedTime = root.latestSuspendedTime;
  return earliestSuspendedTime !== NoWork && expirationTime <= earliestSuspendedTime && expirationTime >= latestSuspendedTime;
}

function markSuspendedPriorityLevel(root, suspendedTime) {
  root.didError = false;
  clearPing(root, suspendedTime);

  // First, check the known pending levels and update them if needed.
  var earliestPendingTime = root.earliestPendingTime;
  var latestPendingTime = root.latestPendingTime;
  if (earliestPendingTime === suspendedTime) {
    if (latestPendingTime === suspendedTime) {
      // Both known pending levels were suspended. Clear them.
      root.earliestPendingTime = root.latestPendingTime = NoWork;
    } else {
      // The earliest pending level was suspended. Clear by setting it to the
      // latest pending level.
      root.earliestPendingTime = latestPendingTime;
    }
  } else if (latestPendingTime === suspendedTime) {
    // The latest pending level was suspended. Clear by setting it to the
    // latest pending level.
    root.latestPendingTime = earliestPendingTime;
  }

  // Finally, update the known suspended levels.
  var earliestSuspendedTime = root.earliestSuspendedTime;
  var latestSuspendedTime = root.latestSuspendedTime;
  if (earliestSuspendedTime === NoWork) {
    // No other suspended levels.
    root.earliestSuspendedTime = root.latestSuspendedTime = suspendedTime;
  } else {
    if (earliestSuspendedTime < suspendedTime) {
      // This is the earliest suspended level.
      root.earliestSuspendedTime = suspendedTime;
    } else if (latestSuspendedTime > suspendedTime) {
      // This is the latest suspended level
      root.latestSuspendedTime = suspendedTime;
    }
  }

  findNextExpirationTimeToWorkOn(suspendedTime, root);
}

function markPingedPriorityLevel(root, pingedTime) {
  root.didError = false;

  // TODO: When we add back resuming, we need to ensure the progressed work
  // is thrown out and not reused during the restarted render. One way to
  // invalidate the progressed work is to restart at expirationTime + 1.
  var latestPingedTime = root.latestPingedTime;
  if (latestPingedTime === NoWork || latestPingedTime > pingedTime) {
    root.latestPingedTime = pingedTime;
  }
  findNextExpirationTimeToWorkOn(pingedTime, root);
}

function clearPing(root, completedTime) {
  var latestPingedTime = root.latestPingedTime;
  if (latestPingedTime >= completedTime) {
    root.latestPingedTime = NoWork;
  }
}

function findEarliestOutstandingPriorityLevel(root, renderExpirationTime) {
  var earliestExpirationTime = renderExpirationTime;

  var earliestPendingTime = root.earliestPendingTime;
  var earliestSuspendedTime = root.earliestSuspendedTime;
  if (earliestPendingTime > earliestExpirationTime) {
    earliestExpirationTime = earliestPendingTime;
  }
  if (earliestSuspendedTime > earliestExpirationTime) {
    earliestExpirationTime = earliestSuspendedTime;
  }
  return earliestExpirationTime;
}

function didExpireAtExpirationTime(root, currentTime) {
  var expirationTime = root.expirationTime;
  if (expirationTime !== NoWork && currentTime <= expirationTime) {
    // The root has expired. Flush all work up to the current time.
    root.nextExpirationTimeToWorkOn = currentTime;
  }
}

function findNextExpirationTimeToWorkOn(completedExpirationTime, root) {
  var earliestSuspendedTime = root.earliestSuspendedTime;
  var latestSuspendedTime = root.latestSuspendedTime;
  var earliestPendingTime = root.earliestPendingTime;
  var latestPingedTime = root.latestPingedTime;

  // Work on the earliest pending time. Failing that, work on the latest
  // pinged time.
  var nextExpirationTimeToWorkOn = earliestPendingTime !== NoWork ? earliestPendingTime : latestPingedTime;

  // If there is no pending or pinged work, check if there's suspended work
  // that's lower priority than what we just completed.
  if (nextExpirationTimeToWorkOn === NoWork && (completedExpirationTime === NoWork || latestSuspendedTime < completedExpirationTime)) {
    // The lowest priority suspended work is the work most likely to be
    // committed next. Let's start rendering it again, so that if it times out,
    // it's ready to commit.
    nextExpirationTimeToWorkOn = latestSuspendedTime;
  }

  var expirationTime = nextExpirationTimeToWorkOn;
  if (expirationTime !== NoWork && earliestSuspendedTime > expirationTime) {
    // Expire using the earliest known expiration time.
    expirationTime = earliestSuspendedTime;
  }

  root.nextExpirationTimeToWorkOn = nextExpirationTimeToWorkOn;
  root.expirationTime = expirationTime;
}

function resolveDefaultProps(Component, baseProps) {
  if (Component && Component.defaultProps) {
    // Resolve default props. Taken from ReactElement
    var props = _assign({}, baseProps);
    var defaultProps = Component.defaultProps;
    for (var propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
    return props;
  }
  return baseProps;
}

function readLazyComponentType(lazyComponent) {
  var status = lazyComponent._status;
  var result = lazyComponent._result;
  switch (status) {
    case Resolved:
      {
        var Component = result;
        return Component;
      }
    case Rejected:
      {
        var error = result;
        throw error;
      }
    case Pending:
      {
        var thenable = result;
        throw thenable;
      }
    default:
      {
        lazyComponent._status = Pending;
        var ctor = lazyComponent._ctor;
        var _thenable = ctor();
        _thenable.then(function (moduleObject) {
          if (lazyComponent._status === Pending) {
            var defaultExport = moduleObject.default;
            {
              if (defaultExport === undefined) {
                warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n  ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
              }
            }
            lazyComponent._status = Resolved;
            lazyComponent._result = defaultExport;
          }
        }, function (error) {
          if (lazyComponent._status === Pending) {
            lazyComponent._status = Rejected;
            lazyComponent._result = error;
          }
        });
        // Handle synchronous thenables.
        switch (lazyComponent._status) {
          case Resolved:
            return lazyComponent._result;
          case Rejected:
            throw lazyComponent._result;
        }
        lazyComponent._result = _thenable;
        throw _thenable;
      }
  }
}

var fakeInternalInstance = {};
var isArray$1 = Array.isArray;

// React.Component uses a shared frozen object by default.
// We'll use it to determine whether we need to initialize legacy refs.
var emptyRefsObject = new React.Component().refs;

var didWarnAboutStateAssignmentForComponent = void 0;
var didWarnAboutUninitializedState = void 0;
var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = void 0;
var didWarnAboutLegacyLifecyclesAndDerivedState = void 0;
var didWarnAboutUndefinedDerivedState = void 0;
var warnOnUndefinedDerivedState = void 0;
var warnOnInvalidCallback$1 = void 0;
var didWarnAboutDirectlyAssigningPropsToState = void 0;
var didWarnAboutContextTypeAndContextTypes = void 0;
var didWarnAboutInvalidateContextType = void 0;

{
  didWarnAboutStateAssignmentForComponent = new Set();
  didWarnAboutUninitializedState = new Set();
  didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
  didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
  didWarnAboutDirectlyAssigningPropsToState = new Set();
  didWarnAboutUndefinedDerivedState = new Set();
  didWarnAboutContextTypeAndContextTypes = new Set();
  didWarnAboutInvalidateContextType = new Set();

  var didWarnOnInvalidCallback = new Set();

  warnOnInvalidCallback$1 = function (callback, callerName) {
    if (callback === null || typeof callback === 'function') {
      return;
    }
    var key = callerName + '_' + callback;
    if (!didWarnOnInvalidCallback.has(key)) {
      didWarnOnInvalidCallback.add(key);
      warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
    }
  };

  warnOnUndefinedDerivedState = function (type, partialState) {
    if (partialState === undefined) {
      var componentName = getComponentName(type) || 'Component';
      if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
        didWarnAboutUndefinedDerivedState.add(componentName);
        warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
      }
    }
  };

  // This is so gross but it's at least non-critical and can be removed if
  // it causes problems. This is meant to give a nicer error message for
  // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
  // ...)) which otherwise throws a "_processChildContext is not a function"
  // exception.
  Object.defineProperty(fakeInternalInstance, '_processChildContext', {
    enumerable: false,
    value: function () {
      invariant(false, '_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn\'t supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).');
    }
  });
  Object.freeze(fakeInternalInstance);
}

function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
  var prevState = workInProgress.memoizedState;

  {
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      // Invoke the function an extra time to help detect side-effects.
      getDerivedStateFromProps(nextProps, prevState);
    }
  }

  var partialState = getDerivedStateFromProps(nextProps, prevState);

  {
    warnOnUndefinedDerivedState(ctor, partialState);
  }
  // Merge the partial state and the previous state.
  var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
  workInProgress.memoizedState = memoizedState;

  // Once the update queue is empty, persist the derived state onto the
  // base state.
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null && workInProgress.expirationTime === NoWork) {
    updateQueue.baseState = memoizedState;
  }
}

var classComponentUpdater = {
  isMounted: isMounted,
  enqueueSetState: function (inst, payload, callback) {
    var fiber = get(inst);
    var currentTime = requestCurrentTime();
    var expirationTime = computeExpirationForFiber(currentTime, fiber);

    var update = createUpdate(expirationTime);
    update.payload = payload;
    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback$1(callback, 'setState');
      }
      update.callback = callback;
    }

    flushPassiveEffects();
    enqueueUpdate(fiber, update);
    scheduleWork(fiber, expirationTime);
  },
  enqueueReplaceState: function (inst, payload, callback) {
    var fiber = get(inst);
    var currentTime = requestCurrentTime();
    var expirationTime = computeExpirationForFiber(currentTime, fiber);

    var update = createUpdate(expirationTime);
    update.tag = ReplaceState;
    update.payload = payload;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback$1(callback, 'replaceState');
      }
      update.callback = callback;
    }

    flushPassiveEffects();
    enqueueUpdate(fiber, update);
    scheduleWork(fiber, expirationTime);
  },
  enqueueForceUpdate: function (inst, callback) {
    var fiber = get(inst);
    var currentTime = requestCurrentTime();
    var expirationTime = computeExpirationForFiber(currentTime, fiber);

    var update = createUpdate(expirationTime);
    update.tag = ForceUpdate;

    if (callback !== undefined && callback !== null) {
      {
        warnOnInvalidCallback$1(callback, 'forceUpdate');
      }
      update.callback = callback;
    }

    flushPassiveEffects();
    enqueueUpdate(fiber, update);
    scheduleWork(fiber, expirationTime);
  }
};

function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
  var instance = workInProgress.stateNode;
  if (typeof instance.shouldComponentUpdate === 'function') {
    startPhaseTimer(workInProgress, 'shouldComponentUpdate');
    var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
    stopPhaseTimer();

    {
      !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
    }

    return shouldUpdate;
  }

  if (ctor.prototype && ctor.prototype.isPureReactComponent) {
    return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
  }

  return true;
}

function checkClassInstance(workInProgress, ctor, newProps) {
  var instance = workInProgress.stateNode;
  {
    var name = getComponentName(ctor) || 'Component';
    var renderPresent = instance.render;

    if (!renderPresent) {
      if (ctor.prototype && typeof ctor.prototype.render === 'function') {
        warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
      } else {
        warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
      }
    }

    var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
    !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
    var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
    !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
    var noInstancePropTypes = !instance.propTypes;
    !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
    var noInstanceContextType = !instance.contextType;
    !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0;
    var noInstanceContextTypes = !instance.contextTypes;
    !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;

    if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
      didWarnAboutContextTypeAndContextTypes.add(ctor);
      warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
    }

    var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
    !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
    if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
      warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
    }
    var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
    !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
    var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
    !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
    var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
    !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
    var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
    !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
    var hasMutatedProps = instance.props !== newProps;
    !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
    var noInstanceDefaultProps = !instance.defaultProps;
    !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;

    if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
      didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
      warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
    }

    var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
    !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
    var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function';
    !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
    var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function';
    !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
    var _state = instance.state;
    if (_state && (typeof _state !== 'object' || isArray$1(_state))) {
      warningWithoutStack$1(false, '%s.state: must be set to an object or null', name);
    }
    if (typeof instance.getChildContext === 'function') {
      !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
    }
  }
}

function adoptClassInstance(workInProgress, instance) {
  instance.updater = classComponentUpdater;
  workInProgress.stateNode = instance;
  // The instance needs access to the fiber so that it can schedule updates
  set(instance, workInProgress);
  {
    instance._reactInternalInstance = fakeInternalInstance;
  }
}

function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) {
  var isLegacyContextConsumer = false;
  var unmaskedContext = emptyContextObject;
  var context = null;
  var contextType = ctor.contextType;

  {
    if ('contextType' in ctor) {
      var isValid =
      // Allow null for conditional declaration
      contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>

      if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
        didWarnAboutInvalidateContextType.add(ctor);

        var addendum = '';
        if (contextType === undefined) {
          addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
        } else if (typeof contextType !== 'object') {
          addendum = ' However, it is set to a ' + typeof contextType + '.';
        } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
          addendum = ' Did you accidentally pass the Context.Provider instead?';
        } else if (contextType._context !== undefined) {
          // <Context.Consumer>
          addendum = ' Did you accidentally pass the Context.Consumer instead?';
        } else {
          addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
        }
        warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
      }
    }
  }

  if (typeof contextType === 'object' && contextType !== null) {
    context = readContext(contextType);
  } else {
    unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    var contextTypes = ctor.contextTypes;
    isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
    context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
  }

  // Instantiate twice to help detect side-effects.
  {
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      new ctor(props, context); // eslint-disable-line no-new
    }
  }

  var instance = new ctor(props, context);
  var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
  adoptClassInstance(workInProgress, instance);

  {
    if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
      var componentName = getComponentName(ctor) || 'Component';
      if (!didWarnAboutUninitializedState.has(componentName)) {
        didWarnAboutUninitializedState.add(componentName);
        warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
      }
    }

    // If new component APIs are defined, "unsafe" lifecycles won't be called.
    // Warn about these lifecycles if they are present.
    // Don't warn about react-lifecycles-compat polyfilled methods though.
    if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
      var foundWillMountName = null;
      var foundWillReceivePropsName = null;
      var foundWillUpdateName = null;
      if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
        foundWillMountName = 'componentWillMount';
      } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
        foundWillMountName = 'UNSAFE_componentWillMount';
      }
      if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
        foundWillReceivePropsName = 'componentWillReceiveProps';
      } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
        foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
      }
      if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
        foundWillUpdateName = 'componentWillUpdate';
      } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        foundWillUpdateName = 'UNSAFE_componentWillUpdate';
      }
      if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
        var _componentName = getComponentName(ctor) || 'Component';
        var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
        if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
          didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
          warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-async-component-lifecycle-hooks', _componentName, newApiName, foundWillMountName !== null ? '\n  ' + foundWillMountName : '', foundWillReceivePropsName !== null ? '\n  ' + foundWillReceivePropsName : '', foundWillUpdateName !== null ? '\n  ' + foundWillUpdateName : '');
        }
      }
    }
  }

  // Cache unmasked context so we can avoid recreating masked context unless necessary.
  // ReactFiberContext usually updates this cache but can't for newly-created instances.
  if (isLegacyContextConsumer) {
    cacheContext(workInProgress, unmaskedContext, context);
  }

  return instance;
}

function callComponentWillMount(workInProgress, instance) {
  startPhaseTimer(workInProgress, 'componentWillMount');
  var oldState = instance.state;

  if (typeof instance.componentWillMount === 'function') {
    instance.componentWillMount();
  }
  if (typeof instance.UNSAFE_componentWillMount === 'function') {
    instance.UNSAFE_componentWillMount();
  }

  stopPhaseTimer();

  if (oldState !== instance.state) {
    {
      warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
    }
    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
}

function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
  var oldState = instance.state;
  startPhaseTimer(workInProgress, 'componentWillReceiveProps');
  if (typeof instance.componentWillReceiveProps === 'function') {
    instance.componentWillReceiveProps(newProps, nextContext);
  }
  if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
    instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
  }
  stopPhaseTimer();

  if (instance.state !== oldState) {
    {
      var componentName = getComponentName(workInProgress.type) || 'Component';
      if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
        didWarnAboutStateAssignmentForComponent.add(componentName);
        warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
      }
    }
    classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
  }
}

// Invokes the mount life-cycles on a previously never rendered instance.
function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  {
    checkClassInstance(workInProgress, ctor, newProps);
  }

  var instance = workInProgress.stateNode;
  instance.props = newProps;
  instance.state = workInProgress.memoizedState;
  instance.refs = emptyRefsObject;

  var contextType = ctor.contextType;
  if (typeof contextType === 'object' && contextType !== null) {
    instance.context = readContext(contextType);
  } else {
    var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    instance.context = getMaskedContext(workInProgress, unmaskedContext);
  }

  {
    if (instance.state === newProps) {
      var componentName = getComponentName(ctor) || 'Component';
      if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
        didWarnAboutDirectlyAssigningPropsToState.add(componentName);
        warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);

      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
    }

    if (warnAboutDeprecatedLifecycles) {
      ReactStrictModeWarnings.recordDeprecationWarnings(workInProgress, instance);
    }
  }

  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    instance.state = workInProgress.memoizedState;
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    instance.state = workInProgress.memoizedState;
  }

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
    callComponentWillMount(workInProgress, instance);
    // If we had additional state updates during this life-cycle, let's
    // process them now.
    updateQueue = workInProgress.updateQueue;
    if (updateQueue !== null) {
      processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
      instance.state = workInProgress.memoizedState;
    }
  }

  if (typeof instance.componentDidMount === 'function') {
    workInProgress.effectTag |= Update;
  }
}

function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
  var instance = workInProgress.stateNode;

  var oldProps = workInProgress.memoizedProps;
  instance.props = oldProps;

  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = void 0;
  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';

  // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();

  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    newState = workInProgress.memoizedState;
  }
  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.effectTag |= Update;
    }
    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
      startPhaseTimer(workInProgress, 'componentWillMount');
      if (typeof instance.componentWillMount === 'function') {
        instance.componentWillMount();
      }
      if (typeof instance.UNSAFE_componentWillMount === 'function') {
        instance.UNSAFE_componentWillMount();
      }
      stopPhaseTimer();
    }
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.effectTag |= Update;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidMount === 'function') {
      workInProgress.effectTag |= Update;
    }

    // If shouldComponentUpdate returned false, we should still update the
    // memoized state to indicate that this work can be reused.
    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  }

  // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.
  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;

  return shouldUpdate;
}

// Invokes the update life-cycles and returns false if it shouldn't rerender.
function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
  var instance = workInProgress.stateNode;

  var oldProps = workInProgress.memoizedProps;
  instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);

  var oldContext = instance.context;
  var contextType = ctor.contextType;
  var nextContext = void 0;
  if (typeof contextType === 'object' && contextType !== null) {
    nextContext = readContext(contextType);
  } else {
    var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
    nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
  }

  var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
  var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function';

  // Note: During these life-cycles, instance.props/instance.state are what
  // ever the previously attempted to render - not the "current". However,
  // during componentDidUpdate we pass the "current" props.

  // In order to support react-lifecycles-compat polyfilled components,
  // Unsafe lifecycles should not be invoked for components using the new APIs.
  if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
    if (oldProps !== newProps || oldContext !== nextContext) {
      callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
    }
  }

  resetHasForceUpdateBeforeProcessing();

  var oldState = workInProgress.memoizedState;
  var newState = instance.state = oldState;
  var updateQueue = workInProgress.updateQueue;
  if (updateQueue !== null) {
    processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
    newState = workInProgress.memoizedState;
  }

  if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Update;
      }
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Snapshot;
      }
    }
    return false;
  }

  if (typeof getDerivedStateFromProps === 'function') {
    applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
    newState = workInProgress.memoizedState;
  }

  var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);

  if (shouldUpdate) {
    // In order to support react-lifecycles-compat polyfilled components,
    // Unsafe lifecycles should not be invoked for components using the new APIs.
    if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
      startPhaseTimer(workInProgress, 'componentWillUpdate');
      if (typeof instance.componentWillUpdate === 'function') {
        instance.componentWillUpdate(newProps, newState, nextContext);
      }
      if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
        instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
      }
      stopPhaseTimer();
    }
    if (typeof instance.componentDidUpdate === 'function') {
      workInProgress.effectTag |= Update;
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      workInProgress.effectTag |= Snapshot;
    }
  } else {
    // If an update was already in progress, we should schedule an Update
    // effect even though we're bailing out, so that cWU/cDU are called.
    if (typeof instance.componentDidUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Update;
      }
    }
    if (typeof instance.getSnapshotBeforeUpdate === 'function') {
      if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
        workInProgress.effectTag |= Snapshot;
      }
    }

    // If shouldComponentUpdate returned false, we should still update the
    // memoized props/state to indicate that this work can be reused.
    workInProgress.memoizedProps = newProps;
    workInProgress.memoizedState = newState;
  }

  // Update the existing instance's state, props, and context pointers even
  // if shouldComponentUpdate returns false.
  instance.props = newProps;
  instance.state = newState;
  instance.context = nextContext;

  return shouldUpdate;
}

var didWarnAboutMaps = void 0;
var didWarnAboutGenerators = void 0;
var didWarnAboutStringRefInStrictMode = void 0;
var ownerHasKeyUseWarning = void 0;
var ownerHasFunctionTypeWarning = void 0;
var warnForMissingKey = function (child) {};

{
  didWarnAboutMaps = false;
  didWarnAboutGenerators = false;
  didWarnAboutStringRefInStrictMode = {};

  /**
   * Warn if there's no key explicitly set on dynamic arrays of children or
   * object keys are not valid. This allows us to keep track of children between
   * updates.
   */
  ownerHasKeyUseWarning = {};
  ownerHasFunctionTypeWarning = {};

  warnForMissingKey = function (child) {
    if (child === null || typeof child !== 'object') {
      return;
    }
    if (!child._store || child._store.validated || child.key != null) {
      return;
    }
    !(typeof child._store === 'object') ? invariant(false, 'React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.') : void 0;
    child._store.validated = true;

    var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
    if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
      return;
    }
    ownerHasKeyUseWarning[currentComponentErrorInfo] = true;

    warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
  };
}

var isArray = Array.isArray;

function coerceRef(returnFiber, current$$1, element) {
  var mixedRef = element.ref;
  if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
    {
      if (returnFiber.mode & StrictMode) {
        var componentName = getComponentName(returnFiber.type) || 'Component';
        if (!didWarnAboutStringRefInStrictMode[componentName]) {
          warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using createRef() instead.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-string-ref', mixedRef, getStackByFiberInDevAndProd(returnFiber));
          didWarnAboutStringRefInStrictMode[componentName] = true;
        }
      }
    }

    if (element._owner) {
      var owner = element._owner;
      var inst = void 0;
      if (owner) {
        var ownerFiber = owner;
        !(ownerFiber.tag === ClassComponent) ? invariant(false, 'Function components cannot have refs. Did you mean to use React.forwardRef()?') : void 0;
        inst = ownerFiber.stateNode;
      }
      !inst ? invariant(false, 'Missing owner for string ref %s. This error is likely caused by a bug in React. Please file an issue.', mixedRef) : void 0;
      var stringRef = '' + mixedRef;
      // Check if previous string ref matches new string ref
      if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) {
        return current$$1.ref;
      }
      var ref = function (value) {
        var refs = inst.refs;
        if (refs === emptyRefsObject) {
          // This is a lazy pooled frozen object, so we need to initialize.
          refs = inst.refs = {};
        }
        if (value === null) {
          delete refs[stringRef];
        } else {
          refs[stringRef] = value;
        }
      };
      ref._stringRef = stringRef;
      return ref;
    } else {
      !(typeof mixedRef === 'string') ? invariant(false, 'Expected ref to be a function, a string, an object returned by React.createRef(), or null.') : void 0;
      !element._owner ? invariant(false, 'Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component\'s render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.', mixedRef) : void 0;
    }
  }
  return mixedRef;
}

function throwOnInvalidObjectType(returnFiber, newChild) {
  if (returnFiber.type !== 'textarea') {
    var addendum = '';
    {
      addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
    }
    invariant(false, 'Objects are not valid as a React child (found: %s).%s', Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild, addendum);
  }
}

function warnOnFunctionType() {
  var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();

  if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
    return;
  }
  ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;

  warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
}

// This wrapper function exists because I expect to clone the code in each path
// to be able to optimize each path individually by branching early. This needs
// a compiler or we can do it manually. Helpers that don't need this branching
// live outside of this function.
function ChildReconciler(shouldTrackSideEffects) {
  function deleteChild(returnFiber, childToDelete) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return;
    }
    // Deletions are added in reversed order so we add it to the front.
    // At this point, the return fiber's effect list is empty except for
    // deletions, so we can just append the deletion to the list. The remaining
    // effects aren't added until the complete phase. Once we implement
    // resuming, this may not be true.
    var last = returnFiber.lastEffect;
    if (last !== null) {
      last.nextEffect = childToDelete;
      returnFiber.lastEffect = childToDelete;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
    }
    childToDelete.nextEffect = null;
    childToDelete.effectTag = Deletion;
  }

  function deleteRemainingChildren(returnFiber, currentFirstChild) {
    if (!shouldTrackSideEffects) {
      // Noop.
      return null;
    }

    // TODO: For the shouldClone case, this could be micro-optimized a bit by
    // assuming that after the first child we've already added everything.
    var childToDelete = currentFirstChild;
    while (childToDelete !== null) {
      deleteChild(returnFiber, childToDelete);
      childToDelete = childToDelete.sibling;
    }
    return null;
  }

  function mapRemainingChildren(returnFiber, currentFirstChild) {
    // Add the remaining children to a temporary map so that we can find them by
    // keys quickly. Implicit (null) keys get added to this set with their index
    var existingChildren = new Map();

    var existingChild = currentFirstChild;
    while (existingChild !== null) {
      if (existingChild.key !== null) {
        existingChildren.set(existingChild.key, existingChild);
      } else {
        existingChildren.set(existingChild.index, existingChild);
      }
      existingChild = existingChild.sibling;
    }
    return existingChildren;
  }

  function useFiber(fiber, pendingProps, expirationTime) {
    // We currently set sibling to null and index to 0 here because it is easy
    // to forget to do before returning it. E.g. for the single child case.
    var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
    clone.index = 0;
    clone.sibling = null;
    return clone;
  }

  function placeChild(newFiber, lastPlacedIndex, newIndex) {
    newFiber.index = newIndex;
    if (!shouldTrackSideEffects) {
      // Noop.
      return lastPlacedIndex;
    }
    var current$$1 = newFiber.alternate;
    if (current$$1 !== null) {
      var oldIndex = current$$1.index;
      if (oldIndex < lastPlacedIndex) {
        // This is a move.
        newFiber.effectTag = Placement;
        return lastPlacedIndex;
      } else {
        // This item can stay in place.
        return oldIndex;
      }
    } else {
      // This is an insertion.
      newFiber.effectTag = Placement;
      return lastPlacedIndex;
    }
  }

  function placeSingleChild(newFiber) {
    // This is simpler for the single child case. We only need to do a
    // placement for inserting new children.
    if (shouldTrackSideEffects && newFiber.alternate === null) {
      newFiber.effectTag = Placement;
    }
    return newFiber;
  }

  function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {
    if (current$$1 === null || current$$1.tag !== HostText) {
      // Insert
      var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current$$1, textContent, expirationTime);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateElement(returnFiber, current$$1, element, expirationTime) {
    if (current$$1 !== null && current$$1.elementType === element.type) {
      // Move based on index
      var existing = useFiber(current$$1, element.props, expirationTime);
      existing.ref = coerceRef(returnFiber, current$$1, element);
      existing.return = returnFiber;
      {
        existing._debugSource = element._source;
        existing._debugOwner = element._owner;
      }
      return existing;
    } else {
      // Insert
      var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
      created.ref = coerceRef(returnFiber, current$$1, element);
      created.return = returnFiber;
      return created;
    }
  }

  function updatePortal(returnFiber, current$$1, portal, expirationTime) {
    if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {
      // Insert
      var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current$$1, portal.children || [], expirationTime);
      existing.return = returnFiber;
      return existing;
    }
  }

  function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {
    if (current$$1 === null || current$$1.tag !== Fragment) {
      // Insert
      var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
      created.return = returnFiber;
      return created;
    } else {
      // Update
      var existing = useFiber(current$$1, fragment, expirationTime);
      existing.return = returnFiber;
      return existing;
    }
  }

  function createChild(returnFiber, newChild, expirationTime) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
      created.return = returnFiber;
      return created;
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
            _created.ref = coerceRef(returnFiber, null, newChild);
            _created.return = returnFiber;
            return _created;
          }
        case REACT_PORTAL_TYPE:
          {
            var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
            _created2.return = returnFiber;
            return _created2;
          }
      }

      if (isArray(newChild) || getIteratorFn(newChild)) {
        var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
        _created3.return = returnFiber;
        return _created3;
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }

    return null;
  }

  function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
    // Update the fiber if the keys match, otherwise return null.

    var key = oldFiber !== null ? oldFiber.key : null;

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys. If the previous node is implicitly keyed
      // we can continue to replace it without aborting even if it is not a text
      // node.
      if (key !== null) {
        return null;
      }
      return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            if (newChild.key === key) {
              if (newChild.type === REACT_FRAGMENT_TYPE) {
                return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
              }
              return updateElement(returnFiber, oldFiber, newChild, expirationTime);
            } else {
              return null;
            }
          }
        case REACT_PORTAL_TYPE:
          {
            if (newChild.key === key) {
              return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
            } else {
              return null;
            }
          }
      }

      if (isArray(newChild) || getIteratorFn(newChild)) {
        if (key !== null) {
          return null;
        }

        return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }

    return null;
  }

  function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
    if (typeof newChild === 'string' || typeof newChild === 'number') {
      // Text nodes don't have keys, so we neither have to check the old nor
      // new node for the key. If both are text nodes, they match.
      var matchedFiber = existingChildren.get(newIdx) || null;
      return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
    }

    if (typeof newChild === 'object' && newChild !== null) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          {
            var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
            if (newChild.type === REACT_FRAGMENT_TYPE) {
              return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
            }
            return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
          }
        case REACT_PORTAL_TYPE:
          {
            var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
            return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
          }
      }

      if (isArray(newChild) || getIteratorFn(newChild)) {
        var _matchedFiber3 = existingChildren.get(newIdx) || null;
        return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
      }

      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }

    return null;
  }

  /**
   * Warns if there is a duplicate or missing key
   */
  function warnOnInvalidKey(child, knownKeys) {
    {
      if (typeof child !== 'object' || child === null) {
        return knownKeys;
      }
      switch (child.$$typeof) {
        case REACT_ELEMENT_TYPE:
        case REACT_PORTAL_TYPE:
          warnForMissingKey(child);
          var key = child.key;
          if (typeof key !== 'string') {
            break;
          }
          if (knownKeys === null) {
            knownKeys = new Set();
            knownKeys.add(key);
            break;
          }
          if (!knownKeys.has(key)) {
            knownKeys.add(key);
            break;
          }
          warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
          break;
        default:
          break;
      }
    }
    return knownKeys;
  }

  function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
    // This algorithm can't optimize by searching from both ends since we
    // don't have backpointers on fibers. I'm trying to see how far we can get
    // with that model. If it ends up not being worth the tradeoffs, we can
    // add it later.

    // Even with a two ended optimization, we'd want to optimize for the case
    // where there are few changes and brute force the comparison instead of
    // going for the Map. It'd like to explore hitting that path first in
    // forward-only mode and only go for the Map once we notice that we need
    // lots of look ahead. This doesn't handle reversal as well as two ended
    // search but that's unusual. Besides, for the two ended optimization to
    // work on Iterables, we'd need to copy the whole set.

    // In this first iteration, we'll just live with hitting the bad case
    // (adding everything to a Map) in for every insert/move.

    // If you change this code, also update reconcileChildrenIterator() which
    // uses the same algorithm.

    {
      // First, validate keys.
      var knownKeys = null;
      for (var i = 0; i < newChildren.length; i++) {
        var child = newChildren[i];
        knownKeys = warnOnInvalidKey(child, knownKeys);
      }
    }

    var resultingFirstChild = null;
    var previousNewFiber = null;

    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;
    for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }
      var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (oldFiber === null) {
          oldFiber = nextOldFiber;
        }
        break;
      }
      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }
      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }
      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (newIdx === newChildren.length) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; newIdx < newChildren.length; newIdx++) {
        var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
        if (!_newFiber) {
          continue;
        }
        lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber;
        } else {
          previousNewFiber.sibling = _newFiber;
        }
        previousNewFiber = _newFiber;
      }
      return resultingFirstChild;
    }

    // Add all children to a key map for quick lookups.
    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);

    // Keep scanning and use the map to restore deleted items as moves.
    for (; newIdx < newChildren.length; newIdx++) {
      var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
      if (_newFiber2) {
        if (shouldTrackSideEffects) {
          if (_newFiber2.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
          }
        }
        lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber2;
        } else {
          previousNewFiber.sibling = _newFiber2;
        }
        previousNewFiber = _newFiber2;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
    // This is the same implementation as reconcileChildrenArray(),
    // but using the iterator instead.

    var iteratorFn = getIteratorFn(newChildrenIterable);
    !(typeof iteratorFn === 'function') ? invariant(false, 'An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.') : void 0;

    {
      // We don't support rendering Generators because it's a mutation.
      // See https://github.com/facebook/react/issues/12995
      if (typeof Symbol === 'function' &&
      // $FlowFixMe Flow doesn't know about toStringTag
      newChildrenIterable[Symbol.toStringTag] === 'Generator') {
        !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;
        didWarnAboutGenerators = true;
      }

      // Warn about using Maps as children
      if (newChildrenIterable.entries === iteratorFn) {
        !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
        didWarnAboutMaps = true;
      }

      // First, validate keys.
      // We'll get a different iterator later for the main pass.
      var _newChildren = iteratorFn.call(newChildrenIterable);
      if (_newChildren) {
        var knownKeys = null;
        var _step = _newChildren.next();
        for (; !_step.done; _step = _newChildren.next()) {
          var child = _step.value;
          knownKeys = warnOnInvalidKey(child, knownKeys);
        }
      }
    }

    var newChildren = iteratorFn.call(newChildrenIterable);
    !(newChildren != null) ? invariant(false, 'An iterable object provided no iterator.') : void 0;

    var resultingFirstChild = null;
    var previousNewFiber = null;

    var oldFiber = currentFirstChild;
    var lastPlacedIndex = 0;
    var newIdx = 0;
    var nextOldFiber = null;

    var step = newChildren.next();
    for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
      if (oldFiber.index > newIdx) {
        nextOldFiber = oldFiber;
        oldFiber = null;
      } else {
        nextOldFiber = oldFiber.sibling;
      }
      var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
      if (newFiber === null) {
        // TODO: This breaks on empty slots like null children. That's
        // unfortunate because it triggers the slow path all the time. We need
        // a better way to communicate whether this was a miss or null,
        // boolean, undefined, etc.
        if (!oldFiber) {
          oldFiber = nextOldFiber;
        }
        break;
      }
      if (shouldTrackSideEffects) {
        if (oldFiber && newFiber.alternate === null) {
          // We matched the slot, but we didn't reuse the existing fiber, so we
          // need to delete the existing child.
          deleteChild(returnFiber, oldFiber);
        }
      }
      lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
      if (previousNewFiber === null) {
        // TODO: Move out of the loop. This only happens for the first run.
        resultingFirstChild = newFiber;
      } else {
        // TODO: Defer siblings if we're not at the right index for this slot.
        // I.e. if we had null values before, then we want to defer this
        // for each null value. However, we also don't want to call updateSlot
        // with the previous one.
        previousNewFiber.sibling = newFiber;
      }
      previousNewFiber = newFiber;
      oldFiber = nextOldFiber;
    }

    if (step.done) {
      // We've reached the end of the new children. We can delete the rest.
      deleteRemainingChildren(returnFiber, oldFiber);
      return resultingFirstChild;
    }

    if (oldFiber === null) {
      // If we don't have any more existing children we can choose a fast path
      // since the rest will all be insertions.
      for (; !step.done; newIdx++, step = newChildren.next()) {
        var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
        if (_newFiber3 === null) {
          continue;
        }
        lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          // TODO: Move out of the loop. This only happens for the first run.
          resultingFirstChild = _newFiber3;
        } else {
          previousNewFiber.sibling = _newFiber3;
        }
        previousNewFiber = _newFiber3;
      }
      return resultingFirstChild;
    }

    // Add all children to a key map for quick lookups.
    var existingChildren = mapRemainingChildren(returnFiber, oldFiber);

    // Keep scanning and use the map to restore deleted items as moves.
    for (; !step.done; newIdx++, step = newChildren.next()) {
      var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
      if (_newFiber4 !== null) {
        if (shouldTrackSideEffects) {
          if (_newFiber4.alternate !== null) {
            // The new fiber is a work in progress, but if there exists a
            // current, that means that we reused the fiber. We need to delete
            // it from the child list so that we don't add it to the deletion
            // list.
            existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
          }
        }
        lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
        if (previousNewFiber === null) {
          resultingFirstChild = _newFiber4;
        } else {
          previousNewFiber.sibling = _newFiber4;
        }
        previousNewFiber = _newFiber4;
      }
    }

    if (shouldTrackSideEffects) {
      // Any existing children that weren't consumed above were deleted. We need
      // to add them to the deletion list.
      existingChildren.forEach(function (child) {
        return deleteChild(returnFiber, child);
      });
    }

    return resultingFirstChild;
  }

  function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
    // There's no need to check for keys on text nodes since we don't have a
    // way to define them.
    if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
      // We already have an existing node so let's just update it and delete
      // the rest.
      deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
      var existing = useFiber(currentFirstChild, textContent, expirationTime);
      existing.return = returnFiber;
      return existing;
    }
    // The existing first child is not a text node so we need to create one
    // and delete the existing ones.
    deleteRemainingChildren(returnFiber, currentFirstChild);
    var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
    created.return = returnFiber;
    return created;
  }

  function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
    var key = element.key;
    var child = currentFirstChild;
    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type) {
          deleteRemainingChildren(returnFiber, child.sibling);
          var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
          existing.ref = coerceRef(returnFiber, child, element);
          existing.return = returnFiber;
          {
            existing._debugSource = element._source;
            existing._debugOwner = element._owner;
          }
          return existing;
        } else {
          deleteRemainingChildren(returnFiber, child);
          break;
        }
      } else {
        deleteChild(returnFiber, child);
      }
      child = child.sibling;
    }

    if (element.type === REACT_FRAGMENT_TYPE) {
      var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
      created.return = returnFiber;
      return created;
    } else {
      var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
      _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
      _created4.return = returnFiber;
      return _created4;
    }
  }

  function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
    var key = portal.key;
    var child = currentFirstChild;
    while (child !== null) {
      // TODO: If key === null and child.key === null, then this only applies to
      // the first item in the list.
      if (child.key === key) {
        if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
          deleteRemainingChildren(returnFiber, child.sibling);
          var existing = useFiber(child, portal.children || [], expirationTime);
          existing.return = returnFiber;
          return existing;
        } else {
          deleteRemainingChildren(returnFiber, child);
          break;
        }
      } else {
        deleteChild(returnFiber, child);
      }
      child = child.sibling;
    }

    var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
    created.return = returnFiber;
    return created;
  }

  // This API will tag the children with the side-effect of the reconciliation
  // itself. They will be added to the side-effect list as we pass through the
  // children and the parent.
  function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
    // This function is not recursive.
    // If the top level item is an array, we treat it as a set of children,
    // not as a fragment. Nested arrays on the other hand will be treated as
    // fragment nodes. Recursion happens at the normal flow.

    // Handle top level unkeyed fragments as if they were arrays.
    // This leads to an ambiguity between <>{[...]}</> and <>...</>.
    // We treat the ambiguous cases above the same.
    var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
    if (isUnkeyedTopLevelFragment) {
      newChild = newChild.props.children;
    }

    // Handle object types
    var isObject = typeof newChild === 'object' && newChild !== null;

    if (isObject) {
      switch (newChild.$$typeof) {
        case REACT_ELEMENT_TYPE:
          return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
        case REACT_PORTAL_TYPE:
          return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
      }
    }

    if (typeof newChild === 'string' || typeof newChild === 'number') {
      return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
    }

    if (isArray(newChild)) {
      return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
    }

    if (getIteratorFn(newChild)) {
      return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
    }

    if (isObject) {
      throwOnInvalidObjectType(returnFiber, newChild);
    }

    {
      if (typeof newChild === 'function') {
        warnOnFunctionType();
      }
    }
    if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
      // If the new child is undefined, and the return fiber is a composite
      // component, throw an error. If Fiber return types are disabled,
      // we already threw above.
      switch (returnFiber.tag) {
        case ClassComponent:
          {
            {
              var instance = returnFiber.stateNode;
              if (instance.render._isMockFunction) {
                // We allow auto-mocks to proceed as if they're returning null.
                break;
              }
            }
          }
        // Intentionally fall through to the next case, which handles both
        // functions and classes
        // eslint-disable-next-lined no-fallthrough
        case FunctionComponent:
          {
            var Component = returnFiber.type;
            invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');
          }
      }
    }

    // Remaining cases are all treated as empty.
    return deleteRemainingChildren(returnFiber, currentFirstChild);
  }

  return reconcileChildFibers;
}

var reconcileChildFibers = ChildReconciler(true);
var mountChildFibers = ChildReconciler(false);

function cloneChildFibers(current$$1, workInProgress) {
  !(current$$1 === null || workInProgress.child === current$$1.child) ? invariant(false, 'Resuming work not yet implemented.') : void 0;

  if (workInProgress.child === null) {
    return;
  }

  var currentChild = workInProgress.child;
  var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
  workInProgress.child = newChild;

  newChild.return = workInProgress;
  while (currentChild.sibling !== null) {
    currentChild = currentChild.sibling;
    newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
    newChild.return = workInProgress;
  }
  newChild.sibling = null;
}

var NO_CONTEXT = {};

var contextStackCursor$1 = createCursor(NO_CONTEXT);
var contextFiberStackCursor = createCursor(NO_CONTEXT);
var rootInstanceStackCursor = createCursor(NO_CONTEXT);

function requiredContext(c) {
  !(c !== NO_CONTEXT) ? invariant(false, 'Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  return c;
}

function getRootHostContainer() {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  return rootInstance;
}

function pushHostContainer(fiber, nextRootInstance) {
  // Push current root instance onto the stack;
  // This allows us to reset root when portals are popped.
  push(rootInstanceStackCursor, nextRootInstance, fiber);
  // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.
  push(contextFiberStackCursor, fiber, fiber);

  // Finally, we need to push the host context to the stack.
  // However, we can't just call getRootHostContext() and push it because
  // we'd have a different number of entries on the stack depending on
  // whether getRootHostContext() throws somewhere in renderer code or not.
  // So we push an empty value first. This lets us safely unwind on errors.
  push(contextStackCursor$1, NO_CONTEXT, fiber);
  var nextRootContext = getRootHostContext(nextRootInstance);
  // Now that we know this function doesn't throw, replace it.
  pop(contextStackCursor$1, fiber);
  push(contextStackCursor$1, nextRootContext, fiber);
}

function popHostContainer(fiber) {
  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
  pop(rootInstanceStackCursor, fiber);
}

function getHostContext() {
  var context = requiredContext(contextStackCursor$1.current);
  return context;
}

function pushHostContext(fiber) {
  var rootInstance = requiredContext(rootInstanceStackCursor.current);
  var context = requiredContext(contextStackCursor$1.current);
  var nextContext = getChildHostContext(context, fiber.type, rootInstance);

  // Don't push this Fiber's context unless it's unique.
  if (context === nextContext) {
    return;
  }

  // Track the context and the Fiber that provided it.
  // This enables us to pop only Fibers that provide unique contexts.
  push(contextFiberStackCursor, fiber, fiber);
  push(contextStackCursor$1, nextContext, fiber);
}

function popHostContext(fiber) {
  // Do not pop unless this Fiber provided the current context.
  // pushHostContext() only pushes Fibers that provide unique contexts.
  if (contextFiberStackCursor.current !== fiber) {
    return;
  }

  pop(contextStackCursor$1, fiber);
  pop(contextFiberStackCursor, fiber);
}

var NoEffect$1 = /*             */0;
var UnmountSnapshot = /*      */2;
var UnmountMutation = /*      */4;
var MountMutation = /*        */8;
var UnmountLayout = /*        */16;
var MountLayout = /*          */32;
var MountPassive = /*         */64;
var UnmountPassive = /*       */128;

var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;


var didWarnAboutMismatchedHooksForComponent = void 0;
{
  didWarnAboutMismatchedHooksForComponent = new Set();
}

// These are set right before calling the component.
var renderExpirationTime = NoWork;
// The work-in-progress fiber. I've named it differently to distinguish it from
// the work-in-progress hook.
var currentlyRenderingFiber$1 = null;

// Hooks are stored as a linked list on the fiber's memoizedState field. The
// current hook list is the list that belongs to the current fiber. The
// work-in-progress hook list is a new list that will be added to the
// work-in-progress fiber.
var currentHook = null;
var nextCurrentHook = null;
var firstWorkInProgressHook = null;
var workInProgressHook = null;
var nextWorkInProgressHook = null;

var remainingExpirationTime = NoWork;
var componentUpdateQueue = null;
var sideEffectTag = 0;

// Updates scheduled during render will trigger an immediate re-render at the
// end of the current pass. We can't store these updates on the normal queue,
// because if the work is aborted, they should be discarded. Because this is
// a relatively rare case, we also don't want to add an additional field to
// either the hook or queue object types. So we store them in a lazily create
// map of queue -> render-phase updates, which are discarded once the component
// completes without re-rendering.

// Whether an update was scheduled during the currently executing render pass.
var didScheduleRenderPhaseUpdate = false;
// Lazily created map of render-phase updates
var renderPhaseUpdates = null;
// Counter to prevent infinite loops.
var numberOfReRenders = 0;
var RE_RENDER_LIMIT = 25;

// In DEV, this is the name of the currently executing primitive hook
var currentHookNameInDev = null;

// In DEV, this list ensures that hooks are called in the same order between renders.
// The list stores the order of hooks used during the initial render (mount).
// Subsequent renders (updates) reference this list.
var hookTypesDev = null;
var hookTypesUpdateIndexDev = -1;

function mountHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev === null) {
      hookTypesDev = [hookName];
    } else {
      hookTypesDev.push(hookName);
    }
  }
}

function updateHookTypesDev() {
  {
    var hookName = currentHookNameInDev;

    if (hookTypesDev !== null) {
      hookTypesUpdateIndexDev++;
      if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
        warnOnHookMismatchInDev(hookName);
      }
    }
  }
}

function warnOnHookMismatchInDev(currentHookName) {
  {
    var componentName = getComponentName(currentlyRenderingFiber$1.type);
    if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
      didWarnAboutMismatchedHooksForComponent.add(componentName);

      if (hookTypesDev !== null) {
        var table = '';

        var secondColumnStart = 30;

        for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
          var oldHookName = hookTypesDev[i];
          var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;

          var row = i + 1 + '. ' + oldHookName;

          // Extra space so second column lines up
          // lol @ IE not supporting String#repeat
          while (row.length < secondColumnStart) {
            row += ' ';
          }

          row += newHookName + '\n';

          table += row;
        }

        warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + '   Previous render            Next render\n' + '   ------------------------------------------------------\n' + '%s' + '   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
      }
    }
  }
}

function throwInvalidHookError() {
  invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.');
}

function areHookInputsEqual(nextDeps, prevDeps) {
  if (prevDeps === null) {
    {
      warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
    }
    return false;
  }

  {
    // Don't bother comparing lengths in prod because these arrays should be
    // passed inline.
    if (nextDeps.length !== prevDeps.length) {
      warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, '[' + nextDeps.join(', ') + ']', '[' + prevDeps.join(', ') + ']');
    }
  }
  for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
    if (is(nextDeps[i], prevDeps[i])) {
      continue;
    }
    return false;
  }
  return true;
}

function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
  renderExpirationTime = nextRenderExpirationTime;
  currentlyRenderingFiber$1 = workInProgress;
  nextCurrentHook = current !== null ? current.memoizedState : null;

  {
    hookTypesDev = current !== null ? current._debugHookTypes : null;
    hookTypesUpdateIndexDev = -1;
  }

  // The following should have already been reset
  // currentHook = null;
  // workInProgressHook = null;

  // remainingExpirationTime = NoWork;
  // componentUpdateQueue = null;

  // didScheduleRenderPhaseUpdate = false;
  // renderPhaseUpdates = null;
  // numberOfReRenders = 0;
  // sideEffectTag = 0;

  // TODO Warn if no hooks are used at all during mount, then some are used during update.
  // Currently we will identify the update render as a mount because nextCurrentHook === null.
  // This is tricky because it's valid for certain types of components (e.g. React.lazy)

  // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
  // Non-stateful hooks (e.g. context) don't get added to memoizedState,
  // so nextCurrentHook would be null during updates and mounts.
  {
    if (nextCurrentHook !== null) {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
    } else if (hookTypesDev !== null) {
      // This dispatcher handles an edge case where a component is updating,
      // but no stateful hooks have been used.
      // We want to match the production code behavior (which will use HooksDispatcherOnMount),
      // but with the extra DEV validation to ensure hooks ordering hasn't changed.
      // This dispatcher does that.
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
    } else {
      ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
    }
  }

  var children = Component(props, refOrContext);

  if (didScheduleRenderPhaseUpdate) {
    do {
      didScheduleRenderPhaseUpdate = false;
      numberOfReRenders += 1;

      // Start over from the beginning of the list
      nextCurrentHook = current !== null ? current.memoizedState : null;
      nextWorkInProgressHook = firstWorkInProgressHook;

      currentHook = null;
      workInProgressHook = null;
      componentUpdateQueue = null;

      {
        // Also validate hook order for cascading updates.
        hookTypesUpdateIndexDev = -1;
      }

      ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;

      children = Component(props, refOrContext);
    } while (didScheduleRenderPhaseUpdate);

    renderPhaseUpdates = null;
    numberOfReRenders = 0;
  }

  // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  var renderedWork = currentlyRenderingFiber$1;

  renderedWork.memoizedState = firstWorkInProgressHook;
  renderedWork.expirationTime = remainingExpirationTime;
  renderedWork.updateQueue = componentUpdateQueue;
  renderedWork.effectTag |= sideEffectTag;

  {
    renderedWork._debugHookTypes = hookTypesDev;
  }

  // This check uses currentHook so that it works the same in DEV and prod bundles.
  // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
  var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;

  renderExpirationTime = NoWork;
  currentlyRenderingFiber$1 = null;

  currentHook = null;
  nextCurrentHook = null;
  firstWorkInProgressHook = null;
  workInProgressHook = null;
  nextWorkInProgressHook = null;

  {
    currentHookNameInDev = null;
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;
  }

  remainingExpirationTime = NoWork;
  componentUpdateQueue = null;
  sideEffectTag = 0;

  // These were reset above
  // didScheduleRenderPhaseUpdate = false;
  // renderPhaseUpdates = null;
  // numberOfReRenders = 0;

  !!didRenderTooFewHooks ? invariant(false, 'Rendered fewer hooks than expected. This may be caused by an accidental early return statement.') : void 0;

  return children;
}

function bailoutHooks(current, workInProgress, expirationTime) {
  workInProgress.updateQueue = current.updateQueue;
  workInProgress.effectTag &= ~(Passive | Update);
  if (current.expirationTime <= expirationTime) {
    current.expirationTime = NoWork;
  }
}

function resetHooks() {
  // We can assume the previous dispatcher is always this one, since we set it
  // at the beginning of the render phase and there's no re-entrancy.
  ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;

  // This is used to reset the state of this module when a component throws.
  // It's also called inside mountIndeterminateComponent if we determine the
  // component is a module-style component.
  renderExpirationTime = NoWork;
  currentlyRenderingFiber$1 = null;

  currentHook = null;
  nextCurrentHook = null;
  firstWorkInProgressHook = null;
  workInProgressHook = null;
  nextWorkInProgressHook = null;

  {
    hookTypesDev = null;
    hookTypesUpdateIndexDev = -1;

    currentHookNameInDev = null;
  }

  remainingExpirationTime = NoWork;
  componentUpdateQueue = null;
  sideEffectTag = 0;

  didScheduleRenderPhaseUpdate = false;
  renderPhaseUpdates = null;
  numberOfReRenders = 0;
}

function mountWorkInProgressHook() {
  var hook = {
    memoizedState: null,

    baseState: null,
    queue: null,
    baseUpdate: null,

    next: null
  };

  if (workInProgressHook === null) {
    // This is the first hook in the list
    firstWorkInProgressHook = workInProgressHook = hook;
  } else {
    // Append to the end of the list
    workInProgressHook = workInProgressHook.next = hook;
  }
  return workInProgressHook;
}

function updateWorkInProgressHook() {
  // This function is used both for updates and for re-renders triggered by a
  // render phase update. It assumes there is either a current hook we can
  // clone, or a work-in-progress hook from a previous render pass that we can
  // use as a base. When we reach the end of the base list, we must switch to
  // the dispatcher used for mounts.
  if (nextWorkInProgressHook !== null) {
    // There's already a work-in-progress. Reuse it.
    workInProgressHook = nextWorkInProgressHook;
    nextWorkInProgressHook = workInProgressHook.next;

    currentHook = nextCurrentHook;
    nextCurrentHook = currentHook !== null ? currentHook.next : null;
  } else {
    // Clone from the current hook.
    !(nextCurrentHook !== null) ? invariant(false, 'Rendered more hooks than during the previous render.') : void 0;
    currentHook = nextCurrentHook;

    var newHook = {
      memoizedState: currentHook.memoizedState,

      baseState: currentHook.baseState,
      queue: currentHook.queue,
      baseUpdate: currentHook.baseUpdate,

      next: null
    };

    if (workInProgressHook === null) {
      // This is the first hook in the list.
      workInProgressHook = firstWorkInProgressHook = newHook;
    } else {
      // Append to the end of the list.
      workInProgressHook = workInProgressHook.next = newHook;
    }
    nextCurrentHook = currentHook.next;
  }
  return workInProgressHook;
}

function createFunctionComponentUpdateQueue() {
  return {
    lastEffect: null
  };
}

function basicStateReducer(state, action) {
  return typeof action === 'function' ? action(state) : action;
}

function mountReducer(reducer, initialArg, init) {
  var hook = mountWorkInProgressHook();
  var initialState = void 0;
  if (init !== undefined) {
    initialState = init(initialArg);
  } else {
    initialState = initialArg;
  }
  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    last: null,
    dispatch: null,
    lastRenderedReducer: reducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null,
  // Flow doesn't know this is non-null, but we do.
  currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateReducer(reducer, initialArg, init) {
  var hook = updateWorkInProgressHook();
  var queue = hook.queue;
  !(queue !== null) ? invariant(false, 'Should have a queue. This is likely a bug in React. Please file an issue.') : void 0;

  queue.lastRenderedReducer = reducer;

  if (numberOfReRenders > 0) {
    // This is a re-render. Apply the new render phase updates to the previous
    var _dispatch = queue.dispatch;
    if (renderPhaseUpdates !== null) {
      // Render phase updates are stored in a map of queue -> linked list
      var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
      if (firstRenderPhaseUpdate !== undefined) {
        renderPhaseUpdates.delete(queue);
        var newState = hook.memoizedState;
        var update = firstRenderPhaseUpdate;
        do {
          // Process this render phase update. We don't have to check the
          // priority because it will always be the same as the current
          // render's.
          var _action = update.action;
          newState = reducer(newState, _action);
          update = update.next;
        } while (update !== null);

        // Mark that the fiber performed work, but only if the new state is
        // different from the current state.
        if (!is(newState, hook.memoizedState)) {
          markWorkInProgressReceivedUpdate();
        }

        hook.memoizedState = newState;
        // Don't persist the state accumlated from the render phase updates to
        // the base state unless the queue is empty.
        // TODO: Not sure if this is the desired semantics, but it's what we
        // do for gDSFP. I can't remember why.
        if (hook.baseUpdate === queue.last) {
          hook.baseState = newState;
        }

        queue.lastRenderedState = newState;

        return [newState, _dispatch];
      }
    }
    return [hook.memoizedState, _dispatch];
  }

  // The last update in the entire queue
  var last = queue.last;
  // The last update that is part of the base state.
  var baseUpdate = hook.baseUpdate;
  var baseState = hook.baseState;

  // Find the first unprocessed update.
  var first = void 0;
  if (baseUpdate !== null) {
    if (last !== null) {
      // For the first update, the queue is a circular linked list where
      // `queue.last.next = queue.first`. Once the first update commits, and
      // the `baseUpdate` is no longer empty, we can unravel the list.
      last.next = null;
    }
    first = baseUpdate.next;
  } else {
    first = last !== null ? last.next : null;
  }
  if (first !== null) {
    var _newState = baseState;
    var newBaseState = null;
    var newBaseUpdate = null;
    var prevUpdate = baseUpdate;
    var _update = first;
    var didSkip = false;
    do {
      var updateExpirationTime = _update.expirationTime;
      if (updateExpirationTime < renderExpirationTime) {
        // Priority is insufficient. Skip this update. If this is the first
        // skipped update, the previous update/state is the new base
        // update/state.
        if (!didSkip) {
          didSkip = true;
          newBaseUpdate = prevUpdate;
          newBaseState = _newState;
        }
        // Update the remaining priority in the queue.
        if (updateExpirationTime > remainingExpirationTime) {
          remainingExpirationTime = updateExpirationTime;
        }
      } else {
        // Process this update.
        if (_update.eagerReducer === reducer) {
          // If this update was processed eagerly, and its reducer matches the
          // current reducer, we can use the eagerly computed state.
          _newState = _update.eagerState;
        } else {
          var _action2 = _update.action;
          _newState = reducer(_newState, _action2);
        }
      }
      prevUpdate = _update;
      _update = _update.next;
    } while (_update !== null && _update !== first);

    if (!didSkip) {
      newBaseUpdate = prevUpdate;
      newBaseState = _newState;
    }

    // Mark that the fiber performed work, but only if the new state is
    // different from the current state.
    if (!is(_newState, hook.memoizedState)) {
      markWorkInProgressReceivedUpdate();
    }

    hook.memoizedState = _newState;
    hook.baseUpdate = newBaseUpdate;
    hook.baseState = newBaseState;

    queue.lastRenderedState = _newState;
  }

  var dispatch = queue.dispatch;
  return [hook.memoizedState, dispatch];
}

function mountState(initialState) {
  var hook = mountWorkInProgressHook();
  if (typeof initialState === 'function') {
    initialState = initialState();
  }
  hook.memoizedState = hook.baseState = initialState;
  var queue = hook.queue = {
    last: null,
    dispatch: null,
    lastRenderedReducer: basicStateReducer,
    lastRenderedState: initialState
  };
  var dispatch = queue.dispatch = dispatchAction.bind(null,
  // Flow doesn't know this is non-null, but we do.
  currentlyRenderingFiber$1, queue);
  return [hook.memoizedState, dispatch];
}

function updateState(initialState) {
  return updateReducer(basicStateReducer, initialState);
}

function pushEffect(tag, create, destroy, deps) {
  var effect = {
    tag: tag,
    create: create,
    destroy: destroy,
    deps: deps,
    // Circular
    next: null
  };
  if (componentUpdateQueue === null) {
    componentUpdateQueue = createFunctionComponentUpdateQueue();
    componentUpdateQueue.lastEffect = effect.next = effect;
  } else {
    var _lastEffect = componentUpdateQueue.lastEffect;
    if (_lastEffect === null) {
      componentUpdateQueue.lastEffect = effect.next = effect;
    } else {
      var firstEffect = _lastEffect.next;
      _lastEffect.next = effect;
      effect.next = firstEffect;
      componentUpdateQueue.lastEffect = effect;
    }
  }
  return effect;
}

function mountRef(initialValue) {
  var hook = mountWorkInProgressHook();
  var ref = { current: initialValue };
  {
    Object.seal(ref);
  }
  hook.memoizedState = ref;
  return ref;
}

function updateRef(initialValue) {
  var hook = updateWorkInProgressHook();
  return hook.memoizedState;
}

function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  sideEffectTag |= fiberEffectTag;
  hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps);
}

function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var destroy = undefined;

  if (currentHook !== null) {
    var prevEffect = currentHook.memoizedState;
    destroy = prevEffect.destroy;
    if (nextDeps !== null) {
      var prevDeps = prevEffect.deps;
      if (areHookInputsEqual(nextDeps, prevDeps)) {
        pushEffect(NoEffect$1, create, destroy, nextDeps);
        return;
      }
    }
  }

  sideEffectTag |= fiberEffectTag;
  hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps);
}

function mountEffect(create, deps) {
  return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
}

function updateEffect(create, deps) {
  return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
}

function mountLayoutEffect(create, deps) {
  return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
}

function updateLayoutEffect(create, deps) {
  return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
}

function imperativeHandleEffect(create, ref) {
  if (typeof ref === 'function') {
    var refCallback = ref;
    var _inst = create();
    refCallback(_inst);
    return function () {
      refCallback(null);
    };
  } else if (ref !== null && ref !== undefined) {
    var refObject = ref;
    {
      !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0;
    }
    var _inst2 = create();
    refObject.current = _inst2;
    return function () {
      refObject.current = null;
    };
  }
}

function mountImperativeHandle(ref, create, deps) {
  {
    !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
  }

  // TODO: If deps are provided, should we skip comparing the ref itself?
  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;

  return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function updateImperativeHandle(ref, create, deps) {
  {
    !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
  }

  // TODO: If deps are provided, should we skip comparing the ref itself?
  var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;

  return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
}

function mountDebugValue(value, formatterFn) {
  // This hook is normally a no-op.
  // The react-debug-hooks package injects its own implementation
  // so that e.g. DevTools can display custom hook values.
}

var updateDebugValue = mountDebugValue;

function mountCallback(callback, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function updateCallback(callback, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;
  if (prevState !== null) {
    if (nextDeps !== null) {
      var prevDeps = prevState[1];
      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }
  hook.memoizedState = [callback, nextDeps];
  return callback;
}

function mountMemo(nextCreate, deps) {
  var hook = mountWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

function updateMemo(nextCreate, deps) {
  var hook = updateWorkInProgressHook();
  var nextDeps = deps === undefined ? null : deps;
  var prevState = hook.memoizedState;
  if (prevState !== null) {
    // Assume these are defined. If they're not, areHookInputsEqual will warn.
    if (nextDeps !== null) {
      var prevDeps = prevState[1];
      if (areHookInputsEqual(nextDeps, prevDeps)) {
        return prevState[0];
      }
    }
  }
  var nextValue = nextCreate();
  hook.memoizedState = [nextValue, nextDeps];
  return nextValue;
}

// in a test-like environment, we want to warn if dispatchAction()
// is called outside of a batchedUpdates/TestUtils.act(...) call.
var shouldWarnForUnbatchedSetState = false;

{
  // jest isn't a 'global', it's just exposed to tests via a wrapped function
  // further, this isn't a test file, so flow doesn't recognize the symbol. So...
  // $FlowExpectedError - because requirements don't give a damn about your type sigs.
  if ('undefined' !== typeof jest) {
    shouldWarnForUnbatchedSetState = true;
  }
}

function dispatchAction(fiber, queue, action) {
  !(numberOfReRenders < RE_RENDER_LIMIT) ? invariant(false, 'Too many re-renders. React limits the number of renders to prevent an infinite loop.') : void 0;

  {
    !(arguments.length <= 3) ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0;
  }

  var alternate = fiber.alternate;
  if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
    // This is a render phase update. Stash it in a lazily-created map of
    // queue -> linked list of updates. After this render pass, we'll restart
    // and apply the stashed updates on top of the work-in-progress hook.
    didScheduleRenderPhaseUpdate = true;
    var update = {
      expirationTime: renderExpirationTime,
      action: action,
      eagerReducer: null,
      eagerState: null,
      next: null
    };
    if (renderPhaseUpdates === null) {
      renderPhaseUpdates = new Map();
    }
    var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
    if (firstRenderPhaseUpdate === undefined) {
      renderPhaseUpdates.set(queue, update);
    } else {
      // Append the update to the end of the list.
      var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
      while (lastRenderPhaseUpdate.next !== null) {
        lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
      }
      lastRenderPhaseUpdate.next = update;
    }
  } else {
    flushPassiveEffects();

    var currentTime = requestCurrentTime();
    var _expirationTime = computeExpirationForFiber(currentTime, fiber);

    var _update2 = {
      expirationTime: _expirationTime,
      action: action,
      eagerReducer: null,
      eagerState: null,
      next: null
    };

    // Append the update to the end of the list.
    var _last = queue.last;
    if (_last === null) {
      // This is the first update. Create a circular list.
      _update2.next = _update2;
    } else {
      var first = _last.next;
      if (first !== null) {
        // Still circular.
        _update2.next = first;
      }
      _last.next = _update2;
    }
    queue.last = _update2;

    if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
      // The queue is currently empty, which means we can eagerly compute the
      // next state before entering the render phase. If the new state is the
      // same as the current state, we may be able to bail out entirely.
      var _lastRenderedReducer = queue.lastRenderedReducer;
      if (_lastRenderedReducer !== null) {
        var prevDispatcher = void 0;
        {
          prevDispatcher = ReactCurrentDispatcher$1.current;
          ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
        }
        try {
          var currentState = queue.lastRenderedState;
          var _eagerState = _lastRenderedReducer(currentState, action);
          // Stash the eagerly computed state, and the reducer used to compute
          // it, on the update object. If the reducer hasn't changed by the
          // time we enter the render phase, then the eager state can be used
          // without calling the reducer again.
          _update2.eagerReducer = _lastRenderedReducer;
          _update2.eagerState = _eagerState;
          if (is(_eagerState, currentState)) {
            // Fast path. We can bail out without scheduling React to re-render.
            // It's still possible that we'll need to rebase this update later,
            // if the component re-renders for a different reason and by that
            // time the reducer has changed.
            return;
          }
        } catch (error) {
          // Suppress the error. It will throw again in the render phase.
        } finally {
          {
            ReactCurrentDispatcher$1.current = prevDispatcher;
          }
        }
      }
    }
    {
      if (shouldWarnForUnbatchedSetState === true) {
        warnIfNotCurrentlyBatchingInDev(fiber);
      }
    }
    scheduleWork(fiber, _expirationTime);
  }
}

var ContextOnlyDispatcher = {
  readContext: readContext,

  useCallback: throwInvalidHookError,
  useContext: throwInvalidHookError,
  useEffect: throwInvalidHookError,
  useImperativeHandle: throwInvalidHookError,
  useLayoutEffect: throwInvalidHookError,
  useMemo: throwInvalidHookError,
  useReducer: throwInvalidHookError,
  useRef: throwInvalidHookError,
  useState: throwInvalidHookError,
  useDebugValue: throwInvalidHookError
};

var HooksDispatcherOnMountInDEV = null;
var HooksDispatcherOnMountWithHookTypesInDEV = null;
var HooksDispatcherOnUpdateInDEV = null;
var InvalidNestedHooksDispatcherOnMountInDEV = null;
var InvalidNestedHooksDispatcherOnUpdateInDEV = null;

{
  var warnInvalidContextAccess = function () {
    warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
  };

  var warnInvalidHookAccess = function () {
    warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
  };

  HooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      mountHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      mountHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      mountHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      mountHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      mountHookTypesDev();
      return mountDebugValue(value, formatterFn);
    }
  };

  HooksDispatcherOnMountWithHookTypesInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return mountDebugValue(value, formatterFn);
    }
  };

  HooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      updateHookTypesDev();
      return updateRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      updateHookTypesDev();
      return updateDebugValue(value, formatterFn);
    }
  };

  InvalidNestedHooksDispatcherOnMountInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      mountHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
      try {
        return mountState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      mountHookTypesDev();
      return mountDebugValue(value, formatterFn);
    }
  };

  InvalidNestedHooksDispatcherOnUpdateInDEV = {
    readContext: function (context, observedBits) {
      warnInvalidContextAccess();
      return readContext(context, observedBits);
    },
    useCallback: function (callback, deps) {
      currentHookNameInDev = 'useCallback';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateCallback(callback, deps);
    },
    useContext: function (context, observedBits) {
      currentHookNameInDev = 'useContext';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return readContext(context, observedBits);
    },
    useEffect: function (create, deps) {
      currentHookNameInDev = 'useEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateEffect(create, deps);
    },
    useImperativeHandle: function (ref, create, deps) {
      currentHookNameInDev = 'useImperativeHandle';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateImperativeHandle(ref, create, deps);
    },
    useLayoutEffect: function (create, deps) {
      currentHookNameInDev = 'useLayoutEffect';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateLayoutEffect(create, deps);
    },
    useMemo: function (create, deps) {
      currentHookNameInDev = 'useMemo';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateMemo(create, deps);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useReducer: function (reducer, initialArg, init) {
      currentHookNameInDev = 'useReducer';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateReducer(reducer, initialArg, init);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useRef: function (initialValue) {
      currentHookNameInDev = 'useRef';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateRef(initialValue);
    },
    useState: function (initialState) {
      currentHookNameInDev = 'useState';
      warnInvalidHookAccess();
      updateHookTypesDev();
      var prevDispatcher = ReactCurrentDispatcher$1.current;
      ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
      try {
        return updateState(initialState);
      } finally {
        ReactCurrentDispatcher$1.current = prevDispatcher;
      }
    },
    useDebugValue: function (value, formatterFn) {
      currentHookNameInDev = 'useDebugValue';
      warnInvalidHookAccess();
      updateHookTypesDev();
      return updateDebugValue(value, formatterFn);
    }
  };
}

var commitTime = 0;
var profilerStartTime = -1;

function getCommitTime() {
  return commitTime;
}

function recordCommitTime() {
  if (!enableProfilerTimer) {
    return;
  }
  commitTime = scheduler.unstable_now();
}

function startProfilerTimer(fiber) {
  if (!enableProfilerTimer) {
    return;
  }

  profilerStartTime = scheduler.unstable_now();

  if (fiber.actualStartTime < 0) {
    fiber.actualStartTime = scheduler.unstable_now();
  }
}

function stopProfilerTimerIfRunning(fiber) {
  if (!enableProfilerTimer) {
    return;
  }
  profilerStartTime = -1;
}

function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {
  if (!enableProfilerTimer) {
    return;
  }

  if (profilerStartTime >= 0) {
    var elapsedTime = scheduler.unstable_now() - profilerStartTime;
    fiber.actualDuration += elapsedTime;
    if (overrideBaseTime) {
      fiber.selfBaseDuration = elapsedTime;
    }
    profilerStartTime = -1;
  }
}

// The deepest Fiber on the stack involved in a hydration context.
// This may have been an insertion or a hydration.
var hydrationParentFiber = null;
var nextHydratableInstance = null;
var isHydrating = false;

function enterHydrationState(fiber) {
  if (!supportsHydration) {
    return false;
  }

  var parentInstance = fiber.stateNode.containerInfo;
  nextHydratableInstance = getFirstHydratableChild(parentInstance);
  hydrationParentFiber = fiber;
  isHydrating = true;
  return true;
}

function reenterHydrationStateFromDehydratedSuspenseInstance(fiber) {
  if (!supportsHydration) {
    return false;
  }

  var suspenseInstance = fiber.stateNode;
  nextHydratableInstance = getNextHydratableSibling(suspenseInstance);
  popToNextHostParent(fiber);
  isHydrating = true;
  return true;
}

function deleteHydratableInstance(returnFiber, instance) {
  {
    switch (returnFiber.tag) {
      case HostRoot:
        didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);
        break;
      case HostComponent:
        didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);
        break;
    }
  }

  var childToDelete = createFiberFromHostInstanceForDeletion();
  childToDelete.stateNode = instance;
  childToDelete.return = returnFiber;
  childToDelete.effectTag = Deletion;

  // This might seem like it belongs on progressedFirstDeletion. However,
  // these children are not part of the reconciliation list of children.
  // Even if we abort and rereconcile the children, that will try to hydrate
  // again and the nodes are still in the host tree so these will be
  // recreated.
  if (returnFiber.lastEffect !== null) {
    returnFiber.lastEffect.nextEffect = childToDelete;
    returnFiber.lastEffect = childToDelete;
  } else {
    returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
  }
}

function insertNonHydratedInstance(returnFiber, fiber) {
  fiber.effectTag |= Placement;
  {
    switch (returnFiber.tag) {
      case HostRoot:
        {
          var parentContainer = returnFiber.stateNode.containerInfo;
          switch (fiber.tag) {
            case HostComponent:
              var type = fiber.type;
              var props = fiber.pendingProps;
              didNotFindHydratableContainerInstance(parentContainer, type, props);
              break;
            case HostText:
              var text = fiber.pendingProps;
              didNotFindHydratableContainerTextInstance(parentContainer, text);
              break;
            case SuspenseComponent:
              
              break;
          }
          break;
        }
      case HostComponent:
        {
          var parentType = returnFiber.type;
          var parentProps = returnFiber.memoizedProps;
          var parentInstance = returnFiber.stateNode;
          switch (fiber.tag) {
            case HostComponent:
              var _type = fiber.type;
              var _props = fiber.pendingProps;
              didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props);
              break;
            case HostText:
              var _text = fiber.pendingProps;
              didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);
              break;
            case SuspenseComponent:
              didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance);
              break;
          }
          break;
        }
      default:
        return;
    }
  }
}

function tryHydrate(fiber, nextInstance) {
  switch (fiber.tag) {
    case HostComponent:
      {
        var type = fiber.type;
        var props = fiber.pendingProps;
        var instance = canHydrateInstance(nextInstance, type, props);
        if (instance !== null) {
          fiber.stateNode = instance;
          return true;
        }
        return false;
      }
    case HostText:
      {
        var text = fiber.pendingProps;
        var textInstance = canHydrateTextInstance(nextInstance, text);
        if (textInstance !== null) {
          fiber.stateNode = textInstance;
          return true;
        }
        return false;
      }
    case SuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          var suspenseInstance = canHydrateSuspenseInstance(nextInstance);
          if (suspenseInstance !== null) {
            // Downgrade the tag to a dehydrated component until we've hydrated it.
            fiber.tag = DehydratedSuspenseComponent;
            fiber.stateNode = suspenseInstance;
            return true;
          }
        }
        return false;
      }
    default:
      return false;
  }
}

function tryToClaimNextHydratableInstance(fiber) {
  if (!isHydrating) {
    return;
  }
  var nextInstance = nextHydratableInstance;
  if (!nextInstance) {
    // Nothing to hydrate. Make it an insertion.
    insertNonHydratedInstance(hydrationParentFiber, fiber);
    isHydrating = false;
    hydrationParentFiber = fiber;
    return;
  }
  var firstAttemptedInstance = nextInstance;
  if (!tryHydrate(fiber, nextInstance)) {
    // If we can't hydrate this instance let's try the next one.
    // We use this as a heuristic. It's based on intuition and not data so it
    // might be flawed or unnecessary.
    nextInstance = getNextHydratableSibling(firstAttemptedInstance);
    if (!nextInstance || !tryHydrate(fiber, nextInstance)) {
      // Nothing to hydrate. Make it an insertion.
      insertNonHydratedInstance(hydrationParentFiber, fiber);
      isHydrating = false;
      hydrationParentFiber = fiber;
      return;
    }
    // We matched the next one, we'll now assume that the first one was
    // superfluous and we'll delete it. Since we can't eagerly delete it
    // we'll have to schedule a deletion. To do that, this node needs a dummy
    // fiber associated with it.
    deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);
  }
  hydrationParentFiber = fiber;
  nextHydratableInstance = getFirstHydratableChild(nextInstance);
}

function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {
  if (!supportsHydration) {
    invariant(false, 'Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
  }

  var instance = fiber.stateNode;
  var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber);
  // TODO: Type this specific to this type of component.
  fiber.updateQueue = updatePayload;
  // If the update payload indicates that there is a change or if there
  // is a new ref we mark this as an update.
  if (updatePayload !== null) {
    return true;
  }
  return false;
}

function prepareToHydrateHostTextInstance(fiber) {
  if (!supportsHydration) {
    invariant(false, 'Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
  }

  var textInstance = fiber.stateNode;
  var textContent = fiber.memoizedProps;
  var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);
  {
    if (shouldUpdate) {
      // We assume that prepareToHydrateHostTextInstance is called in a context where the
      // hydration parent is the parent host component of this host text.
      var returnFiber = hydrationParentFiber;
      if (returnFiber !== null) {
        switch (returnFiber.tag) {
          case HostRoot:
            {
              var parentContainer = returnFiber.stateNode.containerInfo;
              didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);
              break;
            }
          case HostComponent:
            {
              var parentType = returnFiber.type;
              var parentProps = returnFiber.memoizedProps;
              var parentInstance = returnFiber.stateNode;
              didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);
              break;
            }
        }
      }
    }
  }
  return shouldUpdate;
}

function skipPastDehydratedSuspenseInstance(fiber) {
  if (!supportsHydration) {
    invariant(false, 'Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.');
  }
  var suspenseInstance = fiber.stateNode;
  !suspenseInstance ? invariant(false, 'Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  nextHydratableInstance = getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
}

function popToNextHostParent(fiber) {
  var parent = fiber.return;
  while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== DehydratedSuspenseComponent) {
    parent = parent.return;
  }
  hydrationParentFiber = parent;
}

function popHydrationState(fiber) {
  if (!supportsHydration) {
    return false;
  }
  if (fiber !== hydrationParentFiber) {
    // We're deeper than the current hydration context, inside an inserted
    // tree.
    return false;
  }
  if (!isHydrating) {
    // If we're not currently hydrating but we're in a hydration context, then
    // we were an insertion and now need to pop up reenter hydration of our
    // siblings.
    popToNextHostParent(fiber);
    isHydrating = true;
    return false;
  }

  var type = fiber.type;

  // If we have any remaining hydratable nodes, we need to delete them now.
  // We only do this deeper than head and body since they tend to have random
  // other nodes in them. We also ignore components with pure text content in
  // side of them.
  // TODO: Better heuristic.
  if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {
    var nextInstance = nextHydratableInstance;
    while (nextInstance) {
      deleteHydratableInstance(fiber, nextInstance);
      nextInstance = getNextHydratableSibling(nextInstance);
    }
  }

  popToNextHostParent(fiber);
  nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;
  return true;
}

function resetHydrationState() {
  if (!supportsHydration) {
    return;
  }

  hydrationParentFiber = null;
  nextHydratableInstance = null;
  isHydrating = false;
}

var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;

var didReceiveUpdate = false;

var didWarnAboutBadClass = void 0;
var didWarnAboutContextTypeOnFunctionComponent = void 0;
var didWarnAboutGetDerivedStateOnFunctionComponent = void 0;
var didWarnAboutFunctionRefs = void 0;
var didWarnAboutReassigningProps = void 0;

{
  didWarnAboutBadClass = {};
  didWarnAboutContextTypeOnFunctionComponent = {};
  didWarnAboutGetDerivedStateOnFunctionComponent = {};
  didWarnAboutFunctionRefs = {};
  didWarnAboutReassigningProps = false;
}

function reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime) {
  if (current$$1 === null) {
    // If this is a fresh new component that hasn't been rendered yet, we
    // won't update its child set by applying minimal side-effects. Instead,
    // we will add them all to the child before it gets rendered. That means
    // we can optimize this reconciliation pass by not tracking side-effects.
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  } else {
    // If the current child is the same as the work in progress, it means that
    // we haven't yet started any work on these children. Therefore, we use
    // the clone algorithm to create a copy of all the current children.

    // If we had any progressed work already, that is invalid at this point so
    // let's throw it out.
    workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, nextChildren, renderExpirationTime);
  }
}

function forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime) {
  // This function is fork of reconcileChildren. It's used in cases where we
  // want to reconcile without matching against the existing set. This has the
  // effect of all current children being unmounted; even if the type and key
  // are the same, the old child is unmounted and a new child is created.
  //
  // To do this, we're going to go through the reconcile algorithm twice. In
  // the first pass, we schedule a deletion for all the current children by
  // passing null.
  workInProgress.child = reconcileChildFibers(workInProgress, current$$1.child, null, renderExpirationTime);
  // In the second pass, we mount the new children. The trick here is that we
  // pass null in place of where we usually pass the current child set. This has
  // the effect of remounting all children regardless of whether their their
  // identity matches.
  workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
}

function updateForwardRef(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens after the first render suspends.
  // We'll need to figure out if this is fine or can cause issues.

  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;
      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component), getCurrentFiberStackInDev);
      }
    }
  }

  var render = Component.render;
  var ref = workInProgress.ref;

  // The rest is a fork of updateFunctionComponent
  var nextChildren = void 0;
  prepareToReadContext(workInProgress, renderExpirationTime);
  {
    ReactCurrentOwner$3.current = workInProgress;
    setCurrentPhase('render');
    nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      // Only double-render components with Hooks
      if (workInProgress.memoizedState !== null) {
        nextChildren = renderWithHooks(current$$1, workInProgress, render, nextProps, ref, renderExpirationTime);
      }
    }
    setCurrentPhase(null);
  }

  if (current$$1 !== null && !didReceiveUpdate) {
    bailoutHooks(current$$1, workInProgress, renderExpirationTime);
    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  if (current$$1 === null) {
    var type = Component.type;
    if (isSimpleFunctionComponent(type) && Component.compare === null &&
    // SimpleMemoComponent codepath doesn't resolve outer props either.
    Component.defaultProps === undefined) {
      // If this is a plain function component without default props,
      // and with only the default shallow comparison, we upgrade it
      // to a SimpleMemoComponent to allow fast path updates.
      workInProgress.tag = SimpleMemoComponent;
      workInProgress.type = type;
      {
        validateFunctionComponentInDev(workInProgress, type);
      }
      return updateSimpleMemoComponent(current$$1, workInProgress, type, nextProps, updateExpirationTime, renderExpirationTime);
    }
    {
      var innerPropTypes = type.propTypes;
      if (innerPropTypes) {
        // Inner memo component props aren't currently validated in createElement.
        // We could move it there, but we'd still need this for lazy code path.
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(type), getCurrentFiberStackInDev);
      }
    }
    var child = createFiberFromTypeAndProps(Component.type, null, nextProps, null, workInProgress.mode, renderExpirationTime);
    child.ref = workInProgress.ref;
    child.return = workInProgress;
    workInProgress.child = child;
    return child;
  }
  {
    var _type = Component.type;
    var _innerPropTypes = _type.propTypes;
    if (_innerPropTypes) {
      // Inner memo component props aren't currently validated in createElement.
      // We could move it there, but we'd still need this for lazy code path.
      checkPropTypes(_innerPropTypes, nextProps, // Resolved props
      'prop', getComponentName(_type), getCurrentFiberStackInDev);
    }
  }
  var currentChild = current$$1.child; // This is always exactly one child
  if (updateExpirationTime < renderExpirationTime) {
    // This will be the props with resolved defaultProps,
    // unlike current.memoizedProps which will be the unresolved ones.
    var prevProps = currentChild.memoizedProps;
    // Default to shallow comparison
    var compare = Component.compare;
    compare = compare !== null ? compare : shallowEqual;
    if (compare(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
      return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
    }
  }
  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  var newChild = createWorkInProgress(currentChild, nextProps, renderExpirationTime);
  newChild.ref = workInProgress.ref;
  newChild.return = workInProgress;
  workInProgress.child = newChild;
  return newChild;
}

function updateSimpleMemoComponent(current$$1, workInProgress, Component, nextProps, updateExpirationTime, renderExpirationTime) {
  // TODO: current can be non-null here even if the component
  // hasn't yet mounted. This happens when the inner render suspends.
  // We'll need to figure out if this is fine or can cause issues.

  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var outerMemoType = workInProgress.elementType;
      if (outerMemoType.$$typeof === REACT_LAZY_TYPE) {
        // We warn when you define propTypes on lazy()
        // so let's just skip over it to find memo() outer wrapper.
        // Inner props for memo are validated later.
        outerMemoType = refineResolvedLazyComponent(outerMemoType);
      }
      var outerPropTypes = outerMemoType && outerMemoType.propTypes;
      if (outerPropTypes) {
        checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps)
        'prop', getComponentName(outerMemoType), getCurrentFiberStackInDev);
      }
      // Inner propTypes will be validated in the function component path.
    }
  }
  if (current$$1 !== null) {
    var prevProps = current$$1.memoizedProps;
    if (shallowEqual(prevProps, nextProps) && current$$1.ref === workInProgress.ref) {
      didReceiveUpdate = false;
      if (updateExpirationTime < renderExpirationTime) {
        return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
      }
    }
  }
  return updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
}

function updateFragment(current$$1, workInProgress, renderExpirationTime) {
  var nextChildren = workInProgress.pendingProps;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateMode(current$$1, workInProgress, renderExpirationTime) {
  var nextChildren = workInProgress.pendingProps.children;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateProfiler(current$$1, workInProgress, renderExpirationTime) {
  if (enableProfilerTimer) {
    workInProgress.effectTag |= Update;
  }
  var nextProps = workInProgress.pendingProps;
  var nextChildren = nextProps.children;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function markRef(current$$1, workInProgress) {
  var ref = workInProgress.ref;
  if (current$$1 === null && ref !== null || current$$1 !== null && current$$1.ref !== ref) {
    // Schedule a Ref effect
    workInProgress.effectTag |= Ref;
  }
}

function updateFunctionComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;
      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component), getCurrentFiberStackInDev);
      }
    }
  }

  var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);
  var context = getMaskedContext(workInProgress, unmaskedContext);

  var nextChildren = void 0;
  prepareToReadContext(workInProgress, renderExpirationTime);
  {
    ReactCurrentOwner$3.current = workInProgress;
    setCurrentPhase('render');
    nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
    if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
      // Only double-render components with Hooks
      if (workInProgress.memoizedState !== null) {
        nextChildren = renderWithHooks(current$$1, workInProgress, Component, nextProps, context, renderExpirationTime);
      }
    }
    setCurrentPhase(null);
  }

  if (current$$1 !== null && !didReceiveUpdate) {
    bailoutHooks(current$$1, workInProgress, renderExpirationTime);
    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateClassComponent(current$$1, workInProgress, Component, nextProps, renderExpirationTime) {
  {
    if (workInProgress.type !== workInProgress.elementType) {
      // Lazy component props can't be validated in createElement
      // because they're only guaranteed to be resolved here.
      var innerPropTypes = Component.propTypes;
      if (innerPropTypes) {
        checkPropTypes(innerPropTypes, nextProps, // Resolved props
        'prop', getComponentName(Component), getCurrentFiberStackInDev);
      }
    }
  }

  // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.
  var hasContext = void 0;
  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }
  prepareToReadContext(workInProgress, renderExpirationTime);

  var instance = workInProgress.stateNode;
  var shouldUpdate = void 0;
  if (instance === null) {
    if (current$$1 !== null) {
      // An class component without an instance only mounts if it suspended
      // inside a non- concurrent tree, in an inconsistent state. We want to
      // tree it like a new mount, even though an empty version of it already
      // committed. Disconnect the alternate pointers.
      current$$1.alternate = null;
      workInProgress.alternate = null;
      // Since this is conceptually a new fiber, schedule a Placement effect
      workInProgress.effectTag |= Placement;
    }
    // In the initial pass we might need to construct the instance.
    constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
    mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
    shouldUpdate = true;
  } else if (current$$1 === null) {
    // In a resume, we'll already have an instance we can reuse.
    shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  } else {
    shouldUpdate = updateClassInstance(current$$1, workInProgress, Component, nextProps, renderExpirationTime);
  }
  var nextUnitOfWork = finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime);
  {
    var inst = workInProgress.stateNode;
    if (inst.props !== nextProps) {
      !didWarnAboutReassigningProps ? warning$1(false, 'It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component') : void 0;
      didWarnAboutReassigningProps = true;
    }
  }
  return nextUnitOfWork;
}

function finishClassComponent(current$$1, workInProgress, Component, shouldUpdate, hasContext, renderExpirationTime) {
  // Refs should update even if shouldComponentUpdate returns false
  markRef(current$$1, workInProgress);

  var didCaptureError = (workInProgress.effectTag & DidCapture) !== NoEffect;

  if (!shouldUpdate && !didCaptureError) {
    // Context providers should defer to sCU for rendering
    if (hasContext) {
      invalidateContextProvider(workInProgress, Component, false);
    }

    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }

  var instance = workInProgress.stateNode;

  // Rerender
  ReactCurrentOwner$3.current = workInProgress;
  var nextChildren = void 0;
  if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {
    // If we captured an error, but getDerivedStateFrom catch is not defined,
    // unmount all the children. componentDidCatch will schedule an update to
    // re-render a fallback. This is temporary until we migrate everyone to
    // the new API.
    // TODO: Warn in a future release.
    nextChildren = null;

    if (enableProfilerTimer) {
      stopProfilerTimerIfRunning(workInProgress);
    }
  } else {
    {
      setCurrentPhase('render');
      nextChildren = instance.render();
      if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
        instance.render();
      }
      setCurrentPhase(null);
    }
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  if (current$$1 !== null && didCaptureError) {
    // If we're recovering from an error, reconcile without reusing any of
    // the existing children. Conceptually, the normal children and the children
    // that are shown on error are two different sets, so we shouldn't reuse
    // normal children even if their identities match.
    forceUnmountCurrentAndReconcile(current$$1, workInProgress, nextChildren, renderExpirationTime);
  } else {
    reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  }

  // Memoize state using the values we just used to render.
  // TODO: Restructure so we never read values from the instance.
  workInProgress.memoizedState = instance.state;

  // The context might have changed so we need to recalculate it.
  if (hasContext) {
    invalidateContextProvider(workInProgress, Component, true);
  }

  return workInProgress.child;
}

function pushHostRootContext(workInProgress) {
  var root = workInProgress.stateNode;
  if (root.pendingContext) {
    pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);
  } else if (root.context) {
    // Should always be set
    pushTopLevelContextObject(workInProgress, root.context, false);
  }
  pushHostContainer(workInProgress, root.containerInfo);
}

function updateHostRoot(current$$1, workInProgress, renderExpirationTime) {
  pushHostRootContext(workInProgress);
  var updateQueue = workInProgress.updateQueue;
  !(updateQueue !== null) ? invariant(false, 'If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  var nextProps = workInProgress.pendingProps;
  var prevState = workInProgress.memoizedState;
  var prevChildren = prevState !== null ? prevState.element : null;
  processUpdateQueue(workInProgress, updateQueue, nextProps, null, renderExpirationTime);
  var nextState = workInProgress.memoizedState;
  // Caution: React DevTools currently depends on this property
  // being called "element".
  var nextChildren = nextState.element;
  if (nextChildren === prevChildren) {
    // If the state is the same as before, that's a bailout because we had
    // no work that expires at this time.
    resetHydrationState();
    return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
  }
  var root = workInProgress.stateNode;
  if ((current$$1 === null || current$$1.child === null) && root.hydrate && enterHydrationState(workInProgress)) {
    // If we don't have any current children this might be the first pass.
    // We always try to hydrate. If this isn't a hydration pass there won't
    // be any children to hydrate which is effectively the same thing as
    // not hydrating.

    // This is a bit of a hack. We track the host root as a placement to
    // know that we're currently in a mounting state. That way isMounted
    // works as expected. We must reset this before committing.
    // TODO: Delete this when we delete isMounted and findDOMNode.
    workInProgress.effectTag |= Placement;

    // Ensure that children mount into this root without tracking
    // side-effects. This ensures that we don't store Placement effects on
    // nodes that will be hydrated.
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  } else {
    // Otherwise reset hydration state in case we aborted and resumed another
    // root.
    reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
    resetHydrationState();
  }
  return workInProgress.child;
}

function updateHostComponent(current$$1, workInProgress, renderExpirationTime) {
  pushHostContext(workInProgress);

  if (current$$1 === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  }

  var type = workInProgress.type;
  var nextProps = workInProgress.pendingProps;
  var prevProps = current$$1 !== null ? current$$1.memoizedProps : null;

  var nextChildren = nextProps.children;
  var isDirectTextChild = shouldSetTextContent(type, nextProps);

  if (isDirectTextChild) {
    // We special case a direct text child of a host node. This is a common
    // case. We won't handle it as a reified child. We will instead handle
    // this in the host environment that also have access to this prop. That
    // avoids allocating another HostText fiber and traversing it.
    nextChildren = null;
  } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {
    // If we're switching from a direct text child to a normal child, or to
    // empty, we need to schedule the text content to be reset.
    workInProgress.effectTag |= ContentReset;
  }

  markRef(current$$1, workInProgress);

  // Check the host config to see if the children are offscreen/hidden.
  if (renderExpirationTime !== Never && workInProgress.mode & ConcurrentMode && shouldDeprioritizeSubtree(type, nextProps)) {
    // Schedule this fiber to re-render at offscreen priority. Then bailout.
    workInProgress.expirationTime = workInProgress.childExpirationTime = Never;
    return null;
  }

  reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  return workInProgress.child;
}

function updateHostText(current$$1, workInProgress) {
  if (current$$1 === null) {
    tryToClaimNextHydratableInstance(workInProgress);
  }
  // Nothing to do here. This is terminal. We'll do the completion step
  // immediately after.
  return null;
}

function mountLazyComponent(_current, workInProgress, elementType, updateExpirationTime, renderExpirationTime) {
  if (_current !== null) {
    // An lazy component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null;
    // Since this is conceptually a new fiber, schedule a Placement effect
    workInProgress.effectTag |= Placement;
  }

  var props = workInProgress.pendingProps;
  // We can't start a User Timing measurement with correct label yet.
  // Cancel and resume right after we know the tag.
  cancelWorkTimer(workInProgress);
  var Component = readLazyComponentType(elementType);
  // Store the unwrapped component in the type.
  workInProgress.type = Component;
  var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);
  startWorkTimer(workInProgress);
  var resolvedProps = resolveDefaultProps(Component, props);
  var child = void 0;
  switch (resolvedTag) {
    case FunctionComponent:
      {
        {
          validateFunctionComponentInDev(workInProgress, Component);
        }
        child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
        break;
      }
    case ClassComponent:
      {
        child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderExpirationTime);
        break;
      }
    case ForwardRef:
      {
        child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderExpirationTime);
        break;
      }
    case MemoComponent:
      {
        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = Component.propTypes;
            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only
              'prop', getComponentName(Component), getCurrentFiberStackInDev);
            }
          }
        }
        child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too
        updateExpirationTime, renderExpirationTime);
        break;
      }
    default:
      {
        var hint = '';
        {
          if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) {
            hint = ' Did you wrap a component in React.lazy() more than once?';
          }
        }
        // This message intentionally doesn't mention ForwardRef or MemoComponent
        // because the fact that it's a separate type of work is an
        // implementation detail.
        invariant(false, 'Element type is invalid. Received a promise that resolves to: %s. Lazy element type must resolve to a class or function.%s', Component, hint);
      }
  }
  return child;
}

function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderExpirationTime) {
  if (_current !== null) {
    // An incomplete component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null;
    // Since this is conceptually a new fiber, schedule a Placement effect
    workInProgress.effectTag |= Placement;
  }

  // Promote the fiber to a class and try rendering again.
  workInProgress.tag = ClassComponent;

  // The rest of this function is a fork of `updateClassComponent`

  // Push context providers early to prevent context stack mismatches.
  // During mounting we don't know the child context yet as the instance doesn't exist.
  // We will invalidate the child context in finishClassComponent() right after rendering.
  var hasContext = void 0;
  if (isContextProvider(Component)) {
    hasContext = true;
    pushContextProvider(workInProgress);
  } else {
    hasContext = false;
  }
  prepareToReadContext(workInProgress, renderExpirationTime);

  constructClassInstance(workInProgress, Component, nextProps, renderExpirationTime);
  mountClassInstance(workInProgress, Component, nextProps, renderExpirationTime);

  return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
}

function mountIndeterminateComponent(_current, workInProgress, Component, renderExpirationTime) {
  if (_current !== null) {
    // An indeterminate component only mounts if it suspended inside a non-
    // concurrent tree, in an inconsistent state. We want to treat it like
    // a new mount, even though an empty version of it already committed.
    // Disconnect the alternate pointers.
    _current.alternate = null;
    workInProgress.alternate = null;
    // Since this is conceptually a new fiber, schedule a Placement effect
    workInProgress.effectTag |= Placement;
  }

  var props = workInProgress.pendingProps;
  var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);
  var context = getMaskedContext(workInProgress, unmaskedContext);

  prepareToReadContext(workInProgress, renderExpirationTime);

  var value = void 0;

  {
    if (Component.prototype && typeof Component.prototype.render === 'function') {
      var componentName = getComponentName(Component) || 'Unknown';

      if (!didWarnAboutBadClass[componentName]) {
        warningWithoutStack$1(false, "The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);
        didWarnAboutBadClass[componentName] = true;
      }
    }

    if (workInProgress.mode & StrictMode) {
      ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);
    }

    ReactCurrentOwner$3.current = workInProgress;
    value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
  }
  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;

  if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) {
    // Proceed under the assumption that this is a class instance
    workInProgress.tag = ClassComponent;

    // Throw out any hooks that were used.
    resetHooks();

    // Push context providers early to prevent context stack mismatches.
    // During mounting we don't know the child context yet as the instance doesn't exist.
    // We will invalidate the child context in finishClassComponent() right after rendering.
    var hasContext = false;
    if (isContextProvider(Component)) {
      hasContext = true;
      pushContextProvider(workInProgress);
    } else {
      hasContext = false;
    }

    workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;

    var getDerivedStateFromProps = Component.getDerivedStateFromProps;
    if (typeof getDerivedStateFromProps === 'function') {
      applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);
    }

    adoptClassInstance(workInProgress, value);
    mountClassInstance(workInProgress, Component, props, renderExpirationTime);
    return finishClassComponent(null, workInProgress, Component, true, hasContext, renderExpirationTime);
  } else {
    // Proceed under the assumption that this is a function component
    workInProgress.tag = FunctionComponent;
    {
      if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
        // Only double-render components with Hooks
        if (workInProgress.memoizedState !== null) {
          value = renderWithHooks(null, workInProgress, Component, props, context, renderExpirationTime);
        }
      }
    }
    reconcileChildren(null, workInProgress, value, renderExpirationTime);
    {
      validateFunctionComponentInDev(workInProgress, Component);
    }
    return workInProgress.child;
  }
}

function validateFunctionComponentInDev(workInProgress, Component) {
  if (Component) {
    !!Component.childContextTypes ? warningWithoutStack$1(false, '%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component') : void 0;
  }
  if (workInProgress.ref !== null) {
    var info = '';
    var ownerName = getCurrentFiberOwnerNameInDevOrNull();
    if (ownerName) {
      info += '\n\nCheck the render method of `' + ownerName + '`.';
    }

    var warningKey = ownerName || workInProgress._debugID || '';
    var debugSource = workInProgress._debugSource;
    if (debugSource) {
      warningKey = debugSource.fileName + ':' + debugSource.lineNumber;
    }
    if (!didWarnAboutFunctionRefs[warningKey]) {
      didWarnAboutFunctionRefs[warningKey] = true;
      warning$1(false, 'Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);
    }
  }

  if (typeof Component.getDerivedStateFromProps === 'function') {
    var componentName = getComponentName(Component) || 'Unknown';

    if (!didWarnAboutGetDerivedStateOnFunctionComponent[componentName]) {
      warningWithoutStack$1(false, '%s: Function components do not support getDerivedStateFromProps.', componentName);
      didWarnAboutGetDerivedStateOnFunctionComponent[componentName] = true;
    }
  }

  if (typeof Component.contextType === 'object' && Component.contextType !== null) {
    var _componentName = getComponentName(Component) || 'Unknown';

    if (!didWarnAboutContextTypeOnFunctionComponent[_componentName]) {
      warningWithoutStack$1(false, '%s: Function components do not support contextType.', _componentName);
      didWarnAboutContextTypeOnFunctionComponent[_componentName] = true;
    }
  }
}

function updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
  var mode = workInProgress.mode;
  var nextProps = workInProgress.pendingProps;

  // We should attempt to render the primary children unless this boundary
  // already suspended during this render (`alreadyCaptured` is true).
  var nextState = workInProgress.memoizedState;

  var nextDidTimeout = void 0;
  if ((workInProgress.effectTag & DidCapture) === NoEffect) {
    // This is the first attempt.
    nextState = null;
    nextDidTimeout = false;
  } else {
    // Something in this boundary's subtree already suspended. Switch to
    // rendering the fallback children.
    nextState = {
      timedOutAt: nextState !== null ? nextState.timedOutAt : NoWork
    };
    nextDidTimeout = true;
    workInProgress.effectTag &= ~DidCapture;
  }

  // This next part is a bit confusing. If the children timeout, we switch to
  // showing the fallback children in place of the "primary" children.
  // However, we don't want to delete the primary children because then their
  // state will be lost (both the React state and the host state, e.g.
  // uncontrolled form inputs). Instead we keep them mounted and hide them.
  // Both the fallback children AND the primary children are rendered at the
  // same time. Once the primary children are un-suspended, we can delete
  // the fallback children — don't need to preserve their state.
  //
  // The two sets of children are siblings in the host environment, but
  // semantically, for purposes of reconciliation, they are two separate sets.
  // So we store them using two fragment fibers.
  //
  // However, we want to avoid allocating extra fibers for every placeholder.
  // They're only necessary when the children time out, because that's the
  // only time when both sets are mounted.
  //
  // So, the extra fragment fibers are only used if the children time out.
  // Otherwise, we render the primary children directly. This requires some
  // custom reconciliation logic to preserve the state of the primary
  // children. It's essentially a very basic form of re-parenting.

  // `child` points to the child fiber. In the normal case, this is the first
  // fiber of the primary children set. In the timed-out case, it's a
  // a fragment fiber containing the primary children.
  var child = void 0;
  // `next` points to the next fiber React should render. In the normal case,
  // it's the same as `child`: the first fiber of the primary children set.
  // In the timed-out case, it's a fragment fiber containing the *fallback*
  // children -- we skip over the primary children entirely.
  var next = void 0;
  if (current$$1 === null) {
    if (enableSuspenseServerRenderer) {
      // If we're currently hydrating, try to hydrate this boundary.
      // But only if this has a fallback.
      if (nextProps.fallback !== undefined) {
        tryToClaimNextHydratableInstance(workInProgress);
        // This could've changed the tag if this was a dehydrated suspense component.
        if (workInProgress.tag === DehydratedSuspenseComponent) {
          return updateDehydratedSuspenseComponent(null, workInProgress, renderExpirationTime);
        }
      }
    }

    // This is the initial mount. This branch is pretty simple because there's
    // no previous state that needs to be preserved.
    if (nextDidTimeout) {
      // Mount separate fragments for primary and fallback children.
      var nextFallbackChildren = nextProps.fallback;
      var primaryChildFragment = createFiberFromFragment(null, mode, NoWork, null);

      if ((workInProgress.mode & ConcurrentMode) === NoContext) {
        // Outside of concurrent mode, we commit the effects from the
        var progressedState = workInProgress.memoizedState;
        var progressedPrimaryChild = progressedState !== null ? workInProgress.child.child : workInProgress.child;
        primaryChildFragment.child = progressedPrimaryChild;
      }

      var fallbackChildFragment = createFiberFromFragment(nextFallbackChildren, mode, renderExpirationTime, null);
      primaryChildFragment.sibling = fallbackChildFragment;
      child = primaryChildFragment;
      // Skip the primary children, and continue working on the
      // fallback children.
      next = fallbackChildFragment;
      child.return = next.return = workInProgress;
    } else {
      // Mount the primary children without an intermediate fragment fiber.
      var nextPrimaryChildren = nextProps.children;
      child = next = mountChildFibers(workInProgress, null, nextPrimaryChildren, renderExpirationTime);
    }
  } else {
    // This is an update. This branch is more complicated because we need to
    // ensure the state of the primary children is preserved.
    var prevState = current$$1.memoizedState;
    var prevDidTimeout = prevState !== null;
    if (prevDidTimeout) {
      // The current tree already timed out. That means each child set is
      var currentPrimaryChildFragment = current$$1.child;
      var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;
      if (nextDidTimeout) {
        // Still timed out. Reuse the current primary children by cloning
        // its fragment. We're going to skip over these entirely.
        var _nextFallbackChildren = nextProps.fallback;
        var _primaryChildFragment = createWorkInProgress(currentPrimaryChildFragment, currentPrimaryChildFragment.pendingProps, NoWork);

        if ((workInProgress.mode & ConcurrentMode) === NoContext) {
          // Outside of concurrent mode, we commit the effects from the
          var _progressedState = workInProgress.memoizedState;
          var _progressedPrimaryChild = _progressedState !== null ? workInProgress.child.child : workInProgress.child;
          if (_progressedPrimaryChild !== currentPrimaryChildFragment.child) {
            _primaryChildFragment.child = _progressedPrimaryChild;
          }
        }

        // Because primaryChildFragment is a new fiber that we're inserting as the
        // parent of a new tree, we need to set its treeBaseDuration.
        if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
          // treeBaseDuration is the sum of all the child tree base durations.
          var treeBaseDuration = 0;
          var hiddenChild = _primaryChildFragment.child;
          while (hiddenChild !== null) {
            treeBaseDuration += hiddenChild.treeBaseDuration;
            hiddenChild = hiddenChild.sibling;
          }
          _primaryChildFragment.treeBaseDuration = treeBaseDuration;
        }

        // Clone the fallback child fragment, too. These we'll continue
        // working on.
        var _fallbackChildFragment = _primaryChildFragment.sibling = createWorkInProgress(currentFallbackChildFragment, _nextFallbackChildren, currentFallbackChildFragment.expirationTime);
        child = _primaryChildFragment;
        _primaryChildFragment.childExpirationTime = NoWork;
        // Skip the primary children, and continue working on the
        // fallback children.
        next = _fallbackChildFragment;
        child.return = next.return = workInProgress;
      } else {
        // No longer suspended. Switch back to showing the primary children,
        // and remove the intermediate fragment fiber.
        var _nextPrimaryChildren = nextProps.children;
        var currentPrimaryChild = currentPrimaryChildFragment.child;
        var primaryChild = reconcileChildFibers(workInProgress, currentPrimaryChild, _nextPrimaryChildren, renderExpirationTime);

        // If this render doesn't suspend, we need to delete the fallback
        // children. Wait until the complete phase, after we've confirmed the
        // fallback is no longer needed.
        // TODO: Would it be better to store the fallback fragment on
        // the stateNode?

        // Continue rendering the children, like we normally do.
        child = next = primaryChild;
      }
    } else {
      // The current tree has not already timed out. That means the primary
      // children are not wrapped in a fragment fiber.
      var _currentPrimaryChild = current$$1.child;
      if (nextDidTimeout) {
        // Timed out. Wrap the children in a fragment fiber to keep them
        // separate from the fallback children.
        var _nextFallbackChildren2 = nextProps.fallback;
        var _primaryChildFragment2 = createFiberFromFragment(
        // It shouldn't matter what the pending props are because we aren't
        // going to render this fragment.
        null, mode, NoWork, null);
        _primaryChildFragment2.child = _currentPrimaryChild;

        // Even though we're creating a new fiber, there are no new children,
        // because we're reusing an already mounted tree. So we don't need to
        // schedule a placement.
        // primaryChildFragment.effectTag |= Placement;

        if ((workInProgress.mode & ConcurrentMode) === NoContext) {
          // Outside of concurrent mode, we commit the effects from the
          var _progressedState2 = workInProgress.memoizedState;
          var _progressedPrimaryChild2 = _progressedState2 !== null ? workInProgress.child.child : workInProgress.child;
          _primaryChildFragment2.child = _progressedPrimaryChild2;
        }

        // Because primaryChildFragment is a new fiber that we're inserting as the
        // parent of a new tree, we need to set its treeBaseDuration.
        if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
          // treeBaseDuration is the sum of all the child tree base durations.
          var _treeBaseDuration = 0;
          var _hiddenChild = _primaryChildFragment2.child;
          while (_hiddenChild !== null) {
            _treeBaseDuration += _hiddenChild.treeBaseDuration;
            _hiddenChild = _hiddenChild.sibling;
          }
          _primaryChildFragment2.treeBaseDuration = _treeBaseDuration;
        }

        // Create a fragment from the fallback children, too.
        var _fallbackChildFragment2 = _primaryChildFragment2.sibling = createFiberFromFragment(_nextFallbackChildren2, mode, renderExpirationTime, null);
        _fallbackChildFragment2.effectTag |= Placement;
        child = _primaryChildFragment2;
        _primaryChildFragment2.childExpirationTime = NoWork;
        // Skip the primary children, and continue working on the
        // fallback children.
        next = _fallbackChildFragment2;
        child.return = next.return = workInProgress;
      } else {
        // Still haven't timed out.  Continue rendering the children, like we
        // normally do.
        var _nextPrimaryChildren2 = nextProps.children;
        next = child = reconcileChildFibers(workInProgress, _currentPrimaryChild, _nextPrimaryChildren2, renderExpirationTime);
      }
    }
    workInProgress.stateNode = current$$1.stateNode;
  }

  workInProgress.memoizedState = nextState;
  workInProgress.child = child;
  return next;
}

function updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime) {
  if (current$$1 === null) {
    // During the first pass, we'll bail out and not drill into the children.
    // Instead, we'll leave the content in place and try to hydrate it later.
    workInProgress.expirationTime = Never;
    return null;
  }
  // We use childExpirationTime to indicate that a child might depend on context, so if
  // any context has changed, we need to treat is as if the input might have changed.
  var hasContextChanged$$1 = current$$1.childExpirationTime >= renderExpirationTime;
  if (didReceiveUpdate || hasContextChanged$$1) {
    // This boundary has changed since the first render. This means that we are now unable to
    // hydrate it. We might still be able to hydrate it using an earlier expiration time but
    // during this render we can't. Instead, we're going to delete the whole subtree and
    // instead inject a new real Suspense boundary to take its place, which may render content
    // or fallback. The real Suspense boundary will suspend for a while so we have some time
    // to ensure it can produce real content, but all state and pending events will be lost.

    // Detach from the current dehydrated boundary.
    current$$1.alternate = null;
    workInProgress.alternate = null;

    // Insert a deletion in the effect list.
    var returnFiber = workInProgress.return;
    !(returnFiber !== null) ? invariant(false, 'Suspense boundaries are never on the root. This is probably a bug in React.') : void 0;
    var last = returnFiber.lastEffect;
    if (last !== null) {
      last.nextEffect = current$$1;
      returnFiber.lastEffect = current$$1;
    } else {
      returnFiber.firstEffect = returnFiber.lastEffect = current$$1;
    }
    current$$1.nextEffect = null;
    current$$1.effectTag = Deletion;

    // Upgrade this work in progress to a real Suspense component.
    workInProgress.tag = SuspenseComponent;
    workInProgress.stateNode = null;
    workInProgress.memoizedState = null;
    // This is now an insertion.
    workInProgress.effectTag |= Placement;
    // Retry as a real Suspense component.
    return updateSuspenseComponent(null, workInProgress, renderExpirationTime);
  }
  if ((workInProgress.effectTag & DidCapture) === NoEffect) {
    // This is the first attempt.
    reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress);
    var nextProps = workInProgress.pendingProps;
    var nextChildren = nextProps.children;
    workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
    return workInProgress.child;
  } else {
    // Something suspended. Leave the existing children in place.
    // TODO: In non-concurrent mode, should we commit the nodes we have hydrated so far?
    workInProgress.child = null;
    return null;
  }
}

function updatePortalComponent(current$$1, workInProgress, renderExpirationTime) {
  pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
  var nextChildren = workInProgress.pendingProps;
  if (current$$1 === null) {
    // Portals are special because we don't append the children during mount
    // but at commit. Therefore we need to track insertions which the normal
    // flow doesn't do during mount. This doesn't happen at the root because
    // the root always starts with a "current" with a null child.
    // TODO: Consider unifying this with how the root works.
    workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderExpirationTime);
  } else {
    reconcileChildren(current$$1, workInProgress, nextChildren, renderExpirationTime);
  }
  return workInProgress.child;
}

function updateContextProvider(current$$1, workInProgress, renderExpirationTime) {
  var providerType = workInProgress.type;
  var context = providerType._context;

  var newProps = workInProgress.pendingProps;
  var oldProps = workInProgress.memoizedProps;

  var newValue = newProps.value;

  {
    var providerPropTypes = workInProgress.type.propTypes;

    if (providerPropTypes) {
      checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider', getCurrentFiberStackInDev);
    }
  }

  pushProvider(workInProgress, newValue);

  if (oldProps !== null) {
    var oldValue = oldProps.value;
    var changedBits = calculateChangedBits(context, newValue, oldValue);
    if (changedBits === 0) {
      // No change. Bailout early if children are the same.
      if (oldProps.children === newProps.children && !hasContextChanged()) {
        return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
      }
    } else {
      // The context value changed. Search for matching consumers and schedule
      // them to update.
      propagateContextChange(workInProgress, context, changedBits, renderExpirationTime);
    }
  }

  var newChildren = newProps.children;
  reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  return workInProgress.child;
}

var hasWarnedAboutUsingContextAsConsumer = false;

function updateContextConsumer(current$$1, workInProgress, renderExpirationTime) {
  var context = workInProgress.type;
  // The logic below for Context differs depending on PROD or DEV mode. In
  // DEV mode, we create a separate object for Context.Consumer that acts
  // like a proxy to Context. This proxy object adds unnecessary code in PROD
  // so we use the old behaviour (Context.Consumer references Context) to
  // reduce size and overhead. The separate object references context via
  // a property called "_context", which also gives us the ability to check
  // in DEV mode if this property exists or not and warn if it does not.
  {
    if (context._context === undefined) {
      // This may be because it's a Context (rather than a Consumer).
      // Or it may be because it's older React where they're the same thing.
      // We only want to warn if we're sure it's a new React.
      if (context !== context.Consumer) {
        if (!hasWarnedAboutUsingContextAsConsumer) {
          hasWarnedAboutUsingContextAsConsumer = true;
          warning$1(false, 'Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
        }
      }
    } else {
      context = context._context;
    }
  }
  var newProps = workInProgress.pendingProps;
  var render = newProps.children;

  {
    !(typeof render === 'function') ? warningWithoutStack$1(false, 'A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.') : void 0;
  }

  prepareToReadContext(workInProgress, renderExpirationTime);
  var newValue = readContext(context, newProps.unstable_observedBits);
  var newChildren = void 0;
  {
    ReactCurrentOwner$3.current = workInProgress;
    setCurrentPhase('render');
    newChildren = render(newValue);
    setCurrentPhase(null);
  }

  // React DevTools reads this flag.
  workInProgress.effectTag |= PerformedWork;
  reconcileChildren(current$$1, workInProgress, newChildren, renderExpirationTime);
  return workInProgress.child;
}

function markWorkInProgressReceivedUpdate() {
  didReceiveUpdate = true;
}

function bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime) {
  cancelWorkTimer(workInProgress);

  if (current$$1 !== null) {
    // Reuse previous context list
    workInProgress.contextDependencies = current$$1.contextDependencies;
  }

  if (enableProfilerTimer) {
    // Don't update "base" render times for bailouts.
    stopProfilerTimerIfRunning(workInProgress);
  }

  // Check if the children have any pending work.
  var childExpirationTime = workInProgress.childExpirationTime;
  if (childExpirationTime < renderExpirationTime) {
    // The children don't have any work either. We can skip them.
    // TODO: Once we add back resuming, we should check if the children are
    // a work-in-progress set. If so, we need to transfer their effects.
    return null;
  } else {
    // This fiber doesn't have work, but its subtree does. Clone the child
    // fibers and continue.
    cloneChildFibers(current$$1, workInProgress);
    return workInProgress.child;
  }
}

function beginWork(current$$1, workInProgress, renderExpirationTime) {
  var updateExpirationTime = workInProgress.expirationTime;

  if (current$$1 !== null) {
    var oldProps = current$$1.memoizedProps;
    var newProps = workInProgress.pendingProps;

    if (oldProps !== newProps || hasContextChanged()) {
      // If props or context changed, mark the fiber as having performed work.
      // This may be unset if the props are determined to be equal later (memo).
      didReceiveUpdate = true;
    } else if (updateExpirationTime < renderExpirationTime) {
      didReceiveUpdate = false;
      // This fiber does not have any pending work. Bailout without entering
      // the begin phase. There's still some bookkeeping we that needs to be done
      // in this optimized path, mostly pushing stuff onto the stack.
      switch (workInProgress.tag) {
        case HostRoot:
          pushHostRootContext(workInProgress);
          resetHydrationState();
          break;
        case HostComponent:
          pushHostContext(workInProgress);
          break;
        case ClassComponent:
          {
            var Component = workInProgress.type;
            if (isContextProvider(Component)) {
              pushContextProvider(workInProgress);
            }
            break;
          }
        case HostPortal:
          pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);
          break;
        case ContextProvider:
          {
            var newValue = workInProgress.memoizedProps.value;
            pushProvider(workInProgress, newValue);
            break;
          }
        case Profiler:
          if (enableProfilerTimer) {
            workInProgress.effectTag |= Update;
          }
          break;
        case SuspenseComponent:
          {
            var state = workInProgress.memoizedState;
            var didTimeout = state !== null;
            if (didTimeout) {
              // If this boundary is currently timed out, we need to decide
              // whether to retry the primary children, or to skip over it and
              // go straight to the fallback. Check the priority of the primary
              var primaryChildFragment = workInProgress.child;
              var primaryChildExpirationTime = primaryChildFragment.childExpirationTime;
              if (primaryChildExpirationTime !== NoWork && primaryChildExpirationTime >= renderExpirationTime) {
                // The primary children have pending work. Use the normal path
                // to attempt to render the primary children again.
                return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
              } else {
                // The primary children do not have pending work with sufficient
                // priority. Bailout.
                var child = bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
                if (child !== null) {
                  // The fallback children have pending work. Skip over the
                  // primary children and work on the fallback.
                  return child.sibling;
                } else {
                  return null;
                }
              }
            }
            break;
          }
        case DehydratedSuspenseComponent:
          {
            if (enableSuspenseServerRenderer) {
              // We know that this component will suspend again because if it has
              // been unsuspended it has committed as a regular Suspense component.
              // If it needs to be retried, it should have work scheduled on it.
              workInProgress.effectTag |= DidCapture;
              break;
            }
          }
      }
      return bailoutOnAlreadyFinishedWork(current$$1, workInProgress, renderExpirationTime);
    }
  } else {
    didReceiveUpdate = false;
  }

  // Before entering the begin phase, clear the expiration time.
  workInProgress.expirationTime = NoWork;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
      {
        var elementType = workInProgress.elementType;
        return mountIndeterminateComponent(current$$1, workInProgress, elementType, renderExpirationTime);
      }
    case LazyComponent:
      {
        var _elementType = workInProgress.elementType;
        return mountLazyComponent(current$$1, workInProgress, _elementType, updateExpirationTime, renderExpirationTime);
      }
    case FunctionComponent:
      {
        var _Component = workInProgress.type;
        var unresolvedProps = workInProgress.pendingProps;
        var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);
        return updateFunctionComponent(current$$1, workInProgress, _Component, resolvedProps, renderExpirationTime);
      }
    case ClassComponent:
      {
        var _Component2 = workInProgress.type;
        var _unresolvedProps = workInProgress.pendingProps;
        var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);
        return updateClassComponent(current$$1, workInProgress, _Component2, _resolvedProps, renderExpirationTime);
      }
    case HostRoot:
      return updateHostRoot(current$$1, workInProgress, renderExpirationTime);
    case HostComponent:
      return updateHostComponent(current$$1, workInProgress, renderExpirationTime);
    case HostText:
      return updateHostText(current$$1, workInProgress);
    case SuspenseComponent:
      return updateSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
    case HostPortal:
      return updatePortalComponent(current$$1, workInProgress, renderExpirationTime);
    case ForwardRef:
      {
        var type = workInProgress.type;
        var _unresolvedProps2 = workInProgress.pendingProps;
        var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);
        return updateForwardRef(current$$1, workInProgress, type, _resolvedProps2, renderExpirationTime);
      }
    case Fragment:
      return updateFragment(current$$1, workInProgress, renderExpirationTime);
    case Mode:
      return updateMode(current$$1, workInProgress, renderExpirationTime);
    case Profiler:
      return updateProfiler(current$$1, workInProgress, renderExpirationTime);
    case ContextProvider:
      return updateContextProvider(current$$1, workInProgress, renderExpirationTime);
    case ContextConsumer:
      return updateContextConsumer(current$$1, workInProgress, renderExpirationTime);
    case MemoComponent:
      {
        var _type2 = workInProgress.type;
        var _unresolvedProps3 = workInProgress.pendingProps;
        // Resolve outer props first, then resolve inner props.
        var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);
        {
          if (workInProgress.type !== workInProgress.elementType) {
            var outerPropTypes = _type2.propTypes;
            if (outerPropTypes) {
              checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only
              'prop', getComponentName(_type2), getCurrentFiberStackInDev);
            }
          }
        }
        _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);
        return updateMemoComponent(current$$1, workInProgress, _type2, _resolvedProps3, updateExpirationTime, renderExpirationTime);
      }
    case SimpleMemoComponent:
      {
        return updateSimpleMemoComponent(current$$1, workInProgress, workInProgress.type, workInProgress.pendingProps, updateExpirationTime, renderExpirationTime);
      }
    case IncompleteClassComponent:
      {
        var _Component3 = workInProgress.type;
        var _unresolvedProps4 = workInProgress.pendingProps;
        var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);
        return mountIncompleteClassComponent(current$$1, workInProgress, _Component3, _resolvedProps4, renderExpirationTime);
      }
    case DehydratedSuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          return updateDehydratedSuspenseComponent(current$$1, workInProgress, renderExpirationTime);
        }
        break;
      }
  }
  invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
}

var valueCursor = createCursor(null);

var rendererSigil = void 0;
{
  // Use this to detect multiple renderers using the same context
  rendererSigil = {};
}

var currentlyRenderingFiber = null;
var lastContextDependency = null;
var lastContextWithAllBitsObserved = null;

var isDisallowedContextReadInDEV = false;

function resetContextDependences() {
  // This is called right before React yields execution, to ensure `readContext`
  // cannot be called outside the render phase.
  currentlyRenderingFiber = null;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;
  {
    isDisallowedContextReadInDEV = false;
  }
}

function enterDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = true;
  }
}

function exitDisallowedContextReadInDEV() {
  {
    isDisallowedContextReadInDEV = false;
  }
}

function pushProvider(providerFiber, nextValue) {
  var context = providerFiber.type._context;

  if (isPrimaryRenderer) {
    push(valueCursor, context._currentValue, providerFiber);

    context._currentValue = nextValue;
    {
      !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
      context._currentRenderer = rendererSigil;
    }
  } else {
    push(valueCursor, context._currentValue2, providerFiber);

    context._currentValue2 = nextValue;
    {
      !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
      context._currentRenderer2 = rendererSigil;
    }
  }
}

function popProvider(providerFiber) {
  var currentValue = valueCursor.current;

  pop(valueCursor, providerFiber);

  var context = providerFiber.type._context;
  if (isPrimaryRenderer) {
    context._currentValue = currentValue;
  } else {
    context._currentValue2 = currentValue;
  }
}

function calculateChangedBits(context, newValue, oldValue) {
  if (is(oldValue, newValue)) {
    // No change
    return 0;
  } else {
    var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : maxSigned31BitInt;

    {
      !((changedBits & maxSigned31BitInt) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
    }
    return changedBits | 0;
  }
}

function scheduleWorkOnParentPath(parent, renderExpirationTime) {
  // Update the child expiration time of all the ancestors, including
  // the alternates.
  var node = parent;
  while (node !== null) {
    var alternate = node.alternate;
    if (node.childExpirationTime < renderExpirationTime) {
      node.childExpirationTime = renderExpirationTime;
      if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
        alternate.childExpirationTime = renderExpirationTime;
      }
    } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
      alternate.childExpirationTime = renderExpirationTime;
    } else {
      // Neither alternate was updated, which means the rest of the
      // ancestor path already has sufficient priority.
      break;
    }
    node = node.return;
  }
}

function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
  var fiber = workInProgress.child;
  if (fiber !== null) {
    // Set the return pointer of the child to the work-in-progress fiber.
    fiber.return = workInProgress;
  }
  while (fiber !== null) {
    var nextFiber = void 0;

    // Visit this fiber.
    var list = fiber.contextDependencies;
    if (list !== null) {
      nextFiber = fiber.child;

      var dependency = list.first;
      while (dependency !== null) {
        // Check if the context matches.
        if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
          // Match! Schedule an update on this fiber.

          if (fiber.tag === ClassComponent) {
            // Schedule a force update on the work-in-progress.
            var update = createUpdate(renderExpirationTime);
            update.tag = ForceUpdate;
            // TODO: Because we don't have a work-in-progress, this will add the
            // update to the current fiber, too, which means it will persist even if
            // this render is thrown away. Since it's a race condition, not sure it's
            // worth fixing.
            enqueueUpdate(fiber, update);
          }

          if (fiber.expirationTime < renderExpirationTime) {
            fiber.expirationTime = renderExpirationTime;
          }
          var alternate = fiber.alternate;
          if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
            alternate.expirationTime = renderExpirationTime;
          }

          scheduleWorkOnParentPath(fiber.return, renderExpirationTime);

          // Mark the expiration time on the list, too.
          if (list.expirationTime < renderExpirationTime) {
            list.expirationTime = renderExpirationTime;
          }

          // Since we already found a match, we can stop traversing the
          // dependency list.
          break;
        }
        dependency = dependency.next;
      }
    } else if (fiber.tag === ContextProvider) {
      // Don't scan deeper if this is a matching provider
      nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
    } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedSuspenseComponent) {
      // If a dehydrated suspense component is in this subtree, we don't know
      // if it will have any context consumers in it. The best we can do is
      // mark it as having updates on its children.
      if (fiber.expirationTime < renderExpirationTime) {
        fiber.expirationTime = renderExpirationTime;
      }
      var _alternate = fiber.alternate;
      if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) {
        _alternate.expirationTime = renderExpirationTime;
      }
      // This is intentionally passing this fiber as the parent
      // because we want to schedule this fiber as having work
      // on its children. We'll use the childExpirationTime on
      // this fiber to indicate that a context has changed.
      scheduleWorkOnParentPath(fiber, renderExpirationTime);
      nextFiber = fiber.sibling;
    } else {
      // Traverse down.
      nextFiber = fiber.child;
    }

    if (nextFiber !== null) {
      // Set the return pointer of the child to the work-in-progress fiber.
      nextFiber.return = fiber;
    } else {
      // No child. Traverse to next sibling.
      nextFiber = fiber;
      while (nextFiber !== null) {
        if (nextFiber === workInProgress) {
          // We're back to the root of this subtree. Exit.
          nextFiber = null;
          break;
        }
        var sibling = nextFiber.sibling;
        if (sibling !== null) {
          // Set the return pointer of the sibling to the work-in-progress fiber.
          sibling.return = nextFiber.return;
          nextFiber = sibling;
          break;
        }
        // No more siblings. Traverse up.
        nextFiber = nextFiber.return;
      }
    }
    fiber = nextFiber;
  }
}

function prepareToReadContext(workInProgress, renderExpirationTime) {
  currentlyRenderingFiber = workInProgress;
  lastContextDependency = null;
  lastContextWithAllBitsObserved = null;

  var currentDependencies = workInProgress.contextDependencies;
  if (currentDependencies !== null && currentDependencies.expirationTime >= renderExpirationTime) {
    // Context list has a pending update. Mark that this fiber performed work.
    markWorkInProgressReceivedUpdate();
  }

  // Reset the work-in-progress list
  workInProgress.contextDependencies = null;
}

function readContext(context, observedBits) {
  {
    // This warning would fire if you read context inside a Hook like useMemo.
    // Unlike the class check below, it's not enforced in production for perf.
    !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
  }

  if (lastContextWithAllBitsObserved === context) {
    // Nothing to do. We already observe everything in this context.
  } else if (observedBits === false || observedBits === 0) {
    // Do not observe any updates.
  } else {
    var resolvedObservedBits = void 0; // Avoid deopting on observable arguments or heterogeneous types.
    if (typeof observedBits !== 'number' || observedBits === maxSigned31BitInt) {
      // Observe all updates.
      lastContextWithAllBitsObserved = context;
      resolvedObservedBits = maxSigned31BitInt;
    } else {
      resolvedObservedBits = observedBits;
    }

    var contextItem = {
      context: context,
      observedBits: resolvedObservedBits,
      next: null
    };

    if (lastContextDependency === null) {
      !(currentlyRenderingFiber !== null) ? invariant(false, 'Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().') : void 0;

      // This is the first dependency for this component. Create a new list.
      lastContextDependency = contextItem;
      currentlyRenderingFiber.contextDependencies = {
        first: contextItem,
        expirationTime: NoWork
      };
    } else {
      // Append a new context item.
      lastContextDependency = lastContextDependency.next = contextItem;
    }
  }
  return isPrimaryRenderer ? context._currentValue : context._currentValue2;
}

// UpdateQueue is a linked list of prioritized updates.
//
// Like fibers, update queues come in pairs: a current queue, which represents
// the visible state of the screen, and a work-in-progress queue, which can be
// mutated and processed asynchronously before it is committed — a form of
// double buffering. If a work-in-progress render is discarded before finishing,
// we create a new work-in-progress by cloning the current queue.
//
// Both queues share a persistent, singly-linked list structure. To schedule an
// update, we append it to the end of both queues. Each queue maintains a
// pointer to first update in the persistent list that hasn't been processed.
// The work-in-progress pointer always has a position equal to or greater than
// the current queue, since we always work on that one. The current queue's
// pointer is only updated during the commit phase, when we swap in the
// work-in-progress.
//
// For example:
//
//   Current pointer:           A - B - C - D - E - F
//   Work-in-progress pointer:              D - E - F
//                                          ^
//                                          The work-in-progress queue has
//                                          processed more updates than current.
//
// The reason we append to both queues is because otherwise we might drop
// updates without ever processing them. For example, if we only add updates to
// the work-in-progress queue, some updates could be lost whenever a work-in
// -progress render restarts by cloning from current. Similarly, if we only add
// updates to the current queue, the updates will be lost whenever an already
// in-progress queue commits and swaps with the current queue. However, by
// adding to both queues, we guarantee that the update will be part of the next
// work-in-progress. (And because the work-in-progress queue becomes the
// current queue once it commits, there's no danger of applying the same
// update twice.)
//
// Prioritization
// --------------
//
// Updates are not sorted by priority, but by insertion; new updates are always
// appended to the end of the list.
//
// The priority is still important, though. When processing the update queue
// during the render phase, only the updates with sufficient priority are
// included in the result. If we skip an update because it has insufficient
// priority, it remains in the queue to be processed later, during a lower
// priority render. Crucially, all updates subsequent to a skipped update also
// remain in the queue *regardless of their priority*. That means high priority
// updates are sometimes processed twice, at two separate priorities. We also
// keep track of a base state, that represents the state before the first
// update in the queue is applied.
//
// For example:
//
//   Given a base state of '', and the following queue of updates
//
//     A1 - B2 - C1 - D2
//
//   where the number indicates the priority, and the update is applied to the
//   previous state by appending a letter, React will process these updates as
//   two separate renders, one per distinct priority level:
//
//   First render, at priority 1:
//     Base state: ''
//     Updates: [A1, C1]
//     Result state: 'AC'
//
//   Second render, at priority 2:
//     Base state: 'A'            <-  The base state does not include C1,
//                                    because B2 was skipped.
//     Updates: [B2, C1, D2]      <-  C1 was rebased on top of B2
//     Result state: 'ABCD'
//
// Because we process updates in insertion order, and rebase high priority
// updates when preceding updates are skipped, the final result is deterministic
// regardless of priority. Intermediate state may vary according to system
// resources, but the final state is always the same.

var UpdateState = 0;
var ReplaceState = 1;
var ForceUpdate = 2;
var CaptureUpdate = 3;

// Global state that is reset at the beginning of calling `processUpdateQueue`.
// It should only be read right after calling `processUpdateQueue`, via
// `checkHasForceUpdateAfterProcessing`.
var hasForceUpdate = false;

var didWarnUpdateInsideUpdate = void 0;
var currentlyProcessingQueue = void 0;
var resetCurrentlyProcessingQueue = void 0;
{
  didWarnUpdateInsideUpdate = false;
  currentlyProcessingQueue = null;
  resetCurrentlyProcessingQueue = function () {
    currentlyProcessingQueue = null;
  };
}

function createUpdateQueue(baseState) {
  var queue = {
    baseState: baseState,
    firstUpdate: null,
    lastUpdate: null,
    firstCapturedUpdate: null,
    lastCapturedUpdate: null,
    firstEffect: null,
    lastEffect: null,
    firstCapturedEffect: null,
    lastCapturedEffect: null
  };
  return queue;
}

function cloneUpdateQueue(currentQueue) {
  var queue = {
    baseState: currentQueue.baseState,
    firstUpdate: currentQueue.firstUpdate,
    lastUpdate: currentQueue.lastUpdate,

    // TODO: With resuming, if we bail out and resuse the child tree, we should
    // keep these effects.
    firstCapturedUpdate: null,
    lastCapturedUpdate: null,

    firstEffect: null,
    lastEffect: null,

    firstCapturedEffect: null,
    lastCapturedEffect: null
  };
  return queue;
}

function createUpdate(expirationTime) {
  return {
    expirationTime: expirationTime,

    tag: UpdateState,
    payload: null,
    callback: null,

    next: null,
    nextEffect: null
  };
}

function appendUpdateToQueue(queue, update) {
  // Append the update to the end of the list.
  if (queue.lastUpdate === null) {
    // Queue is empty
    queue.firstUpdate = queue.lastUpdate = update;
  } else {
    queue.lastUpdate.next = update;
    queue.lastUpdate = update;
  }
}

function enqueueUpdate(fiber, update) {
  // Update queues are created lazily.
  var alternate = fiber.alternate;
  var queue1 = void 0;
  var queue2 = void 0;
  if (alternate === null) {
    // There's only one fiber.
    queue1 = fiber.updateQueue;
    queue2 = null;
    if (queue1 === null) {
      queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
    }
  } else {
    // There are two owners.
    queue1 = fiber.updateQueue;
    queue2 = alternate.updateQueue;
    if (queue1 === null) {
      if (queue2 === null) {
        // Neither fiber has an update queue. Create new ones.
        queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
        queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState);
      } else {
        // Only one fiber has an update queue. Clone to create a new one.
        queue1 = fiber.updateQueue = cloneUpdateQueue(queue2);
      }
    } else {
      if (queue2 === null) {
        // Only one fiber has an update queue. Clone to create a new one.
        queue2 = alternate.updateQueue = cloneUpdateQueue(queue1);
      } else {
        // Both owners have an update queue.
      }
    }
  }
  if (queue2 === null || queue1 === queue2) {
    // There's only a single queue.
    appendUpdateToQueue(queue1, update);
  } else {
    // There are two queues. We need to append the update to both queues,
    // while accounting for the persistent structure of the list — we don't
    // want the same update to be added multiple times.
    if (queue1.lastUpdate === null || queue2.lastUpdate === null) {
      // One of the queues is not empty. We must add the update to both queues.
      appendUpdateToQueue(queue1, update);
      appendUpdateToQueue(queue2, update);
    } else {
      // Both queues are non-empty. The last update is the same in both lists,
      // because of structural sharing. So, only append to one of the lists.
      appendUpdateToQueue(queue1, update);
      // But we still need to update the `lastUpdate` pointer of queue2.
      queue2.lastUpdate = update;
    }
  }

  {
    if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) {
      warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
      didWarnUpdateInsideUpdate = true;
    }
  }
}

function enqueueCapturedUpdate(workInProgress, update) {
  // Captured updates go into a separate list, and only on the work-in-
  // progress queue.
  var workInProgressQueue = workInProgress.updateQueue;
  if (workInProgressQueue === null) {
    workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState);
  } else {
    // TODO: I put this here rather than createWorkInProgress so that we don't
    // clone the queue unnecessarily. There's probably a better way to
    // structure this.
    workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
  }

  // Append the update to the end of the list.
  if (workInProgressQueue.lastCapturedUpdate === null) {
    // This is the first render phase update
    workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update;
  } else {
    workInProgressQueue.lastCapturedUpdate.next = update;
    workInProgressQueue.lastCapturedUpdate = update;
  }
}

function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
  var current = workInProgress.alternate;
  if (current !== null) {
    // If the work-in-progress queue is equal to the current queue,
    // we need to clone it first.
    if (queue === current.updateQueue) {
      queue = workInProgress.updateQueue = cloneUpdateQueue(queue);
    }
  }
  return queue;
}

function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
  switch (update.tag) {
    case ReplaceState:
      {
        var _payload = update.payload;
        if (typeof _payload === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
            if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
              _payload.call(instance, prevState, nextProps);
            }
          }
          var nextState = _payload.call(instance, prevState, nextProps);
          {
            exitDisallowedContextReadInDEV();
          }
          return nextState;
        }
        // State object
        return _payload;
      }
    case CaptureUpdate:
      {
        workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
      }
    // Intentional fallthrough
    case UpdateState:
      {
        var _payload2 = update.payload;
        var partialState = void 0;
        if (typeof _payload2 === 'function') {
          // Updater function
          {
            enterDisallowedContextReadInDEV();
            if (debugRenderPhaseSideEffects || debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
              _payload2.call(instance, prevState, nextProps);
            }
          }
          partialState = _payload2.call(instance, prevState, nextProps);
          {
            exitDisallowedContextReadInDEV();
          }
        } else {
          // Partial state object
          partialState = _payload2;
        }
        if (partialState === null || partialState === undefined) {
          // Null and undefined are treated as no-ops.
          return prevState;
        }
        // Merge the partial state and the previous state.
        return _assign({}, prevState, partialState);
      }
    case ForceUpdate:
      {
        hasForceUpdate = true;
        return prevState;
      }
  }
  return prevState;
}

function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) {
  hasForceUpdate = false;

  queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);

  {
    currentlyProcessingQueue = queue;
  }

  // These values may change as we process the queue.
  var newBaseState = queue.baseState;
  var newFirstUpdate = null;
  var newExpirationTime = NoWork;

  // Iterate through the list of updates to compute the result.
  var update = queue.firstUpdate;
  var resultState = newBaseState;
  while (update !== null) {
    var updateExpirationTime = update.expirationTime;
    if (updateExpirationTime < renderExpirationTime) {
      // This update does not have sufficient priority. Skip it.
      if (newFirstUpdate === null) {
        // This is the first skipped update. It will be the first update in
        // the new list.
        newFirstUpdate = update;
        // Since this is the first update that was skipped, the current result
        // is the new base state.
        newBaseState = resultState;
      }
      // Since this update will remain in the list, update the remaining
      // expiration time.
      if (newExpirationTime < updateExpirationTime) {
        newExpirationTime = updateExpirationTime;
      }
    } else {
      // This update does have sufficient priority. Process it and compute
      // a new result.
      resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
      var _callback = update.callback;
      if (_callback !== null) {
        workInProgress.effectTag |= Callback;
        // Set this to null, in case it was mutated during an aborted render.
        update.nextEffect = null;
        if (queue.lastEffect === null) {
          queue.firstEffect = queue.lastEffect = update;
        } else {
          queue.lastEffect.nextEffect = update;
          queue.lastEffect = update;
        }
      }
    }
    // Continue to the next update.
    update = update.next;
  }

  // Separately, iterate though the list of captured updates.
  var newFirstCapturedUpdate = null;
  update = queue.firstCapturedUpdate;
  while (update !== null) {
    var _updateExpirationTime = update.expirationTime;
    if (_updateExpirationTime < renderExpirationTime) {
      // This update does not have sufficient priority. Skip it.
      if (newFirstCapturedUpdate === null) {
        // This is the first skipped captured update. It will be the first
        // update in the new list.
        newFirstCapturedUpdate = update;
        // If this is the first update that was skipped, the current result is
        // the new base state.
        if (newFirstUpdate === null) {
          newBaseState = resultState;
        }
      }
      // Since this update will remain in the list, update the remaining
      // expiration time.
      if (newExpirationTime < _updateExpirationTime) {
        newExpirationTime = _updateExpirationTime;
      }
    } else {
      // This update does have sufficient priority. Process it and compute
      // a new result.
      resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
      var _callback2 = update.callback;
      if (_callback2 !== null) {
        workInProgress.effectTag |= Callback;
        // Set this to null, in case it was mutated during an aborted render.
        update.nextEffect = null;
        if (queue.lastCapturedEffect === null) {
          queue.firstCapturedEffect = queue.lastCapturedEffect = update;
        } else {
          queue.lastCapturedEffect.nextEffect = update;
          queue.lastCapturedEffect = update;
        }
      }
    }
    update = update.next;
  }

  if (newFirstUpdate === null) {
    queue.lastUpdate = null;
  }
  if (newFirstCapturedUpdate === null) {
    queue.lastCapturedUpdate = null;
  } else {
    workInProgress.effectTag |= Callback;
  }
  if (newFirstUpdate === null && newFirstCapturedUpdate === null) {
    // We processed every update, without skipping. That means the new base
    // state is the same as the result state.
    newBaseState = resultState;
  }

  queue.baseState = newBaseState;
  queue.firstUpdate = newFirstUpdate;
  queue.firstCapturedUpdate = newFirstCapturedUpdate;

  // Set the remaining expiration time to be whatever is remaining in the queue.
  // This should be fine because the only two other things that contribute to
  // expiration time are props and context. We're already in the middle of the
  // begin phase by the time we start processing the queue, so we've already
  // dealt with the props. Context in components that specify
  // shouldComponentUpdate is tricky; but we'll have to account for
  // that regardless.
  workInProgress.expirationTime = newExpirationTime;
  workInProgress.memoizedState = resultState;

  {
    currentlyProcessingQueue = null;
  }
}

function callCallback(callback, context) {
  !(typeof callback === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', callback) : void 0;
  callback.call(context);
}

function resetHasForceUpdateBeforeProcessing() {
  hasForceUpdate = false;
}

function checkHasForceUpdateAfterProcessing() {
  return hasForceUpdate;
}

function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) {
  // If the finished render included captured updates, and there are still
  // lower priority updates left over, we need to keep the captured updates
  // in the queue so that they are rebased and not dropped once we process the
  // queue again at the lower priority.
  if (finishedQueue.firstCapturedUpdate !== null) {
    // Join the captured update list to the end of the normal list.
    if (finishedQueue.lastUpdate !== null) {
      finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate;
      finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate;
    }
    // Clear the list of captured updates.
    finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null;
  }

  // Commit the effects
  commitUpdateEffects(finishedQueue.firstEffect, instance);
  finishedQueue.firstEffect = finishedQueue.lastEffect = null;

  commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
  finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
}

function commitUpdateEffects(effect, instance) {
  while (effect !== null) {
    var _callback3 = effect.callback;
    if (_callback3 !== null) {
      effect.callback = null;
      callCallback(_callback3, instance);
    }
    effect = effect.nextEffect;
  }
}

function createCapturedValue(value, source) {
  // If the value is an error, call this function immediately after it is thrown
  // so the stack is accurate.
  return {
    value: value,
    source: source,
    stack: getStackByFiberInDevAndProd(source)
  };
}

function markUpdate(workInProgress) {
  // Tag the fiber with an update effect. This turns a Placement into
  // a PlacementAndUpdate.
  workInProgress.effectTag |= Update;
}

function markRef$1(workInProgress) {
  workInProgress.effectTag |= Ref;
}

var appendAllChildren = void 0;
var updateHostContainer = void 0;
var updateHostComponent$1 = void 0;
var updateHostText$1 = void 0;
if (supportsMutation) {
  // Mutation mode

  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;
    while (node !== null) {
      if (node.tag === HostComponent || node.tag === HostText) {
        appendInitialChild(parent, node.stateNode);
      } else if (node.tag === HostPortal) {
        // If we have a portal child, then we don't want to traverse
        // down its children. Instead, we'll get insertions from each child in
        // the portal directly.
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === workInProgress) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  };

  updateHostContainer = function (workInProgress) {
    // Noop
  };
  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    // If we have an alternate, that means this is an update and we need to
    // schedule a side-effect to do the updates.
    var oldProps = current.memoizedProps;
    if (oldProps === newProps) {
      // In mutation mode, this is sufficient for a bailout because
      // we won't touch this node even if children changed.
      return;
    }

    // If we get updated because one of our children updated, we don't
    // have newProps so we'll have to reuse them.
    // TODO: Split the update API as separate for the props vs. children.
    // Even better would be if children weren't special cased at all tho.
    var instance = workInProgress.stateNode;
    var currentHostContext = getHostContext();
    // TODO: Experiencing an error where oldProps is null. Suggests a host
    // component is hitting the resume path. Figure out why. Possibly
    // related to `hidden`.
    var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
    // TODO: Type this specific to this type of component.
    workInProgress.updateQueue = updatePayload;
    // If the update payload indicates that there is a change or if there
    // is a new ref we mark this as an update. All the work is done in commitWork.
    if (updatePayload) {
      markUpdate(workInProgress);
    }
  };
  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    // If the text differs, mark it as an update. All the work in done in commitWork.
    if (oldText !== newText) {
      markUpdate(workInProgress);
    }
  };
} else if (supportsPersistence) {
  // Persistent host tree mode

  appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;
    while (node !== null) {
      // eslint-disable-next-line no-labels
      branches: if (node.tag === HostComponent) {
        var instance = node.stateNode;
        if (needsVisibilityToggle) {
          var props = node.memoizedProps;
          var type = node.type;
          if (isHidden) {
            // This child is inside a timed out tree. Hide it.
            instance = cloneHiddenInstance(instance, type, props, node);
          } else {
            // This child was previously inside a timed out tree. If it was not
            // updated during this render, it may need to be unhidden. Clone
            // again to be sure.
            instance = cloneUnhiddenInstance(instance, type, props, node);
          }
          node.stateNode = instance;
        }
        appendInitialChild(parent, instance);
      } else if (node.tag === HostText) {
        var _instance = node.stateNode;
        if (needsVisibilityToggle) {
          var text = node.memoizedProps;
          var rootContainerInstance = getRootHostContainer();
          var currentHostContext = getHostContext();
          if (isHidden) {
            _instance = createHiddenTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
          } else {
            _instance = createTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
          }
          node.stateNode = _instance;
        }
        appendInitialChild(parent, _instance);
      } else if (node.tag === HostPortal) {
        // If we have a portal child, then we don't want to traverse
        // down its children. Instead, we'll get insertions from each child in
        // the portal directly.
      } else if (node.tag === SuspenseComponent) {
        var current = node.alternate;
        if (current !== null) {
          var oldState = current.memoizedState;
          var newState = node.memoizedState;
          var oldIsHidden = oldState !== null;
          var newIsHidden = newState !== null;
          if (oldIsHidden !== newIsHidden) {
            // The placeholder either just timed out or switched back to the normal
            // children after having previously timed out. Toggle the visibility of
            // the direct host children.
            var primaryChildParent = newIsHidden ? node.child : node;
            if (primaryChildParent !== null) {
              appendAllChildren(parent, primaryChildParent, true, newIsHidden);
            }
            // eslint-disable-next-line no-labels
            break branches;
          }
        }
        if (node.child !== null) {
          // Continue traversing like normal
          node.child.return = node;
          node = node.child;
          continue;
        }
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      // $FlowFixMe This is correct but Flow is confused by the labeled break.
      node = node;
      if (node === workInProgress) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  };

  // An unfortunate fork of appendAllChildren because we have two different parent types.
  var appendAllChildrenToContainer = function (containerChildSet, workInProgress, needsVisibilityToggle, isHidden) {
    // We only have the top Fiber that was created but we need recurse down its
    // children to find all the terminal nodes.
    var node = workInProgress.child;
    while (node !== null) {
      // eslint-disable-next-line no-labels
      branches: if (node.tag === HostComponent) {
        var instance = node.stateNode;
        if (needsVisibilityToggle) {
          var props = node.memoizedProps;
          var type = node.type;
          if (isHidden) {
            // This child is inside a timed out tree. Hide it.
            instance = cloneHiddenInstance(instance, type, props, node);
          } else {
            // This child was previously inside a timed out tree. If it was not
            // updated during this render, it may need to be unhidden. Clone
            // again to be sure.
            instance = cloneUnhiddenInstance(instance, type, props, node);
          }
          node.stateNode = instance;
        }
        appendChildToContainerChildSet(containerChildSet, instance);
      } else if (node.tag === HostText) {
        var _instance2 = node.stateNode;
        if (needsVisibilityToggle) {
          var text = node.memoizedProps;
          var rootContainerInstance = getRootHostContainer();
          var currentHostContext = getHostContext();
          if (isHidden) {
            _instance2 = createHiddenTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
          } else {
            _instance2 = createTextInstance(text, rootContainerInstance, currentHostContext, workInProgress);
          }
          node.stateNode = _instance2;
        }
        appendChildToContainerChildSet(containerChildSet, _instance2);
      } else if (node.tag === HostPortal) {
        // If we have a portal child, then we don't want to traverse
        // down its children. Instead, we'll get insertions from each child in
        // the portal directly.
      } else if (node.tag === SuspenseComponent) {
        var current = node.alternate;
        if (current !== null) {
          var oldState = current.memoizedState;
          var newState = node.memoizedState;
          var oldIsHidden = oldState !== null;
          var newIsHidden = newState !== null;
          if (oldIsHidden !== newIsHidden) {
            // The placeholder either just timed out or switched back to the normal
            // children after having previously timed out. Toggle the visibility of
            // the direct host children.
            var primaryChildParent = newIsHidden ? node.child : node;
            if (primaryChildParent !== null) {
              appendAllChildrenToContainer(containerChildSet, primaryChildParent, true, newIsHidden);
            }
            // eslint-disable-next-line no-labels
            break branches;
          }
        }
        if (node.child !== null) {
          // Continue traversing like normal
          node.child.return = node;
          node = node.child;
          continue;
        }
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      // $FlowFixMe This is correct but Flow is confused by the labeled break.
      node = node;
      if (node === workInProgress) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === workInProgress) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  };
  updateHostContainer = function (workInProgress) {
    var portalOrRoot = workInProgress.stateNode;
    var childrenUnchanged = workInProgress.firstEffect === null;
    if (childrenUnchanged) {
      // No changes, just reuse the existing instance.
    } else {
      var container = portalOrRoot.containerInfo;
      var newChildSet = createContainerChildSet(container);
      // If children might have changed, we have to add them all to the set.
      appendAllChildrenToContainer(newChildSet, workInProgress, false, false);
      portalOrRoot.pendingChildren = newChildSet;
      // Schedule an update on the container to swap out the container.
      markUpdate(workInProgress);
      finalizeContainerChildren(container, newChildSet);
    }
  };
  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    var currentInstance = current.stateNode;
    var oldProps = current.memoizedProps;
    // If there are no effects associated with this node, then none of our children had any updates.
    // This guarantees that we can reuse all of them.
    var childrenUnchanged = workInProgress.firstEffect === null;
    if (childrenUnchanged && oldProps === newProps) {
      // No changes, just reuse the existing instance.
      // Note that this might release a previous clone.
      workInProgress.stateNode = currentInstance;
      return;
    }
    var recyclableInstance = workInProgress.stateNode;
    var currentHostContext = getHostContext();
    var updatePayload = null;
    if (oldProps !== newProps) {
      updatePayload = prepareUpdate(recyclableInstance, type, oldProps, newProps, rootContainerInstance, currentHostContext);
    }
    if (childrenUnchanged && updatePayload === null) {
      // No changes, just reuse the existing instance.
      // Note that this might release a previous clone.
      workInProgress.stateNode = currentInstance;
      return;
    }
    var newInstance = cloneInstance(currentInstance, updatePayload, type, oldProps, newProps, workInProgress, childrenUnchanged, recyclableInstance);
    if (finalizeInitialChildren(newInstance, type, newProps, rootContainerInstance, currentHostContext)) {
      markUpdate(workInProgress);
    }
    workInProgress.stateNode = newInstance;
    if (childrenUnchanged) {
      // If there are no other effects in this tree, we need to flag this node as having one.
      // Even though we're not going to use it for anything.
      // Otherwise parents won't know that there are new children to propagate upwards.
      markUpdate(workInProgress);
    } else {
      // If children might have changed, we have to add them all to the set.
      appendAllChildren(newInstance, workInProgress, false, false);
    }
  };
  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    if (oldText !== newText) {
      // If the text content differs, we'll create a new text instance for it.
      var rootContainerInstance = getRootHostContainer();
      var currentHostContext = getHostContext();
      workInProgress.stateNode = createTextInstance(newText, rootContainerInstance, currentHostContext, workInProgress);
      // We'll have to mark it as having an effect, even though we won't use the effect for anything.
      // This lets the parents know that at least one of their children has changed.
      markUpdate(workInProgress);
    }
  };
} else {
  // No host operations
  updateHostContainer = function (workInProgress) {
    // Noop
  };
  updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {
    // Noop
  };
  updateHostText$1 = function (current, workInProgress, oldText, newText) {
    // Noop
  };
}

function completeWork(current, workInProgress, renderExpirationTime) {
  var newProps = workInProgress.pendingProps;

  switch (workInProgress.tag) {
    case IndeterminateComponent:
      break;
    case LazyComponent:
      break;
    case SimpleMemoComponent:
    case FunctionComponent:
      break;
    case ClassComponent:
      {
        var Component = workInProgress.type;
        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }
        break;
      }
    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        var fiberRoot = workInProgress.stateNode;
        if (fiberRoot.pendingContext) {
          fiberRoot.context = fiberRoot.pendingContext;
          fiberRoot.pendingContext = null;
        }
        if (current === null || current.child === null) {
          // If we hydrated, pop so that we can delete any remaining children
          // that weren't hydrated.
          popHydrationState(workInProgress);
          // This resets the hacky state to fix isMounted before committing.
          // TODO: Delete this when we delete isMounted and findDOMNode.
          workInProgress.effectTag &= ~Placement;
        }
        updateHostContainer(workInProgress);
        break;
      }
    case HostComponent:
      {
        popHostContext(workInProgress);
        var rootContainerInstance = getRootHostContainer();
        var type = workInProgress.type;
        if (current !== null && workInProgress.stateNode != null) {
          updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);

          if (current.ref !== workInProgress.ref) {
            markRef$1(workInProgress);
          }
        } else {
          if (!newProps) {
            !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;
            // This can happen when we abort work.
            break;
          }

          var currentHostContext = getHostContext();
          // TODO: Move createInstance to beginWork and keep it on a context
          // "stack" as the parent. Then append children as we go in beginWork
          // or completeWork depending on we want to add then top->down or
          // bottom->up. Top->down is faster in IE11.
          var wasHydrated = popHydrationState(workInProgress);
          if (wasHydrated) {
            // TODO: Move this and createInstance step into the beginPhase
            // to consolidate.
            if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {
              // If changes to the hydrated node needs to be applied at the
              // commit-phase we mark this as such.
              markUpdate(workInProgress);
            }
          } else {
            var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);

            appendAllChildren(instance, workInProgress, false, false);

            // Certain renderers require commit-time effects for initial mount.
            // (eg DOM renderer supports auto-focus for certain elements).
            // Make sure such renderers get scheduled for later work.
            if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance, currentHostContext)) {
              markUpdate(workInProgress);
            }
            workInProgress.stateNode = instance;
          }

          if (workInProgress.ref !== null) {
            // If there is a ref on a host node we need to schedule a callback
            markRef$1(workInProgress);
          }
        }
        break;
      }
    case HostText:
      {
        var newText = newProps;
        if (current && workInProgress.stateNode != null) {
          var oldText = current.memoizedProps;
          // If we have an alternate, that means this is an update and we need
          // to schedule a side-effect to do the updates.
          updateHostText$1(current, workInProgress, oldText, newText);
        } else {
          if (typeof newText !== 'string') {
            !(workInProgress.stateNode !== null) ? invariant(false, 'We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.') : void 0;
            // This can happen when we abort work.
          }
          var _rootContainerInstance = getRootHostContainer();
          var _currentHostContext = getHostContext();
          var _wasHydrated = popHydrationState(workInProgress);
          if (_wasHydrated) {
            if (prepareToHydrateHostTextInstance(workInProgress)) {
              markUpdate(workInProgress);
            }
          } else {
            workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);
          }
        }
        break;
      }
    case ForwardRef:
      break;
    case SuspenseComponent:
      {
        var nextState = workInProgress.memoizedState;
        if ((workInProgress.effectTag & DidCapture) !== NoEffect) {
          // Something suspended. Re-render with the fallback children.
          workInProgress.expirationTime = renderExpirationTime;
          // Do not reset the effect list.
          return workInProgress;
        }

        var nextDidTimeout = nextState !== null;
        var prevDidTimeout = current !== null && current.memoizedState !== null;

        if (current !== null && !nextDidTimeout && prevDidTimeout) {
          // We just switched from the fallback to the normal children. Delete
          // the fallback.
          // TODO: Would it be better to store the fallback fragment on
          var currentFallbackChild = current.child.sibling;
          if (currentFallbackChild !== null) {
            // Deletions go at the beginning of the return fiber's effect list
            var first = workInProgress.firstEffect;
            if (first !== null) {
              workInProgress.firstEffect = currentFallbackChild;
              currentFallbackChild.nextEffect = first;
            } else {
              workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChild;
              currentFallbackChild.nextEffect = null;
            }
            currentFallbackChild.effectTag = Deletion;
          }
        }

        if (nextDidTimeout || prevDidTimeout) {
          // If the children are hidden, or if they were previous hidden, schedule
          // an effect to toggle their visibility. This is also used to attach a
          // retry listener to the promise.
          workInProgress.effectTag |= Update;
        }
        break;
      }
    case Fragment:
      break;
    case Mode:
      break;
    case Profiler:
      break;
    case HostPortal:
      popHostContainer(workInProgress);
      updateHostContainer(workInProgress);
      break;
    case ContextProvider:
      // Pop provider fiber
      popProvider(workInProgress);
      break;
    case ContextConsumer:
      break;
    case MemoComponent:
      break;
    case IncompleteClassComponent:
      {
        // Same as class component case. I put it down here so that the tags are
        // sequential to ensure this switch is compiled to a jump table.
        var _Component = workInProgress.type;
        if (isContextProvider(_Component)) {
          popContext(workInProgress);
        }
        break;
      }
    case DehydratedSuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          if (current === null) {
            var _wasHydrated2 = popHydrationState(workInProgress);
            !_wasHydrated2 ? invariant(false, 'A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.') : void 0;
            skipPastDehydratedSuspenseInstance(workInProgress);
          } else if ((workInProgress.effectTag & DidCapture) === NoEffect) {
            // This boundary did not suspend so it's now hydrated.
            // To handle any future suspense cases, we're going to now upgrade it
            // to a Suspense component. We detach it from the existing current fiber.
            current.alternate = null;
            workInProgress.alternate = null;
            workInProgress.tag = SuspenseComponent;
            workInProgress.memoizedState = null;
            workInProgress.stateNode = null;
          }
        }
        break;
      }
    default:
      invariant(false, 'Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.');
  }

  return null;
}

function shouldCaptureSuspense(workInProgress) {
  // In order to capture, the Suspense component must have a fallback prop.
  if (workInProgress.memoizedProps.fallback === undefined) {
    return false;
  }
  // If it was the primary children that just suspended, capture and render the
  // fallback. Otherwise, don't capture and bubble to the next boundary.
  var nextState = workInProgress.memoizedState;
  return nextState === null;
}

// This module is forked in different environments.
// By default, return `true` to log errors to the console.
// Forks can return `false` if this isn't desirable.
function showErrorDialog(capturedError) {
  return true;
}

function logCapturedError(capturedError) {
  var logError = showErrorDialog(capturedError);

  // Allow injected showErrorDialog() to prevent default console.error logging.
  // This enables renderers like ReactNative to better manage redbox behavior.
  if (logError === false) {
    return;
  }

  var error = capturedError.error;
  {
    var componentName = capturedError.componentName,
        componentStack = capturedError.componentStack,
        errorBoundaryName = capturedError.errorBoundaryName,
        errorBoundaryFound = capturedError.errorBoundaryFound,
        willRetry = capturedError.willRetry;

    // Browsers support silencing uncaught errors by calling
    // `preventDefault()` in window `error` handler.
    // We record this information as an expando on the error.

    if (error != null && error._suppressLogging) {
      if (errorBoundaryFound && willRetry) {
        // The error is recoverable and was silenced.
        // Ignore it and don't print the stack addendum.
        // This is handy for testing error boundaries without noise.
        return;
      }
      // The error is fatal. Since the silencing might have
      // been accidental, we'll surface it anyway.
      // However, the browser would have silenced the original error
      // so we'll print it first, and then print the stack addendum.
      console.error(error);
      // For a more detailed description of this block, see:
      // https://github.com/facebook/react/pull/13384
    }

    var componentNameMessage = componentName ? 'The above error occurred in the <' + componentName + '> component:' : 'The above error occurred in one of your React components:';

    var errorBoundaryMessage = void 0;
    // errorBoundaryFound check is sufficient; errorBoundaryName check is to satisfy Flow.
    if (errorBoundaryFound && errorBoundaryName) {
      if (willRetry) {
        errorBoundaryMessage = 'React will try to recreate this component tree from scratch ' + ('using the error boundary you provided, ' + errorBoundaryName + '.');
      } else {
        errorBoundaryMessage = 'This error was initially handled by the error boundary ' + errorBoundaryName + '.\n' + 'Recreating the tree from scratch failed so React will unmount the tree.';
      }
    } else {
      errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://fb.me/react-error-boundaries to learn more about error boundaries.';
    }
    var combinedMessage = '' + componentNameMessage + componentStack + '\n\n' + ('' + errorBoundaryMessage);

    // In development, we provide our own message with just the component stack.
    // We don't include the original error message and JS stack because the browser
    // has already printed it. Even if the application swallows the error, it is still
    // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.
    console.error(combinedMessage);
  }
}

var didWarnAboutUndefinedSnapshotBeforeUpdate = null;
{
  didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();
}

var PossiblyWeakSet$1 = typeof WeakSet === 'function' ? WeakSet : Set;

function logError(boundary, errorInfo) {
  var source = errorInfo.source;
  var stack = errorInfo.stack;
  if (stack === null && source !== null) {
    stack = getStackByFiberInDevAndProd(source);
  }

  var capturedError = {
    componentName: source !== null ? getComponentName(source.type) : null,
    componentStack: stack !== null ? stack : '',
    error: errorInfo.value,
    errorBoundary: null,
    errorBoundaryName: null,
    errorBoundaryFound: false,
    willRetry: false
  };

  if (boundary !== null && boundary.tag === ClassComponent) {
    capturedError.errorBoundary = boundary.stateNode;
    capturedError.errorBoundaryName = getComponentName(boundary.type);
    capturedError.errorBoundaryFound = true;
    capturedError.willRetry = true;
  }

  try {
    logCapturedError(capturedError);
  } catch (e) {
    // This method must not throw, or React internal state will get messed up.
    // If console.error is overridden, or logCapturedError() shows a dialog that throws,
    // we want to report this error outside of the normal stack as a last resort.
    // https://github.com/facebook/react/issues/13188
    setTimeout(function () {
      throw e;
    });
  }
}

var callComponentWillUnmountWithTimer = function (current$$1, instance) {
  startPhaseTimer(current$$1, 'componentWillUnmount');
  instance.props = current$$1.memoizedProps;
  instance.state = current$$1.memoizedState;
  instance.componentWillUnmount();
  stopPhaseTimer();
};

// Capture errors so they don't interrupt unmounting.
function safelyCallComponentWillUnmount(current$$1, instance) {
  {
    invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current$$1, instance);
    if (hasCaughtError()) {
      var unmountError = clearCaughtError();
      captureCommitPhaseError(current$$1, unmountError);
    }
  }
}

function safelyDetachRef(current$$1) {
  var ref = current$$1.ref;
  if (ref !== null) {
    if (typeof ref === 'function') {
      {
        invokeGuardedCallback(null, ref, null, null);
        if (hasCaughtError()) {
          var refError = clearCaughtError();
          captureCommitPhaseError(current$$1, refError);
        }
      }
    } else {
      ref.current = null;
    }
  }
}

function safelyCallDestroy(current$$1, destroy) {
  {
    invokeGuardedCallback(null, destroy, null);
    if (hasCaughtError()) {
      var error = clearCaughtError();
      captureCommitPhaseError(current$$1, error);
    }
  }
}

function commitBeforeMutationLifeCycles(current$$1, finishedWork) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
      {
        commitHookEffectList(UnmountSnapshot, NoEffect$1, finishedWork);
        return;
      }
    case ClassComponent:
      {
        if (finishedWork.effectTag & Snapshot) {
          if (current$$1 !== null) {
            var prevProps = current$$1.memoizedProps;
            var prevState = current$$1.memoizedState;
            startPhaseTimer(finishedWork, 'getSnapshotBeforeUpdate');
            var instance = finishedWork.stateNode;
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
                !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              }
            }
            var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);
            {
              var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;
              if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
                didWarnSet.add(finishedWork.type);
                warningWithoutStack$1(false, '%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));
              }
            }
            instance.__reactInternalSnapshotBeforeUpdate = snapshot;
            stopPhaseTimer();
          }
        }
        return;
      }
    case HostRoot:
    case HostComponent:
    case HostText:
    case HostPortal:
    case IncompleteClassComponent:
      // Nothing to do for these component types
      return;
    default:
      {
        invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
      }
  }
}

function commitHookEffectList(unmountTag, mountTag, finishedWork) {
  var updateQueue = finishedWork.updateQueue;
  var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
  if (lastEffect !== null) {
    var firstEffect = lastEffect.next;
    var effect = firstEffect;
    do {
      if ((effect.tag & unmountTag) !== NoEffect$1) {
        // Unmount
        var destroy = effect.destroy;
        effect.destroy = undefined;
        if (destroy !== undefined) {
          destroy();
        }
      }
      if ((effect.tag & mountTag) !== NoEffect$1) {
        // Mount
        var create = effect.create;
        effect.destroy = create();

        {
          var _destroy = effect.destroy;
          if (_destroy !== undefined && typeof _destroy !== 'function') {
            var addendum = void 0;
            if (_destroy === null) {
              addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';
            } else if (typeof _destroy.then === 'function') {
              addendum = '\n\nIt looks like you wrote useEffect(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + 'useEffect(() => {\n' + '  async function fetchData() {\n' + '    // You can await here\n' + '    const response = await MyAPI.getData(someId);\n' + '    // ...\n' + '  }\n' + '  fetchData();\n' + '}, [someId]); // Or [] if effect doesn\'t need props or state\n\n' + 'Learn more about data fetching with Hooks: https://fb.me/react-hooks-data-fetching';
            } else {
              addendum = ' You returned: ' + _destroy;
            }
            warningWithoutStack$1(false, 'An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s%s', addendum, getStackByFiberInDevAndProd(finishedWork));
          }
        }
      }
      effect = effect.next;
    } while (effect !== firstEffect);
  }
}

function commitPassiveHookEffects(finishedWork) {
  commitHookEffectList(UnmountPassive, NoEffect$1, finishedWork);
  commitHookEffectList(NoEffect$1, MountPassive, finishedWork);
}

function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpirationTime) {
  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case SimpleMemoComponent:
      {
        commitHookEffectList(UnmountLayout, MountLayout, finishedWork);
        break;
      }
    case ClassComponent:
      {
        var instance = finishedWork.stateNode;
        if (finishedWork.effectTag & Update) {
          if (current$$1 === null) {
            startPhaseTimer(finishedWork, 'componentDidMount');
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
                !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              }
            }
            instance.componentDidMount();
            stopPhaseTimer();
          } else {
            var prevProps = finishedWork.elementType === finishedWork.type ? current$$1.memoizedProps : resolveDefaultProps(finishedWork.type, current$$1.memoizedProps);
            var prevState = current$$1.memoizedState;
            startPhaseTimer(finishedWork, 'componentDidUpdate');
            // We could update instance props and state here,
            // but instead we rely on them being set during last render.
            // TODO: revisit this when we implement resuming.
            {
              if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
                !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
                !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              }
            }
            instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);
            stopPhaseTimer();
          }
        }
        var updateQueue = finishedWork.updateQueue;
        if (updateQueue !== null) {
          {
            if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {
              !(instance.props === finishedWork.memoizedProps) ? warning$1(false, 'Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
              !(instance.state === finishedWork.memoizedState) ? warning$1(false, 'Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance') : void 0;
            }
          }
          // We could update instance props and state here,
          // but instead we rely on them being set during last render.
          // TODO: revisit this when we implement resuming.
          commitUpdateQueue(finishedWork, updateQueue, instance, committedExpirationTime);
        }
        return;
      }
    case HostRoot:
      {
        var _updateQueue = finishedWork.updateQueue;
        if (_updateQueue !== null) {
          var _instance = null;
          if (finishedWork.child !== null) {
            switch (finishedWork.child.tag) {
              case HostComponent:
                _instance = getPublicInstance(finishedWork.child.stateNode);
                break;
              case ClassComponent:
                _instance = finishedWork.child.stateNode;
                break;
            }
          }
          commitUpdateQueue(finishedWork, _updateQueue, _instance, committedExpirationTime);
        }
        return;
      }
    case HostComponent:
      {
        var _instance2 = finishedWork.stateNode;

        // Renderers may schedule work to be done after host components are mounted
        // (eg DOM renderer may schedule auto-focus for inputs and form controls).
        // These effects should only be committed when components are first mounted,
        // aka when there is no current/alternate.
        if (current$$1 === null && finishedWork.effectTag & Update) {
          var type = finishedWork.type;
          var props = finishedWork.memoizedProps;
          commitMount(_instance2, type, props, finishedWork);
        }

        return;
      }
    case HostText:
      {
        // We have no life-cycles associated with text.
        return;
      }
    case HostPortal:
      {
        // We have no life-cycles associated with portals.
        return;
      }
    case Profiler:
      {
        if (enableProfilerTimer) {
          var onRender = finishedWork.memoizedProps.onRender;

          if (enableSchedulerTracing) {
            onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
          } else {
            onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
          }
        }
        return;
      }
    case SuspenseComponent:
      break;
    case IncompleteClassComponent:
      break;
    default:
      {
        invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
      }
  }
}

function hideOrUnhideAllChildren(finishedWork, isHidden) {
  if (supportsMutation) {
    // We only have the top Fiber that was inserted but we need to recurse down its
    var node = finishedWork;
    while (true) {
      if (node.tag === HostComponent) {
        var instance = node.stateNode;
        if (isHidden) {
          hideInstance(instance);
        } else {
          unhideInstance(node.stateNode, node.memoizedProps);
        }
      } else if (node.tag === HostText) {
        var _instance3 = node.stateNode;
        if (isHidden) {
          hideTextInstance(_instance3);
        } else {
          unhideTextInstance(_instance3, node.memoizedProps);
        }
      } else if (node.tag === SuspenseComponent && node.memoizedState !== null) {
        // Found a nested Suspense component that timed out. Skip over the
        var fallbackChildFragment = node.child.sibling;
        fallbackChildFragment.return = node;
        node = fallbackChildFragment;
        continue;
      } else if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
      if (node === finishedWork) {
        return;
      }
      while (node.sibling === null) {
        if (node.return === null || node.return === finishedWork) {
          return;
        }
        node = node.return;
      }
      node.sibling.return = node.return;
      node = node.sibling;
    }
  }
}

function commitAttachRef(finishedWork) {
  var ref = finishedWork.ref;
  if (ref !== null) {
    var instance = finishedWork.stateNode;
    var instanceToUse = void 0;
    switch (finishedWork.tag) {
      case HostComponent:
        instanceToUse = getPublicInstance(instance);
        break;
      default:
        instanceToUse = instance;
    }
    if (typeof ref === 'function') {
      ref(instanceToUse);
    } else {
      {
        if (!ref.hasOwnProperty('current')) {
          warningWithoutStack$1(false, 'Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().%s', getComponentName(finishedWork.type), getStackByFiberInDevAndProd(finishedWork));
        }
      }

      ref.current = instanceToUse;
    }
  }
}

function commitDetachRef(current$$1) {
  var currentRef = current$$1.ref;
  if (currentRef !== null) {
    if (typeof currentRef === 'function') {
      currentRef(null);
    } else {
      currentRef.current = null;
    }
  }
}

// User-originating errors (lifecycles and refs) should not interrupt
// deletion, so don't let them throw. Host-originating errors should
// interrupt deletion, so it's okay
function commitUnmount(current$$1) {
  onCommitUnmount(current$$1);

  switch (current$$1.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
      {
        var updateQueue = current$$1.updateQueue;
        if (updateQueue !== null) {
          var lastEffect = updateQueue.lastEffect;
          if (lastEffect !== null) {
            var firstEffect = lastEffect.next;
            var effect = firstEffect;
            do {
              var destroy = effect.destroy;
              if (destroy !== undefined) {
                safelyCallDestroy(current$$1, destroy);
              }
              effect = effect.next;
            } while (effect !== firstEffect);
          }
        }
        break;
      }
    case ClassComponent:
      {
        safelyDetachRef(current$$1);
        var instance = current$$1.stateNode;
        if (typeof instance.componentWillUnmount === 'function') {
          safelyCallComponentWillUnmount(current$$1, instance);
        }
        return;
      }
    case HostComponent:
      {
        safelyDetachRef(current$$1);
        return;
      }
    case HostPortal:
      {
        // TODO: this is recursive.
        // We are also not using this parent because
        // the portal will get pushed immediately.
        if (supportsMutation) {
          unmountHostComponents(current$$1);
        } else if (supportsPersistence) {
          emptyPortalContainer(current$$1);
        }
        return;
      }
  }
}

function commitNestedUnmounts(root) {
  // While we're inside a removed host node we don't want to call
  // removeChild on the inner nodes because they're removed by the top
  // call anyway. We also want to call componentWillUnmount on all
  // composites before this host node is removed from the tree. Therefore
  var node = root;
  while (true) {
    commitUnmount(node);
    // Visit children because they may contain more composite or host nodes.
    // Skip portals because commitUnmount() currently visits them recursively.
    if (node.child !== null && (
    // If we use mutation we drill down into portals using commitUnmount above.
    // If we don't use mutation we drill down into portals here instead.
    !supportsMutation || node.tag !== HostPortal)) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === root) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === root) {
        return;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function detachFiber(current$$1) {
  // Cut off the return pointers to disconnect it from the tree. Ideally, we
  // should clear the child pointer of the parent alternate to let this
  // get GC:ed but we don't know which for sure which parent is the current
  // one so we'll settle for GC:ing the subtree of this child. This child
  // itself will be GC:ed when the parent updates the next time.
  current$$1.return = null;
  current$$1.child = null;
  current$$1.memoizedState = null;
  current$$1.updateQueue = null;
  var alternate = current$$1.alternate;
  if (alternate !== null) {
    alternate.return = null;
    alternate.child = null;
    alternate.memoizedState = null;
    alternate.updateQueue = null;
  }
}

function emptyPortalContainer(current$$1) {
  if (!supportsPersistence) {
    return;
  }

  var portal = current$$1.stateNode;
  var containerInfo = portal.containerInfo;

  var emptyChildSet = createContainerChildSet(containerInfo);
  replaceContainerChildren(containerInfo, emptyChildSet);
}

function commitContainer(finishedWork) {
  if (!supportsPersistence) {
    return;
  }

  switch (finishedWork.tag) {
    case ClassComponent:
      {
        return;
      }
    case HostComponent:
      {
        return;
      }
    case HostText:
      {
        return;
      }
    case HostRoot:
    case HostPortal:
      {
        var portalOrRoot = finishedWork.stateNode;
        var containerInfo = portalOrRoot.containerInfo,
            _pendingChildren = portalOrRoot.pendingChildren;

        replaceContainerChildren(containerInfo, _pendingChildren);
        return;
      }
    default:
      {
        invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
      }
  }
}

function getHostParentFiber(fiber) {
  var parent = fiber.return;
  while (parent !== null) {
    if (isHostParent(parent)) {
      return parent;
    }
    parent = parent.return;
  }
  invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.');
}

function isHostParent(fiber) {
  return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;
}

function getHostSibling(fiber) {
  // We're going to search forward into the tree until we find a sibling host
  // node. Unfortunately, if multiple insertions are done in a row we have to
  // search past them. This leads to exponential search for the next sibling.
  var node = fiber;
  siblings: while (true) {
    // If we didn't find anything, let's try the next sibling.
    while (node.sibling === null) {
      if (node.return === null || isHostParent(node.return)) {
        // If we pop out of the root or hit the parent the fiber we are the
        // last sibling.
        return null;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
    while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedSuspenseComponent) {
      // If it is not host node and, we might have a host node inside it.
      // Try to search down until we find one.
      if (node.effectTag & Placement) {
        // If we don't have a child, try the siblings instead.
        continue siblings;
      }
      // If we don't have a child, try the siblings instead.
      // We also skip portals because they are not part of this host tree.
      if (node.child === null || node.tag === HostPortal) {
        continue siblings;
      } else {
        node.child.return = node;
        node = node.child;
      }
    }
    // Check if this host node is stable or about to be placed.
    if (!(node.effectTag & Placement)) {
      // Found it!
      return node.stateNode;
    }
  }
}

function commitPlacement(finishedWork) {
  if (!supportsMutation) {
    return;
  }

  // Recursively insert all host nodes into the parent.
  var parentFiber = getHostParentFiber(finishedWork);

  // Note: these two variables *must* always be updated together.
  var parent = void 0;
  var isContainer = void 0;

  switch (parentFiber.tag) {
    case HostComponent:
      parent = parentFiber.stateNode;
      isContainer = false;
      break;
    case HostRoot:
      parent = parentFiber.stateNode.containerInfo;
      isContainer = true;
      break;
    case HostPortal:
      parent = parentFiber.stateNode.containerInfo;
      isContainer = true;
      break;
    default:
      invariant(false, 'Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.');
  }
  if (parentFiber.effectTag & ContentReset) {
    // Reset the text content of the parent before doing any insertions
    resetTextContent(parent);
    // Clear ContentReset from the effect tag
    parentFiber.effectTag &= ~ContentReset;
  }

  var before = getHostSibling(finishedWork);
  // We only have the top Fiber that was inserted but we need to recurse down its
  // children to find all the terminal nodes.
  var node = finishedWork;
  while (true) {
    if (node.tag === HostComponent || node.tag === HostText) {
      if (before) {
        if (isContainer) {
          insertInContainerBefore(parent, node.stateNode, before);
        } else {
          insertBefore(parent, node.stateNode, before);
        }
      } else {
        if (isContainer) {
          appendChildToContainer(parent, node.stateNode);
        } else {
          appendChild(parent, node.stateNode);
        }
      }
    } else if (node.tag === HostPortal) {
      // If the insertion itself is a portal, then we don't want to traverse
      // down its children. Instead, we'll get insertions from each child in
      // the portal directly.
    } else if (node.child !== null) {
      node.child.return = node;
      node = node.child;
      continue;
    }
    if (node === finishedWork) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === finishedWork) {
        return;
      }
      node = node.return;
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function unmountHostComponents(current$$1) {
  // We only have the top Fiber that was deleted but we need to recurse down its
  var node = current$$1;

  // Each iteration, currentParent is populated with node's host parent if not
  // currentParentIsValid.
  var currentParentIsValid = false;

  // Note: these two variables *must* always be updated together.
  var currentParent = void 0;
  var currentParentIsContainer = void 0;

  while (true) {
    if (!currentParentIsValid) {
      var parent = node.return;
      findParent: while (true) {
        !(parent !== null) ? invariant(false, 'Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.') : void 0;
        switch (parent.tag) {
          case HostComponent:
            currentParent = parent.stateNode;
            currentParentIsContainer = false;
            break findParent;
          case HostRoot:
            currentParent = parent.stateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;
          case HostPortal:
            currentParent = parent.stateNode.containerInfo;
            currentParentIsContainer = true;
            break findParent;
        }
        parent = parent.return;
      }
      currentParentIsValid = true;
    }

    if (node.tag === HostComponent || node.tag === HostText) {
      commitNestedUnmounts(node);
      // After all the children have unmounted, it is now safe to remove the
      // node from the tree.
      if (currentParentIsContainer) {
        removeChildFromContainer(currentParent, node.stateNode);
      } else {
        removeChild(currentParent, node.stateNode);
      }
      // Don't visit children because we already visited them.
    } else if (enableSuspenseServerRenderer && node.tag === DehydratedSuspenseComponent) {
      // Delete the dehydrated suspense boundary and all of its content.
      if (currentParentIsContainer) {
        clearSuspenseBoundaryFromContainer(currentParent, node.stateNode);
      } else {
        clearSuspenseBoundary(currentParent, node.stateNode);
      }
    } else if (node.tag === HostPortal) {
      if (node.child !== null) {
        // When we go into a portal, it becomes the parent to remove from.
        // We will reassign it back when we pop the portal on the way up.
        currentParent = node.stateNode.containerInfo;
        currentParentIsContainer = true;
        // Visit children because portals might contain host components.
        node.child.return = node;
        node = node.child;
        continue;
      }
    } else {
      commitUnmount(node);
      // Visit children because we may find more host components below.
      if (node.child !== null) {
        node.child.return = node;
        node = node.child;
        continue;
      }
    }
    if (node === current$$1) {
      return;
    }
    while (node.sibling === null) {
      if (node.return === null || node.return === current$$1) {
        return;
      }
      node = node.return;
      if (node.tag === HostPortal) {
        // When we go out of the portal, we need to restore the parent.
        // Since we don't keep a stack of them, we will search for it.
        currentParentIsValid = false;
      }
    }
    node.sibling.return = node.return;
    node = node.sibling;
  }
}

function commitDeletion(current$$1) {
  if (supportsMutation) {
    // Recursively delete all host nodes from the parent.
    // Detach refs and call componentWillUnmount() on the whole subtree.
    unmountHostComponents(current$$1);
  } else {
    // Detach refs and call componentWillUnmount() on the whole subtree.
    commitNestedUnmounts(current$$1);
  }
  detachFiber(current$$1);
}

function commitWork(current$$1, finishedWork) {
  if (!supportsMutation) {
    switch (finishedWork.tag) {
      case FunctionComponent:
      case ForwardRef:
      case MemoComponent:
      case SimpleMemoComponent:
        {
          // Note: We currently never use MountMutation, but useLayout uses
          // UnmountMutation.
          commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
          return;
        }
    }

    commitContainer(finishedWork);
    return;
  }

  switch (finishedWork.tag) {
    case FunctionComponent:
    case ForwardRef:
    case MemoComponent:
    case SimpleMemoComponent:
      {
        // Note: We currently never use MountMutation, but useLayout uses
        // UnmountMutation.
        commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
        return;
      }
    case ClassComponent:
      {
        return;
      }
    case HostComponent:
      {
        var instance = finishedWork.stateNode;
        if (instance != null) {
          // Commit the work prepared earlier.
          var newProps = finishedWork.memoizedProps;
          // For hydration we reuse the update path but we treat the oldProps
          // as the newProps. The updatePayload will contain the real change in
          // this case.
          var oldProps = current$$1 !== null ? current$$1.memoizedProps : newProps;
          var type = finishedWork.type;
          // TODO: Type the updateQueue to be specific to host components.
          var updatePayload = finishedWork.updateQueue;
          finishedWork.updateQueue = null;
          if (updatePayload !== null) {
            commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork);
          }
        }
        return;
      }
    case HostText:
      {
        !(finishedWork.stateNode !== null) ? invariant(false, 'This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.') : void 0;
        var textInstance = finishedWork.stateNode;
        var newText = finishedWork.memoizedProps;
        // For hydration we reuse the update path but we treat the oldProps
        // as the newProps. The updatePayload will contain the real change in
        // this case.
        var oldText = current$$1 !== null ? current$$1.memoizedProps : newText;
        commitTextUpdate(textInstance, oldText, newText);
        return;
      }
    case HostRoot:
      {
        return;
      }
    case Profiler:
      {
        return;
      }
    case SuspenseComponent:
      {
        var newState = finishedWork.memoizedState;

        var newDidTimeout = void 0;
        var primaryChildParent = finishedWork;
        if (newState === null) {
          newDidTimeout = false;
        } else {
          newDidTimeout = true;
          primaryChildParent = finishedWork.child;
          if (newState.timedOutAt === NoWork) {
            // If the children had not already timed out, record the time.
            // This is used to compute the elapsed time during subsequent
            // attempts to render the children.
            newState.timedOutAt = requestCurrentTime();
          }
        }

        if (primaryChildParent !== null) {
          hideOrUnhideAllChildren(primaryChildParent, newDidTimeout);
        }

        // If this boundary just timed out, then it will have a set of thenables.
        // For each thenable, attach a listener so that when it resolves, React
        // attempts to re-render the boundary in the primary (pre-timeout) state.
        var thenables = finishedWork.updateQueue;
        if (thenables !== null) {
          finishedWork.updateQueue = null;
          var retryCache = finishedWork.stateNode;
          if (retryCache === null) {
            retryCache = finishedWork.stateNode = new PossiblyWeakSet$1();
          }
          thenables.forEach(function (thenable) {
            // Memoize using the boundary fiber to prevent redundant listeners.
            var retry = retryTimedOutBoundary.bind(null, finishedWork, thenable);
            if (enableSchedulerTracing) {
              retry = tracing.unstable_wrap(retry);
            }
            if (!retryCache.has(thenable)) {
              retryCache.add(thenable);
              thenable.then(retry, retry);
            }
          });
        }

        return;
      }
    case IncompleteClassComponent:
      {
        return;
      }
    default:
      {
        invariant(false, 'This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.');
      }
  }
}

function commitResetTextContent(current$$1) {
  if (!supportsMutation) {
    return;
  }
  resetTextContent(current$$1.stateNode);
}

var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;

function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
  var update = createUpdate(expirationTime);
  // Unmount the root by rendering null.
  update.tag = CaptureUpdate;
  // Caution: React DevTools currently depends on this property
  // being called "element".
  update.payload = { element: null };
  var error = errorInfo.value;
  update.callback = function () {
    onUncaughtError(error);
    logError(fiber, errorInfo);
  };
  return update;
}

function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
  var update = createUpdate(expirationTime);
  update.tag = CaptureUpdate;
  var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
  if (typeof getDerivedStateFromError === 'function') {
    var error = errorInfo.value;
    update.payload = function () {
      return getDerivedStateFromError(error);
    };
  }

  var inst = fiber.stateNode;
  if (inst !== null && typeof inst.componentDidCatch === 'function') {
    update.callback = function callback() {
      if (typeof getDerivedStateFromError !== 'function') {
        // To preserve the preexisting retry behavior of error boundaries,
        // we keep track of which ones already failed during this batch.
        // This gets reset before we yield back to the browser.
        // TODO: Warn in strict mode if getDerivedStateFromError is
        // not defined.
        markLegacyErrorBoundaryAsFailed(this);
      }
      var error = errorInfo.value;
      var stack = errorInfo.stack;
      logError(fiber, errorInfo);
      this.componentDidCatch(error, {
        componentStack: stack !== null ? stack : ''
      });
      {
        if (typeof getDerivedStateFromError !== 'function') {
          // If componentDidCatch is the only error boundary method defined,
          // then it needs to call setState to recover from errors.
          // If no state update is scheduled then the boundary will swallow the error.
          !(fiber.expirationTime === Sync) ? warningWithoutStack$1(false, '%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown') : void 0;
        }
      }
    };
  }
  return update;
}

function attachPingListener(root, renderExpirationTime, thenable) {
  // Attach a listener to the promise to "ping" the root and retry. But
  // only if one does not already exist for the current render expiration
  // time (which acts like a "thread ID" here).
  var pingCache = root.pingCache;
  var threadIDs = void 0;
  if (pingCache === null) {
    pingCache = root.pingCache = new PossiblyWeakMap();
    threadIDs = new Set();
    pingCache.set(thenable, threadIDs);
  } else {
    threadIDs = pingCache.get(thenable);
    if (threadIDs === undefined) {
      threadIDs = new Set();
      pingCache.set(thenable, threadIDs);
    }
  }
  if (!threadIDs.has(renderExpirationTime)) {
    // Memoize using the thread ID to prevent redundant listeners.
    threadIDs.add(renderExpirationTime);
    var ping = pingSuspendedRoot.bind(null, root, thenable, renderExpirationTime);
    if (enableSchedulerTracing) {
      ping = tracing.unstable_wrap(ping);
    }
    thenable.then(ping, ping);
  }
}

function throwException(root, returnFiber, sourceFiber, value, renderExpirationTime) {
  // The source fiber did not complete.
  sourceFiber.effectTag |= Incomplete;
  // Its effect list is no longer valid.
  sourceFiber.firstEffect = sourceFiber.lastEffect = null;

  if (value !== null && typeof value === 'object' && typeof value.then === 'function') {
    // This is a thenable.
    var thenable = value;

    // Find the earliest timeout threshold of all the placeholders in the
    // ancestor path. We could avoid this traversal by storing the thresholds on
    // the stack, but we choose not to because we only hit this path if we're
    // IO-bound (i.e. if something suspends). Whereas the stack is used even in
    // the non-IO- bound case.
    var _workInProgress = returnFiber;
    var earliestTimeoutMs = -1;
    var startTimeMs = -1;
    do {
      if (_workInProgress.tag === SuspenseComponent) {
        var current$$1 = _workInProgress.alternate;
        if (current$$1 !== null) {
          var currentState = current$$1.memoizedState;
          if (currentState !== null) {
            // Reached a boundary that already timed out. Do not search
            // any further.
            var timedOutAt = currentState.timedOutAt;
            startTimeMs = expirationTimeToMs(timedOutAt);
            // Do not search any further.
            break;
          }
        }
        var timeoutPropMs = _workInProgress.pendingProps.maxDuration;
        if (typeof timeoutPropMs === 'number') {
          if (timeoutPropMs <= 0) {
            earliestTimeoutMs = 0;
          } else if (earliestTimeoutMs === -1 || timeoutPropMs < earliestTimeoutMs) {
            earliestTimeoutMs = timeoutPropMs;
          }
        }
      }
      // If there is a DehydratedSuspenseComponent we don't have to do anything because
      // if something suspends inside it, we will simply leave that as dehydrated. It
      // will never timeout.
      _workInProgress = _workInProgress.return;
    } while (_workInProgress !== null);

    // Schedule the nearest Suspense to re-render the timed out view.
    _workInProgress = returnFiber;
    do {
      if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress)) {
        // Found the nearest boundary.

        // Stash the promise on the boundary fiber. If the boundary times out, we'll
        var thenables = _workInProgress.updateQueue;
        if (thenables === null) {
          var updateQueue = new Set();
          updateQueue.add(thenable);
          _workInProgress.updateQueue = updateQueue;
        } else {
          thenables.add(thenable);
        }

        // If the boundary is outside of concurrent mode, we should *not*
        // suspend the commit. Pretend as if the suspended component rendered
        // null and keep rendering. In the commit phase, we'll schedule a
        // subsequent synchronous update to re-render the Suspense.
        //
        // Note: It doesn't matter whether the component that suspended was
        // inside a concurrent mode tree. If the Suspense is outside of it, we
        // should *not* suspend the commit.
        if ((_workInProgress.mode & ConcurrentMode) === NoEffect) {
          _workInProgress.effectTag |= DidCapture;

          // We're going to commit this fiber even though it didn't complete.
          // But we shouldn't call any lifecycle methods or callbacks. Remove
          // all lifecycle effect tags.
          sourceFiber.effectTag &= ~(LifecycleEffectMask | Incomplete);

          if (sourceFiber.tag === ClassComponent) {
            var currentSourceFiber = sourceFiber.alternate;
            if (currentSourceFiber === null) {
              // This is a new mount. Change the tag so it's not mistaken for a
              // completed class component. For example, we should not call
              // componentWillUnmount if it is deleted.
              sourceFiber.tag = IncompleteClassComponent;
            } else {
              // When we try rendering again, we should not reuse the current fiber,
              // since it's known to be in an inconsistent state. Use a force updte to
              // prevent a bail out.
              var update = createUpdate(Sync);
              update.tag = ForceUpdate;
              enqueueUpdate(sourceFiber, update);
            }
          }

          // The source fiber did not complete. Mark it with Sync priority to
          // indicate that it still has pending work.
          sourceFiber.expirationTime = Sync;

          // Exit without suspending.
          return;
        }

        // Confirmed that the boundary is in a concurrent mode tree. Continue
        // with the normal suspend path.

        attachPingListener(root, renderExpirationTime, thenable);

        var absoluteTimeoutMs = void 0;
        if (earliestTimeoutMs === -1) {
          // If no explicit threshold is given, default to an arbitrarily large
          // value. The actual size doesn't matter because the threshold for the
          // whole tree will be clamped to the expiration time.
          absoluteTimeoutMs = maxSigned31BitInt;
        } else {
          if (startTimeMs === -1) {
            // This suspend happened outside of any already timed-out
            // placeholders. We don't know exactly when the update was
            // scheduled, but we can infer an approximate start time from the
            // expiration time. First, find the earliest uncommitted expiration
            // time in the tree, including work that is suspended. Then subtract
            // the offset used to compute an async update's expiration time.
            // This will cause high priority (interactive) work to expire
            // earlier than necessary, but we can account for this by adjusting
            // for the Just Noticeable Difference.
            var earliestExpirationTime = findEarliestOutstandingPriorityLevel(root, renderExpirationTime);
            var earliestExpirationTimeMs = expirationTimeToMs(earliestExpirationTime);
            startTimeMs = earliestExpirationTimeMs - LOW_PRIORITY_EXPIRATION;
          }
          absoluteTimeoutMs = startTimeMs + earliestTimeoutMs;
        }

        // Mark the earliest timeout in the suspended fiber's ancestor path.
        // After completing the root, we'll take the largest of all the
        // suspended fiber's timeouts and use it to compute a timeout for the
        // whole tree.
        renderDidSuspend(root, absoluteTimeoutMs, renderExpirationTime);

        _workInProgress.effectTag |= ShouldCapture;
        _workInProgress.expirationTime = renderExpirationTime;
        return;
      } else if (enableSuspenseServerRenderer && _workInProgress.tag === DehydratedSuspenseComponent) {
        attachPingListener(root, renderExpirationTime, thenable);

        // Since we already have a current fiber, we can eagerly add a retry listener.
        var retryCache = _workInProgress.memoizedState;
        if (retryCache === null) {
          retryCache = _workInProgress.memoizedState = new PossiblyWeakSet();
          var _current = _workInProgress.alternate;
          !_current ? invariant(false, 'A dehydrated suspense boundary must commit before trying to render. This is probably a bug in React.') : void 0;
          _current.memoizedState = retryCache;
        }
        // Memoize using the boundary fiber to prevent redundant listeners.
        if (!retryCache.has(thenable)) {
          retryCache.add(thenable);
          var retry = retryTimedOutBoundary.bind(null, _workInProgress, thenable);
          if (enableSchedulerTracing) {
            retry = tracing.unstable_wrap(retry);
          }
          thenable.then(retry, retry);
        }
        _workInProgress.effectTag |= ShouldCapture;
        _workInProgress.expirationTime = renderExpirationTime;
        return;
      }
      // This boundary already captured during this render. Continue to the next
      // boundary.
      _workInProgress = _workInProgress.return;
    } while (_workInProgress !== null);
    // No boundary was found. Fallthrough to error mode.
    // TODO: Use invariant so the message is stripped in prod?
    value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\n' + '\n' + 'Add a <Suspense fallback=...> component higher in the tree to ' + 'provide a loading indicator or placeholder to display.' + getStackByFiberInDevAndProd(sourceFiber));
  }

  // We didn't find a boundary that could handle this type of exception. Start
  // over and traverse parent path again, this time treating the exception
  // as an error.
  renderDidError();
  value = createCapturedValue(value, sourceFiber);
  var workInProgress = returnFiber;
  do {
    switch (workInProgress.tag) {
      case HostRoot:
        {
          var _errorInfo = value;
          workInProgress.effectTag |= ShouldCapture;
          workInProgress.expirationTime = renderExpirationTime;
          var _update = createRootErrorUpdate(workInProgress, _errorInfo, renderExpirationTime);
          enqueueCapturedUpdate(workInProgress, _update);
          return;
        }
      case ClassComponent:
        // Capture and retry
        var errorInfo = value;
        var ctor = workInProgress.type;
        var instance = workInProgress.stateNode;
        if ((workInProgress.effectTag & DidCapture) === NoEffect && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {
          workInProgress.effectTag |= ShouldCapture;
          workInProgress.expirationTime = renderExpirationTime;
          // Schedule the error boundary to re-render using updated state
          var _update2 = createClassErrorUpdate(workInProgress, errorInfo, renderExpirationTime);
          enqueueCapturedUpdate(workInProgress, _update2);
          return;
        }
        break;
      default:
        break;
    }
    workInProgress = workInProgress.return;
  } while (workInProgress !== null);
}

function unwindWork(workInProgress, renderExpirationTime) {
  switch (workInProgress.tag) {
    case ClassComponent:
      {
        var Component = workInProgress.type;
        if (isContextProvider(Component)) {
          popContext(workInProgress);
        }
        var effectTag = workInProgress.effectTag;
        if (effectTag & ShouldCapture) {
          workInProgress.effectTag = effectTag & ~ShouldCapture | DidCapture;
          return workInProgress;
        }
        return null;
      }
    case HostRoot:
      {
        popHostContainer(workInProgress);
        popTopLevelContextObject(workInProgress);
        var _effectTag = workInProgress.effectTag;
        !((_effectTag & DidCapture) === NoEffect) ? invariant(false, 'The root failed to unmount after an error. This is likely a bug in React. Please file an issue.') : void 0;
        workInProgress.effectTag = _effectTag & ~ShouldCapture | DidCapture;
        return workInProgress;
      }
    case HostComponent:
      {
        // TODO: popHydrationState
        popHostContext(workInProgress);
        return null;
      }
    case SuspenseComponent:
      {
        var _effectTag2 = workInProgress.effectTag;
        if (_effectTag2 & ShouldCapture) {
          workInProgress.effectTag = _effectTag2 & ~ShouldCapture | DidCapture;
          // Captured a suspense effect. Re-render the boundary.
          return workInProgress;
        }
        return null;
      }
    case DehydratedSuspenseComponent:
      {
        if (enableSuspenseServerRenderer) {
          // TODO: popHydrationState
          var _effectTag3 = workInProgress.effectTag;
          if (_effectTag3 & ShouldCapture) {
            workInProgress.effectTag = _effectTag3 & ~ShouldCapture | DidCapture;
            // Captured a suspense effect. Re-render the boundary.
            return workInProgress;
          }
        }
        return null;
      }
    case HostPortal:
      popHostContainer(workInProgress);
      return null;
    case ContextProvider:
      popProvider(workInProgress);
      return null;
    default:
      return null;
  }
}

function unwindInterruptedWork(interruptedWork) {
  switch (interruptedWork.tag) {
    case ClassComponent:
      {
        var childContextTypes = interruptedWork.type.childContextTypes;
        if (childContextTypes !== null && childContextTypes !== undefined) {
          popContext(interruptedWork);
        }
        break;
      }
    case HostRoot:
      {
        popHostContainer(interruptedWork);
        popTopLevelContextObject(interruptedWork);
        break;
      }
    case HostComponent:
      {
        popHostContext(interruptedWork);
        break;
      }
    case HostPortal:
      popHostContainer(interruptedWork);
      break;
    case ContextProvider:
      popProvider(interruptedWork);
      break;
    default:
      break;
  }
}

var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
var ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner;


var didWarnAboutStateTransition = void 0;
var didWarnSetStateChildContext = void 0;
var warnAboutUpdateOnUnmounted = void 0;
var warnAboutInvalidUpdates = void 0;

if (enableSchedulerTracing) {
  // Provide explicit error message when production+profiling bundle of e.g. react-dom
  // is used with production (non-profiling) bundle of scheduler/tracing
  !(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null) ? invariant(false, 'It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling') : void 0;
}

{
  didWarnAboutStateTransition = false;
  didWarnSetStateChildContext = false;
  var didWarnStateUpdateForUnmountedComponent = {};

  warnAboutUpdateOnUnmounted = function (fiber, isClass) {
    // We show the whole stack but dedupe on the top component's name because
    // the problematic code almost always lies inside that component.
    var componentName = getComponentName(fiber.type) || 'ReactComponent';
    if (didWarnStateUpdateForUnmountedComponent[componentName]) {
      return;
    }
    warningWithoutStack$1(false, "Can't perform a React state update on an unmounted component. This " + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.%s', isClass ? 'the componentWillUnmount method' : 'a useEffect cleanup function', getStackByFiberInDevAndProd(fiber));
    didWarnStateUpdateForUnmountedComponent[componentName] = true;
  };

  warnAboutInvalidUpdates = function (instance) {
    switch (phase) {
      case 'getChildContext':
        if (didWarnSetStateChildContext) {
          return;
        }
        warningWithoutStack$1(false, 'setState(...): Cannot call setState() inside getChildContext()');
        didWarnSetStateChildContext = true;
        break;
      case 'render':
        if (didWarnAboutStateTransition) {
          return;
        }
        warningWithoutStack$1(false, 'Cannot update during an existing state transition (such as within ' + '`render`). Render methods should be a pure function of props and state.');
        didWarnAboutStateTransition = true;
        break;
    }
  };
}

// Used to ensure computeUniqueAsyncExpiration is monotonically decreasing.
var lastUniqueAsyncExpiration = Sync - 1;

var isWorking = false;

// The next work in progress fiber that we're currently working on.
var nextUnitOfWork = null;
var nextRoot = null;
// The time at which we're currently rendering work.
var nextRenderExpirationTime = NoWork;
var nextLatestAbsoluteTimeoutMs = -1;
var nextRenderDidError = false;

// The next fiber with an effect that we're currently committing.
var nextEffect = null;

var isCommitting$1 = false;
var rootWithPendingPassiveEffects = null;
var passiveEffectCallbackHandle = null;
var passiveEffectCallback = null;

var legacyErrorBoundariesThatAlreadyFailed = null;

// Used for performance tracking.
var interruptedBy = null;

var stashedWorkInProgressProperties = void 0;
var replayUnitOfWork = void 0;
var mayReplayFailedUnitOfWork = void 0;
var isReplayingFailedUnitOfWork = void 0;
var originalReplayError = void 0;
var rethrowOriginalError = void 0;
if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
  stashedWorkInProgressProperties = null;
  mayReplayFailedUnitOfWork = true;
  isReplayingFailedUnitOfWork = false;
  originalReplayError = null;
  replayUnitOfWork = function (failedUnitOfWork, thrownValue, isYieldy) {
    if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.then === 'function') {
      // Don't replay promises. Treat everything else like an error.
      // TODO: Need to figure out a different strategy if/when we add
      // support for catching other types.
      return;
    }

    // Restore the original state of the work-in-progress
    if (stashedWorkInProgressProperties === null) {
      // This should never happen. Don't throw because this code is DEV-only.
      warningWithoutStack$1(false, 'Could not replay rendering after an error. This is likely a bug in React. ' + 'Please file an issue.');
      return;
    }
    assignFiberPropertiesInDEV(failedUnitOfWork, stashedWorkInProgressProperties);

    switch (failedUnitOfWork.tag) {
      case HostRoot:
        popHostContainer(failedUnitOfWork);
        popTopLevelContextObject(failedUnitOfWork);
        break;
      case HostComponent:
        popHostContext(failedUnitOfWork);
        break;
      case ClassComponent:
        {
          var Component = failedUnitOfWork.type;
          if (isContextProvider(Component)) {
            popContext(failedUnitOfWork);
          }
          break;
        }
      case HostPortal:
        popHostContainer(failedUnitOfWork);
        break;
      case ContextProvider:
        popProvider(failedUnitOfWork);
        break;
    }
    // Replay the begin phase.
    isReplayingFailedUnitOfWork = true;
    originalReplayError = thrownValue;
    invokeGuardedCallback(null, workLoop, null, isYieldy);
    isReplayingFailedUnitOfWork = false;
    originalReplayError = null;
    if (hasCaughtError()) {
      var replayError = clearCaughtError();
      if (replayError != null && thrownValue != null) {
        try {
          // Reading the expando property is intentionally
          // inside `try` because it might be a getter or Proxy.
          if (replayError._suppressLogging) {
            // Also suppress logging for the original error.
            thrownValue._suppressLogging = true;
          }
        } catch (inner) {
          // Ignore.
        }
      }
    } else {
      // If the begin phase did not fail the second time, set this pointer
      // back to the original value.
      nextUnitOfWork = failedUnitOfWork;
    }
  };
  rethrowOriginalError = function () {
    throw originalReplayError;
  };
}

function resetStack() {
  if (nextUnitOfWork !== null) {
    var interruptedWork = nextUnitOfWork.return;
    while (interruptedWork !== null) {
      unwindInterruptedWork(interruptedWork);
      interruptedWork = interruptedWork.return;
    }
  }

  {
    ReactStrictModeWarnings.discardPendingWarnings();
    checkThatStackIsEmpty();
  }

  nextRoot = null;
  nextRenderExpirationTime = NoWork;
  nextLatestAbsoluteTimeoutMs = -1;
  nextRenderDidError = false;
  nextUnitOfWork = null;
}

function commitAllHostEffects() {
  while (nextEffect !== null) {
    {
      setCurrentFiber(nextEffect);
    }
    recordEffect();

    var effectTag = nextEffect.effectTag;

    if (effectTag & ContentReset) {
      commitResetTextContent(nextEffect);
    }

    if (effectTag & Ref) {
      var current$$1 = nextEffect.alternate;
      if (current$$1 !== null) {
        commitDetachRef(current$$1);
      }
    }

    // The following switch statement is only concerned about placement,
    // updates, and deletions. To avoid needing to add a case for every
    // possible bitmap value, we remove the secondary effects from the
    // effect tag and switch on that value.
    var primaryEffectTag = effectTag & (Placement | Update | Deletion);
    switch (primaryEffectTag) {
      case Placement:
        {
          commitPlacement(nextEffect);
          // Clear the "placement" from effect tag so that we know that this is inserted, before
          // any life-cycles like componentDidMount gets called.
          // TODO: findDOMNode doesn't rely on this any more but isMounted
          // does and isMounted is deprecated anyway so we should be able
          // to kill this.
          nextEffect.effectTag &= ~Placement;
          break;
        }
      case PlacementAndUpdate:
        {
          // Placement
          commitPlacement(nextEffect);
          // Clear the "placement" from effect tag so that we know that this is inserted, before
          // any life-cycles like componentDidMount gets called.
          nextEffect.effectTag &= ~Placement;

          // Update
          var _current = nextEffect.alternate;
          commitWork(_current, nextEffect);
          break;
        }
      case Update:
        {
          var _current2 = nextEffect.alternate;
          commitWork(_current2, nextEffect);
          break;
        }
      case Deletion:
        {
          commitDeletion(nextEffect);
          break;
        }
    }
    nextEffect = nextEffect.nextEffect;
  }

  {
    resetCurrentFiber();
  }
}

function commitBeforeMutationLifecycles() {
  while (nextEffect !== null) {
    {
      setCurrentFiber(nextEffect);
    }

    var effectTag = nextEffect.effectTag;
    if (effectTag & Snapshot) {
      recordEffect();
      var current$$1 = nextEffect.alternate;
      commitBeforeMutationLifeCycles(current$$1, nextEffect);
    }

    nextEffect = nextEffect.nextEffect;
  }

  {
    resetCurrentFiber();
  }
}

function commitAllLifeCycles(finishedRoot, committedExpirationTime) {
  {
    ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
    ReactStrictModeWarnings.flushLegacyContextWarning();

    if (warnAboutDeprecatedLifecycles) {
      ReactStrictModeWarnings.flushPendingDeprecationWarnings();
    }
  }
  while (nextEffect !== null) {
    {
      setCurrentFiber(nextEffect);
    }
    var effectTag = nextEffect.effectTag;

    if (effectTag & (Update | Callback)) {
      recordEffect();
      var current$$1 = nextEffect.alternate;
      commitLifeCycles(finishedRoot, current$$1, nextEffect, committedExpirationTime);
    }

    if (effectTag & Ref) {
      recordEffect();
      commitAttachRef(nextEffect);
    }

    if (effectTag & Passive) {
      rootWithPendingPassiveEffects = finishedRoot;
    }

    nextEffect = nextEffect.nextEffect;
  }
  {
    resetCurrentFiber();
  }
}

function commitPassiveEffects(root, firstEffect) {
  rootWithPendingPassiveEffects = null;
  passiveEffectCallbackHandle = null;
  passiveEffectCallback = null;

  // Set this to true to prevent re-entrancy
  var previousIsRendering = isRendering;
  isRendering = true;

  var effect = firstEffect;
  do {
    {
      setCurrentFiber(effect);
    }

    if (effect.effectTag & Passive) {
      var didError = false;
      var error = void 0;
      {
        invokeGuardedCallback(null, commitPassiveHookEffects, null, effect);
        if (hasCaughtError()) {
          didError = true;
          error = clearCaughtError();
        }
      }
      if (didError) {
        captureCommitPhaseError(effect, error);
      }
    }
    effect = effect.nextEffect;
  } while (effect !== null);
  {
    resetCurrentFiber();
  }

  isRendering = previousIsRendering;

  // Check if work was scheduled by one of the effects
  var rootExpirationTime = root.expirationTime;
  if (rootExpirationTime !== NoWork) {
    requestWork(root, rootExpirationTime);
  }
  // Flush any sync work that was scheduled by effects
  if (!isBatchingUpdates && !isRendering) {
    performSyncWork();
  }
}

function isAlreadyFailedLegacyErrorBoundary(instance) {
  return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);
}

function markLegacyErrorBoundaryAsFailed(instance) {
  if (legacyErrorBoundariesThatAlreadyFailed === null) {
    legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);
  } else {
    legacyErrorBoundariesThatAlreadyFailed.add(instance);
  }
}

function flushPassiveEffects() {
  if (passiveEffectCallbackHandle !== null) {
    cancelPassiveEffects(passiveEffectCallbackHandle);
  }
  if (passiveEffectCallback !== null) {
    // We call the scheduled callback instead of commitPassiveEffects directly
    // to ensure tracing works correctly.
    passiveEffectCallback();
  }
}

function commitRoot(root, finishedWork) {
  isWorking = true;
  isCommitting$1 = true;
  startCommitTimer();

  !(root.current !== finishedWork) ? invariant(false, 'Cannot commit the same tree as before. This is probably a bug related to the return field. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  var committedExpirationTime = root.pendingCommitExpirationTime;
  !(committedExpirationTime !== NoWork) ? invariant(false, 'Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  root.pendingCommitExpirationTime = NoWork;

  // Update the pending priority levels to account for the work that we are
  // about to commit. This needs to happen before calling the lifecycles, since
  // they may schedule additional updates.
  var updateExpirationTimeBeforeCommit = finishedWork.expirationTime;
  var childExpirationTimeBeforeCommit = finishedWork.childExpirationTime;
  var earliestRemainingTimeBeforeCommit = childExpirationTimeBeforeCommit > updateExpirationTimeBeforeCommit ? childExpirationTimeBeforeCommit : updateExpirationTimeBeforeCommit;
  markCommittedPriorityLevels(root, earliestRemainingTimeBeforeCommit);

  var prevInteractions = null;
  if (enableSchedulerTracing) {
    // Restore any pending interactions at this point,
    // So that cascading work triggered during the render phase will be accounted for.
    prevInteractions = tracing.__interactionsRef.current;
    tracing.__interactionsRef.current = root.memoizedInteractions;
  }

  // Reset this to null before calling lifecycles
  ReactCurrentOwner$2.current = null;

  var firstEffect = void 0;
  if (finishedWork.effectTag > PerformedWork) {
    // A fiber's effect list consists only of its children, not itself. So if
    // the root has an effect, we need to add it to the end of the list. The
    // resulting list is the set that would belong to the root's parent, if
    // it had one; that is, all the effects in the tree including the root.
    if (finishedWork.lastEffect !== null) {
      finishedWork.lastEffect.nextEffect = finishedWork;
      firstEffect = finishedWork.firstEffect;
    } else {
      firstEffect = finishedWork;
    }
  } else {
    // There is no effect on the root.
    firstEffect = finishedWork.firstEffect;
  }

  prepareForCommit(root.containerInfo);

  // Invoke instances of getSnapshotBeforeUpdate before mutation.
  nextEffect = firstEffect;
  startCommitSnapshotEffectsTimer();
  while (nextEffect !== null) {
    var didError = false;
    var error = void 0;
    {
      invokeGuardedCallback(null, commitBeforeMutationLifecycles, null);
      if (hasCaughtError()) {
        didError = true;
        error = clearCaughtError();
      }
    }
    if (didError) {
      !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
      captureCommitPhaseError(nextEffect, error);
      // Clean-up
      if (nextEffect !== null) {
        nextEffect = nextEffect.nextEffect;
      }
    }
  }
  stopCommitSnapshotEffectsTimer();

  if (enableProfilerTimer) {
    // Mark the current commit time to be shared by all Profilers in this batch.
    // This enables them to be grouped later.
    recordCommitTime();
  }

  // Commit all the side-effects within a tree. We'll do this in two passes.
  // The first pass performs all the host insertions, updates, deletions and
  // ref unmounts.
  nextEffect = firstEffect;
  startCommitHostEffectsTimer();
  while (nextEffect !== null) {
    var _didError = false;
    var _error = void 0;
    {
      invokeGuardedCallback(null, commitAllHostEffects, null);
      if (hasCaughtError()) {
        _didError = true;
        _error = clearCaughtError();
      }
    }
    if (_didError) {
      !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
      captureCommitPhaseError(nextEffect, _error);
      // Clean-up
      if (nextEffect !== null) {
        nextEffect = nextEffect.nextEffect;
      }
    }
  }
  stopCommitHostEffectsTimer();

  resetAfterCommit(root.containerInfo);

  // The work-in-progress tree is now the current tree. This must come after
  // the first pass of the commit phase, so that the previous tree is still
  // current during componentWillUnmount, but before the second pass, so that
  // the finished work is current during componentDidMount/Update.
  root.current = finishedWork;

  // In the second pass we'll perform all life-cycles and ref callbacks.
  // Life-cycles happen as a separate pass so that all placements, updates,
  // and deletions in the entire tree have already been invoked.
  // This pass also triggers any renderer-specific initial effects.
  nextEffect = firstEffect;
  startCommitLifeCyclesTimer();
  while (nextEffect !== null) {
    var _didError2 = false;
    var _error2 = void 0;
    {
      invokeGuardedCallback(null, commitAllLifeCycles, null, root, committedExpirationTime);
      if (hasCaughtError()) {
        _didError2 = true;
        _error2 = clearCaughtError();
      }
    }
    if (_didError2) {
      !(nextEffect !== null) ? invariant(false, 'Should have next effect. This error is likely caused by a bug in React. Please file an issue.') : void 0;
      captureCommitPhaseError(nextEffect, _error2);
      if (nextEffect !== null) {
        nextEffect = nextEffect.nextEffect;
      }
    }
  }

  if (firstEffect !== null && rootWithPendingPassiveEffects !== null) {
    // This commit included a passive effect. These do not need to fire until
    // after the next paint. Schedule an callback to fire them in an async
    // event. To ensure serial execution, the callback will be flushed early if
    // we enter rootWithPendingPassiveEffects commit phase before then.
    var callback = commitPassiveEffects.bind(null, root, firstEffect);
    if (enableSchedulerTracing) {
      // TODO: Avoid this extra callback by mutating the tracing ref directly,
      // like we do at the beginning of commitRoot. I've opted not to do that
      // here because that code is still in flux.
      callback = tracing.unstable_wrap(callback);
    }
    passiveEffectCallbackHandle = scheduler.unstable_runWithPriority(scheduler.unstable_NormalPriority, function () {
      return schedulePassiveEffects(callback);
    });
    passiveEffectCallback = callback;
  }

  isCommitting$1 = false;
  isWorking = false;
  stopCommitLifeCyclesTimer();
  stopCommitTimer();
  onCommitRoot(finishedWork.stateNode);
  if (true && ReactFiberInstrumentation_1.debugTool) {
    ReactFiberInstrumentation_1.debugTool.onCommitWork(finishedWork);
  }

  var updateExpirationTimeAfterCommit = finishedWork.expirationTime;
  var childExpirationTimeAfterCommit = finishedWork.childExpirationTime;
  var earliestRemainingTimeAfterCommit = childExpirationTimeAfterCommit > updateExpirationTimeAfterCommit ? childExpirationTimeAfterCommit : updateExpirationTimeAfterCommit;
  if (earliestRemainingTimeAfterCommit === NoWork) {
    // If there's no remaining work, we can clear the set of already failed
    // error boundaries.
    legacyErrorBoundariesThatAlreadyFailed = null;
  }
  onCommit(root, earliestRemainingTimeAfterCommit);

  if (enableSchedulerTracing) {
    tracing.__interactionsRef.current = prevInteractions;

    var subscriber = void 0;

    try {
      subscriber = tracing.__subscriberRef.current;
      if (subscriber !== null && root.memoizedInteractions.size > 0) {
        var threadID = computeThreadID(committedExpirationTime, root.interactionThreadID);
        subscriber.onWorkStopped(root.memoizedInteractions, threadID);
      }
    } catch (error) {
      // It's not safe for commitRoot() to throw.
      // Store the error for now and we'll re-throw in finishRendering().
      if (!hasUnhandledError) {
        hasUnhandledError = true;
        unhandledError = error;
      }
    } finally {
      // Clear completed interactions from the pending Map.
      // Unless the render was suspended or cascading work was scheduled,
      // In which case– leave pending interactions until the subsequent render.
      var pendingInteractionMap = root.pendingInteractionMap;
      pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
        // Only decrement the pending interaction count if we're done.
        // If there's still work at the current priority,
        // That indicates that we are waiting for suspense data.
        if (scheduledExpirationTime > earliestRemainingTimeAfterCommit) {
          pendingInteractionMap.delete(scheduledExpirationTime);

          scheduledInteractions.forEach(function (interaction) {
            interaction.__count--;

            if (subscriber !== null && interaction.__count === 0) {
              try {
                subscriber.onInteractionScheduledWorkCompleted(interaction);
              } catch (error) {
                // It's not safe for commitRoot() to throw.
                // Store the error for now and we'll re-throw in finishRendering().
                if (!hasUnhandledError) {
                  hasUnhandledError = true;
                  unhandledError = error;
                }
              }
            }
          });
        }
      });
    }
  }
}

function resetChildExpirationTime(workInProgress, renderTime) {
  if (renderTime !== Never && workInProgress.childExpirationTime === Never) {
    // The children of this component are hidden. Don't bubble their
    // expiration times.
    return;
  }

  var newChildExpirationTime = NoWork;

  // Bubble up the earliest expiration time.
  if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
    // We're in profiling mode.
    // Let's use this same traversal to update the render durations.
    var actualDuration = workInProgress.actualDuration;
    var treeBaseDuration = workInProgress.selfBaseDuration;

    // When a fiber is cloned, its actualDuration is reset to 0.
    // This value will only be updated if work is done on the fiber (i.e. it doesn't bailout).
    // When work is done, it should bubble to the parent's actualDuration.
    // If the fiber has not been cloned though, (meaning no work was done),
    // Then this value will reflect the amount of time spent working on a previous render.
    // In that case it should not bubble.
    // We determine whether it was cloned by comparing the child pointer.
    var shouldBubbleActualDurations = workInProgress.alternate === null || workInProgress.child !== workInProgress.alternate.child;

    var child = workInProgress.child;
    while (child !== null) {
      var childUpdateExpirationTime = child.expirationTime;
      var childChildExpirationTime = child.childExpirationTime;
      if (childUpdateExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = childUpdateExpirationTime;
      }
      if (childChildExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = childChildExpirationTime;
      }
      if (shouldBubbleActualDurations) {
        actualDuration += child.actualDuration;
      }
      treeBaseDuration += child.treeBaseDuration;
      child = child.sibling;
    }
    workInProgress.actualDuration = actualDuration;
    workInProgress.treeBaseDuration = treeBaseDuration;
  } else {
    var _child = workInProgress.child;
    while (_child !== null) {
      var _childUpdateExpirationTime = _child.expirationTime;
      var _childChildExpirationTime = _child.childExpirationTime;
      if (_childUpdateExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = _childUpdateExpirationTime;
      }
      if (_childChildExpirationTime > newChildExpirationTime) {
        newChildExpirationTime = _childChildExpirationTime;
      }
      _child = _child.sibling;
    }
  }

  workInProgress.childExpirationTime = newChildExpirationTime;
}

function completeUnitOfWork(workInProgress) {
  // Attempt to complete the current unit of work, then move to the
  // next sibling. If there are no more siblings, return to the
  // parent fiber.
  while (true) {
    // The current, flushed, state of this fiber is the alternate.
    // Ideally nothing should rely on this, but relying on it here
    // means that we don't need an additional field on the work in
    // progress.
    var current$$1 = workInProgress.alternate;
    {
      setCurrentFiber(workInProgress);
    }

    var returnFiber = workInProgress.return;
    var siblingFiber = workInProgress.sibling;

    if ((workInProgress.effectTag & Incomplete) === NoEffect) {
      if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
        // Don't replay if it fails during completion phase.
        mayReplayFailedUnitOfWork = false;
      }
      // This fiber completed.
      // Remember we're completing this unit so we can find a boundary if it fails.
      nextUnitOfWork = workInProgress;
      if (enableProfilerTimer) {
        if (workInProgress.mode & ProfileMode) {
          startProfilerTimer(workInProgress);
        }
        nextUnitOfWork = completeWork(current$$1, workInProgress, nextRenderExpirationTime);
        if (workInProgress.mode & ProfileMode) {
          // Update render duration assuming we didn't error.
          stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);
        }
      } else {
        nextUnitOfWork = completeWork(current$$1, workInProgress, nextRenderExpirationTime);
      }
      if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
        // We're out of completion phase so replaying is fine now.
        mayReplayFailedUnitOfWork = true;
      }
      stopWorkTimer(workInProgress);
      resetChildExpirationTime(workInProgress, nextRenderExpirationTime);
      {
        resetCurrentFiber();
      }

      if (nextUnitOfWork !== null) {
        // Completing this fiber spawned new work. Work on that next.
        return nextUnitOfWork;
      }

      if (returnFiber !== null &&
      // Do not append effects to parents if a sibling failed to complete
      (returnFiber.effectTag & Incomplete) === NoEffect) {
        // Append all the effects of the subtree and this fiber onto the effect
        // list of the parent. The completion order of the children affects the
        // side-effect order.
        if (returnFiber.firstEffect === null) {
          returnFiber.firstEffect = workInProgress.firstEffect;
        }
        if (workInProgress.lastEffect !== null) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = workInProgress.firstEffect;
          }
          returnFiber.lastEffect = workInProgress.lastEffect;
        }

        // If this fiber had side-effects, we append it AFTER the children's
        // side-effects. We can perform certain side-effects earlier if
        // needed, by doing multiple passes over the effect list. We don't want
        // to schedule our own side-effect on our own list because if end up
        // reusing children we'll schedule this effect onto itself since we're
        // at the end.
        var effectTag = workInProgress.effectTag;
        // Skip both NoWork and PerformedWork tags when creating the effect list.
        // PerformedWork effect is read by React DevTools but shouldn't be committed.
        if (effectTag > PerformedWork) {
          if (returnFiber.lastEffect !== null) {
            returnFiber.lastEffect.nextEffect = workInProgress;
          } else {
            returnFiber.firstEffect = workInProgress;
          }
          returnFiber.lastEffect = workInProgress;
        }
      }

      if (true && ReactFiberInstrumentation_1.debugTool) {
        ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
      }

      if (siblingFiber !== null) {
        // If there is more work to do in this returnFiber, do that next.
        return siblingFiber;
      } else if (returnFiber !== null) {
        // If there's no more work in this returnFiber. Complete the returnFiber.
        workInProgress = returnFiber;
        continue;
      } else {
        // We've reached the root.
        return null;
      }
    } else {
      if (enableProfilerTimer && workInProgress.mode & ProfileMode) {
        // Record the render duration for the fiber that errored.
        stopProfilerTimerIfRunningAndRecordDelta(workInProgress, false);

        // Include the time spent working on failed children before continuing.
        var actualDuration = workInProgress.actualDuration;
        var child = workInProgress.child;
        while (child !== null) {
          actualDuration += child.actualDuration;
          child = child.sibling;
        }
        workInProgress.actualDuration = actualDuration;
      }

      // This fiber did not complete because something threw. Pop values off
      // the stack without entering the complete phase. If this is a boundary,
      // capture values if possible.
      var next = unwindWork(workInProgress, nextRenderExpirationTime);
      // Because this fiber did not complete, don't reset its expiration time.
      if (workInProgress.effectTag & DidCapture) {
        // Restarting an error boundary
        stopFailedWorkTimer(workInProgress);
      } else {
        stopWorkTimer(workInProgress);
      }

      {
        resetCurrentFiber();
      }

      if (next !== null) {
        stopWorkTimer(workInProgress);
        if (true && ReactFiberInstrumentation_1.debugTool) {
          ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
        }

        // If completing this work spawned new work, do that next. We'll come
        // back here again.
        // Since we're restarting, remove anything that is not a host effect
        // from the effect tag.
        next.effectTag &= HostEffectMask;
        return next;
      }

      if (returnFiber !== null) {
        // Mark the parent fiber as incomplete and clear its effect list.
        returnFiber.firstEffect = returnFiber.lastEffect = null;
        returnFiber.effectTag |= Incomplete;
      }

      if (true && ReactFiberInstrumentation_1.debugTool) {
        ReactFiberInstrumentation_1.debugTool.onCompleteWork(workInProgress);
      }

      if (siblingFiber !== null) {
        // If there is more work to do in this returnFiber, do that next.
        return siblingFiber;
      } else if (returnFiber !== null) {
        // If there's no more work in this returnFiber. Complete the returnFiber.
        workInProgress = returnFiber;
        continue;
      } else {
        return null;
      }
    }
  }

  // Without this explicit null return Flow complains of invalid return type
  // TODO Remove the above while(true) loop
  // eslint-disable-next-line no-unreachable
  return null;
}

function performUnitOfWork(workInProgress) {
  // The current, flushed, state of this fiber is the alternate.
  // Ideally nothing should rely on this, but relying on it here
  // means that we don't need an additional field on the work in
  // progress.
  var current$$1 = workInProgress.alternate;

  // See if beginning this work spawns more work.
  startWorkTimer(workInProgress);
  {
    setCurrentFiber(workInProgress);
  }

  if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
    stashedWorkInProgressProperties = assignFiberPropertiesInDEV(stashedWorkInProgressProperties, workInProgress);
  }

  var next = void 0;
  if (enableProfilerTimer) {
    if (workInProgress.mode & ProfileMode) {
      startProfilerTimer(workInProgress);
    }

    next = beginWork(current$$1, workInProgress, nextRenderExpirationTime);
    workInProgress.memoizedProps = workInProgress.pendingProps;

    if (workInProgress.mode & ProfileMode) {
      // Record the render duration assuming we didn't bailout (or error).
      stopProfilerTimerIfRunningAndRecordDelta(workInProgress, true);
    }
  } else {
    next = beginWork(current$$1, workInProgress, nextRenderExpirationTime);
    workInProgress.memoizedProps = workInProgress.pendingProps;
  }

  {
    resetCurrentFiber();
    if (isReplayingFailedUnitOfWork) {
      // Currently replaying a failed unit of work. This should be unreachable,
      // because the render phase is meant to be idempotent, and it should
      // have thrown again. Since it didn't, rethrow the original error, so
      // React's internal stack is not misaligned.
      rethrowOriginalError();
    }
  }
  if (true && ReactFiberInstrumentation_1.debugTool) {
    ReactFiberInstrumentation_1.debugTool.onBeginWork(workInProgress);
  }

  if (next === null) {
    // If this doesn't spawn new work, complete the current work.
    next = completeUnitOfWork(workInProgress);
  }

  ReactCurrentOwner$2.current = null;

  return next;
}

function workLoop(isYieldy) {
  if (!isYieldy) {
    // Flush work without yielding
    while (nextUnitOfWork !== null) {
      nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
    }
  } else {
    // Flush asynchronous work until there's a higher priority event
    while (nextUnitOfWork !== null && !shouldYieldToRenderer()) {
      nextUnitOfWork = performUnitOfWork(nextUnitOfWork);
    }
  }
}

function renderRoot(root, isYieldy) {
  !!isWorking ? invariant(false, 'renderRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;

  flushPassiveEffects();

  isWorking = true;
  var previousDispatcher = ReactCurrentDispatcher.current;
  ReactCurrentDispatcher.current = ContextOnlyDispatcher;

  var expirationTime = root.nextExpirationTimeToWorkOn;

  // Check if we're starting from a fresh stack, or if we're resuming from
  // previously yielded work.
  if (expirationTime !== nextRenderExpirationTime || root !== nextRoot || nextUnitOfWork === null) {
    // Reset the stack and start working from the root.
    resetStack();
    nextRoot = root;
    nextRenderExpirationTime = expirationTime;
    nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime);
    root.pendingCommitExpirationTime = NoWork;

    if (enableSchedulerTracing) {
      // Determine which interactions this batch of work currently includes,
      // So that we can accurately attribute time spent working on it,
      var interactions = new Set();
      root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledExpirationTime) {
        if (scheduledExpirationTime >= expirationTime) {
          scheduledInteractions.forEach(function (interaction) {
            return interactions.add(interaction);
          });
        }
      });

      // Store the current set of interactions on the FiberRoot for a few reasons:
      // We can re-use it in hot functions like renderRoot() without having to recalculate it.
      // We will also use it in commitWork() to pass to any Profiler onRender() hooks.
      // This also provides DevTools with a way to access it when the onCommitRoot() hook is called.
      root.memoizedInteractions = interactions;

      if (interactions.size > 0) {
        var subscriber = tracing.__subscriberRef.current;
        if (subscriber !== null) {
          var threadID = computeThreadID(expirationTime, root.interactionThreadID);
          try {
            subscriber.onWorkStarted(interactions, threadID);
          } catch (error) {
            // Work thrown by an interaction tracing subscriber should be rethrown,
            // But only once it's safe (to avoid leaving the scheduler in an invalid state).
            // Store the error for now and we'll re-throw in finishRendering().
            if (!hasUnhandledError) {
              hasUnhandledError = true;
              unhandledError = error;
            }
          }
        }
      }
    }
  }

  var prevInteractions = null;
  if (enableSchedulerTracing) {
    // We're about to start new traced work.
    // Restore pending interactions so cascading work triggered during the render phase will be accounted for.
    prevInteractions = tracing.__interactionsRef.current;
    tracing.__interactionsRef.current = root.memoizedInteractions;
  }

  var didFatal = false;

  startWorkLoopTimer(nextUnitOfWork);

  do {
    try {
      workLoop(isYieldy);
    } catch (thrownValue) {
      resetContextDependences();
      resetHooks();

      // Reset in case completion throws.
      // This is only used in DEV and when replaying is on.
      var mayReplay = void 0;
      if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
        mayReplay = mayReplayFailedUnitOfWork;
        mayReplayFailedUnitOfWork = true;
      }

      if (nextUnitOfWork === null) {
        // This is a fatal error.
        didFatal = true;
        onUncaughtError(thrownValue);
      } else {
        if (enableProfilerTimer && nextUnitOfWork.mode & ProfileMode) {
          // Record the time spent rendering before an error was thrown.
          // This avoids inaccurate Profiler durations in the case of a suspended render.
          stopProfilerTimerIfRunningAndRecordDelta(nextUnitOfWork, true);
        }

        {
          // Reset global debug state
          // We assume this is defined in DEV
          resetCurrentlyProcessingQueue();
        }

        if (true && replayFailedUnitOfWorkWithInvokeGuardedCallback) {
          if (mayReplay) {
            var failedUnitOfWork = nextUnitOfWork;
            replayUnitOfWork(failedUnitOfWork, thrownValue, isYieldy);
          }
        }

        // TODO: we already know this isn't true in some cases.
        // At least this shows a nicer error message until we figure out the cause.
        // https://github.com/facebook/react/issues/12449#issuecomment-386727431
        !(nextUnitOfWork !== null) ? invariant(false, 'Failed to replay rendering after an error. This is likely caused by a bug in React. Please file an issue with a reproducing case to help us find it.') : void 0;

        var sourceFiber = nextUnitOfWork;
        var returnFiber = sourceFiber.return;
        if (returnFiber === null) {
          // This is the root. The root could capture its own errors. However,
          // we don't know if it errors before or after we pushed the host
          // context. This information is needed to avoid a stack mismatch.
          // Because we're not sure, treat this as a fatal error. We could track
          // which phase it fails in, but doesn't seem worth it. At least
          // for now.
          didFatal = true;
          onUncaughtError(thrownValue);
        } else {
          throwException(root, returnFiber, sourceFiber, thrownValue, nextRenderExpirationTime);
          nextUnitOfWork = completeUnitOfWork(sourceFiber);
          continue;
        }
      }
    }
    break;
  } while (true);

  if (enableSchedulerTracing) {
    // Traced work is done for now; restore the previous interactions.
    tracing.__interactionsRef.current = prevInteractions;
  }

  // We're done performing work. Time to clean up.
  isWorking = false;
  ReactCurrentDispatcher.current = previousDispatcher;
  resetContextDependences();
  resetHooks();

  // Yield back to main thread.
  if (didFatal) {
    var _didCompleteRoot = false;
    stopWorkLoopTimer(interruptedBy, _didCompleteRoot);
    interruptedBy = null;
    // There was a fatal error.
    {
      resetStackAfterFatalErrorInDev();
    }
    // `nextRoot` points to the in-progress root. A non-null value indicates
    // that we're in the middle of an async render. Set it to null to indicate
    // there's no more work to be done in the current batch.
    nextRoot = null;
    onFatal(root);
    return;
  }

  if (nextUnitOfWork !== null) {
    // There's still remaining async work in this tree, but we ran out of time
    // in the current frame. Yield back to the renderer. Unless we're
    // interrupted by a higher priority update, we'll continue later from where
    // we left off.
    var _didCompleteRoot2 = false;
    stopWorkLoopTimer(interruptedBy, _didCompleteRoot2);
    interruptedBy = null;
    onYield(root);
    return;
  }

  // We completed the whole tree.
  var didCompleteRoot = true;
  stopWorkLoopTimer(interruptedBy, didCompleteRoot);
  var rootWorkInProgress = root.current.alternate;
  !(rootWorkInProgress !== null) ? invariant(false, 'Finished root should have a work-in-progress. This error is likely caused by a bug in React. Please file an issue.') : void 0;

  // `nextRoot` points to the in-progress root. A non-null value indicates
  // that we're in the middle of an async render. Set it to null to indicate
  // there's no more work to be done in the current batch.
  nextRoot = null;
  interruptedBy = null;

  if (nextRenderDidError) {
    // There was an error
    if (hasLowerPriorityWork(root, expirationTime)) {
      // There's lower priority work. If so, it may have the effect of fixing
      // the exception that was just thrown. Exit without committing. This is
      // similar to a suspend, but without a timeout because we're not waiting
      // for a promise to resolve. React will restart at the lower
      // priority level.
      markSuspendedPriorityLevel(root, expirationTime);
      var suspendedExpirationTime = expirationTime;
      var rootExpirationTime = root.expirationTime;
      onSuspend(root, rootWorkInProgress, suspendedExpirationTime, rootExpirationTime, -1 // Indicates no timeout
      );
      return;
    } else if (
    // There's no lower priority work, but we're rendering asynchronously.
    // Synchronously attempt to render the same level one more time. This is
    // similar to a suspend, but without a timeout because we're not waiting
    // for a promise to resolve.
    !root.didError && isYieldy) {
      root.didError = true;
      var _suspendedExpirationTime = root.nextExpirationTimeToWorkOn = expirationTime;
      var _rootExpirationTime = root.expirationTime = Sync;
      onSuspend(root, rootWorkInProgress, _suspendedExpirationTime, _rootExpirationTime, -1 // Indicates no timeout
      );
      return;
    }
  }

  if (isYieldy && nextLatestAbsoluteTimeoutMs !== -1) {
    // The tree was suspended.
    var _suspendedExpirationTime2 = expirationTime;
    markSuspendedPriorityLevel(root, _suspendedExpirationTime2);

    // Find the earliest uncommitted expiration time in the tree, including
    // work that is suspended. The timeout threshold cannot be longer than
    // the overall expiration.
    var earliestExpirationTime = findEarliestOutstandingPriorityLevel(root, expirationTime);
    var earliestExpirationTimeMs = expirationTimeToMs(earliestExpirationTime);
    if (earliestExpirationTimeMs < nextLatestAbsoluteTimeoutMs) {
      nextLatestAbsoluteTimeoutMs = earliestExpirationTimeMs;
    }

    // Subtract the current time from the absolute timeout to get the number
    // of milliseconds until the timeout. In other words, convert an absolute
    // timestamp to a relative time. This is the value that is passed
    // to `setTimeout`.
    var currentTimeMs = expirationTimeToMs(requestCurrentTime());
    var msUntilTimeout = nextLatestAbsoluteTimeoutMs - currentTimeMs;
    msUntilTimeout = msUntilTimeout < 0 ? 0 : msUntilTimeout;

    // TODO: Account for the Just Noticeable Difference

    var _rootExpirationTime2 = root.expirationTime;
    onSuspend(root, rootWorkInProgress, _suspendedExpirationTime2, _rootExpirationTime2, msUntilTimeout);
    return;
  }

  // Ready to commit.
  onComplete(root, rootWorkInProgress, expirationTime);
}

function captureCommitPhaseError(sourceFiber, value) {
  var expirationTime = Sync;
  var fiber = sourceFiber.return;
  while (fiber !== null) {
    switch (fiber.tag) {
      case ClassComponent:
        var ctor = fiber.type;
        var instance = fiber.stateNode;
        if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {
          var errorInfo = createCapturedValue(value, sourceFiber);
          var update = createClassErrorUpdate(fiber, errorInfo, expirationTime);
          enqueueUpdate(fiber, update);
          scheduleWork(fiber, expirationTime);
          return;
        }
        break;
      case HostRoot:
        {
          var _errorInfo = createCapturedValue(value, sourceFiber);
          var _update = createRootErrorUpdate(fiber, _errorInfo, expirationTime);
          enqueueUpdate(fiber, _update);
          scheduleWork(fiber, expirationTime);
          return;
        }
    }
    fiber = fiber.return;
  }

  if (sourceFiber.tag === HostRoot) {
    // Error was thrown at the root. There is no parent, so the root
    // itself should capture it.
    var rootFiber = sourceFiber;
    var _errorInfo2 = createCapturedValue(value, rootFiber);
    var _update2 = createRootErrorUpdate(rootFiber, _errorInfo2, expirationTime);
    enqueueUpdate(rootFiber, _update2);
    scheduleWork(rootFiber, expirationTime);
  }
}

function computeThreadID(expirationTime, interactionThreadID) {
  // Interaction threads are unique per root and expiration time.
  return expirationTime * 1000 + interactionThreadID;
}

// Creates a unique async expiration time.
function computeUniqueAsyncExpiration() {
  var currentTime = requestCurrentTime();
  var result = computeAsyncExpiration(currentTime);
  if (result >= lastUniqueAsyncExpiration) {
    // Since we assume the current time monotonically increases, we only hit
    // this branch when computeUniqueAsyncExpiration is fired multiple times
    // within a 200ms window (or whatever the async bucket size is).
    result = lastUniqueAsyncExpiration - 1;
  }
  lastUniqueAsyncExpiration = result;
  return lastUniqueAsyncExpiration;
}

function computeExpirationForFiber(currentTime, fiber) {
  var priorityLevel = scheduler.unstable_getCurrentPriorityLevel();

  var expirationTime = void 0;
  if ((fiber.mode & ConcurrentMode) === NoContext) {
    // Outside of concurrent mode, updates are always synchronous.
    expirationTime = Sync;
  } else if (isWorking && !isCommitting$1) {
    // During render phase, updates expire during as the current render.
    expirationTime = nextRenderExpirationTime;
  } else {
    switch (priorityLevel) {
      case scheduler.unstable_ImmediatePriority:
        expirationTime = Sync;
        break;
      case scheduler.unstable_UserBlockingPriority:
        expirationTime = computeInteractiveExpiration(currentTime);
        break;
      case scheduler.unstable_NormalPriority:
        // This is a normal, concurrent update
        expirationTime = computeAsyncExpiration(currentTime);
        break;
      case scheduler.unstable_LowPriority:
      case scheduler.unstable_IdlePriority:
        expirationTime = Never;
        break;
      default:
        invariant(false, 'Unknown priority level. This error is likely caused by a bug in React. Please file an issue.');
    }

    // If we're in the middle of rendering a tree, do not update at the same
    // expiration time that is already rendering.
    if (nextRoot !== null && expirationTime === nextRenderExpirationTime) {
      expirationTime -= 1;
    }
  }

  // Keep track of the lowest pending interactive expiration time. This
  // allows us to synchronously flush all interactive updates
  // when needed.
  // TODO: Move this to renderer?
  if (priorityLevel === scheduler.unstable_UserBlockingPriority && (lowestPriorityPendingInteractiveExpirationTime === NoWork || expirationTime < lowestPriorityPendingInteractiveExpirationTime)) {
    lowestPriorityPendingInteractiveExpirationTime = expirationTime;
  }

  return expirationTime;
}

function renderDidSuspend(root, absoluteTimeoutMs, suspendedTime) {
  // Schedule the timeout.
  if (absoluteTimeoutMs >= 0 && nextLatestAbsoluteTimeoutMs < absoluteTimeoutMs) {
    nextLatestAbsoluteTimeoutMs = absoluteTimeoutMs;
  }
}

function renderDidError() {
  nextRenderDidError = true;
}

function pingSuspendedRoot(root, thenable, pingTime) {
  // A promise that previously suspended React from committing has resolved.
  // If React is still suspended, try again at the previous level (pingTime).

  var pingCache = root.pingCache;
  if (pingCache !== null) {
    // The thenable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    pingCache.delete(thenable);
  }

  if (nextRoot !== null && nextRenderExpirationTime === pingTime) {
    // Received a ping at the same priority level at which we're currently
    // rendering. Restart from the root.
    nextRoot = null;
  } else {
    // Confirm that the root is still suspended at this level. Otherwise exit.
    if (isPriorityLevelSuspended(root, pingTime)) {
      // Ping at the original level
      markPingedPriorityLevel(root, pingTime);
      var rootExpirationTime = root.expirationTime;
      if (rootExpirationTime !== NoWork) {
        requestWork(root, rootExpirationTime);
      }
    }
  }
}

function retryTimedOutBoundary(boundaryFiber, thenable) {
  // The boundary fiber (a Suspense component) previously timed out and was
  // rendered in its fallback state. One of the promises that suspended it has
  // resolved, which means at least part of the tree was likely unblocked. Try
  var retryCache = void 0;
  if (enableSuspenseServerRenderer) {
    switch (boundaryFiber.tag) {
      case SuspenseComponent:
        retryCache = boundaryFiber.stateNode;
        break;
      case DehydratedSuspenseComponent:
        retryCache = boundaryFiber.memoizedState;
        break;
      default:
        invariant(false, 'Pinged unknown suspense boundary type. This is probably a bug in React.');
    }
  } else {
    retryCache = boundaryFiber.stateNode;
  }
  if (retryCache !== null) {
    // The thenable resolved, so we no longer need to memoize, because it will
    // never be thrown again.
    retryCache.delete(thenable);
  }

  var currentTime = requestCurrentTime();
  var retryTime = computeExpirationForFiber(currentTime, boundaryFiber);
  var root = scheduleWorkToRoot(boundaryFiber, retryTime);
  if (root !== null) {
    markPendingPriorityLevel(root, retryTime);
    var rootExpirationTime = root.expirationTime;
    if (rootExpirationTime !== NoWork) {
      requestWork(root, rootExpirationTime);
    }
  }
}

function scheduleWorkToRoot(fiber, expirationTime) {
  recordScheduleUpdate();

  {
    if (fiber.tag === ClassComponent) {
      var instance = fiber.stateNode;
      warnAboutInvalidUpdates(instance);
    }
  }

  // Update the source fiber's expiration time
  if (fiber.expirationTime < expirationTime) {
    fiber.expirationTime = expirationTime;
  }
  var alternate = fiber.alternate;
  if (alternate !== null && alternate.expirationTime < expirationTime) {
    alternate.expirationTime = expirationTime;
  }
  // Walk the parent path to the root and update the child expiration time.
  var node = fiber.return;
  var root = null;
  if (node === null && fiber.tag === HostRoot) {
    root = fiber.stateNode;
  } else {
    while (node !== null) {
      alternate = node.alternate;
      if (node.childExpirationTime < expirationTime) {
        node.childExpirationTime = expirationTime;
        if (alternate !== null && alternate.childExpirationTime < expirationTime) {
          alternate.childExpirationTime = expirationTime;
        }
      } else if (alternate !== null && alternate.childExpirationTime < expirationTime) {
        alternate.childExpirationTime = expirationTime;
      }
      if (node.return === null && node.tag === HostRoot) {
        root = node.stateNode;
        break;
      }
      node = node.return;
    }
  }

  if (enableSchedulerTracing) {
    if (root !== null) {
      var interactions = tracing.__interactionsRef.current;
      if (interactions.size > 0) {
        var pendingInteractionMap = root.pendingInteractionMap;
        var pendingInteractions = pendingInteractionMap.get(expirationTime);
        if (pendingInteractions != null) {
          interactions.forEach(function (interaction) {
            if (!pendingInteractions.has(interaction)) {
              // Update the pending async work count for previously unscheduled interaction.
              interaction.__count++;
            }

            pendingInteractions.add(interaction);
          });
        } else {
          pendingInteractionMap.set(expirationTime, new Set(interactions));

          // Update the pending async work count for the current interactions.
          interactions.forEach(function (interaction) {
            interaction.__count++;
          });
        }

        var subscriber = tracing.__subscriberRef.current;
        if (subscriber !== null) {
          var threadID = computeThreadID(expirationTime, root.interactionThreadID);
          subscriber.onWorkScheduled(interactions, threadID);
        }
      }
    }
  }
  return root;
}

function warnIfNotCurrentlyBatchingInDev(fiber) {
  {
    if (isRendering === false && isBatchingUpdates === false) {
      warningWithoutStack$1(false, 'An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be wrapped into act(...):\n\n' + 'act(() => {\n' + '  /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see in the browser." + ' Learn more at https://fb.me/react-wrap-tests-with-act' + '%s', getComponentName(fiber.type), getStackByFiberInDevAndProd(fiber));
    }
  }
}

function scheduleWork(fiber, expirationTime) {
  var root = scheduleWorkToRoot(fiber, expirationTime);
  if (root === null) {
    {
      switch (fiber.tag) {
        case ClassComponent:
          warnAboutUpdateOnUnmounted(fiber, true);
          break;
        case FunctionComponent:
        case ForwardRef:
        case MemoComponent:
        case SimpleMemoComponent:
          warnAboutUpdateOnUnmounted(fiber, false);
          break;
      }
    }
    return;
  }

  if (!isWorking && nextRenderExpirationTime !== NoWork && expirationTime > nextRenderExpirationTime) {
    // This is an interruption. (Used for performance tracking.)
    interruptedBy = fiber;
    resetStack();
  }
  markPendingPriorityLevel(root, expirationTime);
  if (
  // If we're in the render phase, we don't need to schedule this root
  // for an update, because we'll do it before we exit...
  !isWorking || isCommitting$1 ||
  // ...unless this is a different root than the one we're rendering.
  nextRoot !== root) {
    var rootExpirationTime = root.expirationTime;
    requestWork(root, rootExpirationTime);
  }
  if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
    // Reset this back to zero so subsequent updates don't throw.
    nestedUpdateCount = 0;
    invariant(false, 'Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.');
  }
}

function syncUpdates(fn, a, b, c, d) {
  return scheduler.unstable_runWithPriority(scheduler.unstable_ImmediatePriority, function () {
    return fn(a, b, c, d);
  });
}

// TODO: Everything below this is written as if it has been lifted to the
// renderers. I'll do this in a follow-up.

// Linked-list of roots
var firstScheduledRoot = null;
var lastScheduledRoot = null;

var callbackExpirationTime = NoWork;
var callbackID = void 0;
var isRendering = false;
var nextFlushedRoot = null;
var nextFlushedExpirationTime = NoWork;
var lowestPriorityPendingInteractiveExpirationTime = NoWork;
var hasUnhandledError = false;
var unhandledError = null;

var isBatchingUpdates = false;
var isUnbatchingUpdates = false;

var completedBatches = null;

var originalStartTimeMs = scheduler.unstable_now();
var currentRendererTime = msToExpirationTime(originalStartTimeMs);
var currentSchedulerTime = currentRendererTime;

// Use these to prevent an infinite loop of nested updates
var NESTED_UPDATE_LIMIT = 50;
var nestedUpdateCount = 0;
var lastCommittedRootDuringThisBatch = null;

function recomputeCurrentRendererTime() {
  var currentTimeMs = scheduler.unstable_now() - originalStartTimeMs;
  currentRendererTime = msToExpirationTime(currentTimeMs);
}

function scheduleCallbackWithExpirationTime(root, expirationTime) {
  if (callbackExpirationTime !== NoWork) {
    // A callback is already scheduled. Check its expiration time (timeout).
    if (expirationTime < callbackExpirationTime) {
      // Existing callback has sufficient timeout. Exit.
      return;
    } else {
      if (callbackID !== null) {
        // Existing callback has insufficient timeout. Cancel and schedule a
        // new one.
        scheduler.unstable_cancelCallback(callbackID);
      }
    }
    // The request callback timer is already running. Don't start a new one.
  } else {
    startRequestCallbackTimer();
  }

  callbackExpirationTime = expirationTime;
  var currentMs = scheduler.unstable_now() - originalStartTimeMs;
  var expirationTimeMs = expirationTimeToMs(expirationTime);
  var timeout = expirationTimeMs - currentMs;
  callbackID = scheduler.unstable_scheduleCallback(performAsyncWork, { timeout: timeout });
}

// For every call to renderRoot, one of onFatal, onComplete, onSuspend, and
// onYield is called upon exiting. We use these in lieu of returning a tuple.
// I've also chosen not to inline them into renderRoot because these will
// eventually be lifted into the renderer.
function onFatal(root) {
  root.finishedWork = null;
}

function onComplete(root, finishedWork, expirationTime) {
  root.pendingCommitExpirationTime = expirationTime;
  root.finishedWork = finishedWork;
}

function onSuspend(root, finishedWork, suspendedExpirationTime, rootExpirationTime, msUntilTimeout) {
  root.expirationTime = rootExpirationTime;
  if (msUntilTimeout === 0 && !shouldYieldToRenderer()) {
    // Don't wait an additional tick. Commit the tree immediately.
    root.pendingCommitExpirationTime = suspendedExpirationTime;
    root.finishedWork = finishedWork;
  } else if (msUntilTimeout > 0) {
    // Wait `msUntilTimeout` milliseconds before committing.
    root.timeoutHandle = scheduleTimeout(onTimeout.bind(null, root, finishedWork, suspendedExpirationTime), msUntilTimeout);
  }
}

function onYield(root) {
  root.finishedWork = null;
}

function onTimeout(root, finishedWork, suspendedExpirationTime) {
  // The root timed out. Commit it.
  root.pendingCommitExpirationTime = suspendedExpirationTime;
  root.finishedWork = finishedWork;
  // Read the current time before entering the commit phase. We can be
  // certain this won't cause tearing related to batching of event updates
  // because we're at the top of a timer event.
  recomputeCurrentRendererTime();
  currentSchedulerTime = currentRendererTime;
  flushRoot(root, suspendedExpirationTime);
}

function onCommit(root, expirationTime) {
  root.expirationTime = expirationTime;
  root.finishedWork = null;
}

function requestCurrentTime() {
  // requestCurrentTime is called by the scheduler to compute an expiration
  // time.
  //
  // Expiration times are computed by adding to the current time (the start
  // time). However, if two updates are scheduled within the same event, we
  // should treat their start times as simultaneous, even if the actual clock
  // time has advanced between the first and second call.

  // In other words, because expiration times determine how updates are batched,
  // we want all updates of like priority that occur within the same event to
  // receive the same expiration time. Otherwise we get tearing.
  //
  // We keep track of two separate times: the current "renderer" time and the
  // current "scheduler" time. The renderer time can be updated whenever; it
  // only exists to minimize the calls performance.now.
  //
  // But the scheduler time can only be updated if there's no pending work, or
  // if we know for certain that we're not in the middle of an event.

  if (isRendering) {
    // We're already rendering. Return the most recently read time.
    return currentSchedulerTime;
  }
  // Check if there's pending work.
  findHighestPriorityRoot();
  if (nextFlushedExpirationTime === NoWork || nextFlushedExpirationTime === Never) {
    // If there's no pending work, or if the pending work is offscreen, we can
    // read the current time without risk of tearing.
    recomputeCurrentRendererTime();
    currentSchedulerTime = currentRendererTime;
    return currentSchedulerTime;
  }
  // There's already pending work. We might be in the middle of a browser
  // event. If we were to read the current time, it could cause multiple updates
  // within the same event to receive different expiration times, leading to
  // tearing. Return the last read time. During the next idle callback, the
  // time will be updated.
  return currentSchedulerTime;
}

// requestWork is called by the scheduler whenever a root receives an update.
// It's up to the renderer to call renderRoot at some point in the future.
function requestWork(root, expirationTime) {
  addRootToSchedule(root, expirationTime);
  if (isRendering) {
    // Prevent reentrancy. Remaining work will be scheduled at the end of
    // the currently rendering batch.
    return;
  }

  if (isBatchingUpdates) {
    // Flush work at the end of the batch.
    if (isUnbatchingUpdates) {
      // ...unless we're inside unbatchedUpdates, in which case we should
      // flush it now.
      nextFlushedRoot = root;
      nextFlushedExpirationTime = Sync;
      performWorkOnRoot(root, Sync, false);
    }
    return;
  }

  // TODO: Get rid of Sync and use current time?
  if (expirationTime === Sync) {
    performSyncWork();
  } else {
    scheduleCallbackWithExpirationTime(root, expirationTime);
  }
}

function addRootToSchedule(root, expirationTime) {
  // Add the root to the schedule.
  // Check if this root is already part of the schedule.
  if (root.nextScheduledRoot === null) {
    // This root is not already scheduled. Add it.
    root.expirationTime = expirationTime;
    if (lastScheduledRoot === null) {
      firstScheduledRoot = lastScheduledRoot = root;
      root.nextScheduledRoot = root;
    } else {
      lastScheduledRoot.nextScheduledRoot = root;
      lastScheduledRoot = root;
      lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;
    }
  } else {
    // This root is already scheduled, but its priority may have increased.
    var remainingExpirationTime = root.expirationTime;
    if (expirationTime > remainingExpirationTime) {
      // Update the priority.
      root.expirationTime = expirationTime;
    }
  }
}

function findHighestPriorityRoot() {
  var highestPriorityWork = NoWork;
  var highestPriorityRoot = null;
  if (lastScheduledRoot !== null) {
    var previousScheduledRoot = lastScheduledRoot;
    var root = firstScheduledRoot;
    while (root !== null) {
      var remainingExpirationTime = root.expirationTime;
      if (remainingExpirationTime === NoWork) {
        // This root no longer has work. Remove it from the scheduler.

        // TODO: This check is redudant, but Flow is confused by the branch
        // below where we set lastScheduledRoot to null, even though we break
        // from the loop right after.
        !(previousScheduledRoot !== null && lastScheduledRoot !== null) ? invariant(false, 'Should have a previous and last root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
        if (root === root.nextScheduledRoot) {
          // This is the only root in the list.
          root.nextScheduledRoot = null;
          firstScheduledRoot = lastScheduledRoot = null;
          break;
        } else if (root === firstScheduledRoot) {
          // This is the first root in the list.
          var next = root.nextScheduledRoot;
          firstScheduledRoot = next;
          lastScheduledRoot.nextScheduledRoot = next;
          root.nextScheduledRoot = null;
        } else if (root === lastScheduledRoot) {
          // This is the last root in the list.
          lastScheduledRoot = previousScheduledRoot;
          lastScheduledRoot.nextScheduledRoot = firstScheduledRoot;
          root.nextScheduledRoot = null;
          break;
        } else {
          previousScheduledRoot.nextScheduledRoot = root.nextScheduledRoot;
          root.nextScheduledRoot = null;
        }
        root = previousScheduledRoot.nextScheduledRoot;
      } else {
        if (remainingExpirationTime > highestPriorityWork) {
          // Update the priority, if it's higher
          highestPriorityWork = remainingExpirationTime;
          highestPriorityRoot = root;
        }
        if (root === lastScheduledRoot) {
          break;
        }
        if (highestPriorityWork === Sync) {
          // Sync is highest priority by definition so
          // we can stop searching.
          break;
        }
        previousScheduledRoot = root;
        root = root.nextScheduledRoot;
      }
    }
  }

  nextFlushedRoot = highestPriorityRoot;
  nextFlushedExpirationTime = highestPriorityWork;
}

// TODO: This wrapper exists because many of the older tests (the ones that use
// flushDeferredPri) rely on the number of times `shouldYield` is called. We
// should get rid of it.
var didYield = false;
function shouldYieldToRenderer() {
  if (didYield) {
    return true;
  }
  if (scheduler.unstable_shouldYield()) {
    didYield = true;
    return true;
  }
  return false;
}

function performAsyncWork() {
  try {
    if (!shouldYieldToRenderer()) {
      // The callback timed out. That means at least one update has expired.
      // Iterate through the root schedule. If they contain expired work, set
      // the next render expiration time to the current time. This has the effect
      // of flushing all expired work in a single batch, instead of flushing each
      // level one at a time.
      if (firstScheduledRoot !== null) {
        recomputeCurrentRendererTime();
        var root = firstScheduledRoot;
        do {
          didExpireAtExpirationTime(root, currentRendererTime);
          // The root schedule is circular, so this is never null.
          root = root.nextScheduledRoot;
        } while (root !== firstScheduledRoot);
      }
    }
    performWork(NoWork, true);
  } finally {
    didYield = false;
  }
}

function performSyncWork() {
  performWork(Sync, false);
}

function performWork(minExpirationTime, isYieldy) {
  // Keep working on roots until there's no more work, or until there's a higher
  // priority event.
  findHighestPriorityRoot();

  if (isYieldy) {
    recomputeCurrentRendererTime();
    currentSchedulerTime = currentRendererTime;

    if (enableUserTimingAPI) {
      var didExpire = nextFlushedExpirationTime > currentRendererTime;
      var timeout = expirationTimeToMs(nextFlushedExpirationTime);
      stopRequestCallbackTimer(didExpire, timeout);
    }

    while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && minExpirationTime <= nextFlushedExpirationTime && !(didYield && currentRendererTime > nextFlushedExpirationTime)) {
      performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, currentRendererTime > nextFlushedExpirationTime);
      findHighestPriorityRoot();
      recomputeCurrentRendererTime();
      currentSchedulerTime = currentRendererTime;
    }
  } else {
    while (nextFlushedRoot !== null && nextFlushedExpirationTime !== NoWork && minExpirationTime <= nextFlushedExpirationTime) {
      performWorkOnRoot(nextFlushedRoot, nextFlushedExpirationTime, false);
      findHighestPriorityRoot();
    }
  }

  // We're done flushing work. Either we ran out of time in this callback,
  // or there's no more work left with sufficient priority.

  // If we're inside a callback, set this to false since we just completed it.
  if (isYieldy) {
    callbackExpirationTime = NoWork;
    callbackID = null;
  }
  // If there's work left over, schedule a new callback.
  if (nextFlushedExpirationTime !== NoWork) {
    scheduleCallbackWithExpirationTime(nextFlushedRoot, nextFlushedExpirationTime);
  }

  // Clean-up.
  finishRendering();
}

function flushRoot(root, expirationTime) {
  !!isRendering ? invariant(false, 'work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.') : void 0;
  // Perform work on root as if the given expiration time is the current time.
  // This has the effect of synchronously flushing all work up to and
  // including the given time.
  nextFlushedRoot = root;
  nextFlushedExpirationTime = expirationTime;
  performWorkOnRoot(root, expirationTime, false);
  // Flush any sync work that was scheduled by lifecycles
  performSyncWork();
}

function finishRendering() {
  nestedUpdateCount = 0;
  lastCommittedRootDuringThisBatch = null;

  if (completedBatches !== null) {
    var batches = completedBatches;
    completedBatches = null;
    for (var i = 0; i < batches.length; i++) {
      var batch = batches[i];
      try {
        batch._onComplete();
      } catch (error) {
        if (!hasUnhandledError) {
          hasUnhandledError = true;
          unhandledError = error;
        }
      }
    }
  }

  if (hasUnhandledError) {
    var error = unhandledError;
    unhandledError = null;
    hasUnhandledError = false;
    throw error;
  }
}

function performWorkOnRoot(root, expirationTime, isYieldy) {
  !!isRendering ? invariant(false, 'performWorkOnRoot was called recursively. This error is likely caused by a bug in React. Please file an issue.') : void 0;

  isRendering = true;

  // Check if this is async work or sync/expired work.
  if (!isYieldy) {
    // Flush work without yielding.
    // TODO: Non-yieldy work does not necessarily imply expired work. A renderer
    // may want to perform some work without yielding, but also without
    // requiring the root to complete (by triggering placeholders).

    var finishedWork = root.finishedWork;
    if (finishedWork !== null) {
      // This root is already complete. We can commit it.
      completeRoot(root, finishedWork, expirationTime);
    } else {
      root.finishedWork = null;
      // If this root previously suspended, clear its existing timeout, since
      // we're about to try rendering again.
      var timeoutHandle = root.timeoutHandle;
      if (timeoutHandle !== noTimeout) {
        root.timeoutHandle = noTimeout;
        // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above
        cancelTimeout(timeoutHandle);
      }
      renderRoot(root, isYieldy);
      finishedWork = root.finishedWork;
      if (finishedWork !== null) {
        // We've completed the root. Commit it.
        completeRoot(root, finishedWork, expirationTime);
      }
    }
  } else {
    // Flush async work.
    var _finishedWork = root.finishedWork;
    if (_finishedWork !== null) {
      // This root is already complete. We can commit it.
      completeRoot(root, _finishedWork, expirationTime);
    } else {
      root.finishedWork = null;
      // If this root previously suspended, clear its existing timeout, since
      // we're about to try rendering again.
      var _timeoutHandle = root.timeoutHandle;
      if (_timeoutHandle !== noTimeout) {
        root.timeoutHandle = noTimeout;
        // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above
        cancelTimeout(_timeoutHandle);
      }
      renderRoot(root, isYieldy);
      _finishedWork = root.finishedWork;
      if (_finishedWork !== null) {
        // We've completed the root. Check the if we should yield one more time
        // before committing.
        if (!shouldYieldToRenderer()) {
          // Still time left. Commit the root.
          completeRoot(root, _finishedWork, expirationTime);
        } else {
          // There's no time left. Mark this root as complete. We'll come
          // back and commit it later.
          root.finishedWork = _finishedWork;
        }
      }
    }
  }

  isRendering = false;
}

function completeRoot(root, finishedWork, expirationTime) {
  // Check if there's a batch that matches this expiration time.
  var firstBatch = root.firstBatch;
  if (firstBatch !== null && firstBatch._expirationTime >= expirationTime) {
    if (completedBatches === null) {
      completedBatches = [firstBatch];
    } else {
      completedBatches.push(firstBatch);
    }
    if (firstBatch._defer) {
      // This root is blocked from committing by a batch. Unschedule it until
      // we receive another update.
      root.finishedWork = finishedWork;
      root.expirationTime = NoWork;
      return;
    }
  }

  // Commit the root.
  root.finishedWork = null;

  // Check if this is a nested update (a sync update scheduled during the
  // commit phase).
  if (root === lastCommittedRootDuringThisBatch) {
    // If the next root is the same as the previous root, this is a nested
    // update. To prevent an infinite loop, increment the nested update count.
    nestedUpdateCount++;
  } else {
    // Reset whenever we switch roots.
    lastCommittedRootDuringThisBatch = root;
    nestedUpdateCount = 0;
  }
  scheduler.unstable_runWithPriority(scheduler.unstable_ImmediatePriority, function () {
    commitRoot(root, finishedWork);
  });
}

function onUncaughtError(error) {
  !(nextFlushedRoot !== null) ? invariant(false, 'Should be working on a root. This error is likely caused by a bug in React. Please file an issue.') : void 0;
  // Unschedule this root so we don't work on it again until there's
  // another update.
  nextFlushedRoot.expirationTime = NoWork;
  if (!hasUnhandledError) {
    hasUnhandledError = true;
    unhandledError = error;
  }
}

// TODO: Batching should be implemented at the renderer level, not inside
// the reconciler.
function batchedUpdates$1(fn, a) {
  var previousIsBatchingUpdates = isBatchingUpdates;
  isBatchingUpdates = true;
  try {
    return fn(a);
  } finally {
    isBatchingUpdates = previousIsBatchingUpdates;
    if (!isBatchingUpdates && !isRendering) {
      performSyncWork();
    }
  }
}

// TODO: Batching should be implemented at the renderer level, not inside
// the reconciler.
function unbatchedUpdates(fn, a) {
  if (isBatchingUpdates && !isUnbatchingUpdates) {
    isUnbatchingUpdates = true;
    try {
      return fn(a);
    } finally {
      isUnbatchingUpdates = false;
    }
  }
  return fn(a);
}

// TODO: Batching should be implemented at the renderer level, not within
// the reconciler.
function flushSync(fn, a) {
  !!isRendering ? invariant(false, 'flushSync was called from inside a lifecycle method. It cannot be called when React is already rendering.') : void 0;
  var previousIsBatchingUpdates = isBatchingUpdates;
  isBatchingUpdates = true;
  try {
    return syncUpdates(fn, a);
  } finally {
    isBatchingUpdates = previousIsBatchingUpdates;
    performSyncWork();
  }
}

function interactiveUpdates$1(fn, a, b) {
  // If there are any pending interactive updates, synchronously flush them.
  // This needs to happen before we read any handlers, because the effect of
  // the previous event may influence which handlers are called during
  // this event.
  if (!isBatchingUpdates && !isRendering && lowestPriorityPendingInteractiveExpirationTime !== NoWork) {
    // Synchronously flush pending interactive updates.
    performWork(lowestPriorityPendingInteractiveExpirationTime, false);
    lowestPriorityPendingInteractiveExpirationTime = NoWork;
  }
  var previousIsBatchingUpdates = isBatchingUpdates;
  isBatchingUpdates = true;
  try {
    return scheduler.unstable_runWithPriority(scheduler.unstable_UserBlockingPriority, function () {
      return fn(a, b);
    });
  } finally {
    isBatchingUpdates = previousIsBatchingUpdates;
    if (!isBatchingUpdates && !isRendering) {
      performSyncWork();
    }
  }
}

function flushInteractiveUpdates$1() {
  if (!isRendering && lowestPriorityPendingInteractiveExpirationTime !== NoWork) {
    // Synchronously flush pending interactive updates.
    performWork(lowestPriorityPendingInteractiveExpirationTime, false);
    lowestPriorityPendingInteractiveExpirationTime = NoWork;
  }
}

function flushControlled(fn) {
  var previousIsBatchingUpdates = isBatchingUpdates;
  isBatchingUpdates = true;
  try {
    syncUpdates(fn);
  } finally {
    isBatchingUpdates = previousIsBatchingUpdates;
    if (!isBatchingUpdates && !isRendering) {
      performSyncWork();
    }
  }
}

// 0 is PROD, 1 is DEV.
// Might add PROFILE later.


var didWarnAboutNestedUpdates = void 0;
var didWarnAboutFindNodeInStrictMode = void 0;

{
  didWarnAboutNestedUpdates = false;
  didWarnAboutFindNodeInStrictMode = {};
}

function getContextForSubtree(parentComponent) {
  if (!parentComponent) {
    return emptyContextObject;
  }

  var fiber = get(parentComponent);
  var parentContext = findCurrentUnmaskedContext(fiber);

  if (fiber.tag === ClassComponent) {
    var Component = fiber.type;
    if (isContextProvider(Component)) {
      return processChildContext(fiber, Component, parentContext);
    }
  }

  return parentContext;
}

function scheduleRootUpdate(current$$1, element, expirationTime, callback) {
  {
    if (phase === 'render' && current !== null && !didWarnAboutNestedUpdates) {
      didWarnAboutNestedUpdates = true;
      warningWithoutStack$1(false, 'Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentName(current.type) || 'Unknown');
    }
  }

  var update = createUpdate(expirationTime);
  // Caution: React DevTools currently depends on this property
  // being called "element".
  update.payload = { element: element };

  callback = callback === undefined ? null : callback;
  if (callback !== null) {
    !(typeof callback === 'function') ? warningWithoutStack$1(false, 'render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback) : void 0;
    update.callback = callback;
  }

  flushPassiveEffects();
  enqueueUpdate(current$$1, update);
  scheduleWork(current$$1, expirationTime);

  return expirationTime;
}

function updateContainerAtExpirationTime(element, container, parentComponent, expirationTime, callback) {
  // TODO: If this is a nested container, this won't be the root.
  var current$$1 = container.current;

  {
    if (ReactFiberInstrumentation_1.debugTool) {
      if (current$$1.alternate === null) {
        ReactFiberInstrumentation_1.debugTool.onMountContainer(container);
      } else if (element === null) {
        ReactFiberInstrumentation_1.debugTool.onUnmountContainer(container);
      } else {
        ReactFiberInstrumentation_1.debugTool.onUpdateContainer(container);
      }
    }
  }

  var context = getContextForSubtree(parentComponent);
  if (container.context === null) {
    container.context = context;
  } else {
    container.pendingContext = context;
  }

  return scheduleRootUpdate(current$$1, element, expirationTime, callback);
}

function findHostInstance(component) {
  var fiber = get(component);
  if (fiber === undefined) {
    if (typeof component.render === 'function') {
      invariant(false, 'Unable to find node on an unmounted component.');
    } else {
      invariant(false, 'Argument appears to not be a ReactComponent. Keys: %s', Object.keys(component));
    }
  }
  var hostFiber = findCurrentHostFiber(fiber);
  if (hostFiber === null) {
    return null;
  }
  return hostFiber.stateNode;
}

function findHostInstanceWithWarning(component, methodName) {
  {
    var fiber = get(component);
    if (fiber === undefined) {
      if (typeof component.render === 'function') {
        invariant(false, 'Unable to find node on an unmounted component.');
      } else {
        invariant(false, 'Argument appears to not be a ReactComponent. Keys: %s', Object.keys(component));
      }
    }
    var hostFiber = findCurrentHostFiber(fiber);
    if (hostFiber === null) {
      return null;
    }
    if (hostFiber.mode & StrictMode) {
      var componentName = getComponentName(fiber.type) || 'Component';
      if (!didWarnAboutFindNodeInStrictMode[componentName]) {
        didWarnAboutFindNodeInStrictMode[componentName] = true;
        if (fiber.mode & StrictMode) {
          warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-find-node', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
        } else {
          warningWithoutStack$1(false, '%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference.' + '\n%s' + '\n\nLearn more about using refs safely here:' + '\nhttps://fb.me/react-strict-mode-find-node', methodName, methodName, componentName, getStackByFiberInDevAndProd(hostFiber));
        }
      }
    }
    return hostFiber.stateNode;
  }
  return findHostInstance(component);
}

function createContainer(containerInfo, isConcurrent, hydrate) {
  return createFiberRoot(containerInfo, isConcurrent, hydrate);
}

function updateContainer(element, container, parentComponent, callback) {
  var current$$1 = container.current;
  var currentTime = requestCurrentTime();
  var expirationTime = computeExpirationForFiber(currentTime, current$$1);
  return updateContainerAtExpirationTime(element, container, parentComponent, expirationTime, callback);
}

function getPublicRootInstance(container) {
  var containerFiber = container.current;
  if (!containerFiber.child) {
    return null;
  }
  switch (containerFiber.child.tag) {
    case HostComponent:
      return getPublicInstance(containerFiber.child.stateNode);
    default:
      return containerFiber.child.stateNode;
  }
}

function findHostInstanceWithNoPortals(fiber) {
  var hostFiber = findCurrentHostFiberWithNoPortals(fiber);
  if (hostFiber === null) {
    return null;
  }
  return hostFiber.stateNode;
}

var overrideProps = null;

{
  var copyWithSetImpl = function (obj, path, idx, value) {
    if (idx >= path.length) {
      return value;
    }
    var key = path[idx];
    var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);
    // $FlowFixMe number or string is fine here
    updated[key] = copyWithSetImpl(obj[key], path, idx + 1, value);
    return updated;
  };

  var copyWithSet = function (obj, path, value) {
    return copyWithSetImpl(obj, path, 0, value);
  };

  // Support DevTools props for function components, forwardRef, memo, host components, etc.
  overrideProps = function (fiber, path, value) {
    flushPassiveEffects();
    fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);
    if (fiber.alternate) {
      fiber.alternate.pendingProps = fiber.pendingProps;
    }
    scheduleWork(fiber, Sync);
  };
}

function injectIntoDevTools(devToolsConfig) {
  var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
  var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;


  return injectInternals(_assign({}, devToolsConfig, {
    overrideProps: overrideProps,
    currentDispatcherRef: ReactCurrentDispatcher,
    findHostInstanceByFiber: function (fiber) {
      var hostFiber = findCurrentHostFiber(fiber);
      if (hostFiber === null) {
        return null;
      }
      return hostFiber.stateNode;
    },
    findFiberByHostInstance: function (instance) {
      if (!findFiberByHostInstance) {
        // Might not be implemented by the renderer.
        return null;
      }
      return findFiberByHostInstance(instance);
    }
  }));
}

// This file intentionally does *not* have the Flow annotation.
// Don't add it. See `./inline-typed.js` for an explanation.

function createPortal$1(children, containerInfo,
// TODO: figure out the API for cross-renderer implementation.
implementation) {
  var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

  return {
    // This tag allow us to uniquely identify this as a React Portal
    $$typeof: REACT_PORTAL_TYPE,
    key: key == null ? null : '' + key,
    children: children,
    containerInfo: containerInfo,
    implementation: implementation
  };
}

// TODO: this is special because it gets imported during build.

var ReactVersion = '16.8.6';

// TODO: This type is shared between the reconciler and ReactDOM, but will
// eventually be lifted out to the renderer.

var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;

var topLevelUpdateWarnings = void 0;
var warnOnInvalidCallback = void 0;
var didWarnAboutUnstableCreatePortal = false;

{
  if (typeof Map !== 'function' ||
  // $FlowIssue Flow incorrectly thinks Map has no prototype
  Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' ||
  // $FlowIssue Flow incorrectly thinks Set has no prototype
  Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {
    warningWithoutStack$1(false, 'React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
  }

  topLevelUpdateWarnings = function (container) {
    if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
      var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);
      if (hostInstance) {
        !(hostInstance.parentNode === container) ? warningWithoutStack$1(false, 'render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.') : void 0;
      }
    }

    var isRootRenderedBySomeReact = !!container._reactRootContainer;
    var rootEl = getReactRootElementInContainer(container);
    var hasNonRootReactChild = !!(rootEl && getInstanceFromNode$1(rootEl));

    !(!hasNonRootReactChild || isRootRenderedBySomeReact) ? warningWithoutStack$1(false, 'render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.') : void 0;

    !(container.nodeType !== ELEMENT_NODE || !container.tagName || container.tagName.toUpperCase() !== 'BODY') ? warningWithoutStack$1(false, 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : void 0;
  };

  warnOnInvalidCallback = function (callback, callerName) {
    !(callback === null || typeof callback === 'function') ? warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback) : void 0;
  };
}

setRestoreImplementation(restoreControlledState$1);

function ReactBatch(root) {
  var expirationTime = computeUniqueAsyncExpiration();
  this._expirationTime = expirationTime;
  this._root = root;
  this._next = null;
  this._callbacks = null;
  this._didComplete = false;
  this._hasChildren = false;
  this._children = null;
  this._defer = true;
}
ReactBatch.prototype.render = function (children) {
  !this._defer ? invariant(false, 'batch.render: Cannot render a batch that already committed.') : void 0;
  this._hasChildren = true;
  this._children = children;
  var internalRoot = this._root._internalRoot;
  var expirationTime = this._expirationTime;
  var work = new ReactWork();
  updateContainerAtExpirationTime(children, internalRoot, null, expirationTime, work._onCommit);
  return work;
};
ReactBatch.prototype.then = function (onComplete) {
  if (this._didComplete) {
    onComplete();
    return;
  }
  var callbacks = this._callbacks;
  if (callbacks === null) {
    callbacks = this._callbacks = [];
  }
  callbacks.push(onComplete);
};
ReactBatch.prototype.commit = function () {
  var internalRoot = this._root._internalRoot;
  var firstBatch = internalRoot.firstBatch;
  !(this._defer && firstBatch !== null) ? invariant(false, 'batch.commit: Cannot commit a batch multiple times.') : void 0;

  if (!this._hasChildren) {
    // This batch is empty. Return.
    this._next = null;
    this._defer = false;
    return;
  }

  var expirationTime = this._expirationTime;

  // Ensure this is the first batch in the list.
  if (firstBatch !== this) {
    // This batch is not the earliest batch. We need to move it to the front.
    // Update its expiration time to be the expiration time of the earliest
    // batch, so that we can flush it without flushing the other batches.
    if (this._hasChildren) {
      expirationTime = this._expirationTime = firstBatch._expirationTime;
      // Rendering this batch again ensures its children will be the final state
      // when we flush (updates are processed in insertion order: last
      // update wins).
      // TODO: This forces a restart. Should we print a warning?
      this.render(this._children);
    }

    // Remove the batch from the list.
    var previous = null;
    var batch = firstBatch;
    while (batch !== this) {
      previous = batch;
      batch = batch._next;
    }
    !(previous !== null) ? invariant(false, 'batch.commit: Cannot commit a batch multiple times.') : void 0;
    previous._next = batch._next;

    // Add it to the front.
    this._next = firstBatch;
    firstBatch = internalRoot.firstBatch = this;
  }

  // Synchronously flush all the work up to this batch's expiration time.
  this._defer = false;
  flushRoot(internalRoot, expirationTime);

  // Pop the batch from the list.
  var next = this._next;
  this._next = null;
  firstBatch = internalRoot.firstBatch = next;

  // Append the next earliest batch's children to the update queue.
  if (firstBatch !== null && firstBatch._hasChildren) {
    firstBatch.render(firstBatch._children);
  }
};
ReactBatch.prototype._onComplete = function () {
  if (this._didComplete) {
    return;
  }
  this._didComplete = true;
  var callbacks = this._callbacks;
  if (callbacks === null) {
    return;
  }
  // TODO: Error handling.
  for (var i = 0; i < callbacks.length; i++) {
    var _callback = callbacks[i];
    _callback();
  }
};

function ReactWork() {
  this._callbacks = null;
  this._didCommit = false;
  // TODO: Avoid need to bind by replacing callbacks in the update queue with
  // list of Work objects.
  this._onCommit = this._onCommit.bind(this);
}
ReactWork.prototype.then = function (onCommit) {
  if (this._didCommit) {
    onCommit();
    return;
  }
  var callbacks = this._callbacks;
  if (callbacks === null) {
    callbacks = this._callbacks = [];
  }
  callbacks.push(onCommit);
};
ReactWork.prototype._onCommit = function () {
  if (this._didCommit) {
    return;
  }
  this._didCommit = true;
  var callbacks = this._callbacks;
  if (callbacks === null) {
    return;
  }
  // TODO: Error handling.
  for (var i = 0; i < callbacks.length; i++) {
    var _callback2 = callbacks[i];
    !(typeof _callback2 === 'function') ? invariant(false, 'Invalid argument passed as callback. Expected a function. Instead received: %s', _callback2) : void 0;
    _callback2();
  }
};

function ReactRoot(container, isConcurrent, hydrate) {
  var root = createContainer(container, isConcurrent, hydrate);
  this._internalRoot = root;
}
ReactRoot.prototype.render = function (children, callback) {
  var root = this._internalRoot;
  var work = new ReactWork();
  callback = callback === undefined ? null : callback;
  {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  updateContainer(children, root, null, work._onCommit);
  return work;
};
ReactRoot.prototype.unmount = function (callback) {
  var root = this._internalRoot;
  var work = new ReactWork();
  callback = callback === undefined ? null : callback;
  {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  updateContainer(null, root, null, work._onCommit);
  return work;
};
ReactRoot.prototype.legacy_renderSubtreeIntoContainer = function (parentComponent, children, callback) {
  var root = this._internalRoot;
  var work = new ReactWork();
  callback = callback === undefined ? null : callback;
  {
    warnOnInvalidCallback(callback, 'render');
  }
  if (callback !== null) {
    work.then(callback);
  }
  updateContainer(children, root, parentComponent, work._onCommit);
  return work;
};
ReactRoot.prototype.createBatch = function () {
  var batch = new ReactBatch(this);
  var expirationTime = batch._expirationTime;

  var internalRoot = this._internalRoot;
  var firstBatch = internalRoot.firstBatch;
  if (firstBatch === null) {
    internalRoot.firstBatch = batch;
    batch._next = null;
  } else {
    // Insert sorted by expiration time then insertion order
    var insertAfter = null;
    var insertBefore = firstBatch;
    while (insertBefore !== null && insertBefore._expirationTime >= expirationTime) {
      insertAfter = insertBefore;
      insertBefore = insertBefore._next;
    }
    batch._next = insertBefore;
    if (insertAfter !== null) {
      insertAfter._next = batch;
    }
  }

  return batch;
};

/**
 * True if the supplied DOM node is a valid node element.
 *
 * @param {?DOMElement} node The candidate DOM node.
 * @return {boolean} True if the DOM is a valid DOM node.
 * @internal
 */
function isValidContainer(node) {
  return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
}

function getReactRootElementInContainer(container) {
  if (!container) {
    return null;
  }

  if (container.nodeType === DOCUMENT_NODE) {
    return container.documentElement;
  } else {
    return container.firstChild;
  }
}

function shouldHydrateDueToLegacyHeuristic(container) {
  var rootElement = getReactRootElementInContainer(container);
  return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
}

setBatchingImplementation(batchedUpdates$1, interactiveUpdates$1, flushInteractiveUpdates$1);

var warnedAboutHydrateAPI = false;

function legacyCreateRootFromDOMContainer(container, forceHydrate) {
  var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container);
  // First clear any existing content.
  if (!shouldHydrate) {
    var warned = false;
    var rootSibling = void 0;
    while (rootSibling = container.lastChild) {
      {
        if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {
          warned = true;
          warningWithoutStack$1(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');
        }
      }
      container.removeChild(rootSibling);
    }
  }
  {
    if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {
      warnedAboutHydrateAPI = true;
      lowPriorityWarning$1(false, 'render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v17. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');
    }
  }
  // Legacy roots are not async by default.
  var isConcurrent = false;
  return new ReactRoot(container, isConcurrent, shouldHydrate);
}

function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
  {
    topLevelUpdateWarnings(container);
  }

  // TODO: Without `any` type, Flow says "Property cannot be accessed on any
  // member of intersection type." Whyyyyyy.
  var root = container._reactRootContainer;
  if (!root) {
    // Initial mount
    root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);
    if (typeof callback === 'function') {
      var originalCallback = callback;
      callback = function () {
        var instance = getPublicRootInstance(root._internalRoot);
        originalCallback.call(instance);
      };
    }
    // Initial mount should not be batched.
    unbatchedUpdates(function () {
      if (parentComponent != null) {
        root.legacy_renderSubtreeIntoContainer(parentComponent, children, callback);
      } else {
        root.render(children, callback);
      }
    });
  } else {
    if (typeof callback === 'function') {
      var _originalCallback = callback;
      callback = function () {
        var instance = getPublicRootInstance(root._internalRoot);
        _originalCallback.call(instance);
      };
    }
    // Update
    if (parentComponent != null) {
      root.legacy_renderSubtreeIntoContainer(parentComponent, children, callback);
    } else {
      root.render(children, callback);
    }
  }
  return getPublicRootInstance(root._internalRoot);
}

function createPortal$$1(children, container) {
  var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

  !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
  // TODO: pass ReactDOM portal implementation as third argument
  return createPortal$1(children, container, null, key);
}

var ReactDOM = {
  createPortal: createPortal$$1,

  findDOMNode: function (componentOrElement) {
    {
      var owner = ReactCurrentOwner.current;
      if (owner !== null && owner.stateNode !== null) {
        var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;
        !warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(owner.type) || 'A component') : void 0;
        owner.stateNode._warnedAboutRefsInRender = true;
      }
    }
    if (componentOrElement == null) {
      return null;
    }
    if (componentOrElement.nodeType === ELEMENT_NODE) {
      return componentOrElement;
    }
    {
      return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');
    }
    return findHostInstance(componentOrElement);
  },
  hydrate: function (element, container, callback) {
    !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
    {
      !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    }
    // TODO: throw or warn if we couldn't hydrate?
    return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);
  },
  render: function (element, container, callback) {
    !isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
    {
      !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. ' + 'Did you mean to call root.render(element)?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    }
    return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);
  },
  unstable_renderSubtreeIntoContainer: function (parentComponent, element, containerNode, callback) {
    !isValidContainer(containerNode) ? invariant(false, 'Target container is not a DOM element.') : void 0;
    !(parentComponent != null && has(parentComponent)) ? invariant(false, 'parentComponent must be a valid React Component') : void 0;
    return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);
  },
  unmountComponentAtNode: function (container) {
    !isValidContainer(container) ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : void 0;

    {
      !!container._reactHasBeenPassedToCreateRootDEV ? warningWithoutStack$1(false, 'You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.%s(). This is not supported. Did you mean to call root.unmount()?', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    }

    if (container._reactRootContainer) {
      {
        var rootEl = getReactRootElementInContainer(container);
        var renderedByDifferentReact = rootEl && !getInstanceFromNode$1(rootEl);
        !!renderedByDifferentReact ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.') : void 0;
      }

      // Unmount should not be batched.
      unbatchedUpdates(function () {
        legacyRenderSubtreeIntoContainer(null, null, container, false, function () {
          container._reactRootContainer = null;
        });
      });
      // If you call unmountComponentAtNode twice in quick succession, you'll
      // get `true` twice. That's probably fine?
      return true;
    } else {
      {
        var _rootEl = getReactRootElementInContainer(container);
        var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode$1(_rootEl));

        // Check if the container itself is a React root node.
        var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;

        !!hasNonRootReactChild ? warningWithoutStack$1(false, "unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.') : void 0;
      }

      return false;
    }
  },


  // Temporary alias since we already shipped React 16 RC with it.
  // TODO: remove in React 17.
  unstable_createPortal: function () {
    if (!didWarnAboutUnstableCreatePortal) {
      didWarnAboutUnstableCreatePortal = true;
      lowPriorityWarning$1(false, 'The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the "unstable_" prefix.');
    }
    return createPortal$$1.apply(undefined, arguments);
  },


  unstable_batchedUpdates: batchedUpdates$1,

  unstable_interactiveUpdates: interactiveUpdates$1,

  flushSync: flushSync,

  unstable_createRoot: createRoot,
  unstable_flushControlled: flushControlled,

  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
    // Keep in sync with ReactDOMUnstableNativeDependencies.js
    // and ReactTestUtils.js. This is an array for better minification.
    Events: [getInstanceFromNode$1, getNodeFromInstance$1, getFiberCurrentPropsFromNode$1, injection.injectEventPluginsByName, eventNameDispatchConfigs, accumulateTwoPhaseDispatches, accumulateDirectDispatches, enqueueStateRestore, restoreStateIfNeeded, dispatchEvent, runEventsInBatch]
  }
};

function createRoot(container, options) {
  var functionName = enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot';
  !isValidContainer(container) ? invariant(false, '%s(...): Target container is not a DOM element.', functionName) : void 0;
  {
    !!container._reactRootContainer ? warningWithoutStack$1(false, 'You are calling ReactDOM.%s() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.', enableStableConcurrentModeAPIs ? 'createRoot' : 'unstable_createRoot') : void 0;
    container._reactHasBeenPassedToCreateRootDEV = true;
  }
  var hydrate = options != null && options.hydrate === true;
  return new ReactRoot(container, true, hydrate);
}

if (enableStableConcurrentModeAPIs) {
  ReactDOM.createRoot = createRoot;
  ReactDOM.unstable_createRoot = undefined;
}

var foundDevTools = injectIntoDevTools({
  findFiberByHostInstance: getClosestInstanceFromNode,
  bundleType: 1,
  version: ReactVersion,
  rendererPackageName: 'react-dom'
});

{
  if (!foundDevTools && canUseDOM && window.top === window.self) {
    // If we're in Chrome or Firefox, provide a download link if not installed.
    if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) {
      var protocol = window.location.protocol;
      // Don't warn in exotic cases like chrome-extension://.
      if (/^(https?|file):$/.test(protocol)) {
        console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://fb.me/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://fb.me/react-devtools-faq' : ''), 'font-weight:bold');
      }
    }
  }
}



var ReactDOM$2 = Object.freeze({
	default: ReactDOM
});

var ReactDOM$3 = ( ReactDOM$2 && ReactDOM ) || ReactDOM$2;

// TODO: decide on the top-level export form.
// This is hacky but makes it work with both Rollup and Jest.
var reactDom = ReactDOM$3.default || ReactDOM$3;

module.exports = reactDom;
  })();
}


/***/ }),
/* 1360 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(1363);


/***/ }),
/* 1361 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* eslint-disable global-require */



if (true) {
  module.exports = __webpack_require__(1362);
} else {
  module.exports = require('./AppContainer.dev');
}

/***/ }),
/* 1362 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* eslint-disable react/prop-types */



var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var React = __webpack_require__(0);
var Component = React.Component;

var AppContainer = function (_Component) {
  _inherits(AppContainer, _Component);

  function AppContainer() {
    _classCallCheck(this, AppContainer);

    return _possibleConstructorReturn(this, (AppContainer.__proto__ || Object.getPrototypeOf(AppContainer)).apply(this, arguments));
  }

  _createClass(AppContainer, [{
    key: 'render',
    value: function render() {
      if (this.props.component) {
        return React.createElement(this.props.component, this.props.props);
      }

      return React.Children.only(this.props.children);
    }
  }]);

  return AppContainer;
}(Component);

module.exports = AppContainer;

/***/ }),
/* 1363 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var AppContainer = __webpack_require__(1361);

module.exports = function warnAboutIncorrectUsage(arg) {
  if (this && this.callback) {
    throw new Error('React Hot Loader: The Webpack loader is now exported separately. ' + 'If you use Babel, we recommend that you remove "react-hot-loader" ' + 'from the "loaders" section of your Webpack configuration altogether, ' + 'and instead add "react-hot-loader/babel" to the "plugins" section ' + 'of your .babelrc file. ' + 'If you prefer not to use Babel, replace "react-hot-loader" or ' + '"react-hot" with "react-hot-loader/webpack" in the "loaders" section ' + 'of your Webpack configuration.');
  } else if (arg && arg.types && arg.types.IfStatement) {
    throw new Error('React Hot Loader: The Babel plugin is exported separately. ' + 'Replace "react-hot-loader" with "react-hot-loader/babel" ' + 'in the "plugins" section of your .babelrc file. ' + 'While we recommend the above, if you prefer not to use Babel, ' + 'you may remove "react-hot-loader" from the "plugins" section of ' + 'your .babelrc file altogether, and instead add ' + '"react-hot-loader/webpack" to the "loaders" section of your Webpack ' + 'configuration.');
  } else {
    throw new Error('React Hot Loader does not have a default export. ' + 'If you use the import statement, make sure to include the ' + 'curly braces: import { AppContainer } from "react-hot-loader". ' + 'If you use CommonJS, make sure to read the named export: ' + 'require("react-hot-loader").AppContainer.');
  }
};

module.exports.AppContainer = AppContainer;

/***/ }),
/* 1364 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v16.9.0
 * react-is.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;

var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
// (unstable) APIs that have been removed. Can we remove the symbols?
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;

function isValidElementType(type) {
  return typeof type === 'string' || typeof type === 'function' ||
  // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE);
}

/**
 * Forked from fbjs/warning:
 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
 *
 * Only change is we use console.warn instead of console.error,
 * and do nothing when 'console' is not supported.
 * This really simplifies the code.
 * ---
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var lowPriorityWarning = function () {};

{
  var printWarning = function (format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.warn(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  lowPriorityWarning = function (condition, format) {
    if (format === undefined) {
      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

var lowPriorityWarning$1 = lowPriorityWarning;

function typeOf(object) {
  if (typeof object === 'object' && object !== null) {
    var $$typeof = object.$$typeof;
    switch ($$typeof) {
      case REACT_ELEMENT_TYPE:
        var type = object.type;

        switch (type) {
          case REACT_ASYNC_MODE_TYPE:
          case REACT_CONCURRENT_MODE_TYPE:
          case REACT_FRAGMENT_TYPE:
          case REACT_PROFILER_TYPE:
          case REACT_STRICT_MODE_TYPE:
          case REACT_SUSPENSE_TYPE:
            return type;
          default:
            var $$typeofType = type && type.$$typeof;

            switch ($$typeofType) {
              case REACT_CONTEXT_TYPE:
              case REACT_FORWARD_REF_TYPE:
              case REACT_PROVIDER_TYPE:
                return $$typeofType;
              default:
                return $$typeof;
            }
        }
      case REACT_LAZY_TYPE:
      case REACT_MEMO_TYPE:
      case REACT_PORTAL_TYPE:
        return $$typeof;
    }
  }

  return undefined;
}

// AsyncMode is deprecated along with isAsyncMode
var AsyncMode = REACT_ASYNC_MODE_TYPE;
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
var ContextConsumer = REACT_CONTEXT_TYPE;
var ContextProvider = REACT_PROVIDER_TYPE;
var Element = REACT_ELEMENT_TYPE;
var ForwardRef = REACT_FORWARD_REF_TYPE;
var Fragment = REACT_FRAGMENT_TYPE;
var Lazy = REACT_LAZY_TYPE;
var Memo = REACT_MEMO_TYPE;
var Portal = REACT_PORTAL_TYPE;
var Profiler = REACT_PROFILER_TYPE;
var StrictMode = REACT_STRICT_MODE_TYPE;
var Suspense = REACT_SUSPENSE_TYPE;

var hasWarnedAboutDeprecatedIsAsyncMode = false;

// AsyncMode should be deprecated
function isAsyncMode(object) {
  {
    if (!hasWarnedAboutDeprecatedIsAsyncMode) {
      hasWarnedAboutDeprecatedIsAsyncMode = true;
      lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
    }
  }
  return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
  return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
  return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
  return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
  return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
  return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
  return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
  return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
  return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
  return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
  return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
  return typeOf(object) === REACT_SUSPENSE_TYPE;
}

exports.typeOf = typeOf;
exports.AsyncMode = AsyncMode;
exports.ConcurrentMode = ConcurrentMode;
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.isValidElementType = isValidElementType;
exports.isAsyncMode = isAsyncMode;
exports.isConcurrentMode = isConcurrentMode;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
  })();
}


/***/ }),
/* 1365 */
/***/ (function(module, exports) {

module.exports = Array.isArray || function (arr) {
  return Object.prototype.toString.call(arr) == '[object Array]';
};


/***/ }),
/* 1366 */
/***/ (function(module, exports, __webpack_require__) {

var isarray = __webpack_require__(1365)

/**
 * Expose `pathToRegexp`.
 */
module.exports = pathToRegexp
module.exports.parse = parse
module.exports.compile = compile
module.exports.tokensToFunction = tokensToFunction
module.exports.tokensToRegExp = tokensToRegExp

/**
 * The main path matching regexp utility.
 *
 * @type {RegExp}
 */
var PATH_REGEXP = new RegExp([
  // Match escaped characters that would otherwise appear in future matches.
  // This allows the user to escape special characters that won't transform.
  '(\\\\.)',
  // Match Express-style parameters and un-named parameters with a prefix
  // and optional suffixes. Matches appear as:
  //
  // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  // "/route(\\d+)"  => [undefined, undefined, undefined, "\d+", undefined, undefined]
  // "/*"            => ["/", undefined, undefined, undefined, undefined, "*"]
  '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
].join('|'), 'g')

/**
 * Parse a string for the raw tokens.
 *
 * @param  {string}  str
 * @param  {Object=} options
 * @return {!Array}
 */
function parse (str, options) {
  var tokens = []
  var key = 0
  var index = 0
  var path = ''
  var defaultDelimiter = options && options.delimiter || '/'
  var res

  while ((res = PATH_REGEXP.exec(str)) != null) {
    var m = res[0]
    var escaped = res[1]
    var offset = res.index
    path += str.slice(index, offset)
    index = offset + m.length

    // Ignore already escaped sequences.
    if (escaped) {
      path += escaped[1]
      continue
    }

    var next = str[index]
    var prefix = res[2]
    var name = res[3]
    var capture = res[4]
    var group = res[5]
    var modifier = res[6]
    var asterisk = res[7]

    // Push the current path onto the tokens.
    if (path) {
      tokens.push(path)
      path = ''
    }

    var partial = prefix != null && next != null && next !== prefix
    var repeat = modifier === '+' || modifier === '*'
    var optional = modifier === '?' || modifier === '*'
    var delimiter = res[2] || defaultDelimiter
    var pattern = capture || group

    tokens.push({
      name: name || key++,
      prefix: prefix || '',
      delimiter: delimiter,
      optional: optional,
      repeat: repeat,
      partial: partial,
      asterisk: !!asterisk,
      pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
    })
  }

  // Match any characters still remaining.
  if (index < str.length) {
    path += str.substr(index)
  }

  // If the path exists, push it onto the end.
  if (path) {
    tokens.push(path)
  }

  return tokens
}

/**
 * Compile a string to a template function for the path.
 *
 * @param  {string}             str
 * @param  {Object=}            options
 * @return {!function(Object=, Object=)}
 */
function compile (str, options) {
  return tokensToFunction(parse(str, options))
}

/**
 * Prettier encoding of URI path segments.
 *
 * @param  {string}
 * @return {string}
 */
function encodeURIComponentPretty (str) {
  return encodeURI(str).replace(/[\/?#]/g, function (c) {
    return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  })
}

/**
 * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
 *
 * @param  {string}
 * @return {string}
 */
function encodeAsterisk (str) {
  return encodeURI(str).replace(/[?#]/g, function (c) {
    return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  })
}

/**
 * Expose a method for transforming tokens into the path function.
 */
function tokensToFunction (tokens) {
  // Compile all the tokens into regexps.
  var matches = new Array(tokens.length)

  // Compile all the patterns before compilation.
  for (var i = 0; i < tokens.length; i++) {
    if (typeof tokens[i] === 'object') {
      matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$')
    }
  }

  return function (obj, opts) {
    var path = ''
    var data = obj || {}
    var options = opts || {}
    var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent

    for (var i = 0; i < tokens.length; i++) {
      var token = tokens[i]

      if (typeof token === 'string') {
        path += token

        continue
      }

      var value = data[token.name]
      var segment

      if (value == null) {
        if (token.optional) {
          // Prepend partial segment prefixes.
          if (token.partial) {
            path += token.prefix
          }

          continue
        } else {
          throw new TypeError('Expected "' + token.name + '" to be defined')
        }
      }

      if (isarray(value)) {
        if (!token.repeat) {
          throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
        }

        if (value.length === 0) {
          if (token.optional) {
            continue
          } else {
            throw new TypeError('Expected "' + token.name + '" to not be empty')
          }
        }

        for (var j = 0; j < value.length; j++) {
          segment = encode(value[j])

          if (!matches[i].test(segment)) {
            throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
          }

          path += (j === 0 ? token.prefix : token.delimiter) + segment
        }

        continue
      }

      segment = token.asterisk ? encodeAsterisk(value) : encode(value)

      if (!matches[i].test(segment)) {
        throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
      }

      path += token.prefix + segment
    }

    return path
  }
}

/**
 * Escape a regular expression string.
 *
 * @param  {string} str
 * @return {string}
 */
function escapeString (str) {
  return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
}

/**
 * Escape the capturing group by escaping special characters and meaning.
 *
 * @param  {string} group
 * @return {string}
 */
function escapeGroup (group) {
  return group.replace(/([=!:$\/()])/g, '\\$1')
}

/**
 * Attach the keys as a property of the regexp.
 *
 * @param  {!RegExp} re
 * @param  {Array}   keys
 * @return {!RegExp}
 */
function attachKeys (re, keys) {
  re.keys = keys
  return re
}

/**
 * Get the flags for a regexp from the options.
 *
 * @param  {Object} options
 * @return {string}
 */
function flags (options) {
  return options.sensitive ? '' : 'i'
}

/**
 * Pull out keys from a regexp.
 *
 * @param  {!RegExp} path
 * @param  {!Array}  keys
 * @return {!RegExp}
 */
function regexpToRegexp (path, keys) {
  // Use a negative lookahead to match only capturing groups.
  var groups = path.source.match(/\((?!\?)/g)

  if (groups) {
    for (var i = 0; i < groups.length; i++) {
      keys.push({
        name: i,
        prefix: null,
        delimiter: null,
        optional: false,
        repeat: false,
        partial: false,
        asterisk: false,
        pattern: null
      })
    }
  }

  return attachKeys(path, keys)
}

/**
 * Transform an array into a regexp.
 *
 * @param  {!Array}  path
 * @param  {Array}   keys
 * @param  {!Object} options
 * @return {!RegExp}
 */
function arrayToRegexp (path, keys, options) {
  var parts = []

  for (var i = 0; i < path.length; i++) {
    parts.push(pathToRegexp(path[i], keys, options).source)
  }

  var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))

  return attachKeys(regexp, keys)
}

/**
 * Create a path regexp from string input.
 *
 * @param  {string}  path
 * @param  {!Array}  keys
 * @param  {!Object} options
 * @return {!RegExp}
 */
function stringToRegexp (path, keys, options) {
  return tokensToRegExp(parse(path, options), keys, options)
}

/**
 * Expose a function for taking tokens and returning a RegExp.
 *
 * @param  {!Array}          tokens
 * @param  {(Array|Object)=} keys
 * @param  {Object=}         options
 * @return {!RegExp}
 */
function tokensToRegExp (tokens, keys, options) {
  if (!isarray(keys)) {
    options = /** @type {!Object} */ (keys || options)
    keys = []
  }

  options = options || {}

  var strict = options.strict
  var end = options.end !== false
  var route = ''

  // Iterate over the tokens and create our regexp string.
  for (var i = 0; i < tokens.length; i++) {
    var token = tokens[i]

    if (typeof token === 'string') {
      route += escapeString(token)
    } else {
      var prefix = escapeString(token.prefix)
      var capture = '(?:' + token.pattern + ')'

      keys.push(token)

      if (token.repeat) {
        capture += '(?:' + prefix + capture + ')*'
      }

      if (token.optional) {
        if (!token.partial) {
          capture = '(?:' + prefix + '(' + capture + '))?'
        } else {
          capture = prefix + '(' + capture + ')?'
        }
      } else {
        capture = prefix + '(' + capture + ')'
      }

      route += capture
    }
  }

  var delimiter = escapeString(options.delimiter || '/')
  var endsWithDelimiter = route.slice(-delimiter.length) === delimiter

  // In non-strict mode we allow a slash at the end of match. If the path to
  // match already ends with a slash, we remove it for consistency. The slash
  // is valid at the end of a path match, not in the middle. This is important
  // in non-ending mode, where "/test/" shouldn't match "/test//route".
  if (!strict) {
    route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
  }

  if (end) {
    route += '$'
  } else {
    // In non-ending mode, we need the capturing groups to match as much as
    // possible by using a positive lookahead to the end or next path segment.
    route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
  }

  return attachKeys(new RegExp('^' + route, flags(options)), keys)
}

/**
 * Normalize the given path string, returning a regular expression.
 *
 * An empty array can be passed in for the keys, which will hold the
 * placeholder key descriptions. For example, using `/user/:id`, `keys` will
 * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
 *
 * @param  {(string|RegExp|Array)} path
 * @param  {(Array|Object)=}       keys
 * @param  {Object=}               options
 * @return {!RegExp}
 */
function pathToRegexp (path, keys, options) {
  if (!isarray(keys)) {
    options = /** @type {!Object} */ (keys || options)
    keys = []
  }

  options = options || {}

  if (path instanceof RegExp) {
    return regexpToRegexp(path, /** @type {!Array} */ (keys))
  }

  if (isarray(path)) {
    return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  }

  return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
}


/***/ }),
/* 1367 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v16.8.6
 * react.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

var _assign = __webpack_require__(140);
var checkPropTypes = __webpack_require__(182);

// TODO: this is special because it gets imported during build.

var ReactVersion = '16.8.6';

// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
// nor polyfill, then a plain number is used for performance.
var hasSymbol = typeof Symbol === 'function' && Symbol.for;

var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;

var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;

var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
var FAUX_ITERATOR_SYMBOL = '@@iterator';

function getIteratorFn(maybeIterable) {
  if (maybeIterable === null || typeof maybeIterable !== 'object') {
    return null;
  }
  var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
  if (typeof maybeIterator === 'function') {
    return maybeIterator;
  }
  return null;
}

/**
 * Use invariant() to assert state which your program assumes to be true.
 *
 * Provide sprintf-style format (only %s is supported) and arguments
 * to provide information about what broke and what you were
 * expecting.
 *
 * The invariant message will be stripped in production, but the invariant
 * will remain to ensure logic does not differ in production.
 */

var validateFormat = function () {};

{
  validateFormat = function (format) {
    if (format === undefined) {
      throw new Error('invariant requires an error message argument');
    }
  };
}

function invariant(condition, format, a, b, c, d, e, f) {
  validateFormat(format);

  if (!condition) {
    var error = void 0;
    if (format === undefined) {
      error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
    } else {
      var args = [a, b, c, d, e, f];
      var argIndex = 0;
      error = new Error(format.replace(/%s/g, function () {
        return args[argIndex++];
      }));
      error.name = 'Invariant Violation';
    }

    error.framesToPop = 1; // we don't care about invariant's own frame
    throw error;
  }
}

// Relying on the `invariant()` implementation lets us
// preserve the format and params in the www builds.

/**
 * Forked from fbjs/warning:
 * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
 *
 * Only change is we use console.warn instead of console.error,
 * and do nothing when 'console' is not supported.
 * This really simplifies the code.
 * ---
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var lowPriorityWarning = function () {};

{
  var printWarning = function (format) {
    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
      args[_key - 1] = arguments[_key];
    }

    var argIndex = 0;
    var message = 'Warning: ' + format.replace(/%s/g, function () {
      return args[argIndex++];
    });
    if (typeof console !== 'undefined') {
      console.warn(message);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      throw new Error(message);
    } catch (x) {}
  };

  lowPriorityWarning = function (condition, format) {
    if (format === undefined) {
      throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (!condition) {
      for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
        args[_key2 - 2] = arguments[_key2];
      }

      printWarning.apply(undefined, [format].concat(args));
    }
  };
}

var lowPriorityWarning$1 = lowPriorityWarning;

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warningWithoutStack = function () {};

{
  warningWithoutStack = function (condition, format) {
    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    if (format === undefined) {
      throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
    }
    if (args.length > 8) {
      // Check before the condition to catch violations early.
      throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
    }
    if (condition) {
      return;
    }
    if (typeof console !== 'undefined') {
      var argsWithFormat = args.map(function (item) {
        return '' + item;
      });
      argsWithFormat.unshift('Warning: ' + format);

      // We intentionally don't use spread (or .apply) directly because it
      // breaks IE9: https://github.com/facebook/react/issues/13610
      Function.prototype.apply.call(console.error, console, argsWithFormat);
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      var argIndex = 0;
      var message = 'Warning: ' + format.replace(/%s/g, function () {
        return args[argIndex++];
      });
      throw new Error(message);
    } catch (x) {}
  };
}

var warningWithoutStack$1 = warningWithoutStack;

var didWarnStateUpdateForUnmountedComponent = {};

function warnNoop(publicInstance, callerName) {
  {
    var _constructor = publicInstance.constructor;
    var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
    var warningKey = componentName + '.' + callerName;
    if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
      return;
    }
    warningWithoutStack$1(false, "Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
    didWarnStateUpdateForUnmountedComponent[warningKey] = true;
  }
}

/**
 * This is the abstract API for an update queue.
 */
var ReactNoopUpdateQueue = {
  /**
   * Checks whether or not this composite component is mounted.
   * @param {ReactClass} publicInstance The instance we want to test.
   * @return {boolean} True if mounted, false otherwise.
   * @protected
   * @final
   */
  isMounted: function (publicInstance) {
    return false;
  },

  /**
   * Forces an update. This should only be invoked when it is known with
   * certainty that we are **not** in a DOM transaction.
   *
   * You may want to call this when you know that some deeper aspect of the
   * component's state has changed but `setState` was not called.
   *
   * This will not invoke `shouldComponentUpdate`, but it will invoke
   * `componentWillUpdate` and `componentDidUpdate`.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueForceUpdate: function (publicInstance, callback, callerName) {
    warnNoop(publicInstance, 'forceUpdate');
  },

  /**
   * Replaces all of the state. Always use this or `setState` to mutate state.
   * You should treat `this.state` as immutable.
   *
   * There is no guarantee that `this.state` will be immediately updated, so
   * accessing `this.state` after calling this method may return the old value.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} completeState Next state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} callerName name of the calling function in the public API.
   * @internal
   */
  enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
    warnNoop(publicInstance, 'replaceState');
  },

  /**
   * Sets a subset of the state. This only exists because _pendingState is
   * internal. This provides a merging strategy that is not available to deep
   * properties which is confusing. TODO: Expose pendingState or don't use it
   * during the merge.
   *
   * @param {ReactClass} publicInstance The instance that should rerender.
   * @param {object} partialState Next partial state to be merged with state.
   * @param {?function} callback Called after component is updated.
   * @param {?string} Name of the calling function in the public API.
   * @internal
   */
  enqueueSetState: function (publicInstance, partialState, callback, callerName) {
    warnNoop(publicInstance, 'setState');
  }
};

var emptyObject = {};
{
  Object.freeze(emptyObject);
}

/**
 * Base class helpers for the updating state of a component.
 */
function Component(props, context, updater) {
  this.props = props;
  this.context = context;
  // If a component has string refs, we will assign a different object later.
  this.refs = emptyObject;
  // We initialize the default updater but the real one gets injected by the
  // renderer.
  this.updater = updater || ReactNoopUpdateQueue;
}

Component.prototype.isReactComponent = {};

/**
 * Sets a subset of the state. Always use this to mutate
 * state. You should treat `this.state` as immutable.
 *
 * There is no guarantee that `this.state` will be immediately updated, so
 * accessing `this.state` after calling this method may return the old value.
 *
 * There is no guarantee that calls to `setState` will run synchronously,
 * as they may eventually be batched together.  You can provide an optional
 * callback that will be executed when the call to setState is actually
 * completed.
 *
 * When a function is provided to setState, it will be called at some point in
 * the future (not synchronously). It will be called with the up to date
 * component arguments (state, props, context). These values can be different
 * from this.* because your function may be called after receiveProps but before
 * shouldComponentUpdate, and this new state, props, and context will not yet be
 * assigned to this.
 *
 * @param {object|function} partialState Next partial state or function to
 *        produce next partial state to be merged with current state.
 * @param {?function} callback Called after state is updated.
 * @final
 * @protected
 */
Component.prototype.setState = function (partialState, callback) {
  !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
  this.updater.enqueueSetState(this, partialState, callback, 'setState');
};

/**
 * Forces an update. This should only be invoked when it is known with
 * certainty that we are **not** in a DOM transaction.
 *
 * You may want to call this when you know that some deeper aspect of the
 * component's state has changed but `setState` was not called.
 *
 * This will not invoke `shouldComponentUpdate`, but it will invoke
 * `componentWillUpdate` and `componentDidUpdate`.
 *
 * @param {?function} callback Called after update is complete.
 * @final
 * @protected
 */
Component.prototype.forceUpdate = function (callback) {
  this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
};

/**
 * Deprecated APIs. These APIs used to exist on classic React classes but since
 * we would like to deprecate them, we're not going to move them over to this
 * modern base class. Instead, we define a getter that warns if it's accessed.
 */
{
  var deprecatedAPIs = {
    isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
    replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
  };
  var defineDeprecationWarning = function (methodName, info) {
    Object.defineProperty(Component.prototype, methodName, {
      get: function () {
        lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
        return undefined;
      }
    });
  };
  for (var fnName in deprecatedAPIs) {
    if (deprecatedAPIs.hasOwnProperty(fnName)) {
      defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
    }
  }
}

function ComponentDummy() {}
ComponentDummy.prototype = Component.prototype;

/**
 * Convenience component with default shallow equality check for sCU.
 */
function PureComponent(props, context, updater) {
  this.props = props;
  this.context = context;
  // If a component has string refs, we will assign a different object later.
  this.refs = emptyObject;
  this.updater = updater || ReactNoopUpdateQueue;
}

var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
pureComponentPrototype.constructor = PureComponent;
// Avoid an extra prototype jump for these methods.
_assign(pureComponentPrototype, Component.prototype);
pureComponentPrototype.isPureReactComponent = true;

// an immutable object with a single mutable value
function createRef() {
  var refObject = {
    current: null
  };
  {
    Object.seal(refObject);
  }
  return refObject;
}

/**
 * Keeps track of the current dispatcher.
 */
var ReactCurrentDispatcher = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

/**
 * Keeps track of the current owner.
 *
 * The current owner is the component who should own any components that are
 * currently being constructed.
 */
var ReactCurrentOwner = {
  /**
   * @internal
   * @type {ReactComponent}
   */
  current: null
};

var BEFORE_SLASH_RE = /^(.*)[\\\/]/;

var describeComponentFrame = function (name, source, ownerName) {
  var sourceInfo = '';
  if (source) {
    var path = source.fileName;
    var fileName = path.replace(BEFORE_SLASH_RE, '');
    {
      // In DEV, include code for a common special case:
      // prefer "folder/index.js" instead of just "index.js".
      if (/^index\./.test(fileName)) {
        var match = path.match(BEFORE_SLASH_RE);
        if (match) {
          var pathBeforeSlash = match[1];
          if (pathBeforeSlash) {
            var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
            fileName = folderName + '/' + fileName;
          }
        }
      }
    }
    sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
  } else if (ownerName) {
    sourceInfo = ' (created by ' + ownerName + ')';
  }
  return '\n    in ' + (name || 'Unknown') + sourceInfo;
};

var Resolved = 1;


function refineResolvedLazyComponent(lazyComponent) {
  return lazyComponent._status === Resolved ? lazyComponent._result : null;
}

function getWrappedName(outerType, innerType, wrapperName) {
  var functionName = innerType.displayName || innerType.name || '';
  return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
}

function getComponentName(type) {
  if (type == null) {
    // Host root, text node or just invalid type.
    return null;
  }
  {
    if (typeof type.tag === 'number') {
      warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
    }
  }
  if (typeof type === 'function') {
    return type.displayName || type.name || null;
  }
  if (typeof type === 'string') {
    return type;
  }
  switch (type) {
    case REACT_CONCURRENT_MODE_TYPE:
      return 'ConcurrentMode';
    case REACT_FRAGMENT_TYPE:
      return 'Fragment';
    case REACT_PORTAL_TYPE:
      return 'Portal';
    case REACT_PROFILER_TYPE:
      return 'Profiler';
    case REACT_STRICT_MODE_TYPE:
      return 'StrictMode';
    case REACT_SUSPENSE_TYPE:
      return 'Suspense';
  }
  if (typeof type === 'object') {
    switch (type.$$typeof) {
      case REACT_CONTEXT_TYPE:
        return 'Context.Consumer';
      case REACT_PROVIDER_TYPE:
        return 'Context.Provider';
      case REACT_FORWARD_REF_TYPE:
        return getWrappedName(type, type.render, 'ForwardRef');
      case REACT_MEMO_TYPE:
        return getComponentName(type.type);
      case REACT_LAZY_TYPE:
        {
          var thenable = type;
          var resolvedThenable = refineResolvedLazyComponent(thenable);
          if (resolvedThenable) {
            return getComponentName(resolvedThenable);
          }
        }
    }
  }
  return null;
}

var ReactDebugCurrentFrame = {};

var currentlyValidatingElement = null;

function setCurrentlyValidatingElement(element) {
  {
    currentlyValidatingElement = element;
  }
}

{
  // Stack implementation injected by the current renderer.
  ReactDebugCurrentFrame.getCurrentStack = null;

  ReactDebugCurrentFrame.getStackAddendum = function () {
    var stack = '';

    // Add an extra top frame while an element is being validated
    if (currentlyValidatingElement) {
      var name = getComponentName(currentlyValidatingElement.type);
      var owner = currentlyValidatingElement._owner;
      stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
    }

    // Delegate to the injected renderer-specific implementation
    var impl = ReactDebugCurrentFrame.getCurrentStack;
    if (impl) {
      stack += impl() || '';
    }

    return stack;
  };
}

var ReactSharedInternals = {
  ReactCurrentDispatcher: ReactCurrentDispatcher,
  ReactCurrentOwner: ReactCurrentOwner,
  // Used by renderers to avoid bundling object-assign twice in UMD bundles:
  assign: _assign
};

{
  _assign(ReactSharedInternals, {
    // These should not be included in production.
    ReactDebugCurrentFrame: ReactDebugCurrentFrame,
    // Shim for React DOM 16.0.0 which still destructured (but not used) this.
    // TODO: remove in React 17.0.
    ReactComponentTreeHook: {}
  });
}

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

var warning = warningWithoutStack$1;

{
  warning = function (condition, format) {
    if (condition) {
      return;
    }
    var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
    var stack = ReactDebugCurrentFrame.getStackAddendum();
    // eslint-disable-next-line react-internal/warning-and-invariant-args

    for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      args[_key - 2] = arguments[_key];
    }

    warningWithoutStack$1.apply(undefined, [false, format + '%s'].concat(args, [stack]));
  };
}

var warning$1 = warning;

var hasOwnProperty = Object.prototype.hasOwnProperty;

var RESERVED_PROPS = {
  key: true,
  ref: true,
  __self: true,
  __source: true
};

var specialPropKeyWarningShown = void 0;
var specialPropRefWarningShown = void 0;

function hasValidRef(config) {
  {
    if (hasOwnProperty.call(config, 'ref')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }
  return config.ref !== undefined;
}

function hasValidKey(config) {
  {
    if (hasOwnProperty.call(config, 'key')) {
      var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
      if (getter && getter.isReactWarning) {
        return false;
      }
    }
  }
  return config.key !== undefined;
}

function defineKeyPropWarningGetter(props, displayName) {
  var warnAboutAccessingKey = function () {
    if (!specialPropKeyWarningShown) {
      specialPropKeyWarningShown = true;
      warningWithoutStack$1(false, '%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
    }
  };
  warnAboutAccessingKey.isReactWarning = true;
  Object.defineProperty(props, 'key', {
    get: warnAboutAccessingKey,
    configurable: true
  });
}

function defineRefPropWarningGetter(props, displayName) {
  var warnAboutAccessingRef = function () {
    if (!specialPropRefWarningShown) {
      specialPropRefWarningShown = true;
      warningWithoutStack$1(false, '%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
    }
  };
  warnAboutAccessingRef.isReactWarning = true;
  Object.defineProperty(props, 'ref', {
    get: warnAboutAccessingRef,
    configurable: true
  });
}

/**
 * Factory method to create a new React element. This no longer adheres to
 * the class pattern, so do not use new to call it. Also, no instanceof check
 * will work. Instead test $$typeof field against Symbol.for('react.element') to check
 * if something is a React Element.
 *
 * @param {*} type
 * @param {*} key
 * @param {string|object} ref
 * @param {*} self A *temporary* helper to detect places where `this` is
 * different from the `owner` when React.createElement is called, so that we
 * can warn. We want to get rid of owner and replace string `ref`s with arrow
 * functions, and as long as `this` and owner are the same, there will be no
 * change in behavior.
 * @param {*} source An annotation object (added by a transpiler or otherwise)
 * indicating filename, line number, and/or other information.
 * @param {*} owner
 * @param {*} props
 * @internal
 */
var ReactElement = function (type, key, ref, self, source, owner, props) {
  var element = {
    // This tag allows us to uniquely identify this as a React Element
    $$typeof: REACT_ELEMENT_TYPE,

    // Built-in properties that belong on the element
    type: type,
    key: key,
    ref: ref,
    props: props,

    // Record the component responsible for creating this element.
    _owner: owner
  };

  {
    // The validation flag is currently mutative. We put it on
    // an external backing store so that we can freeze the whole object.
    // This can be replaced with a WeakMap once they are implemented in
    // commonly used development environments.
    element._store = {};

    // To make comparing ReactElements easier for testing purposes, we make
    // the validation flag non-enumerable (where possible, which should
    // include every environment we run tests in), so the test framework
    // ignores it.
    Object.defineProperty(element._store, 'validated', {
      configurable: false,
      enumerable: false,
      writable: true,
      value: false
    });
    // self and source are DEV only properties.
    Object.defineProperty(element, '_self', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: self
    });
    // Two elements created in two different places should be considered
    // equal for testing purposes and therefore we hide it from enumeration.
    Object.defineProperty(element, '_source', {
      configurable: false,
      enumerable: false,
      writable: false,
      value: source
    });
    if (Object.freeze) {
      Object.freeze(element.props);
      Object.freeze(element);
    }
  }

  return element;
};

/**
 * Create and return a new ReactElement of the given type.
 * See https://reactjs.org/docs/react-api.html#createelement
 */
function createElement(type, config, children) {
  var propName = void 0;

  // Reserved names are extracted
  var props = {};

  var key = null;
  var ref = null;
  var self = null;
  var source = null;

  if (config != null) {
    if (hasValidRef(config)) {
      ref = config.ref;
    }
    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    self = config.__self === undefined ? null : config.__self;
    source = config.__source === undefined ? null : config.__source;
    // Remaining properties are added to a new props object
    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        props[propName] = config[propName];
      }
    }
  }

  // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.
  var childrenLength = arguments.length - 2;
  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);
    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }
    {
      if (Object.freeze) {
        Object.freeze(childArray);
      }
    }
    props.children = childArray;
  }

  // Resolve default props
  if (type && type.defaultProps) {
    var defaultProps = type.defaultProps;
    for (propName in defaultProps) {
      if (props[propName] === undefined) {
        props[propName] = defaultProps[propName];
      }
    }
  }
  {
    if (key || ref) {
      var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
      if (key) {
        defineKeyPropWarningGetter(props, displayName);
      }
      if (ref) {
        defineRefPropWarningGetter(props, displayName);
      }
    }
  }
  return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
}

/**
 * Return a function that produces ReactElements of a given type.
 * See https://reactjs.org/docs/react-api.html#createfactory
 */


function cloneAndReplaceKey(oldElement, newKey) {
  var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);

  return newElement;
}

/**
 * Clone and return a new ReactElement using element as the starting point.
 * See https://reactjs.org/docs/react-api.html#cloneelement
 */
function cloneElement(element, config, children) {
  !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;

  var propName = void 0;

  // Original props are copied
  var props = _assign({}, element.props);

  // Reserved names are extracted
  var key = element.key;
  var ref = element.ref;
  // Self is preserved since the owner is preserved.
  var self = element._self;
  // Source is preserved since cloneElement is unlikely to be targeted by a
  // transpiler, and the original source is probably a better indicator of the
  // true owner.
  var source = element._source;

  // Owner will be preserved, unless ref is overridden
  var owner = element._owner;

  if (config != null) {
    if (hasValidRef(config)) {
      // Silently steal the ref from the parent.
      ref = config.ref;
      owner = ReactCurrentOwner.current;
    }
    if (hasValidKey(config)) {
      key = '' + config.key;
    }

    // Remaining properties override existing props
    var defaultProps = void 0;
    if (element.type && element.type.defaultProps) {
      defaultProps = element.type.defaultProps;
    }
    for (propName in config) {
      if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
        if (config[propName] === undefined && defaultProps !== undefined) {
          // Resolve default props
          props[propName] = defaultProps[propName];
        } else {
          props[propName] = config[propName];
        }
      }
    }
  }

  // Children can be more than one argument, and those are transferred onto
  // the newly allocated props object.
  var childrenLength = arguments.length - 2;
  if (childrenLength === 1) {
    props.children = children;
  } else if (childrenLength > 1) {
    var childArray = Array(childrenLength);
    for (var i = 0; i < childrenLength; i++) {
      childArray[i] = arguments[i + 2];
    }
    props.children = childArray;
  }

  return ReactElement(element.type, key, ref, self, source, owner, props);
}

/**
 * Verifies the object is a ReactElement.
 * See https://reactjs.org/docs/react-api.html#isvalidelement
 * @param {?object} object
 * @return {boolean} True if `object` is a ReactElement.
 * @final
 */
function isValidElement(object) {
  return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}

var SEPARATOR = '.';
var SUBSEPARATOR = ':';

/**
 * Escape and wrap key so it is safe to use as a reactid
 *
 * @param {string} key to be escaped.
 * @return {string} the escaped key.
 */
function escape(key) {
  var escapeRegex = /[=:]/g;
  var escaperLookup = {
    '=': '=0',
    ':': '=2'
  };
  var escapedString = ('' + key).replace(escapeRegex, function (match) {
    return escaperLookup[match];
  });

  return '$' + escapedString;
}

/**
 * TODO: Test that a single child and an array with one item have the same key
 * pattern.
 */

var didWarnAboutMaps = false;

var userProvidedKeyEscapeRegex = /\/+/g;
function escapeUserProvidedKey(text) {
  return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
}

var POOL_SIZE = 10;
var traverseContextPool = [];
function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
  if (traverseContextPool.length) {
    var traverseContext = traverseContextPool.pop();
    traverseContext.result = mapResult;
    traverseContext.keyPrefix = keyPrefix;
    traverseContext.func = mapFunction;
    traverseContext.context = mapContext;
    traverseContext.count = 0;
    return traverseContext;
  } else {
    return {
      result: mapResult,
      keyPrefix: keyPrefix,
      func: mapFunction,
      context: mapContext,
      count: 0
    };
  }
}

function releaseTraverseContext(traverseContext) {
  traverseContext.result = null;
  traverseContext.keyPrefix = null;
  traverseContext.func = null;
  traverseContext.context = null;
  traverseContext.count = 0;
  if (traverseContextPool.length < POOL_SIZE) {
    traverseContextPool.push(traverseContext);
  }
}

/**
 * @param {?*} children Children tree container.
 * @param {!string} nameSoFar Name of the key path so far.
 * @param {!function} callback Callback to invoke with each child found.
 * @param {?*} traverseContext Used to pass information throughout the traversal
 * process.
 * @return {!number} The number of children in this subtree.
 */
function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
  var type = typeof children;

  if (type === 'undefined' || type === 'boolean') {
    // All of the above are perceived as null.
    children = null;
  }

  var invokeCallback = false;

  if (children === null) {
    invokeCallback = true;
  } else {
    switch (type) {
      case 'string':
      case 'number':
        invokeCallback = true;
        break;
      case 'object':
        switch (children.$$typeof) {
          case REACT_ELEMENT_TYPE:
          case REACT_PORTAL_TYPE:
            invokeCallback = true;
        }
    }
  }

  if (invokeCallback) {
    callback(traverseContext, children,
    // If it's the only child, treat the name as if it was wrapped in an array
    // so that it's consistent if the number of children grows.
    nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
    return 1;
  }

  var child = void 0;
  var nextName = void 0;
  var subtreeCount = 0; // Count of children found in the current subtree.
  var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;

  if (Array.isArray(children)) {
    for (var i = 0; i < children.length; i++) {
      child = children[i];
      nextName = nextNamePrefix + getComponentKey(child, i);
      subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
    }
  } else {
    var iteratorFn = getIteratorFn(children);
    if (typeof iteratorFn === 'function') {
      {
        // Warn about using Maps as children
        if (iteratorFn === children.entries) {
          !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
          didWarnAboutMaps = true;
        }
      }

      var iterator = iteratorFn.call(children);
      var step = void 0;
      var ii = 0;
      while (!(step = iterator.next()).done) {
        child = step.value;
        nextName = nextNamePrefix + getComponentKey(child, ii++);
        subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
      }
    } else if (type === 'object') {
      var addendum = '';
      {
        addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
      }
      var childrenString = '' + children;
      invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
    }
  }

  return subtreeCount;
}

/**
 * Traverses children that are typically specified as `props.children`, but
 * might also be specified through attributes:
 *
 * - `traverseAllChildren(this.props.children, ...)`
 * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
 *
 * The `traverseContext` is an optional argument that is passed through the
 * entire traversal. It can be used to store accumulations or anything else that
 * the callback might find relevant.
 *
 * @param {?*} children Children tree object.
 * @param {!function} callback To invoke upon traversing each child.
 * @param {?*} traverseContext Context for traversal.
 * @return {!number} The number of children in this subtree.
 */
function traverseAllChildren(children, callback, traverseContext) {
  if (children == null) {
    return 0;
  }

  return traverseAllChildrenImpl(children, '', callback, traverseContext);
}

/**
 * Generate a key string that identifies a component within a set.
 *
 * @param {*} component A component that could contain a manual key.
 * @param {number} index Index that is used if a manual key is not provided.
 * @return {string}
 */
function getComponentKey(component, index) {
  // Do some typechecking here since we call this blindly. We want to ensure
  // that we don't block potential future ES APIs.
  if (typeof component === 'object' && component !== null && component.key != null) {
    // Explicit key
    return escape(component.key);
  }
  // Implicit key determined by the index in the set
  return index.toString(36);
}

function forEachSingleChild(bookKeeping, child, name) {
  var func = bookKeeping.func,
      context = bookKeeping.context;

  func.call(context, child, bookKeeping.count++);
}

/**
 * Iterates through children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
 *
 * The provided forEachFunc(child, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} forEachFunc
 * @param {*} forEachContext Context for forEachContext.
 */
function forEachChildren(children, forEachFunc, forEachContext) {
  if (children == null) {
    return children;
  }
  var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
  traverseAllChildren(children, forEachSingleChild, traverseContext);
  releaseTraverseContext(traverseContext);
}

function mapSingleChildIntoContext(bookKeeping, child, childKey) {
  var result = bookKeeping.result,
      keyPrefix = bookKeeping.keyPrefix,
      func = bookKeeping.func,
      context = bookKeeping.context;


  var mappedChild = func.call(context, child, bookKeeping.count++);
  if (Array.isArray(mappedChild)) {
    mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
      return c;
    });
  } else if (mappedChild != null) {
    if (isValidElement(mappedChild)) {
      mappedChild = cloneAndReplaceKey(mappedChild,
      // Keep both the (mapped) and old keys if they differ, just as
      // traverseAllChildren used to do for objects as children
      keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
    }
    result.push(mappedChild);
  }
}

function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
  var escapedPrefix = '';
  if (prefix != null) {
    escapedPrefix = escapeUserProvidedKey(prefix) + '/';
  }
  var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
  traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
  releaseTraverseContext(traverseContext);
}

/**
 * Maps children that are typically specified as `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
 *
 * The provided mapFunction(child, key, index) will be called for each
 * leaf child.
 *
 * @param {?*} children Children tree container.
 * @param {function(*, int)} func The map function.
 * @param {*} context Context for mapFunction.
 * @return {object} Object containing the ordered map of results.
 */
function mapChildren(children, func, context) {
  if (children == null) {
    return children;
  }
  var result = [];
  mapIntoWithKeyPrefixInternal(children, result, null, func, context);
  return result;
}

/**
 * Count the number of children that are typically specified as
 * `props.children`.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrencount
 *
 * @param {?*} children Children tree container.
 * @return {number} The number of children.
 */
function countChildren(children) {
  return traverseAllChildren(children, function () {
    return null;
  }, null);
}

/**
 * Flatten a children object (typically specified as `props.children`) and
 * return an array with appropriately re-keyed children.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
 */
function toArray(children) {
  var result = [];
  mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
    return child;
  });
  return result;
}

/**
 * Returns the first child in a collection of children and verifies that there
 * is only one child in the collection.
 *
 * See https://reactjs.org/docs/react-api.html#reactchildrenonly
 *
 * The current implementation of this function assumes that a single child gets
 * passed without a wrapper, but the purpose of this helper function is to
 * abstract away the particular structure of children.
 *
 * @param {?object} children Child collection structure.
 * @return {ReactElement} The first and only `ReactElement` contained in the
 * structure.
 */
function onlyChild(children) {
  !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
  return children;
}

function createContext(defaultValue, calculateChangedBits) {
  if (calculateChangedBits === undefined) {
    calculateChangedBits = null;
  } else {
    {
      !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
    }
  }

  var context = {
    $$typeof: REACT_CONTEXT_TYPE,
    _calculateChangedBits: calculateChangedBits,
    // As a workaround to support multiple concurrent renderers, we categorize
    // some renderers as primary and others as secondary. We only expect
    // there to be two concurrent renderers at most: React Native (primary) and
    // Fabric (secondary); React DOM (primary) and React ART (secondary).
    // Secondary renderers store their context values on separate fields.
    _currentValue: defaultValue,
    _currentValue2: defaultValue,
    // Used to track how many concurrent renderers this context currently
    // supports within in a single renderer. Such as parallel server rendering.
    _threadCount: 0,
    // These are circular
    Provider: null,
    Consumer: null
  };

  context.Provider = {
    $$typeof: REACT_PROVIDER_TYPE,
    _context: context
  };

  var hasWarnedAboutUsingNestedContextConsumers = false;
  var hasWarnedAboutUsingConsumerProvider = false;

  {
    // A separate object, but proxies back to the original context object for
    // backwards compatibility. It has a different $$typeof, so we can properly
    // warn for the incorrect usage of Context as a Consumer.
    var Consumer = {
      $$typeof: REACT_CONTEXT_TYPE,
      _context: context,
      _calculateChangedBits: context._calculateChangedBits
    };
    // $FlowFixMe: Flow complains about not setting a value, which is intentional here
    Object.defineProperties(Consumer, {
      Provider: {
        get: function () {
          if (!hasWarnedAboutUsingConsumerProvider) {
            hasWarnedAboutUsingConsumerProvider = true;
            warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
          }
          return context.Provider;
        },
        set: function (_Provider) {
          context.Provider = _Provider;
        }
      },
      _currentValue: {
        get: function () {
          return context._currentValue;
        },
        set: function (_currentValue) {
          context._currentValue = _currentValue;
        }
      },
      _currentValue2: {
        get: function () {
          return context._currentValue2;
        },
        set: function (_currentValue2) {
          context._currentValue2 = _currentValue2;
        }
      },
      _threadCount: {
        get: function () {
          return context._threadCount;
        },
        set: function (_threadCount) {
          context._threadCount = _threadCount;
        }
      },
      Consumer: {
        get: function () {
          if (!hasWarnedAboutUsingNestedContextConsumers) {
            hasWarnedAboutUsingNestedContextConsumers = true;
            warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
          }
          return context.Consumer;
        }
      }
    });
    // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
    context.Consumer = Consumer;
  }

  {
    context._currentRenderer = null;
    context._currentRenderer2 = null;
  }

  return context;
}

function lazy(ctor) {
  var lazyType = {
    $$typeof: REACT_LAZY_TYPE,
    _ctor: ctor,
    // React uses these fields to store the result.
    _status: -1,
    _result: null
  };

  {
    // In production, this would just set it on the object.
    var defaultProps = void 0;
    var propTypes = void 0;
    Object.defineProperties(lazyType, {
      defaultProps: {
        configurable: true,
        get: function () {
          return defaultProps;
        },
        set: function (newDefaultProps) {
          warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
          defaultProps = newDefaultProps;
          // Match production behavior more closely:
          Object.defineProperty(lazyType, 'defaultProps', {
            enumerable: true
          });
        }
      },
      propTypes: {
        configurable: true,
        get: function () {
          return propTypes;
        },
        set: function (newPropTypes) {
          warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
          propTypes = newPropTypes;
          // Match production behavior more closely:
          Object.defineProperty(lazyType, 'propTypes', {
            enumerable: true
          });
        }
      }
    });
  }

  return lazyType;
}

function forwardRef(render) {
  {
    if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
      warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
    } else if (typeof render !== 'function') {
      warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
    } else {
      !(
      // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
      render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
    }

    if (render != null) {
      !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
    }
  }

  return {
    $$typeof: REACT_FORWARD_REF_TYPE,
    render: render
  };
}

function isValidElementType(type) {
  return typeof type === 'string' || typeof type === 'function' ||
  // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
}

function memo(type, compare) {
  {
    if (!isValidElementType(type)) {
      warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
    }
  }
  return {
    $$typeof: REACT_MEMO_TYPE,
    type: type,
    compare: compare === undefined ? null : compare
  };
}

function resolveDispatcher() {
  var dispatcher = ReactCurrentDispatcher.current;
  !(dispatcher !== null) ? invariant(false, 'Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.') : void 0;
  return dispatcher;
}

function useContext(Context, unstable_observedBits) {
  var dispatcher = resolveDispatcher();
  {
    !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0;

    // TODO: add a more generic warning for invalid values.
    if (Context._context !== undefined) {
      var realContext = Context._context;
      // Don't deduplicate because this legitimately causes bugs
      // and nobody should be using this in existing code.
      if (realContext.Consumer === Context) {
        warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
      } else if (realContext.Provider === Context) {
        warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
      }
    }
  }
  return dispatcher.useContext(Context, unstable_observedBits);
}

function useState(initialState) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useState(initialState);
}

function useReducer(reducer, initialArg, init) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useReducer(reducer, initialArg, init);
}

function useRef(initialValue) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useRef(initialValue);
}

function useEffect(create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useEffect(create, inputs);
}

function useLayoutEffect(create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useLayoutEffect(create, inputs);
}

function useCallback(callback, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useCallback(callback, inputs);
}

function useMemo(create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useMemo(create, inputs);
}

function useImperativeHandle(ref, create, inputs) {
  var dispatcher = resolveDispatcher();
  return dispatcher.useImperativeHandle(ref, create, inputs);
}

function useDebugValue(value, formatterFn) {
  {
    var dispatcher = resolveDispatcher();
    return dispatcher.useDebugValue(value, formatterFn);
  }
}

/**
 * ReactElementValidator provides a wrapper around a element factory
 * which validates the props passed to the element. This is intended to be
 * used only in DEV and could be replaced by a static type checker for languages
 * that support it.
 */

var propTypesMisspellWarningShown = void 0;

{
  propTypesMisspellWarningShown = false;
}

function getDeclarationErrorAddendum() {
  if (ReactCurrentOwner.current) {
    var name = getComponentName(ReactCurrentOwner.current.type);
    if (name) {
      return '\n\nCheck the render method of `' + name + '`.';
    }
  }
  return '';
}

function getSourceInfoErrorAddendum(elementProps) {
  if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
    var source = elementProps.__source;
    var fileName = source.fileName.replace(/^.*[\\\/]/, '');
    var lineNumber = source.lineNumber;
    return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
  }
  return '';
}

/**
 * Warn if there's no key explicitly set on dynamic arrays of children or
 * object keys are not valid. This allows us to keep track of children between
 * updates.
 */
var ownerHasKeyUseWarning = {};

function getCurrentComponentErrorInfo(parentType) {
  var info = getDeclarationErrorAddendum();

  if (!info) {
    var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
    if (parentName) {
      info = '\n\nCheck the top-level render call using <' + parentName + '>.';
    }
  }
  return info;
}

/**
 * Warn if the element doesn't have an explicit key assigned to it.
 * This element is in an array. The array could grow and shrink or be
 * reordered. All children that haven't already been validated are required to
 * have a "key" property assigned to it. Error statuses are cached so a warning
 * will only be shown once.
 *
 * @internal
 * @param {ReactElement} element Element that requires a key.
 * @param {*} parentType element's parent's type.
 */
function validateExplicitKey(element, parentType) {
  if (!element._store || element._store.validated || element.key != null) {
    return;
  }
  element._store.validated = true;

  var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
  if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
    return;
  }
  ownerHasKeyUseWarning[currentComponentErrorInfo] = true;

  // Usually the current owner is the offender, but if it accepts children as a
  // property, it may be the creator of the child that's responsible for
  // assigning it a key.
  var childOwner = '';
  if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
    // Give the component that originally created this child.
    childOwner = ' It was passed a child from ' + getComponentName(element._owner.type) + '.';
  }

  setCurrentlyValidatingElement(element);
  {
    warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
  }
  setCurrentlyValidatingElement(null);
}

/**
 * Ensure that every element either is passed in a static location, in an
 * array with an explicit keys property defined, or in an object literal
 * with valid key property.
 *
 * @internal
 * @param {ReactNode} node Statically passed child of any type.
 * @param {*} parentType node's parent's type.
 */
function validateChildKeys(node, parentType) {
  if (typeof node !== 'object') {
    return;
  }
  if (Array.isArray(node)) {
    for (var i = 0; i < node.length; i++) {
      var child = node[i];
      if (isValidElement(child)) {
        validateExplicitKey(child, parentType);
      }
    }
  } else if (isValidElement(node)) {
    // This element was passed in a valid location.
    if (node._store) {
      node._store.validated = true;
    }
  } else if (node) {
    var iteratorFn = getIteratorFn(node);
    if (typeof iteratorFn === 'function') {
      // Entry iterators used to provide implicit keys,
      // but now we print a separate warning for them later.
      if (iteratorFn !== node.entries) {
        var iterator = iteratorFn.call(node);
        var step = void 0;
        while (!(step = iterator.next()).done) {
          if (isValidElement(step.value)) {
            validateExplicitKey(step.value, parentType);
          }
        }
      }
    }
  }
}

/**
 * Given an element, validate that its props follow the propTypes definition,
 * provided by the type.
 *
 * @param {ReactElement} element
 */
function validatePropTypes(element) {
  var type = element.type;
  if (type === null || type === undefined || typeof type === 'string') {
    return;
  }
  var name = getComponentName(type);
  var propTypes = void 0;
  if (typeof type === 'function') {
    propTypes = type.propTypes;
  } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
  // Note: Memo only checks outer props here.
  // Inner props are checked in the reconciler.
  type.$$typeof === REACT_MEMO_TYPE)) {
    propTypes = type.propTypes;
  } else {
    return;
  }
  if (propTypes) {
    setCurrentlyValidatingElement(element);
    checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
    setCurrentlyValidatingElement(null);
  } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
    propTypesMisspellWarningShown = true;
    warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
  }
  if (typeof type.getDefaultProps === 'function') {
    !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
  }
}

/**
 * Given a fragment, validate that it can only be provided with fragment props
 * @param {ReactElement} fragment
 */
function validateFragmentProps(fragment) {
  setCurrentlyValidatingElement(fragment);

  var keys = Object.keys(fragment.props);
  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    if (key !== 'children' && key !== 'key') {
      warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
      break;
    }
  }

  if (fragment.ref !== null) {
    warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
  }

  setCurrentlyValidatingElement(null);
}

function createElementWithValidation(type, props, children) {
  var validType = isValidElementType(type);

  // We warn in this case but don't throw. We expect the element creation to
  // succeed and there will likely be errors in render.
  if (!validType) {
    var info = '';
    if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
      info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
    }

    var sourceInfo = getSourceInfoErrorAddendum(props);
    if (sourceInfo) {
      info += sourceInfo;
    } else {
      info += getDeclarationErrorAddendum();
    }

    var typeString = void 0;
    if (type === null) {
      typeString = 'null';
    } else if (Array.isArray(type)) {
      typeString = 'array';
    } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
      typeString = '<' + (getComponentName(type.type) || 'Unknown') + ' />';
      info = ' Did you accidentally export a JSX literal instead of a component?';
    } else {
      typeString = typeof type;
    }

    warning$1(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
  }

  var element = createElement.apply(this, arguments);

  // The result can be nullish if a mock or a custom function is used.
  // TODO: Drop this when these are no longer allowed as the type argument.
  if (element == null) {
    return element;
  }

  // Skip key warning if the type isn't valid since our key validation logic
  // doesn't expect a non-string/function type and can throw confusing errors.
  // We don't want exception behavior to differ between dev and prod.
  // (Rendering will throw with a helpful message and as soon as the type is
  // fixed, the key warnings will appear.)
  if (validType) {
    for (var i = 2; i < arguments.length; i++) {
      validateChildKeys(arguments[i], type);
    }
  }

  if (type === REACT_FRAGMENT_TYPE) {
    validateFragmentProps(element);
  } else {
    validatePropTypes(element);
  }

  return element;
}

function createFactoryWithValidation(type) {
  var validatedFactory = createElementWithValidation.bind(null, type);
  validatedFactory.type = type;
  // Legacy hook: remove it
  {
    Object.defineProperty(validatedFactory, 'type', {
      enumerable: false,
      get: function () {
        lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
        Object.defineProperty(this, 'type', {
          value: type
        });
        return type;
      }
    });
  }

  return validatedFactory;
}

function cloneElementWithValidation(element, props, children) {
  var newElement = cloneElement.apply(this, arguments);
  for (var i = 2; i < arguments.length; i++) {
    validateChildKeys(arguments[i], newElement.type);
  }
  validatePropTypes(newElement);
  return newElement;
}

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:


// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:


// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.


// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:


// Gather advanced timing metrics for Profiler subtrees.


// Trace which interactions trigger each commit.


// Only used in www builds.
 // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties


// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
var enableStableConcurrentModeAPIs = false;

var React = {
  Children: {
    map: mapChildren,
    forEach: forEachChildren,
    count: countChildren,
    toArray: toArray,
    only: onlyChild
  },

  createRef: createRef,
  Component: Component,
  PureComponent: PureComponent,

  createContext: createContext,
  forwardRef: forwardRef,
  lazy: lazy,
  memo: memo,

  useCallback: useCallback,
  useContext: useContext,
  useEffect: useEffect,
  useImperativeHandle: useImperativeHandle,
  useDebugValue: useDebugValue,
  useLayoutEffect: useLayoutEffect,
  useMemo: useMemo,
  useReducer: useReducer,
  useRef: useRef,
  useState: useState,

  Fragment: REACT_FRAGMENT_TYPE,
  StrictMode: REACT_STRICT_MODE_TYPE,
  Suspense: REACT_SUSPENSE_TYPE,

  createElement: createElementWithValidation,
  cloneElement: cloneElementWithValidation,
  createFactory: createFactoryWithValidation,
  isValidElement: isValidElement,

  version: ReactVersion,

  unstable_ConcurrentMode: REACT_CONCURRENT_MODE_TYPE,
  unstable_Profiler: REACT_PROFILER_TYPE,

  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
};

// Note: some APIs are added with feature flags.
// Make sure that stable builds for open source
// don't modify the React object to avoid deopts.
// Also let's not expose their names in stable builds.

if (enableStableConcurrentModeAPIs) {
  React.ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  React.Profiler = REACT_PROFILER_TYPE;
  React.unstable_ConcurrentMode = undefined;
  React.unstable_Profiler = undefined;
}



var React$2 = Object.freeze({
	default: React
});

var React$3 = ( React$2 && React ) || React$2;

// TODO: decide on the top-level export form.
// This is hacky but makes it work with both Rollup and Jest.
var react = React$3.default || React$3;

module.exports = react;
  })();
}


/***/ }),
/* 1368 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__DO_NOT_USE__ActionTypes", function() { return ActionTypes; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyMiddleware", function() { return applyMiddleware; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "bindActionCreators", function() { return bindActionCreators; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return combineReducers; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compose", function() { return compose; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createStore", function() { return createStore; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_symbol_observable__ = __webpack_require__(1388);


/**
 * These are private action types reserved by Redux.
 * For any unknown actions, you must return the current state.
 * If the current state is undefined, you must return the initial state.
 * Do not reference these action types directly in your code.
 */
var randomString = function randomString() {
  return Math.random().toString(36).substring(7).split('').join('.');
};

var ActionTypes = {
  INIT: "@@redux/INIT" + randomString(),
  REPLACE: "@@redux/REPLACE" + randomString(),
  PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
    return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
  }
};

/**
 * @param {any} obj The object to inspect.
 * @returns {boolean} True if the argument appears to be a plain object.
 */
function isPlainObject(obj) {
  if (typeof obj !== 'object' || obj === null) return false;
  var proto = obj;

  while (Object.getPrototypeOf(proto) !== null) {
    proto = Object.getPrototypeOf(proto);
  }

  return Object.getPrototypeOf(obj) === proto;
}

/**
 * Creates a Redux store that holds the state tree.
 * The only way to change the data in the store is to call `dispatch()` on it.
 *
 * There should only be a single store in your app. To specify how different
 * parts of the state tree respond to actions, you may combine several reducers
 * into a single reducer function by using `combineReducers`.
 *
 * @param {Function} reducer A function that returns the next state tree, given
 * the current state tree and the action to handle.
 *
 * @param {any} [preloadedState] The initial state. You may optionally specify it
 * to hydrate the state from the server in universal apps, or to restore a
 * previously serialized user session.
 * If you use `combineReducers` to produce the root reducer function, this must be
 * an object with the same shape as `combineReducers` keys.
 *
 * @param {Function} [enhancer] The store enhancer. You may optionally specify it
 * to enhance the store with third-party capabilities such as middleware,
 * time travel, persistence, etc. The only store enhancer that ships with Redux
 * is `applyMiddleware()`.
 *
 * @returns {Store} A Redux store that lets you read the state, dispatch actions
 * and subscribe to changes.
 */

function createStore(reducer, preloadedState, enhancer) {
  var _ref2;

  if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
    throw new Error('It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function.');
  }

  if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
    enhancer = preloadedState;
    preloadedState = undefined;
  }

  if (typeof enhancer !== 'undefined') {
    if (typeof enhancer !== 'function') {
      throw new Error('Expected the enhancer to be a function.');
    }

    return enhancer(createStore)(reducer, preloadedState);
  }

  if (typeof reducer !== 'function') {
    throw new Error('Expected the reducer to be a function.');
  }

  var currentReducer = reducer;
  var currentState = preloadedState;
  var currentListeners = [];
  var nextListeners = currentListeners;
  var isDispatching = false;
  /**
   * This makes a shallow copy of currentListeners so we can use
   * nextListeners as a temporary list while dispatching.
   *
   * This prevents any bugs around consumers calling
   * subscribe/unsubscribe in the middle of a dispatch.
   */

  function ensureCanMutateNextListeners() {
    if (nextListeners === currentListeners) {
      nextListeners = currentListeners.slice();
    }
  }
  /**
   * Reads the state tree managed by the store.
   *
   * @returns {any} The current state tree of your application.
   */


  function getState() {
    if (isDispatching) {
      throw new Error('You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
    }

    return currentState;
  }
  /**
   * Adds a change listener. It will be called any time an action is dispatched,
   * and some part of the state tree may potentially have changed. You may then
   * call `getState()` to read the current state tree inside the callback.
   *
   * You may call `dispatch()` from a change listener, with the following
   * caveats:
   *
   * 1. The subscriptions are snapshotted just before every `dispatch()` call.
   * If you subscribe or unsubscribe while the listeners are being invoked, this
   * will not have any effect on the `dispatch()` that is currently in progress.
   * However, the next `dispatch()` call, whether nested or not, will use a more
   * recent snapshot of the subscription list.
   *
   * 2. The listener should not expect to see all state changes, as the state
   * might have been updated multiple times during a nested `dispatch()` before
   * the listener is called. It is, however, guaranteed that all subscribers
   * registered before the `dispatch()` started will be called with the latest
   * state by the time it exits.
   *
   * @param {Function} listener A callback to be invoked on every dispatch.
   * @returns {Function} A function to remove this change listener.
   */


  function subscribe(listener) {
    if (typeof listener !== 'function') {
      throw new Error('Expected the listener to be a function.');
    }

    if (isDispatching) {
      throw new Error('You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
    }

    var isSubscribed = true;
    ensureCanMutateNextListeners();
    nextListeners.push(listener);
    return function unsubscribe() {
      if (!isSubscribed) {
        return;
      }

      if (isDispatching) {
        throw new Error('You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api-reference/store#subscribe(listener) for more details.');
      }

      isSubscribed = false;
      ensureCanMutateNextListeners();
      var index = nextListeners.indexOf(listener);
      nextListeners.splice(index, 1);
    };
  }
  /**
   * Dispatches an action. It is the only way to trigger a state change.
   *
   * The `reducer` function, used to create the store, will be called with the
   * current state tree and the given `action`. Its return value will
   * be considered the **next** state of the tree, and the change listeners
   * will be notified.
   *
   * The base implementation only supports plain object actions. If you want to
   * dispatch a Promise, an Observable, a thunk, or something else, you need to
   * wrap your store creating function into the corresponding middleware. For
   * example, see the documentation for the `redux-thunk` package. Even the
   * middleware will eventually dispatch plain object actions using this method.
   *
   * @param {Object} action A plain object representing “what changed”. It is
   * a good idea to keep actions serializable so you can record and replay user
   * sessions, or use the time travelling `redux-devtools`. An action must have
   * a `type` property which may not be `undefined`. It is a good idea to use
   * string constants for action types.
   *
   * @returns {Object} For convenience, the same action object you dispatched.
   *
   * Note that, if you use a custom middleware, it may wrap `dispatch()` to
   * return something else (for example, a Promise you can await).
   */


  function dispatch(action) {
    if (!isPlainObject(action)) {
      throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
    }

    if (typeof action.type === 'undefined') {
      throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?');
    }

    if (isDispatching) {
      throw new Error('Reducers may not dispatch actions.');
    }

    try {
      isDispatching = true;
      currentState = currentReducer(currentState, action);
    } finally {
      isDispatching = false;
    }

    var listeners = currentListeners = nextListeners;

    for (var i = 0; i < listeners.length; i++) {
      var listener = listeners[i];
      listener();
    }

    return action;
  }
  /**
   * Replaces the reducer currently used by the store to calculate the state.
   *
   * You might need this if your app implements code splitting and you want to
   * load some of the reducers dynamically. You might also need this if you
   * implement a hot reloading mechanism for Redux.
   *
   * @param {Function} nextReducer The reducer for the store to use instead.
   * @returns {void}
   */


  function replaceReducer(nextReducer) {
    if (typeof nextReducer !== 'function') {
      throw new Error('Expected the nextReducer to be a function.');
    }

    currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
    // Any reducers that existed in both the new and old rootReducer
    // will receive the previous state. This effectively populates
    // the new state tree with any relevant data from the old one.

    dispatch({
      type: ActionTypes.REPLACE
    });
  }
  /**
   * Interoperability point for observable/reactive libraries.
   * @returns {observable} A minimal observable of state changes.
   * For more information, see the observable proposal:
   * https://github.com/tc39/proposal-observable
   */


  function observable() {
    var _ref;

    var outerSubscribe = subscribe;
    return _ref = {
      /**
       * The minimal observable subscription method.
       * @param {Object} observer Any object that can be used as an observer.
       * The observer object should have a `next` method.
       * @returns {subscription} An object with an `unsubscribe` method that can
       * be used to unsubscribe the observable from the store, and prevent further
       * emission of values from the observable.
       */
      subscribe: function subscribe(observer) {
        if (typeof observer !== 'object' || observer === null) {
          throw new TypeError('Expected the observer to be an object.');
        }

        function observeState() {
          if (observer.next) {
            observer.next(getState());
          }
        }

        observeState();
        var unsubscribe = outerSubscribe(observeState);
        return {
          unsubscribe: unsubscribe
        };
      }
    }, _ref[__WEBPACK_IMPORTED_MODULE_0_symbol_observable__["a" /* default */]] = function () {
      return this;
    }, _ref;
  } // When a store is created, an "INIT" action is dispatched so that every
  // reducer returns their initial state. This effectively populates
  // the initial state tree.


  dispatch({
    type: ActionTypes.INIT
  });
  return _ref2 = {
    dispatch: dispatch,
    subscribe: subscribe,
    getState: getState,
    replaceReducer: replaceReducer
  }, _ref2[__WEBPACK_IMPORTED_MODULE_0_symbol_observable__["a" /* default */]] = observable, _ref2;
}

/**
 * Prints a warning in the console if it exists.
 *
 * @param {String} message The warning message.
 * @returns {void}
 */
function warning(message) {
  /* eslint-disable no-console */
  if (typeof console !== 'undefined' && typeof console.error === 'function') {
    console.error(message);
  }
  /* eslint-enable no-console */


  try {
    // This error was thrown as a convenience so that if you enable
    // "break on all exceptions" in your console,
    // it would pause the execution at this line.
    throw new Error(message);
  } catch (e) {} // eslint-disable-line no-empty

}

function getUndefinedStateErrorMessage(key, action) {
  var actionType = action && action.type;
  var actionDescription = actionType && "action \"" + String(actionType) + "\"" || 'an action';
  return "Given " + actionDescription + ", reducer \"" + key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.";
}

function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
  var reducerKeys = Object.keys(reducers);
  var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';

  if (reducerKeys.length === 0) {
    return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
  }

  if (!isPlainObject(inputState)) {
    return "The " + argumentName + " has unexpected type of \"" + {}.toString.call(inputState).match(/\s([a-z|A-Z]+)/)[1] + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
  }

  var unexpectedKeys = Object.keys(inputState).filter(function (key) {
    return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
  });
  unexpectedKeys.forEach(function (key) {
    unexpectedKeyCache[key] = true;
  });
  if (action && action.type === ActionTypes.REPLACE) return;

  if (unexpectedKeys.length > 0) {
    return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
  }
}

function assertReducerShape(reducers) {
  Object.keys(reducers).forEach(function (key) {
    var reducer = reducers[key];
    var initialState = reducer(undefined, {
      type: ActionTypes.INIT
    });

    if (typeof initialState === 'undefined') {
      throw new Error("Reducer \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
    }

    if (typeof reducer(undefined, {
      type: ActionTypes.PROBE_UNKNOWN_ACTION()
    }) === 'undefined') {
      throw new Error("Reducer \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle " + ActionTypes.INIT + " or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
    }
  });
}
/**
 * Turns an object whose values are different reducer functions, into a single
 * reducer function. It will call every child reducer, and gather their results
 * into a single state object, whose keys correspond to the keys of the passed
 * reducer functions.
 *
 * @param {Object} reducers An object whose values correspond to different
 * reducer functions that need to be combined into one. One handy way to obtain
 * it is to use ES6 `import * as reducers` syntax. The reducers may never return
 * undefined for any action. Instead, they should return their initial state
 * if the state passed to them was undefined, and the current state for any
 * unrecognized action.
 *
 * @returns {Function} A reducer function that invokes every reducer inside the
 * passed object, and builds a state object with the same shape.
 */


function combineReducers(reducers) {
  var reducerKeys = Object.keys(reducers);
  var finalReducers = {};

  for (var i = 0; i < reducerKeys.length; i++) {
    var key = reducerKeys[i];

    if (true) {
      if (typeof reducers[key] === 'undefined') {
        warning("No reducer provided for key \"" + key + "\"");
      }
    }

    if (typeof reducers[key] === 'function') {
      finalReducers[key] = reducers[key];
    }
  }

  var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
  // keys multiple times.

  var unexpectedKeyCache;

  if (true) {
    unexpectedKeyCache = {};
  }

  var shapeAssertionError;

  try {
    assertReducerShape(finalReducers);
  } catch (e) {
    shapeAssertionError = e;
  }

  return function combination(state, action) {
    if (state === void 0) {
      state = {};
    }

    if (shapeAssertionError) {
      throw shapeAssertionError;
    }

    if (true) {
      var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);

      if (warningMessage) {
        warning(warningMessage);
      }
    }

    var hasChanged = false;
    var nextState = {};

    for (var _i = 0; _i < finalReducerKeys.length; _i++) {
      var _key = finalReducerKeys[_i];
      var reducer = finalReducers[_key];
      var previousStateForKey = state[_key];
      var nextStateForKey = reducer(previousStateForKey, action);

      if (typeof nextStateForKey === 'undefined') {
        var errorMessage = getUndefinedStateErrorMessage(_key, action);
        throw new Error(errorMessage);
      }

      nextState[_key] = nextStateForKey;
      hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
    }

    return hasChanged ? nextState : state;
  };
}

function bindActionCreator(actionCreator, dispatch) {
  return function () {
    return dispatch(actionCreator.apply(this, arguments));
  };
}
/**
 * Turns an object whose values are action creators, into an object with the
 * same keys, but with every function wrapped into a `dispatch` call so they
 * may be invoked directly. This is just a convenience method, as you can call
 * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
 *
 * For convenience, you can also pass an action creator as the first argument,
 * and get a dispatch wrapped function in return.
 *
 * @param {Function|Object} actionCreators An object whose values are action
 * creator functions. One handy way to obtain it is to use ES6 `import * as`
 * syntax. You may also pass a single function.
 *
 * @param {Function} dispatch The `dispatch` function available on your Redux
 * store.
 *
 * @returns {Function|Object} The object mimicking the original object, but with
 * every action creator wrapped into the `dispatch` call. If you passed a
 * function as `actionCreators`, the return value will also be a single
 * function.
 */


function bindActionCreators(actionCreators, dispatch) {
  if (typeof actionCreators === 'function') {
    return bindActionCreator(actionCreators, dispatch);
  }

  if (typeof actionCreators !== 'object' || actionCreators === null) {
    throw new Error("bindActionCreators expected an object or a function, instead received " + (actionCreators === null ? 'null' : typeof actionCreators) + ". " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
  }

  var boundActionCreators = {};

  for (var key in actionCreators) {
    var actionCreator = actionCreators[key];

    if (typeof actionCreator === 'function') {
      boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
    }
  }

  return boundActionCreators;
}

function _defineProperty(obj, key, value) {
  if (key in obj) {
    Object.defineProperty(obj, key, {
      value: value,
      enumerable: true,
      configurable: true,
      writable: true
    });
  } else {
    obj[key] = value;
  }

  return obj;
}

function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);

  if (Object.getOwnPropertySymbols) {
    keys.push.apply(keys, Object.getOwnPropertySymbols(object));
  }

  if (enumerableOnly) keys = keys.filter(function (sym) {
    return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  });
  return keys;
}

function _objectSpread2(target) {
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};

    if (i % 2) {
      ownKeys(source, true).forEach(function (key) {
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
      ownKeys(source).forEach(function (key) {
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
    }
  }

  return target;
}

/**
 * Composes single-argument functions from right to left. The rightmost
 * function can take multiple arguments as it provides the signature for
 * the resulting composite function.
 *
 * @param {...Function} funcs The functions to compose.
 * @returns {Function} A function obtained by composing the argument functions
 * from right to left. For example, compose(f, g, h) is identical to doing
 * (...args) => f(g(h(...args))).
 */
function compose() {
  for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
    funcs[_key] = arguments[_key];
  }

  if (funcs.length === 0) {
    return function (arg) {
      return arg;
    };
  }

  if (funcs.length === 1) {
    return funcs[0];
  }

  return funcs.reduce(function (a, b) {
    return function () {
      return a(b.apply(void 0, arguments));
    };
  });
}

/**
 * Creates a store enhancer that applies middleware to the dispatch method
 * of the Redux store. This is handy for a variety of tasks, such as expressing
 * asynchronous actions in a concise manner, or logging every action payload.
 *
 * See `redux-thunk` package as an example of the Redux middleware.
 *
 * Because middleware is potentially asynchronous, this should be the first
 * store enhancer in the composition chain.
 *
 * Note that each middleware will be given the `dispatch` and `getState` functions
 * as named arguments.
 *
 * @param {...Function} middlewares The middleware chain to be applied.
 * @returns {Function} A store enhancer applying the middleware.
 */

function applyMiddleware() {
  for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
    middlewares[_key] = arguments[_key];
  }

  return function (createStore) {
    return function () {
      var store = createStore.apply(void 0, arguments);

      var _dispatch = function dispatch() {
        throw new Error('Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
      };

      var middlewareAPI = {
        getState: store.getState,
        dispatch: function dispatch() {
          return _dispatch.apply(void 0, arguments);
        }
      };
      var chain = middlewares.map(function (middleware) {
        return middleware(middlewareAPI);
      });
      _dispatch = compose.apply(void 0, chain)(store.dispatch);
      return _objectSpread2({}, store, {
        dispatch: _dispatch
      });
    };
  };
}

/*
 * This is a dummy function to check if the function name has been altered by minification.
 * If the function has been minified and NODE_ENV !== 'production', warn the user.
 */

function isCrushed() {}

if ("development" !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
  warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
}




/***/ }),
/* 1369 */
/***/ (function(module, exports, __webpack_require__) {

var _ = __webpack_require__(85),
    ListenerMethods = __webpack_require__(379);

/**
 * A module meant to be consumed as a mixin by a React component. Supplies the methods from
 * `ListenerMethods` mixin and takes care of teardown of subscriptions.
 */
module.exports = _.extend({

    /**
     * By adding this in the mixin we get error message if other React mixins try to use the same prop
     */
    subscriptions: [],

    /**
     * Cleans up all listener previously registered.
     */
    componentWillUnmount: ListenerMethods.stopListeningToAll

}, ListenerMethods);


/***/ }),
/* 1370 */
/***/ (function(module, exports, __webpack_require__) {

var _ = __webpack_require__(85);

/**
 * A module of methods for object that you want to be able to listen to.
 * This module is consumed by `createStore` and `createAction`
 */
module.exports = {

    /**
     * Hook used by the publisher that is invoked before emitting
     * and before `shouldEmit`. The arguments are the ones that the action
     * is invoked with. If this function returns something other than
     * undefined, that will be passed on as arguments for shouldEmit and
     * emission.
     */
    preEmit: function() {},

    /**
     * Hook used by the publisher after `preEmit` to determine if the
     * event should be emitted with given arguments. This may be overridden
     * in your application, default implementation always returns true.
     *
     * @returns {Boolean} true if event should be emitted
     */
    shouldEmit: function() { return true; },

    /**
     * Subscribes the given callback for action triggered
     *
     * @param {Function} callback The callback to register as event handler
     * @param {Mixed} [optional] bindContext The context to bind the callback with
     * @returns {Function} Callback that unsubscribes the registered event handler
     */
    listen: function(callback, bindContext) {
        var eventHandler = function(args) {
            callback.apply(bindContext, args);
        }, me = this;
        this.emitter.addListener(this.eventLabel, eventHandler);
        return function() {
            me.emitter.removeListener(me.eventLabel, eventHandler);
        };
    },

    /**
     * Publishes an event using `this.emitter` (if `shouldEmit` agrees)
     */
    trigger: function() {
        var args = arguments,
            pre = this.preEmit.apply(this, args);
        args = pre === undefined ? args : _.isArguments(pre) ? pre : [].concat(pre);
        if (this.shouldEmit.apply(this, args)) {
            this.emitter.emit(this.eventLabel, args);
        }
    },

    /**
     * Tries to publish the event on the next tick
     */
    triggerAsync: function(){
        var args = arguments,me = this;
        _.nextTick(function() {
            me.trigger.apply(me, args);
        });
    }
};


/***/ }),
/* 1371 */
/***/ (function(module, exports, __webpack_require__) {

var createAction = __webpack_require__(380);

var slice = Array.prototype.slice;

/**
 * Track a set of Actions and Stores. Use Reflux.all if you need to handle
 * data coming in parallel.
 *
 * @param {...Action|Store} listenables Actions and Stores that should be
 *  tracked.
 * @returns {Action} An action which tracks the provided Actions and Stores.
 *  The action will emit once all of the provided listenables have emitted at
 *  least once.
 */
module.exports = function(/* listenables... */) {
    var numberOfListenables = arguments.length,
        // create a new array of the expected size. The initial
        // values will be falsy, which is fine for us.
        // Once each item in the array is truthy, the callback can be called
        listenablesEmitted,
        // these arguments will be used to *apply* the action.
        args,
        // this action combines all the listenables
        action = createAction();

    action.hasListener = function(listenable) {
        var i = 0, listener;

        for (; i < args.length; ++i) {
            listener = args[i];
            if (listener === listenable || listener.hasListener && listener.hasListener(listenable)) {
                return true;
            }
        }

        return false;
    };

    reset();

    for (var i = 0; i < numberOfListenables; i++) {
        arguments[i].listen(newListener(i), null);
    }

    return action;

    function reset() {
        listenablesEmitted = new Array(numberOfListenables);
        args = new Array(numberOfListenables);
    }

    function newListener(i) {
        return function() {
            listenablesEmitted[i] = true;
            // Reflux users should not need to care about Array and arguments
            // differences. This makes sure that they get the expected Array
            // interface
            args[i] = slice.call(arguments);
            emitWhenAllListenablesEmitted();
        };
    }

    function emitWhenAllListenablesEmitted() {
        if (didAllListenablesEmit()) {
            action.apply(action, args);
            reset();
        }
    }

    function didAllListenablesEmit() {
        // reduce cannot be used because it only iterates over *present*
        // elements in the array. Initially the Array doesn't contain
        // elements. For this reason the usage of reduce would always indicate
        // that all listenables emitted.
        for (var i = 0; i < numberOfListenables; i++) {
            if (!listenablesEmitted[i]) {
                return false;
            }
        }
        return true;
    }
};


/***/ }),
/* 1372 */
/***/ (function(module, exports, __webpack_require__) {

var Reflux = __webpack_require__(3),
    _ = __webpack_require__(85);

module.exports = function(listenable,key){
    return {
        componentDidMount: function(){
            for(var m in Reflux.ListenerMethods){
                if (this[m] !== Reflux.ListenerMethods[m]){
                    if (this[m]){
                        throw "Can't have other property '"+m+"' when using Reflux.listenTo!";
                    }
                    this[m] = Reflux.ListenerMethods[m];
                }
            }
            var me = this, cb = (key ? function(v){me.setState(_.object([key],[v]));} : this.setState);
            this.listenTo(listenable,cb,cb);
        },
        componentWillUnmount: Reflux.ListenerMixin.componentWillUnmount
    };
};


/***/ }),
/* 1373 */
/***/ (function(module, exports, __webpack_require__) {

var _ = __webpack_require__(85),
    Reflux = __webpack_require__(3),
    Keep = __webpack_require__(251);

/**
 * Creates an event emitting Data Store. It is mixed in with functions
 * from the `ListenerMethods` and `PublisherMethods` mixins. `preEmit`
 * and `shouldEmit` may be overridden in the definition object.
 *
 * @param {Object} definition The data store object definition
 * @returns {Store} A data store instance
 */
module.exports = function(definition) {

    definition = definition || {};

    function Store() {
        var i=0, arr;
        this.subscriptions = [];
        this.emitter = new _.EventEmitter();
        this.eventLabel = "change";
        if (this.init && _.isFunction(this.init)) {
            this.init();
        }
        if (this.listenables){
            arr = [].concat(this.listenables);
            for(;i < arr.length;i++){
                this.listenToMany(arr[i]);
            }
        }
    }

    _.extend(Store.prototype, definition, Reflux.ListenerMethods, Reflux.PublisherMethods, {
        preEmit: definition.preEmit || Reflux.PublisherMethods.preEmit,
        shouldEmit: definition.shouldEmit || Reflux.PublisherMethods.shouldEmit
    });

    var store = new Store();
    Keep.createdStores.push(store);

    return store;
};


/***/ }),
/* 1374 */
/***/ (function(module, exports, __webpack_require__) {

var Reflux = __webpack_require__(3);


/**
 * A mixin factory for a React component. Meant as a more convenient way of using the `ListenerMixin`,
 * without having to manually set listeners in the `componentDidMount` method.
 *
 * @param {Action|Store} listenable An Action or Store that should be
 *  listened to.
 * @param {Function|String} callback The callback to register as event handler
 * @param {Function|String} defaultCallback The callback to register as default handler
 * @returns {Object} An object to be used as a mixin, which sets up the listener for the given listenable.
 */
module.exports = function(listenable,callback,initial){
    return {
        /**
         * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`
         * and then make the call to `listenTo` with the arguments provided to the factory function
         */
        componentDidMount: function() {
            for(var m in Reflux.ListenerMethods){
                if (this[m] !== Reflux.ListenerMethods[m]){
                    if (this[m]){
                        throw "Can't have other property '"+m+"' when using Reflux.listenTo!";
                    }
                    this[m] = Reflux.ListenerMethods[m];
                }
            }
            this.listenTo(listenable,callback,initial);
        },
        /**
         * Cleans up all listener previously registered.
         */
        componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll
    };
};


/***/ }),
/* 1375 */
/***/ (function(module, exports, __webpack_require__) {

var Reflux = __webpack_require__(3);

/**
 * A mixin factory for a React component. Meant as a more convenient way of using the `listenerMixin`,
 * without having to manually set listeners in the `componentDidMount` method. This version is used
 * to automatically set up a `listenToMany` call.
 *
 * @param {Object} listenables An object of listenables
 * @returns {Object} An object to be used as a mixin, which sets up the listeners for the given listenables.
 */
module.exports = function(listenables){
    return {
        /**
         * Set up the mixin before the initial rendering occurs. Import methods from `ListenerMethods`
         * and then make the call to `listenTo` with the arguments provided to the factory function
         */
        componentDidMount: function() {
            for(var m in Reflux.ListenerMethods){
                if (this[m] !== Reflux.ListenerMethods[m]){
                    if (this[m]){
                        throw "Can't have other property '"+m+"' when using Reflux.listenToMany!";
                    }
                    this[m] = Reflux.ListenerMethods[m];
                }
            }
            this.listenToMany(listenables);
        },
        /**
         * Cleans up all listener previously registered.
         */
        componentWillUnmount: Reflux.ListenerMethods.stopListeningToAll
    };
};


/***/ }),
/* 1376 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global) {/**
 * Copyright (c) 2014, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
 * additional grant of patent rights can be found in the PATENTS file in
 * the same directory.
 */

!(function(global) {
  "use strict";

  var Op = Object.prototype;
  var hasOwn = Op.hasOwnProperty;
  var undefined; // More compressible than void 0.
  var $Symbol = typeof Symbol === "function" ? Symbol : {};
  var iteratorSymbol = $Symbol.iterator || "@@iterator";
  var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";

  var inModule = typeof module === "object";
  var runtime = global.regeneratorRuntime;
  if (runtime) {
    if (inModule) {
      // If regeneratorRuntime is defined globally and we're in a module,
      // make the exports object identical to regeneratorRuntime.
      module.exports = runtime;
    }
    // Don't bother evaluating the rest of this file if the runtime was
    // already defined globally.
    return;
  }

  // Define the runtime globally (as expected by generated code) as either
  // module.exports (if we're in a module) or a new, empty object.
  runtime = global.regeneratorRuntime = inModule ? module.exports : {};

  function wrap(innerFn, outerFn, self, tryLocsList) {
    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
    var generator = Object.create(protoGenerator.prototype);
    var context = new Context(tryLocsList || []);

    // The ._invoke method unifies the implementations of the .next,
    // .throw, and .return methods.
    generator._invoke = makeInvokeMethod(innerFn, self, context);

    return generator;
  }
  runtime.wrap = wrap;

  // Try/catch helper to minimize deoptimizations. Returns a completion
  // record like context.tryEntries[i].completion. This interface could
  // have been (and was previously) designed to take a closure to be
  // invoked without arguments, but in all the cases we care about we
  // already have an existing method we want to call, so there's no need
  // to create a new function object. We can even get away with assuming
  // the method takes exactly one argument, since that happens to be true
  // in every case, so we don't have to touch the arguments object. The
  // only additional allocation required is the completion record, which
  // has a stable shape and so hopefully should be cheap to allocate.
  function tryCatch(fn, obj, arg) {
    try {
      return { type: "normal", arg: fn.call(obj, arg) };
    } catch (err) {
      return { type: "throw", arg: err };
    }
  }

  var GenStateSuspendedStart = "suspendedStart";
  var GenStateSuspendedYield = "suspendedYield";
  var GenStateExecuting = "executing";
  var GenStateCompleted = "completed";

  // Returning this object from the innerFn has the same effect as
  // breaking out of the dispatch switch statement.
  var ContinueSentinel = {};

  // Dummy constructor functions that we use as the .constructor and
  // .constructor.prototype properties for functions that return Generator
  // objects. For full spec compliance, you may wish to configure your
  // minifier not to mangle the names of these two functions.
  function Generator() {}
  function GeneratorFunction() {}
  function GeneratorFunctionPrototype() {}

  // This is a polyfill for %IteratorPrototype% for environments that
  // don't natively support it.
  var IteratorPrototype = {};
  IteratorPrototype[iteratorSymbol] = function () {
    return this;
  };

  var getProto = Object.getPrototypeOf;
  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  if (NativeIteratorPrototype &&
      NativeIteratorPrototype !== Op &&
      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
    // This environment has a native %IteratorPrototype%; use it instead
    // of the polyfill.
    IteratorPrototype = NativeIteratorPrototype;
  }

  var Gp = GeneratorFunctionPrototype.prototype =
    Generator.prototype = Object.create(IteratorPrototype);
  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  GeneratorFunctionPrototype.constructor = GeneratorFunction;
  GeneratorFunctionPrototype[toStringTagSymbol] =
    GeneratorFunction.displayName = "GeneratorFunction";

  // Helper for defining the .next, .throw, and .return methods of the
  // Iterator interface in terms of a single ._invoke method.
  function defineIteratorMethods(prototype) {
    ["next", "throw", "return"].forEach(function(method) {
      prototype[method] = function(arg) {
        return this._invoke(method, arg);
      };
    });
  }

  runtime.isGeneratorFunction = function(genFun) {
    var ctor = typeof genFun === "function" && genFun.constructor;
    return ctor
      ? ctor === GeneratorFunction ||
        // For the native GeneratorFunction constructor, the best we can
        // do is to check its .name property.
        (ctor.displayName || ctor.name) === "GeneratorFunction"
      : false;
  };

  runtime.mark = function(genFun) {
    if (Object.setPrototypeOf) {
      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
    } else {
      genFun.__proto__ = GeneratorFunctionPrototype;
      if (!(toStringTagSymbol in genFun)) {
        genFun[toStringTagSymbol] = "GeneratorFunction";
      }
    }
    genFun.prototype = Object.create(Gp);
    return genFun;
  };

  // Within the body of any async function, `await x` is transformed to
  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  // `hasOwn.call(value, "__await")` to determine if the yielded value is
  // meant to be awaited.
  runtime.awrap = function(arg) {
    return { __await: arg };
  };

  function AsyncIterator(generator) {
    function invoke(method, arg, resolve, reject) {
      var record = tryCatch(generator[method], generator, arg);
      if (record.type === "throw") {
        reject(record.arg);
      } else {
        var result = record.arg;
        var value = result.value;
        if (value &&
            typeof value === "object" &&
            hasOwn.call(value, "__await")) {
          return Promise.resolve(value.__await).then(function(value) {
            invoke("next", value, resolve, reject);
          }, function(err) {
            invoke("throw", err, resolve, reject);
          });
        }

        return Promise.resolve(value).then(function(unwrapped) {
          // When a yielded Promise is resolved, its final value becomes
          // the .value of the Promise<{value,done}> result for the
          // current iteration. If the Promise is rejected, however, the
          // result for this iteration will be rejected with the same
          // reason. Note that rejections of yielded Promises are not
          // thrown back into the generator function, as is the case
          // when an awaited Promise is rejected. This difference in
          // behavior between yield and await is important, because it
          // allows the consumer to decide what to do with the yielded
          // rejection (swallow it and continue, manually .throw it back
          // into the generator, abandon iteration, whatever). With
          // await, by contrast, there is no opportunity to examine the
          // rejection reason outside the generator function, so the
          // only option is to throw it from the await expression, and
          // let the generator function handle the exception.
          result.value = unwrapped;
          resolve(result);
        }, reject);
      }
    }

    if (typeof global.process === "object" && global.process.domain) {
      invoke = global.process.domain.bind(invoke);
    }

    var previousPromise;

    function enqueue(method, arg) {
      function callInvokeWithMethodAndArg() {
        return new Promise(function(resolve, reject) {
          invoke(method, arg, resolve, reject);
        });
      }

      return previousPromise =
        // If enqueue has been called before, then we want to wait until
        // all previous Promises have been resolved before calling invoke,
        // so that results are always delivered in the correct order. If
        // enqueue has not been called before, then it is important to
        // call invoke immediately, without waiting on a callback to fire,
        // so that the async generator function has the opportunity to do
        // any necessary setup in a predictable way. This predictability
        // is why the Promise constructor synchronously invokes its
        // executor callback, and why async functions synchronously
        // execute code before the first await. Since we implement simple
        // async functions in terms of async generators, it is especially
        // important to get this right, even though it requires care.
        previousPromise ? previousPromise.then(
          callInvokeWithMethodAndArg,
          // Avoid propagating failures to Promises returned by later
          // invocations of the iterator.
          callInvokeWithMethodAndArg
        ) : callInvokeWithMethodAndArg();
    }

    // Define the unified helper method that is used to implement .next,
    // .throw, and .return (see defineIteratorMethods).
    this._invoke = enqueue;
  }

  defineIteratorMethods(AsyncIterator.prototype);
  AsyncIterator.prototype[asyncIteratorSymbol] = function () {
    return this;
  };
  runtime.AsyncIterator = AsyncIterator;

  // Note that simple async functions are implemented on top of
  // AsyncIterator objects; they just return a Promise for the value of
  // the final result produced by the iterator.
  runtime.async = function(innerFn, outerFn, self, tryLocsList) {
    var iter = new AsyncIterator(
      wrap(innerFn, outerFn, self, tryLocsList)
    );

    return runtime.isGeneratorFunction(outerFn)
      ? iter // If outerFn is a generator, return the full iterator.
      : iter.next().then(function(result) {
          return result.done ? result.value : iter.next();
        });
  };

  function makeInvokeMethod(innerFn, self, context) {
    var state = GenStateSuspendedStart;

    return function invoke(method, arg) {
      if (state === GenStateExecuting) {
        throw new Error("Generator is already running");
      }

      if (state === GenStateCompleted) {
        if (method === "throw") {
          throw arg;
        }

        // Be forgiving, per 25.3.3.3.3 of the spec:
        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
        return doneResult();
      }

      context.method = method;
      context.arg = arg;

      while (true) {
        var delegate = context.delegate;
        if (delegate) {
          var delegateResult = maybeInvokeDelegate(delegate, context);
          if (delegateResult) {
            if (delegateResult === ContinueSentinel) continue;
            return delegateResult;
          }
        }

        if (context.method === "next") {
          // Setting context._sent for legacy support of Babel's
          // function.sent implementation.
          context.sent = context._sent = context.arg;

        } else if (context.method === "throw") {
          if (state === GenStateSuspendedStart) {
            state = GenStateCompleted;
            throw context.arg;
          }

          context.dispatchException(context.arg);

        } else if (context.method === "return") {
          context.abrupt("return", context.arg);
        }

        state = GenStateExecuting;

        var record = tryCatch(innerFn, self, context);
        if (record.type === "normal") {
          // If an exception is thrown from innerFn, we leave state ===
          // GenStateExecuting and loop back for another invocation.
          state = context.done
            ? GenStateCompleted
            : GenStateSuspendedYield;

          if (record.arg === ContinueSentinel) {
            continue;
          }

          return {
            value: record.arg,
            done: context.done
          };

        } else if (record.type === "throw") {
          state = GenStateCompleted;
          // Dispatch the exception by looping back around to the
          // context.dispatchException(context.arg) call above.
          context.method = "throw";
          context.arg = record.arg;
        }
      }
    };
  }

  // Call delegate.iterator[context.method](context.arg) and handle the
  // result, either by returning a { value, done } result from the
  // delegate iterator, or by modifying context.method and context.arg,
  // setting context.delegate to null, and returning the ContinueSentinel.
  function maybeInvokeDelegate(delegate, context) {
    var method = delegate.iterator[context.method];
    if (method === undefined) {
      // A .throw or .return when the delegate iterator has no .throw
      // method always terminates the yield* loop.
      context.delegate = null;

      if (context.method === "throw") {
        if (delegate.iterator.return) {
          // If the delegate iterator has a return method, give it a
          // chance to clean up.
          context.method = "return";
          context.arg = undefined;
          maybeInvokeDelegate(delegate, context);

          if (context.method === "throw") {
            // If maybeInvokeDelegate(context) changed context.method from
            // "return" to "throw", let that override the TypeError below.
            return ContinueSentinel;
          }
        }

        context.method = "throw";
        context.arg = new TypeError(
          "The iterator does not provide a 'throw' method");
      }

      return ContinueSentinel;
    }

    var record = tryCatch(method, delegate.iterator, context.arg);

    if (record.type === "throw") {
      context.method = "throw";
      context.arg = record.arg;
      context.delegate = null;
      return ContinueSentinel;
    }

    var info = record.arg;

    if (! info) {
      context.method = "throw";
      context.arg = new TypeError("iterator result is not an object");
      context.delegate = null;
      return ContinueSentinel;
    }

    if (info.done) {
      // Assign the result of the finished delegate to the temporary
      // variable specified by delegate.resultName (see delegateYield).
      context[delegate.resultName] = info.value;

      // Resume execution at the desired location (see delegateYield).
      context.next = delegate.nextLoc;

      // If context.method was "throw" but the delegate handled the
      // exception, let the outer generator proceed normally. If
      // context.method was "next", forget context.arg since it has been
      // "consumed" by the delegate iterator. If context.method was
      // "return", allow the original .return call to continue in the
      // outer generator.
      if (context.method !== "return") {
        context.method = "next";
        context.arg = undefined;
      }

    } else {
      // Re-yield the result returned by the delegate method.
      return info;
    }

    // The delegate iterator is finished, so forget it and continue with
    // the outer generator.
    context.delegate = null;
    return ContinueSentinel;
  }

  // Define Generator.prototype.{next,throw,return} in terms of the
  // unified ._invoke helper method.
  defineIteratorMethods(Gp);

  Gp[toStringTagSymbol] = "Generator";

  // A Generator should always return itself as the iterator object when the
  // @@iterator function is called on it. Some browsers' implementations of the
  // iterator prototype chain incorrectly implement this, causing the Generator
  // object to not be returned from this call. This ensures that doesn't happen.
  // See https://github.com/facebook/regenerator/issues/274 for more details.
  Gp[iteratorSymbol] = function() {
    return this;
  };

  Gp.toString = function() {
    return "[object Generator]";
  };

  function pushTryEntry(locs) {
    var entry = { tryLoc: locs[0] };

    if (1 in locs) {
      entry.catchLoc = locs[1];
    }

    if (2 in locs) {
      entry.finallyLoc = locs[2];
      entry.afterLoc = locs[3];
    }

    this.tryEntries.push(entry);
  }

  function resetTryEntry(entry) {
    var record = entry.completion || {};
    record.type = "normal";
    delete record.arg;
    entry.completion = record;
  }

  function Context(tryLocsList) {
    // The root entry object (effectively a try statement without a catch
    // or a finally block) gives us a place to store values thrown from
    // locations where there is no enclosing try statement.
    this.tryEntries = [{ tryLoc: "root" }];
    tryLocsList.forEach(pushTryEntry, this);
    this.reset(true);
  }

  runtime.keys = function(object) {
    var keys = [];
    for (var key in object) {
      keys.push(key);
    }
    keys.reverse();

    // Rather than returning an object with a next method, we keep
    // things simple and return the next function itself.
    return function next() {
      while (keys.length) {
        var key = keys.pop();
        if (key in object) {
          next.value = key;
          next.done = false;
          return next;
        }
      }

      // To avoid creating an additional object, we just hang the .value
      // and .done properties off the next function object itself. This
      // also ensures that the minifier will not anonymize the function.
      next.done = true;
      return next;
    };
  };

  function values(iterable) {
    if (iterable) {
      var iteratorMethod = iterable[iteratorSymbol];
      if (iteratorMethod) {
        return iteratorMethod.call(iterable);
      }

      if (typeof iterable.next === "function") {
        return iterable;
      }

      if (!isNaN(iterable.length)) {
        var i = -1, next = function next() {
          while (++i < iterable.length) {
            if (hasOwn.call(iterable, i)) {
              next.value = iterable[i];
              next.done = false;
              return next;
            }
          }

          next.value = undefined;
          next.done = true;

          return next;
        };

        return next.next = next;
      }
    }

    // Return an iterator with no values.
    return { next: doneResult };
  }
  runtime.values = values;

  function doneResult() {
    return { value: undefined, done: true };
  }

  Context.prototype = {
    constructor: Context,

    reset: function(skipTempReset) {
      this.prev = 0;
      this.next = 0;
      // Resetting context._sent for legacy support of Babel's
      // function.sent implementation.
      this.sent = this._sent = undefined;
      this.done = false;
      this.delegate = null;

      this.method = "next";
      this.arg = undefined;

      this.tryEntries.forEach(resetTryEntry);

      if (!skipTempReset) {
        for (var name in this) {
          // Not sure about the optimal order of these conditions:
          if (name.charAt(0) === "t" &&
              hasOwn.call(this, name) &&
              !isNaN(+name.slice(1))) {
            this[name] = undefined;
          }
        }
      }
    },

    stop: function() {
      this.done = true;

      var rootEntry = this.tryEntries[0];
      var rootRecord = rootEntry.completion;
      if (rootRecord.type === "throw") {
        throw rootRecord.arg;
      }

      return this.rval;
    },

    dispatchException: function(exception) {
      if (this.done) {
        throw exception;
      }

      var context = this;
      function handle(loc, caught) {
        record.type = "throw";
        record.arg = exception;
        context.next = loc;

        if (caught) {
          // If the dispatched exception was caught by a catch block,
          // then let that catch block handle the exception normally.
          context.method = "next";
          context.arg = undefined;
        }

        return !! caught;
      }

      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
        var entry = this.tryEntries[i];
        var record = entry.completion;

        if (entry.tryLoc === "root") {
          // Exception thrown outside of any try block that could handle
          // it, so set the completion value of the entire function to
          // throw the exception.
          return handle("end");
        }

        if (entry.tryLoc <= this.prev) {
          var hasCatch = hasOwn.call(entry, "catchLoc");
          var hasFinally = hasOwn.call(entry, "finallyLoc");

          if (hasCatch && hasFinally) {
            if (this.prev < entry.catchLoc) {
              return handle(entry.catchLoc, true);
            } else if (this.prev < entry.finallyLoc) {
              return handle(entry.finallyLoc);
            }

          } else if (hasCatch) {
            if (this.prev < entry.catchLoc) {
              return handle(entry.catchLoc, true);
            }

          } else if (hasFinally) {
            if (this.prev < entry.finallyLoc) {
              return handle(entry.finallyLoc);
            }

          } else {
            throw new Error("try statement without catch or finally");
          }
        }
      }
    },

    abrupt: function(type, arg) {
      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
        var entry = this.tryEntries[i];
        if (entry.tryLoc <= this.prev &&
            hasOwn.call(entry, "finallyLoc") &&
            this.prev < entry.finallyLoc) {
          var finallyEntry = entry;
          break;
        }
      }

      if (finallyEntry &&
          (type === "break" ||
           type === "continue") &&
          finallyEntry.tryLoc <= arg &&
          arg <= finallyEntry.finallyLoc) {
        // Ignore the finally entry if control is not jumping to a
        // location outside the try/catch block.
        finallyEntry = null;
      }

      var record = finallyEntry ? finallyEntry.completion : {};
      record.type = type;
      record.arg = arg;

      if (finallyEntry) {
        this.method = "next";
        this.next = finallyEntry.finallyLoc;
        return ContinueSentinel;
      }

      return this.complete(record);
    },

    complete: function(record, afterLoc) {
      if (record.type === "throw") {
        throw record.arg;
      }

      if (record.type === "break" ||
          record.type === "continue") {
        this.next = record.arg;
      } else if (record.type === "return") {
        this.rval = this.arg = record.arg;
        this.method = "return";
        this.next = "end";
      } else if (record.type === "normal" && afterLoc) {
        this.next = afterLoc;
      }

      return ContinueSentinel;
    },

    finish: function(finallyLoc) {
      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
        var entry = this.tryEntries[i];
        if (entry.finallyLoc === finallyLoc) {
          this.complete(entry.completion, entry.afterLoc);
          resetTryEntry(entry);
          return ContinueSentinel;
        }
      }
    },

    "catch": function(tryLoc) {
      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
        var entry = this.tryEntries[i];
        if (entry.tryLoc === tryLoc) {
          var record = entry.completion;
          if (record.type === "throw") {
            var thrown = record.arg;
            resetTryEntry(entry);
          }
          return thrown;
        }
      }

      // The context.catch method must only be called with a location
      // argument that corresponds to a known catch block.
      throw new Error("illegal catch attempt");
    },

    delegateYield: function(iterable, resultName, nextLoc) {
      this.delegate = {
        iterator: values(iterable),
        resultName: resultName,
        nextLoc: nextLoc
      };

      if (this.method === "next") {
        // Deliberately forget the last sent value so that we don't
        // accidentally pass it on to the delegate.
        this.arg = undefined;
      }

      return ContinueSentinel;
    }
  };
})(
  // Among the various tricks for obtaining a reference to the global
  // object, this seems to be the most reliable technique that does not
  // use indirect eval (which violates Content Security Policy).
  typeof global === "object" ? global :
  typeof window === "object" ? window :
  typeof self === "object" ? self : this
);

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1377 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
function isAbsolute(pathname) {
  return pathname.charAt(0) === '/';
}

// About 1.5x faster than the two-arg version of Array#splice()
function spliceOne(list, index) {
  for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
    list[i] = list[k];
  }

  list.pop();
}

// This implementation is based heavily on node's url.parse
function resolvePathname(to) {
  var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

  var toParts = to && to.split('/') || [];
  var fromParts = from && from.split('/') || [];

  var isToAbs = to && isAbsolute(to);
  var isFromAbs = from && isAbsolute(from);
  var mustEndAbs = isToAbs || isFromAbs;

  if (to && isAbsolute(to)) {
    // to is absolute
    fromParts = toParts;
  } else if (toParts.length) {
    // to is relative, drop the filename
    fromParts.pop();
    fromParts = fromParts.concat(toParts);
  }

  if (!fromParts.length) return '/';

  var hasTrailingSlash = void 0;
  if (fromParts.length) {
    var last = fromParts[fromParts.length - 1];
    hasTrailingSlash = last === '.' || last === '..' || last === '';
  } else {
    hasTrailingSlash = false;
  }

  var up = 0;
  for (var i = fromParts.length; i >= 0; i--) {
    var part = fromParts[i];

    if (part === '.') {
      spliceOne(fromParts, i);
    } else if (part === '..') {
      spliceOne(fromParts, i);
      up++;
    } else if (up) {
      spliceOne(fromParts, i);
      up--;
    }
  }

  if (!mustEndAbs) for (; up--; up) {
    fromParts.unshift('..');
  }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) fromParts.unshift('');

  var result = fromParts.join('/');

  if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';

  return result;
}

/* harmony default export */ __webpack_exports__["a"] = (resolvePathname);

/***/ }),
/* 1378 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/** @license React v0.13.6
 * scheduler-tracing.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

// Helps identify side effects in begin-phase lifecycle hooks and setState reducers:


// In some cases, StrictMode should also double-render lifecycles.
// This can be confusing for tests though,
// And it can be bad for performance in production.
// This feature flag can be used to control the behavior:


// To preserve the "Pause on caught exceptions" behavior of the debugger, we
// replay the begin phase of a failed component inside invokeGuardedCallback.


// Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:


// Gather advanced timing metrics for Profiler subtrees.


// Trace which interactions trigger each commit.
var enableSchedulerTracing = true;

// Only used in www builds.
 // TODO: true? Here it might just be false.

// Only used in www builds.


// Only used in www builds.


// React Fire: prevent the value and checked attributes from syncing
// with their related DOM properties


// These APIs will no longer be "unstable" in the upcoming 16.7 release,
// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.

var DEFAULT_THREAD_ID = 0;

// Counters used to generate unique IDs.
var interactionIDCounter = 0;
var threadIDCounter = 0;

// Set of currently traced interactions.
// Interactions "stack"–
// Meaning that newly traced interactions are appended to the previously active set.
// When an interaction goes out of scope, the previous set (if any) is restored.
exports.__interactionsRef = null;

// Listener(s) to notify when interactions begin and end.
exports.__subscriberRef = null;

if (enableSchedulerTracing) {
  exports.__interactionsRef = {
    current: new Set()
  };
  exports.__subscriberRef = {
    current: null
  };
}

function unstable_clear(callback) {
  if (!enableSchedulerTracing) {
    return callback();
  }

  var prevInteractions = exports.__interactionsRef.current;
  exports.__interactionsRef.current = new Set();

  try {
    return callback();
  } finally {
    exports.__interactionsRef.current = prevInteractions;
  }
}

function unstable_getCurrent() {
  if (!enableSchedulerTracing) {
    return null;
  } else {
    return exports.__interactionsRef.current;
  }
}

function unstable_getThreadID() {
  return ++threadIDCounter;
}

function unstable_trace(name, timestamp, callback) {
  var threadID = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_THREAD_ID;

  if (!enableSchedulerTracing) {
    return callback();
  }

  var interaction = {
    __count: 1,
    id: interactionIDCounter++,
    name: name,
    timestamp: timestamp
  };

  var prevInteractions = exports.__interactionsRef.current;

  // Traced interactions should stack/accumulate.
  // To do that, clone the current interactions.
  // The previous set will be restored upon completion.
  var interactions = new Set(prevInteractions);
  interactions.add(interaction);
  exports.__interactionsRef.current = interactions;

  var subscriber = exports.__subscriberRef.current;
  var returnValue = void 0;

  try {
    if (subscriber !== null) {
      subscriber.onInteractionTraced(interaction);
    }
  } finally {
    try {
      if (subscriber !== null) {
        subscriber.onWorkStarted(interactions, threadID);
      }
    } finally {
      try {
        returnValue = callback();
      } finally {
        exports.__interactionsRef.current = prevInteractions;

        try {
          if (subscriber !== null) {
            subscriber.onWorkStopped(interactions, threadID);
          }
        } finally {
          interaction.__count--;

          // If no async work was scheduled for this interaction,
          // Notify subscribers that it's completed.
          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        }
      }
    }
  }

  return returnValue;
}

function unstable_wrap(callback) {
  var threadID = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_THREAD_ID;

  if (!enableSchedulerTracing) {
    return callback;
  }

  var wrappedInteractions = exports.__interactionsRef.current;

  var subscriber = exports.__subscriberRef.current;
  if (subscriber !== null) {
    subscriber.onWorkScheduled(wrappedInteractions, threadID);
  }

  // Update the pending async work count for the current interactions.
  // Update after calling subscribers in case of error.
  wrappedInteractions.forEach(function (interaction) {
    interaction.__count++;
  });

  var hasRun = false;

  function wrapped() {
    var prevInteractions = exports.__interactionsRef.current;
    exports.__interactionsRef.current = wrappedInteractions;

    subscriber = exports.__subscriberRef.current;

    try {
      var returnValue = void 0;

      try {
        if (subscriber !== null) {
          subscriber.onWorkStarted(wrappedInteractions, threadID);
        }
      } finally {
        try {
          returnValue = callback.apply(undefined, arguments);
        } finally {
          exports.__interactionsRef.current = prevInteractions;

          if (subscriber !== null) {
            subscriber.onWorkStopped(wrappedInteractions, threadID);
          }
        }
      }

      return returnValue;
    } finally {
      if (!hasRun) {
        // We only expect a wrapped function to be executed once,
        // But in the event that it's executed more than once–
        // Only decrement the outstanding interaction counts once.
        hasRun = true;

        // Update pending async counts for all wrapped interactions.
        // If this was the last scheduled async work for any of them,
        // Mark them as completed.
        wrappedInteractions.forEach(function (interaction) {
          interaction.__count--;

          if (subscriber !== null && interaction.__count === 0) {
            subscriber.onInteractionScheduledWorkCompleted(interaction);
          }
        });
      }
    }
  }

  wrapped.cancel = function cancel() {
    subscriber = exports.__subscriberRef.current;

    try {
      if (subscriber !== null) {
        subscriber.onWorkCanceled(wrappedInteractions, threadID);
      }
    } finally {
      // Update pending async counts for all wrapped interactions.
      // If this was the last scheduled async work for any of them,
      // Mark them as completed.
      wrappedInteractions.forEach(function (interaction) {
        interaction.__count--;

        if (subscriber && interaction.__count === 0) {
          subscriber.onInteractionScheduledWorkCompleted(interaction);
        }
      });
    }
  };

  return wrapped;
}

var subscribers = null;
if (enableSchedulerTracing) {
  subscribers = new Set();
}

function unstable_subscribe(subscriber) {
  if (enableSchedulerTracing) {
    subscribers.add(subscriber);

    if (subscribers.size === 1) {
      exports.__subscriberRef.current = {
        onInteractionScheduledWorkCompleted: onInteractionScheduledWorkCompleted,
        onInteractionTraced: onInteractionTraced,
        onWorkCanceled: onWorkCanceled,
        onWorkScheduled: onWorkScheduled,
        onWorkStarted: onWorkStarted,
        onWorkStopped: onWorkStopped
      };
    }
  }
}

function unstable_unsubscribe(subscriber) {
  if (enableSchedulerTracing) {
    subscribers.delete(subscriber);

    if (subscribers.size === 0) {
      exports.__subscriberRef.current = null;
    }
  }
}

function onInteractionTraced(interaction) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionTraced(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onInteractionScheduledWorkCompleted(interaction) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onInteractionScheduledWorkCompleted(interaction);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkScheduled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkScheduled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStarted(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStarted(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkStopped(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkStopped(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

function onWorkCanceled(interactions, threadID) {
  var didCatchError = false;
  var caughtError = null;

  subscribers.forEach(function (subscriber) {
    try {
      subscriber.onWorkCanceled(interactions, threadID);
    } catch (error) {
      if (!didCatchError) {
        didCatchError = true;
        caughtError = error;
      }
    }
  });

  if (didCatchError) {
    throw caughtError;
  }
}

exports.unstable_clear = unstable_clear;
exports.unstable_getCurrent = unstable_getCurrent;
exports.unstable_getThreadID = unstable_getThreadID;
exports.unstable_trace = unstable_trace;
exports.unstable_wrap = unstable_wrap;
exports.unstable_subscribe = unstable_subscribe;
exports.unstable_unsubscribe = unstable_unsubscribe;
  })();
}


/***/ }),
/* 1379 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global) {/** @license React v0.13.6
 * scheduler.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */





if (true) {
  (function() {
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var enableSchedulerDebugging = false;

/* eslint-disable no-var */

// TODO: Use symbols?
var ImmediatePriority = 1;
var UserBlockingPriority = 2;
var NormalPriority = 3;
var LowPriority = 4;
var IdlePriority = 5;

// Max 31 bit integer. The max integer size in V8 for 32-bit systems.
// Math.pow(2, 30) - 1
// 0b111111111111111111111111111111
var maxSigned31BitInt = 1073741823;

// Times out immediately
var IMMEDIATE_PRIORITY_TIMEOUT = -1;
// Eventually times out
var USER_BLOCKING_PRIORITY = 250;
var NORMAL_PRIORITY_TIMEOUT = 5000;
var LOW_PRIORITY_TIMEOUT = 10000;
// Never times out
var IDLE_PRIORITY = maxSigned31BitInt;

// Callbacks are stored as a circular, doubly linked list.
var firstCallbackNode = null;

var currentDidTimeout = false;
// Pausing the scheduler is useful for debugging.
var isSchedulerPaused = false;

var currentPriorityLevel = NormalPriority;
var currentEventStartTime = -1;
var currentExpirationTime = -1;

// This is set when a callback is being executed, to prevent re-entrancy.
var isExecutingCallback = false;

var isHostCallbackScheduled = false;

var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';

function ensureHostCallbackIsScheduled() {
  if (isExecutingCallback) {
    // Don't schedule work yet; wait until the next time we yield.
    return;
  }
  // Schedule the host callback using the earliest expiration in the list.
  var expirationTime = firstCallbackNode.expirationTime;
  if (!isHostCallbackScheduled) {
    isHostCallbackScheduled = true;
  } else {
    // Cancel the existing host callback.
    cancelHostCallback();
  }
  requestHostCallback(flushWork, expirationTime);
}

function flushFirstCallback() {
  var flushedNode = firstCallbackNode;

  // Remove the node from the list before calling the callback. That way the
  // list is in a consistent state even if the callback throws.
  var next = firstCallbackNode.next;
  if (firstCallbackNode === next) {
    // This is the last callback in the list.
    firstCallbackNode = null;
    next = null;
  } else {
    var lastCallbackNode = firstCallbackNode.previous;
    firstCallbackNode = lastCallbackNode.next = next;
    next.previous = lastCallbackNode;
  }

  flushedNode.next = flushedNode.previous = null;

  // Now it's safe to call the callback.
  var callback = flushedNode.callback;
  var expirationTime = flushedNode.expirationTime;
  var priorityLevel = flushedNode.priorityLevel;
  var previousPriorityLevel = currentPriorityLevel;
  var previousExpirationTime = currentExpirationTime;
  currentPriorityLevel = priorityLevel;
  currentExpirationTime = expirationTime;
  var continuationCallback;
  try {
    continuationCallback = callback();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
    currentExpirationTime = previousExpirationTime;
  }

  // A callback may return a continuation. The continuation should be scheduled
  // with the same priority and expiration as the just-finished callback.
  if (typeof continuationCallback === 'function') {
    var continuationNode = {
      callback: continuationCallback,
      priorityLevel: priorityLevel,
      expirationTime: expirationTime,
      next: null,
      previous: null
    };

    // Insert the new callback into the list, sorted by its expiration. This is
    // almost the same as the code in `scheduleCallback`, except the callback
    // is inserted into the list *before* callbacks of equal expiration instead
    // of after.
    if (firstCallbackNode === null) {
      // This is the first callback in the list.
      firstCallbackNode = continuationNode.next = continuationNode.previous = continuationNode;
    } else {
      var nextAfterContinuation = null;
      var node = firstCallbackNode;
      do {
        if (node.expirationTime >= expirationTime) {
          // This callback expires at or after the continuation. We will insert
          // the continuation *before* this callback.
          nextAfterContinuation = node;
          break;
        }
        node = node.next;
      } while (node !== firstCallbackNode);

      if (nextAfterContinuation === null) {
        // No equal or lower priority callback was found, which means the new
        // callback is the lowest priority callback in the list.
        nextAfterContinuation = firstCallbackNode;
      } else if (nextAfterContinuation === firstCallbackNode) {
        // The new callback is the highest priority callback in the list.
        firstCallbackNode = continuationNode;
        ensureHostCallbackIsScheduled();
      }

      var previous = nextAfterContinuation.previous;
      previous.next = nextAfterContinuation.previous = continuationNode;
      continuationNode.next = nextAfterContinuation;
      continuationNode.previous = previous;
    }
  }
}

function flushImmediateWork() {
  if (
  // Confirm we've exited the outer most event handler
  currentEventStartTime === -1 && firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority) {
    isExecutingCallback = true;
    try {
      do {
        flushFirstCallback();
      } while (
      // Keep flushing until there are no more immediate callbacks
      firstCallbackNode !== null && firstCallbackNode.priorityLevel === ImmediatePriority);
    } finally {
      isExecutingCallback = false;
      if (firstCallbackNode !== null) {
        // There's still work remaining. Request another callback.
        ensureHostCallbackIsScheduled();
      } else {
        isHostCallbackScheduled = false;
      }
    }
  }
}

function flushWork(didTimeout) {
  // Exit right away if we're currently paused

  if (enableSchedulerDebugging && isSchedulerPaused) {
    return;
  }

  isExecutingCallback = true;
  var previousDidTimeout = currentDidTimeout;
  currentDidTimeout = didTimeout;
  try {
    if (didTimeout) {
      // Flush all the expired callbacks without yielding.
      while (firstCallbackNode !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
        // TODO Wrap in feature flag
        // Read the current time. Flush all the callbacks that expire at or
        // earlier than that time. Then read the current time again and repeat.
        // This optimizes for as few performance.now calls as possible.
        var currentTime = exports.unstable_now();
        if (firstCallbackNode.expirationTime <= currentTime) {
          do {
            flushFirstCallback();
          } while (firstCallbackNode !== null && firstCallbackNode.expirationTime <= currentTime && !(enableSchedulerDebugging && isSchedulerPaused));
          continue;
        }
        break;
      }
    } else {
      // Keep flushing callbacks until we run out of time in the frame.
      if (firstCallbackNode !== null) {
        do {
          if (enableSchedulerDebugging && isSchedulerPaused) {
            break;
          }
          flushFirstCallback();
        } while (firstCallbackNode !== null && !shouldYieldToHost());
      }
    }
  } finally {
    isExecutingCallback = false;
    currentDidTimeout = previousDidTimeout;
    if (firstCallbackNode !== null) {
      // There's still work remaining. Request another callback.
      ensureHostCallbackIsScheduled();
    } else {
      isHostCallbackScheduled = false;
    }
    // Before exiting, flush all the immediate work that was scheduled.
    flushImmediateWork();
  }
}

function unstable_runWithPriority(priorityLevel, eventHandler) {
  switch (priorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
    case LowPriority:
    case IdlePriority:
      break;
    default:
      priorityLevel = NormalPriority;
  }

  var previousPriorityLevel = currentPriorityLevel;
  var previousEventStartTime = currentEventStartTime;
  currentPriorityLevel = priorityLevel;
  currentEventStartTime = exports.unstable_now();

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
    currentEventStartTime = previousEventStartTime;

    // Before exiting, flush all the immediate work that was scheduled.
    flushImmediateWork();
  }
}

function unstable_next(eventHandler) {
  var priorityLevel = void 0;
  switch (currentPriorityLevel) {
    case ImmediatePriority:
    case UserBlockingPriority:
    case NormalPriority:
      // Shift down to normal priority
      priorityLevel = NormalPriority;
      break;
    default:
      // Anything lower than normal priority should remain at the current level.
      priorityLevel = currentPriorityLevel;
      break;
  }

  var previousPriorityLevel = currentPriorityLevel;
  var previousEventStartTime = currentEventStartTime;
  currentPriorityLevel = priorityLevel;
  currentEventStartTime = exports.unstable_now();

  try {
    return eventHandler();
  } finally {
    currentPriorityLevel = previousPriorityLevel;
    currentEventStartTime = previousEventStartTime;

    // Before exiting, flush all the immediate work that was scheduled.
    flushImmediateWork();
  }
}

function unstable_wrapCallback(callback) {
  var parentPriorityLevel = currentPriorityLevel;
  return function () {
    // This is a fork of runWithPriority, inlined for performance.
    var previousPriorityLevel = currentPriorityLevel;
    var previousEventStartTime = currentEventStartTime;
    currentPriorityLevel = parentPriorityLevel;
    currentEventStartTime = exports.unstable_now();

    try {
      return callback.apply(this, arguments);
    } finally {
      currentPriorityLevel = previousPriorityLevel;
      currentEventStartTime = previousEventStartTime;
      flushImmediateWork();
    }
  };
}

function unstable_scheduleCallback(callback, deprecated_options) {
  var startTime = currentEventStartTime !== -1 ? currentEventStartTime : exports.unstable_now();

  var expirationTime;
  if (typeof deprecated_options === 'object' && deprecated_options !== null && typeof deprecated_options.timeout === 'number') {
    // FIXME: Remove this branch once we lift expiration times out of React.
    expirationTime = startTime + deprecated_options.timeout;
  } else {
    switch (currentPriorityLevel) {
      case ImmediatePriority:
        expirationTime = startTime + IMMEDIATE_PRIORITY_TIMEOUT;
        break;
      case UserBlockingPriority:
        expirationTime = startTime + USER_BLOCKING_PRIORITY;
        break;
      case IdlePriority:
        expirationTime = startTime + IDLE_PRIORITY;
        break;
      case LowPriority:
        expirationTime = startTime + LOW_PRIORITY_TIMEOUT;
        break;
      case NormalPriority:
      default:
        expirationTime = startTime + NORMAL_PRIORITY_TIMEOUT;
    }
  }

  var newNode = {
    callback: callback,
    priorityLevel: currentPriorityLevel,
    expirationTime: expirationTime,
    next: null,
    previous: null
  };

  // Insert the new callback into the list, ordered first by expiration, then
  // by insertion. So the new callback is inserted any other callback with
  // equal expiration.
  if (firstCallbackNode === null) {
    // This is the first callback in the list.
    firstCallbackNode = newNode.next = newNode.previous = newNode;
    ensureHostCallbackIsScheduled();
  } else {
    var next = null;
    var node = firstCallbackNode;
    do {
      if (node.expirationTime > expirationTime) {
        // The new callback expires before this one.
        next = node;
        break;
      }
      node = node.next;
    } while (node !== firstCallbackNode);

    if (next === null) {
      // No callback with a later expiration was found, which means the new
      // callback has the latest expiration in the list.
      next = firstCallbackNode;
    } else if (next === firstCallbackNode) {
      // The new callback has the earliest expiration in the entire list.
      firstCallbackNode = newNode;
      ensureHostCallbackIsScheduled();
    }

    var previous = next.previous;
    previous.next = next.previous = newNode;
    newNode.next = next;
    newNode.previous = previous;
  }

  return newNode;
}

function unstable_pauseExecution() {
  isSchedulerPaused = true;
}

function unstable_continueExecution() {
  isSchedulerPaused = false;
  if (firstCallbackNode !== null) {
    ensureHostCallbackIsScheduled();
  }
}

function unstable_getFirstCallbackNode() {
  return firstCallbackNode;
}

function unstable_cancelCallback(callbackNode) {
  var next = callbackNode.next;
  if (next === null) {
    // Already cancelled.
    return;
  }

  if (next === callbackNode) {
    // This is the only scheduled callback. Clear the list.
    firstCallbackNode = null;
  } else {
    // Remove the callback from its position in the list.
    if (callbackNode === firstCallbackNode) {
      firstCallbackNode = next;
    }
    var previous = callbackNode.previous;
    previous.next = next;
    next.previous = previous;
  }

  callbackNode.next = callbackNode.previous = null;
}

function unstable_getCurrentPriorityLevel() {
  return currentPriorityLevel;
}

function unstable_shouldYield() {
  return !currentDidTimeout && (firstCallbackNode !== null && firstCallbackNode.expirationTime < currentExpirationTime || shouldYieldToHost());
}

// The remaining code is essentially a polyfill for requestIdleCallback. It
// works by scheduling a requestAnimationFrame, storing the time for the start
// of the frame, then scheduling a postMessage which gets scheduled after paint.
// Within the postMessage handler do as much work as possible until time + frame
// rate. By separating the idle call into a separate event tick we ensure that
// layout, paint and other browser work is counted against the available time.
// The frame rate is dynamically adjusted.

// We capture a local reference to any global, in case it gets polyfilled after
// this module is initially evaluated. We want to be using a
// consistent implementation.
var localDate = Date;

// This initialization code may run even on server environments if a component
// just imports ReactDOM (e.g. for findDOMNode). Some environments might not
// have setTimeout or clearTimeout. However, we always expect them to be defined
// on the client. https://github.com/facebook/react/pull/13088
var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;

// We don't expect either of these to necessarily be defined, but we will error
// later if they are missing on the client.
var localRequestAnimationFrame = typeof requestAnimationFrame === 'function' ? requestAnimationFrame : undefined;
var localCancelAnimationFrame = typeof cancelAnimationFrame === 'function' ? cancelAnimationFrame : undefined;

// requestAnimationFrame does not run when the tab is in the background. If
// we're backgrounded we prefer for that work to happen so that the page
// continues to load in the background. So we also schedule a 'setTimeout' as
// a fallback.
// TODO: Need a better heuristic for backgrounded work.
var ANIMATION_FRAME_TIMEOUT = 100;
var rAFID;
var rAFTimeoutID;
var requestAnimationFrameWithTimeout = function (callback) {
  // schedule rAF and also a setTimeout
  rAFID = localRequestAnimationFrame(function (timestamp) {
    // cancel the setTimeout
    localClearTimeout(rAFTimeoutID);
    callback(timestamp);
  });
  rAFTimeoutID = localSetTimeout(function () {
    // cancel the requestAnimationFrame
    localCancelAnimationFrame(rAFID);
    callback(exports.unstable_now());
  }, ANIMATION_FRAME_TIMEOUT);
};

if (hasNativePerformanceNow) {
  var Performance = performance;
  exports.unstable_now = function () {
    return Performance.now();
  };
} else {
  exports.unstable_now = function () {
    return localDate.now();
  };
}

var requestHostCallback;
var cancelHostCallback;
var shouldYieldToHost;

var globalValue = null;
if (typeof window !== 'undefined') {
  globalValue = window;
} else if (typeof global !== 'undefined') {
  globalValue = global;
}

if (globalValue && globalValue._schedMock) {
  // Dynamic injection, only for testing purposes.
  var globalImpl = globalValue._schedMock;
  requestHostCallback = globalImpl[0];
  cancelHostCallback = globalImpl[1];
  shouldYieldToHost = globalImpl[2];
  exports.unstable_now = globalImpl[3];
} else if (
// If Scheduler runs in a non-DOM environment, it falls back to a naive
// implementation using setTimeout.
typeof window === 'undefined' ||
// Check if MessageChannel is supported, too.
typeof MessageChannel !== 'function') {
  // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
  // fallback to a naive implementation.
  var _callback = null;
  var _flushCallback = function (didTimeout) {
    if (_callback !== null) {
      try {
        _callback(didTimeout);
      } finally {
        _callback = null;
      }
    }
  };
  requestHostCallback = function (cb, ms) {
    if (_callback !== null) {
      // Protect against re-entrancy.
      setTimeout(requestHostCallback, 0, cb);
    } else {
      _callback = cb;
      setTimeout(_flushCallback, 0, false);
    }
  };
  cancelHostCallback = function () {
    _callback = null;
  };
  shouldYieldToHost = function () {
    return false;
  };
} else {
  if (typeof console !== 'undefined') {
    // TODO: Remove fb.me link
    if (typeof localRequestAnimationFrame !== 'function') {
      console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
    }
    if (typeof localCancelAnimationFrame !== 'function') {
      console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
    }
  }

  var scheduledHostCallback = null;
  var isMessageEventScheduled = false;
  var timeoutTime = -1;

  var isAnimationFrameScheduled = false;

  var isFlushingHostCallback = false;

  var frameDeadline = 0;
  // We start out assuming that we run at 30fps but then the heuristic tracking
  // will adjust this value to a faster fps if we get more frequent animation
  // frames.
  var previousFrameTime = 33;
  var activeFrameTime = 33;

  shouldYieldToHost = function () {
    return frameDeadline <= exports.unstable_now();
  };

  // We use the postMessage trick to defer idle work until after the repaint.
  var channel = new MessageChannel();
  var port = channel.port2;
  channel.port1.onmessage = function (event) {
    isMessageEventScheduled = false;

    var prevScheduledCallback = scheduledHostCallback;
    var prevTimeoutTime = timeoutTime;
    scheduledHostCallback = null;
    timeoutTime = -1;

    var currentTime = exports.unstable_now();

    var didTimeout = false;
    if (frameDeadline - currentTime <= 0) {
      // There's no time left in this idle period. Check if the callback has
      // a timeout and whether it's been exceeded.
      if (prevTimeoutTime !== -1 && prevTimeoutTime <= currentTime) {
        // Exceeded the timeout. Invoke the callback even though there's no
        // time left.
        didTimeout = true;
      } else {
        // No timeout.
        if (!isAnimationFrameScheduled) {
          // Schedule another animation callback so we retry later.
          isAnimationFrameScheduled = true;
          requestAnimationFrameWithTimeout(animationTick);
        }
        // Exit without invoking the callback.
        scheduledHostCallback = prevScheduledCallback;
        timeoutTime = prevTimeoutTime;
        return;
      }
    }

    if (prevScheduledCallback !== null) {
      isFlushingHostCallback = true;
      try {
        prevScheduledCallback(didTimeout);
      } finally {
        isFlushingHostCallback = false;
      }
    }
  };

  var animationTick = function (rafTime) {
    if (scheduledHostCallback !== null) {
      // Eagerly schedule the next animation callback at the beginning of the
      // frame. If the scheduler queue is not empty at the end of the frame, it
      // will continue flushing inside that callback. If the queue *is* empty,
      // then it will exit immediately. Posting the callback at the start of the
      // frame ensures it's fired within the earliest possible frame. If we
      // waited until the end of the frame to post the callback, we risk the
      // browser skipping a frame and not firing the callback until the frame
      // after that.
      requestAnimationFrameWithTimeout(animationTick);
    } else {
      // No pending work. Exit.
      isAnimationFrameScheduled = false;
      return;
    }

    var nextFrameTime = rafTime - frameDeadline + activeFrameTime;
    if (nextFrameTime < activeFrameTime && previousFrameTime < activeFrameTime) {
      if (nextFrameTime < 8) {
        // Defensive coding. We don't support higher frame rates than 120hz.
        // If the calculated frame time gets lower than 8, it is probably a bug.
        nextFrameTime = 8;
      }
      // If one frame goes long, then the next one can be short to catch up.
      // If two frames are short in a row, then that's an indication that we
      // actually have a higher frame rate than what we're currently optimizing.
      // We adjust our heuristic dynamically accordingly. For example, if we're
      // running on 120hz display or 90hz VR display.
      // Take the max of the two in case one of them was an anomaly due to
      // missed frame deadlines.
      activeFrameTime = nextFrameTime < previousFrameTime ? previousFrameTime : nextFrameTime;
    } else {
      previousFrameTime = nextFrameTime;
    }
    frameDeadline = rafTime + activeFrameTime;
    if (!isMessageEventScheduled) {
      isMessageEventScheduled = true;
      port.postMessage(undefined);
    }
  };

  requestHostCallback = function (callback, absoluteTimeout) {
    scheduledHostCallback = callback;
    timeoutTime = absoluteTimeout;
    if (isFlushingHostCallback || absoluteTimeout < 0) {
      // Don't wait for the next frame. Continue working ASAP, in a new event.
      port.postMessage(undefined);
    } else if (!isAnimationFrameScheduled) {
      // If rAF didn't already schedule one, we need to schedule a frame.
      // TODO: If this rAF doesn't materialize because the browser throttles, we
      // might want to still have setTimeout trigger rIC as a backup to ensure
      // that we keep performing work.
      isAnimationFrameScheduled = true;
      requestAnimationFrameWithTimeout(animationTick);
    }
  };

  cancelHostCallback = function () {
    scheduledHostCallback = null;
    isMessageEventScheduled = false;
    timeoutTime = -1;
  };
}

exports.unstable_ImmediatePriority = ImmediatePriority;
exports.unstable_UserBlockingPriority = UserBlockingPriority;
exports.unstable_NormalPriority = NormalPriority;
exports.unstable_IdlePriority = IdlePriority;
exports.unstable_LowPriority = LowPriority;
exports.unstable_runWithPriority = unstable_runWithPriority;
exports.unstable_next = unstable_next;
exports.unstable_scheduleCallback = unstable_scheduleCallback;
exports.unstable_cancelCallback = unstable_cancelCallback;
exports.unstable_wrapCallback = unstable_wrapCallback;
exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
exports.unstable_shouldYield = unstable_shouldYield;
exports.unstable_continueExecution = unstable_continueExecution;
exports.unstable_pauseExecution = unstable_pauseExecution;
exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
  })();
}

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1380 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {
  module.exports = require('./cjs/scheduler.production.min.js');
} else {
  module.exports = __webpack_require__(1379);
}


/***/ }),
/* 1381 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


if (false) {
  module.exports = require('./cjs/scheduler-tracing.production.min.js');
} else {
  module.exports = __webpack_require__(1378);
}


/***/ }),
/* 1382 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
    "use strict";

    if (global.setImmediate) {
        return;
    }

    var nextHandle = 1; // Spec says greater than zero
    var tasksByHandle = {};
    var currentlyRunningATask = false;
    var doc = global.document;
    var registerImmediate;

    function setImmediate(callback) {
      // Callback can either be a function or a string
      if (typeof callback !== "function") {
        callback = new Function("" + callback);
      }
      // Copy function arguments
      var args = new Array(arguments.length - 1);
      for (var i = 0; i < args.length; i++) {
          args[i] = arguments[i + 1];
      }
      // Store and register the task
      var task = { callback: callback, args: args };
      tasksByHandle[nextHandle] = task;
      registerImmediate(nextHandle);
      return nextHandle++;
    }

    function clearImmediate(handle) {
        delete tasksByHandle[handle];
    }

    function run(task) {
        var callback = task.callback;
        var args = task.args;
        switch (args.length) {
        case 0:
            callback();
            break;
        case 1:
            callback(args[0]);
            break;
        case 2:
            callback(args[0], args[1]);
            break;
        case 3:
            callback(args[0], args[1], args[2]);
            break;
        default:
            callback.apply(undefined, args);
            break;
        }
    }

    function runIfPresent(handle) {
        // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
        // So if we're currently running a task, we'll need to delay this invocation.
        if (currentlyRunningATask) {
            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
            // "too much recursion" error.
            setTimeout(runIfPresent, 0, handle);
        } else {
            var task = tasksByHandle[handle];
            if (task) {
                currentlyRunningATask = true;
                try {
                    run(task);
                } finally {
                    clearImmediate(handle);
                    currentlyRunningATask = false;
                }
            }
        }
    }

    function installNextTickImplementation() {
        registerImmediate = function(handle) {
            process.nextTick(function () { runIfPresent(handle); });
        };
    }

    function canUsePostMessage() {
        // The test against `importScripts` prevents this implementation from being installed inside a web worker,
        // where `global.postMessage` means something completely different and can't be used for this purpose.
        if (global.postMessage && !global.importScripts) {
            var postMessageIsAsynchronous = true;
            var oldOnMessage = global.onmessage;
            global.onmessage = function() {
                postMessageIsAsynchronous = false;
            };
            global.postMessage("", "*");
            global.onmessage = oldOnMessage;
            return postMessageIsAsynchronous;
        }
    }

    function installPostMessageImplementation() {
        // Installs an event handler on `global` for the `message` event: see
        // * https://developer.mozilla.org/en/DOM/window.postMessage
        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages

        var messagePrefix = "setImmediate$" + Math.random() + "$";
        var onGlobalMessage = function(event) {
            if (event.source === global &&
                typeof event.data === "string" &&
                event.data.indexOf(messagePrefix) === 0) {
                runIfPresent(+event.data.slice(messagePrefix.length));
            }
        };

        if (global.addEventListener) {
            global.addEventListener("message", onGlobalMessage, false);
        } else {
            global.attachEvent("onmessage", onGlobalMessage);
        }

        registerImmediate = function(handle) {
            global.postMessage(messagePrefix + handle, "*");
        };
    }

    function installMessageChannelImplementation() {
        var channel = new MessageChannel();
        channel.port1.onmessage = function(event) {
            var handle = event.data;
            runIfPresent(handle);
        };

        registerImmediate = function(handle) {
            channel.port2.postMessage(handle);
        };
    }

    function installReadyStateChangeImplementation() {
        var html = doc.documentElement;
        registerImmediate = function(handle) {
            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
            var script = doc.createElement("script");
            script.onreadystatechange = function () {
                runIfPresent(handle);
                script.onreadystatechange = null;
                html.removeChild(script);
                script = null;
            };
            html.appendChild(script);
        };
    }

    function installSetTimeoutImplementation() {
        registerImmediate = function(handle) {
            setTimeout(runIfPresent, 0, handle);
        };
    }

    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;

    // Don't get fooled by e.g. browserify environments.
    if ({}.toString.call(global.process) === "[object process]") {
        // For Node.js before 0.9
        installNextTickImplementation();

    } else if (canUsePostMessage()) {
        // For non-IE10 modern browsers
        installPostMessageImplementation();

    } else if (global.MessageChannel) {
        // For web workers, where supported
        installMessageChannelImplementation();

    } else if (doc && "onreadystatechange" in doc.createElement("script")) {
        // For IE 6–8
        installReadyStateChangeImplementation();

    } else {
        // For older browsers
        installSetTimeoutImplementation();
    }

    attachTo.setImmediate = setImmediate;
    attachTo.clearImmediate = clearImmediate;
}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51), __webpack_require__(246)))

/***/ }),
/* 1383 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var bind = __webpack_require__(241);
var define = __webpack_require__(350);

var implementation = __webpack_require__(381);
var getPolyfill = __webpack_require__(382);
var shim = __webpack_require__(1384);

var boundTrim = bind.call(Function.call, getPolyfill());

define(boundTrim, {
	getPolyfill: getPolyfill,
	implementation: implementation,
	shim: shim
});

module.exports = boundTrim;


/***/ }),
/* 1384 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var define = __webpack_require__(350);
var getPolyfill = __webpack_require__(382);

module.exports = function shimStringTrim() {
	var polyfill = getPolyfill();
	define(String.prototype, { trim: polyfill }, {
		trim: function testTrim() {
			return String.prototype.trim !== polyfill;
		}
	});
	return polyfill;
};


/***/ }),
/* 1385 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


/**
 * Copyright 2015, Yahoo! Inc.
 * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */
var REACT_STATICS = {
    childContextTypes: true,
    contextTypes: true,
    defaultProps: true,
    displayName: true,
    getDefaultProps: true,
    getDerivedStateFromProps: true,
    mixins: true,
    propTypes: true,
    type: true
};

var KNOWN_STATICS = {
    name: true,
    length: true,
    prototype: true,
    caller: true,
    callee: true,
    arguments: true,
    arity: true
};

var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);

function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
    if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components

        if (objectPrototype) {
            var inheritedComponent = getPrototypeOf(sourceComponent);
            if (inheritedComponent && inheritedComponent !== objectPrototype) {
                hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
            }
        }

        var keys = getOwnPropertyNames(sourceComponent);

        if (getOwnPropertySymbols) {
            keys = keys.concat(getOwnPropertySymbols(sourceComponent));
        }

        for (var i = 0; i < keys.length; ++i) {
            var key = keys[i];
            if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
                var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
                try { // Avoid failures from read-only properties
                    defineProperty(targetComponent, key, descriptor);
                } catch (e) {}
            }
        }

        return targetComponent;
    }

    return targetComponent;
}

module.exports = hoistNonReactStatics;


/***/ }),
/* 1386 */
/***/ (function(module, exports, __webpack_require__) {

(function (factory) {
	 true ? (module['exports'] = factory()) :
		typeof define === 'function' && define['amd'] ? define(factory()) :
			(window['stylisRuleSheet'] = factory())
}(function () {

	'use strict'

	return function (insertRule) {
		var delimiter = '/*|*/'
		var needle = delimiter+'}'

		function toSheet (block) {
			if (block)
				try {
					insertRule(block + '}')
				} catch (e) {}
		}

		return function ruleSheet (context, content, selectors, parents, line, column, length, ns, depth, at) {
			switch (context) {
				// property
				case 1:
					// @import
					if (depth === 0 && content.charCodeAt(0) === 64)
						return insertRule(content+';'), ''
					break
				// selector
				case 2:
					if (ns === 0)
						return content + delimiter
					break
				// at-rule
				case 3:
					switch (ns) {
						// @font-face, @page
						case 102:
						case 112:
							return insertRule(selectors[0]+content), ''
						default:
							return content + (at === 0 ? delimiter : '')
					}
				case -2:
					content.split(needle).forEach(toSheet)
			}
		}
	}
}))


/***/ }),
/* 1387 */
/***/ (function(module, exports, __webpack_require__) {

/*
 *          __        ___
 *    _____/ /___  __/ (_)____
 *   / ___/ __/ / / / / / ___/
 *  (__  ) /_/ /_/ / / (__  )
 * /____/\__/\__, /_/_/____/
 *          /____/
 *
 * light - weight css preprocessor @licence MIT
 */
(function (factory) {/* eslint-disable */
	 true ? (module['exports'] = factory(null)) :
		typeof define === 'function' && define['amd'] ? define(factory(null)) :
			(window['stylis'] = factory(null))
}(/** @param {*=} options */function factory (options) {/* eslint-disable */

	'use strict'

	/**
	 * Notes
	 *
	 * The ['<method name>'] pattern is used to support closure compiler
	 * the jsdoc signatures are also used to the same effect
	 *
	 * ----
	 *
	 * int + int + int === n4 [faster]
	 *
	 * vs
	 *
	 * int === n1 && int === n2 && int === n3
	 *
	 * ----
	 *
	 * switch (int) { case ints...} [faster]
	 *
	 * vs
	 *
	 * if (int == 1 && int === 2 ...)
	 *
	 * ----
	 *
	 * The (first*n1 + second*n2 + third*n3) format used in the property parser
	 * is a simple way to hash the sequence of characters
	 * taking into account the index they occur in
	 * since any number of 3 character sequences could produce duplicates.
	 *
	 * On the other hand sequences that are directly tied to the index of the character
	 * resolve a far more accurate measure, it's also faster
	 * to evaluate one condition in a switch statement
	 * than three in an if statement regardless of the added math.
	 *
	 * This allows the vendor prefixer to be both small and fast.
	 */

	var nullptn = /^\0+/g /* matches leading null characters */
	var formatptn = /[\0\r\f]/g /* matches new line, null and formfeed characters */
	var colonptn = /: */g /* splits animation rules */
	var cursorptn = /zoo|gra/ /* assert cursor varient */
	var transformptn = /([,: ])(transform)/g /* vendor prefix transform, older webkit */
	var animationptn = /,+\s*(?![^(]*[)])/g /* splits multiple shorthand notation animations */
	var propertiesptn = / +\s*(?![^(]*[)])/g /* animation properties */
	var elementptn = / *[\0] */g /* selector elements */
	var selectorptn = /,\r+?/g /* splits selectors */
	var andptn = /([\t\r\n ])*\f?&/g /* match & */
	var escapeptn = /:global\(((?:[^\(\)\[\]]*|\[.*\]|\([^\(\)]*\))*)\)/g /* matches :global(.*) */
	var invalidptn = /\W+/g /* removes invalid characters from keyframes */
	var keyframeptn = /@(k\w+)\s*(\S*)\s*/ /* matches @keyframes $1 */
	var plcholdrptn = /::(place)/g /* match ::placeholder varient */
	var readonlyptn = /:(read-only)/g /* match :read-only varient */
	var beforeptn = /\s+(?=[{\];=:>])/g /* matches \s before ] ; = : */
	var afterptn = /([[}=:>])\s+/g /* matches \s after characters [ } = : */
	var tailptn = /(\{[^{]+?);(?=\})/g /* matches tail semi-colons ;} */
	var whiteptn = /\s{2,}/g /* matches repeating whitespace */
	var pseudoptn = /([^\(])(:+) */g /* pseudo element */
	var writingptn = /[svh]\w+-[tblr]{2}/ /* match writing mode property values */
	var gradientptn = /([\w-]+t\()/g /* match *gradient property */
	var supportsptn = /\(\s*(.*)\s*\)/g /* match supports (groups) */
	var propertyptn = /([\s\S]*?);/g /* match properties leading semicolon */
	var selfptn = /-self|flex-/g /* match flex- and -self in align-self: flex-*; */
	var pseudofmt = /[^]*?(:[rp][el]a[\w-]+)[^]*/ /* extrats :readonly or :placholder from selector */
	var trimptn = /[ \t]+$/ /* match tail whitspace */
	var dimensionptn = /stretch|:\s*\w+\-(?:conte|avail)/ /* match max/min/fit-content, fill-available */
	var imgsrcptn = /([^-])(image-set\()/

	/* vendors */
	var webkit = '-webkit-'
	var moz = '-moz-'
	var ms = '-ms-'

	/* character codes */
	var SEMICOLON = 59 /* ; */
	var CLOSEBRACES = 125 /* } */
	var OPENBRACES = 123 /* { */
	var OPENPARENTHESES = 40 /* ( */
	var CLOSEPARENTHESES = 41 /* ) */
	var OPENBRACKET = 91 /* [ */
	var CLOSEBRACKET = 93 /* ] */
	var NEWLINE = 10 /* \n */
	var CARRIAGE = 13 /* \r */
	var TAB = 9 /* \t */
	var AT = 64 /* @ */
	var SPACE = 32 /*   */
	var AND = 38 /* & */
	var DASH = 45 /* - */
	var UNDERSCORE = 95 /* _ */
	var STAR = 42 /* * */
	var COMMA = 44 /* , */
	var COLON = 58 /* : */
	var SINGLEQUOTE = 39 /* ' */
	var DOUBLEQUOTE = 34 /* " */
	var FOWARDSLASH = 47 /* / */
	var GREATERTHAN = 62 /* > */
	var PLUS = 43 /* + */
	var TILDE = 126 /* ~ */
	var NULL = 0 /* \0 */
	var FORMFEED = 12 /* \f */
	var VERTICALTAB = 11 /* \v */

	/* special identifiers */
	var KEYFRAME = 107 /* k */
	var MEDIA = 109 /* m */
	var SUPPORTS = 115 /* s */
	var PLACEHOLDER = 112 /* p */
	var READONLY = 111 /* o */
	var IMPORT = 105 /* <at>i */
	var CHARSET = 99 /* <at>c */
	var DOCUMENT = 100 /* <at>d */
	var PAGE = 112 /* <at>p */

	var column = 1 /* current column */
	var line = 1 /* current line numebr */
	var pattern = 0 /* :pattern */

	var cascade = 1 /* #id h1 h2 vs h1#id h2#id  */
	var prefix = 1 /* vendor prefix */
	var escape = 1 /* escape :global() pattern */
	var compress = 0 /* compress output */
	var semicolon = 0 /* no/semicolon option */
	var preserve = 0 /* preserve empty selectors */

	/* empty reference */
	var array = []

	/* plugins */
	var plugins = []
	var plugged = 0
	var should = null

	/* plugin context */
	var POSTS = -2
	var PREPS = -1
	var UNKWN = 0
	var PROPS = 1
	var BLCKS = 2
	var ATRUL = 3

	/* plugin newline context */
	var unkwn = 0

	/* keyframe animation */
	var keyed = 1
	var key = ''

	/* selector namespace */
	var nscopealt = ''
	var nscope = ''

	/**
	 * Compile
	 *
	 * @param {Array<string>} parent
	 * @param {Array<string>} current
	 * @param {string} body
	 * @param {number} id
	 * @param {number} depth
	 * @return {string}
	 */
	function compile (parent, current, body, id, depth) {
		var bracket = 0 /* brackets [] */
		var comment = 0 /* comments /* // or /* */
		var parentheses = 0 /* functions () */
		var quote = 0 /* quotes '', "" */

		var first = 0 /* first character code */
		var second = 0 /* second character code */
		var code = 0 /* current character code */
		var tail = 0 /* previous character code */
		var trail = 0 /* character before previous code */
		var peak = 0 /* previous non-whitespace code */

		var counter = 0 /* count sequence termination */
		var context = 0 /* track current context */
		var atrule = 0 /* track @at-rule context */
		var pseudo = 0 /* track pseudo token index */
		var caret = 0 /* current character index */
		var format = 0 /* control character formating context */
		var insert = 0 /* auto semicolon insertion */
		var invert = 0 /* inverted selector pattern */
		var length = 0 /* generic length address */
		var eof = body.length /* end of file(length) */
		var eol = eof - 1 /* end of file(characters) */

		var char = '' /* current character */
		var chars = '' /* current buffer of characters */
		var child = '' /* next buffer of characters */
		var out = '' /* compiled body */
		var children = '' /* compiled children */
		var flat = '' /* compiled leafs */
		var selector /* generic selector address */
		var result /* generic address */

		// ...build body
		while (caret < eof) {
			code = body.charCodeAt(caret)

			// eof varient
			if (caret === eol) {
				// last character + noop context, add synthetic padding for noop context to terminate
				if (comment + quote + parentheses + bracket !== 0) {
					if (comment !== 0) {
						code = comment === FOWARDSLASH ? NEWLINE : FOWARDSLASH
					}

					quote = parentheses = bracket = 0
					eof++
					eol++
				}
			}

			if (comment + quote + parentheses + bracket === 0) {
				// eof varient
				if (caret === eol) {
					if (format > 0) {
						chars = chars.replace(formatptn, '')
					}

					if (chars.trim().length > 0) {
						switch (code) {
							case SPACE:
							case TAB:
							case SEMICOLON:
							case CARRIAGE:
							case NEWLINE: {
								break
							}
							default: {
								chars += body.charAt(caret)
							}
						}

						code = SEMICOLON
					}
				}

				// auto semicolon insertion
				if (insert === 1) {
					switch (code) {
						// false flags
						case OPENBRACES:
						case CLOSEBRACES:
						case SEMICOLON:
						case DOUBLEQUOTE:
						case SINGLEQUOTE:
						case OPENPARENTHESES:
						case CLOSEPARENTHESES:
						case COMMA: {
							insert = 0
						}
						// ignore
						case TAB:
						case CARRIAGE:
						case NEWLINE:
						case SPACE: {
							break
						}
						// valid
						default: {
							insert = 0
							length = caret
							first = code
							caret--
							code = SEMICOLON

							while (length < eof) {
								switch (body.charCodeAt(length++)) {
									case NEWLINE:
									case CARRIAGE:
									case SEMICOLON: {
										++caret
										code = first
										length = eof
										break
									}
									case COLON: {
										if (format > 0) {
											++caret
											code = first
										}
									}
									case OPENBRACES: {
										length = eof
									}
								}
							}
						}
					}
				}

				// token varient
				switch (code) {
					case OPENBRACES: {
						chars = chars.trim()
						first = chars.charCodeAt(0)
						counter = 1
						length = ++caret

						while (caret < eof) {
							switch (code = body.charCodeAt(caret)) {
								case OPENBRACES: {
									counter++
									break
								}
								case CLOSEBRACES: {
									counter--
									break
								}
								case FOWARDSLASH: {
									switch (second = body.charCodeAt(caret + 1)) {
										// /*, //
										case STAR:
										case FOWARDSLASH: {
											caret = delimited(second, caret, eol, body)
										}
									}
									break
								}
								// given "[" === 91 & "]" === 93 hence forth 91 + 1 + 1 === 93
								case OPENBRACKET: {
									code++
								}
								// given "(" === 40 & ")" === 41 hence forth 40 + 1 === 41
								case OPENPARENTHESES: {
									code++
								}
								// quote tail delimiter is identical to the head delimiter hence noop,
								// fallthrough clauses have been shifted to the correct tail delimiter
								case DOUBLEQUOTE:
								case SINGLEQUOTE: {
									while (caret++ < eol) {
										if (body.charCodeAt(caret) === code) {
											break
										}
									}
								}
							}

							if (counter === 0) {
								break
							}

							caret++
						}

						child = body.substring(length, caret)

						if (first === NULL) {
							first = (chars = chars.replace(nullptn, '').trim()).charCodeAt(0)
						}

						switch (first) {
							// @at-rule
							case AT: {
								if (format > 0) {
									chars = chars.replace(formatptn, '')
								}

								second = chars.charCodeAt(1)

								switch (second) {
									case DOCUMENT:
									case MEDIA:
									case SUPPORTS:
									case DASH: {
										selector = current
										break
									}
									default: {
										selector = array
									}
								}

								child = compile(current, selector, child, second, depth+1)
								length = child.length

								// preserve empty @at-rule
								if (preserve > 0 && length === 0) {
									length = chars.length
								}

								// execute plugins, @at-rule context
								if (plugged > 0) {
									selector = select(array, chars, invert)
									result = proxy(ATRUL, child, selector, current, line, column, length, second, depth, id)
									chars = selector.join('')

									if (result !== void 0) {
										if ((length = (child = result.trim()).length) === 0) {
											second = 0
											child = ''
										}
									}
								}

								if (length > 0) {
									switch (second) {
										case SUPPORTS: {
											chars = chars.replace(supportsptn, supports)
										}
										case DOCUMENT:
										case MEDIA:
										case DASH: {
											child = chars + '{' + child + '}'
											break
										}
										case KEYFRAME: {
											chars = chars.replace(keyframeptn, '$1 $2' + (keyed > 0 ? key : ''))
											child = chars + '{' + child + '}'

											if (prefix === 1 || (prefix === 2 && vendor('@'+child, 3))) {
												child = '@' + webkit + child + '@' + child
											} else {
												child = '@' + child
											}
											break
										}
										default: {
											child = chars + child

											if (id === PAGE) {
												child = (out += child, '')
											}
										}
									}
								} else {
									child = ''
								}

								break
							}
							// selector
							default: {
								child = compile(current, select(current, chars, invert), child, id, depth+1)
							}
						}

						children += child

						// reset
						context = 0
						insert = 0
						pseudo = 0
						format = 0
						invert = 0
						atrule = 0
						chars = ''
						child = ''
						code = body.charCodeAt(++caret)
						break
					}
					case CLOSEBRACES:
					case SEMICOLON: {
						chars = (format > 0 ? chars.replace(formatptn, '') : chars).trim()

						if ((length = chars.length) > 1) {
							// monkey-patch missing colon
							if (pseudo === 0) {
								first = chars.charCodeAt(0)

								// first character is a letter or dash, buffer has a space character
								if ((first === DASH || first > 96 && first < 123)) {
									length = (chars = chars.replace(' ', ':')).length
								}
							}

							// execute plugins, property context
							if (plugged > 0) {
								if ((result = proxy(PROPS, chars, current, parent, line, column, out.length, id, depth, id)) !== void 0) {
									if ((length = (chars = result.trim()).length) === 0) {
										chars = '\0\0'
									}
								}
							}

							first = chars.charCodeAt(0)
							second = chars.charCodeAt(1)

							switch (first) {
								case NULL: {
									break
								}
								case AT: {
									if (second === IMPORT || second === CHARSET) {
										flat += chars + body.charAt(caret)
										break
									}
								}
								default: {
									if (chars.charCodeAt(length-1) === COLON) {
										break
									}

									out += property(chars, first, second, chars.charCodeAt(2))
								}
							}
						}

						// reset
						context = 0
						insert = 0
						pseudo = 0
						format = 0
						invert = 0
						chars = ''
						code = body.charCodeAt(++caret)
						break
					}
				}
			}

			// parse characters
			switch (code) {
				case CARRIAGE:
				case NEWLINE: {
					// auto insert semicolon
					if (comment + quote + parentheses + bracket + semicolon === 0) {
						// valid non-whitespace characters that
						// may precede a newline
						switch (peak) {
							case CLOSEPARENTHESES:
							case SINGLEQUOTE:
							case DOUBLEQUOTE:
							case AT:
							case TILDE:
							case GREATERTHAN:
							case STAR:
							case PLUS:
							case FOWARDSLASH:
							case DASH:
							case COLON:
							case COMMA:
							case SEMICOLON:
							case OPENBRACES:
							case CLOSEBRACES: {
								break
							}
							default: {
								// current buffer has a colon
								if (pseudo > 0) {
									insert = 1
								}
							}
						}
					}

					// terminate line comment
					if (comment === FOWARDSLASH) {
						comment = 0
					} else if (cascade + context === 0 && id !== KEYFRAME && chars.length > 0) {
						format = 1
						chars += '\0'
					}

					// execute plugins, newline context
					if (plugged * unkwn > 0) {
						proxy(UNKWN, chars, current, parent, line, column, out.length, id, depth, id)
					}

					// next line, reset column position
					column = 1
					line++
					break
				}
				case SEMICOLON:
				case CLOSEBRACES: {
					if (comment + quote + parentheses + bracket === 0) {
						column++
						break
					}
				}
				default: {
					// increment column position
					column++

					// current character
					char = body.charAt(caret)

					// remove comments, escape functions, strings, attributes and prepare selectors
					switch (code) {
						case TAB:
						case SPACE: {
							if (quote + bracket + comment === 0) {
								switch (tail) {
									case COMMA:
									case COLON:
									case TAB:
									case SPACE: {
										char = ''
										break
									}
									default: {
										if (code !== SPACE) {
											char = ' '
										}
									}
								}
							}
							break
						}
						// escape breaking control characters
						case NULL: {
							char = '\\0'
							break
						}
						case FORMFEED: {
							char = '\\f'
							break
						}
						case VERTICALTAB: {
							char = '\\v'
							break
						}
						// &
						case AND: {
							// inverted selector pattern i.e html &
							if (quote + comment + bracket === 0 && cascade > 0) {
								invert = 1
								format = 1
								char = '\f' + char
							}
							break
						}
						// ::p<l>aceholder, l
						// :read-on<l>y, l
						case 108: {
							if (quote + comment + bracket + pattern === 0 && pseudo > 0) {
								switch (caret - pseudo) {
									// ::placeholder
									case 2: {
										if (tail === PLACEHOLDER && body.charCodeAt(caret-3) === COLON) {
											pattern = tail
										}
									}
									// :read-only
									case 8: {
										if (trail === READONLY) {
											pattern = trail
										}
									}
								}
							}
							break
						}
						// :<pattern>
						case COLON: {
							if (quote + comment + bracket === 0) {
								pseudo = caret
							}
							break
						}
						// selectors
						case COMMA: {
							if (comment + parentheses + quote + bracket === 0) {
								format = 1
								char += '\r'
							}
							break
						}
						// quotes
						case DOUBLEQUOTE:
						case SINGLEQUOTE: {
							if (comment === 0) {
								quote = quote === code ? 0 : (quote === 0 ? code : quote)
							}
							break
						}
						// attributes
						case OPENBRACKET: {
							if (quote + comment + parentheses === 0) {
								bracket++
							}
							break
						}
						case CLOSEBRACKET: {
							if (quote + comment + parentheses === 0) {
								bracket--
							}
							break
						}
						// functions
						case CLOSEPARENTHESES: {
							if (quote + comment + bracket === 0) {
								parentheses--
							}
							break
						}
						case OPENPARENTHESES: {
							if (quote + comment + bracket === 0) {
								if (context === 0) {
									switch (tail*2 + trail*3) {
										// :matches
										case 533: {
											break
										}
										// :global, :not, :nth-child etc...
										default: {
											counter = 0
											context = 1
										}
									}
								}

								parentheses++
							}
							break
						}
						case AT: {
							if (comment + parentheses + quote + bracket + pseudo + atrule === 0) {
								atrule = 1
							}
							break
						}
						// block/line comments
						case STAR:
						case FOWARDSLASH: {
							if (quote + bracket + parentheses > 0) {
								break
							}

							switch (comment) {
								// initialize line/block comment context
								case 0: {
									switch (code*2 + body.charCodeAt(caret+1)*3) {
										// //
										case 235: {
											comment = FOWARDSLASH
											break
										}
										// /*
										case 220: {
											length = caret
											comment = STAR
											break
										}
									}
									break
								}
								// end block comment context
								case STAR: {
									if (code === FOWARDSLASH && tail === STAR && length + 2 !== caret) {
										// /*<!> ... */, !
										if (body.charCodeAt(length+2) === 33) {
											out += body.substring(length, caret+1)
										}
										char = ''
										comment = 0
									}
								}
							}
						}
					}

					// ignore comment blocks
					if (comment === 0) {
						// aggressive isolation mode, divide each individual selector
						// including selectors in :not function but excluding selectors in :global function
						if (cascade + quote + bracket + atrule === 0 && id !== KEYFRAME && code !== SEMICOLON) {
							switch (code) {
								case COMMA:
								case TILDE:
								case GREATERTHAN:
								case PLUS:
								case CLOSEPARENTHESES:
								case OPENPARENTHESES: {
									if (context === 0) {
										// outside of an isolated context i.e nth-child(<...>)
										switch (tail) {
											case TAB:
											case SPACE:
											case NEWLINE:
											case CARRIAGE: {
												char = char + '\0'
												break
											}
											default: {
												char = '\0' + char + (code === COMMA ? '' : '\0')
											}
										}
										format = 1
									} else {
										// within an isolated context, sleep untill it's terminated
										switch (code) {
											case OPENPARENTHESES: {
												// :globa<l>(
												if (pseudo + 7 === caret && tail === 108) {
													pseudo = 0
												}
												context = ++counter
												break
											}
											case CLOSEPARENTHESES: {
												if ((context = --counter) === 0) {
													format = 1
													char += '\0'
												}
												break
											}
										}
									}
									break
								}
								case TAB:
								case SPACE: {
									switch (tail) {
										case NULL:
										case OPENBRACES:
										case CLOSEBRACES:
										case SEMICOLON:
										case COMMA:
										case FORMFEED:
										case TAB:
										case SPACE:
										case NEWLINE:
										case CARRIAGE: {
											break
										}
										default: {
											// ignore in isolated contexts
											if (context === 0) {
												format = 1
												char += '\0'
											}
										}
									}
								}
							}
						}

						// concat buffer of characters
						chars += char

						// previous non-whitespace character code
						if (code !== SPACE && code !== TAB) {
							peak = code
						}
					}
				}
			}

			// tail character codes
			trail = tail
			tail = code

			// visit every character
			caret++
		}

		length = out.length

		// preserve empty selector
 		if (preserve > 0) {
 			if (length === 0 && children.length === 0 && (current[0].length === 0) === false) {
 				if (id !== MEDIA || (current.length === 1 && (cascade > 0 ? nscopealt : nscope) === current[0])) {
					length = current.join(',').length + 2
 				}
 			}
		}

		if (length > 0) {
			// cascade isolation mode?
			selector = cascade === 0 && id !== KEYFRAME ? isolate(current) : current

			// execute plugins, block context
			if (plugged > 0) {
				result = proxy(BLCKS, out, selector, parent, line, column, length, id, depth, id)

				if (result !== void 0 && (out = result).length === 0) {
					return flat + out + children
				}
			}

			out = selector.join(',') + '{' + out + '}'

			if (prefix*pattern !== 0) {
				if (prefix === 2 && !vendor(out, 2))
					pattern = 0

				switch (pattern) {
					// ::read-only
					case READONLY: {
						out = out.replace(readonlyptn, ':'+moz+'$1')+out
						break
					}
					// ::placeholder
					case PLACEHOLDER: {
						out = (
							out.replace(plcholdrptn, '::' + webkit + 'input-$1') +
							out.replace(plcholdrptn, '::' + moz + '$1') +
							out.replace(plcholdrptn, ':' + ms + 'input-$1') + out
						)
						break
					}
				}

				pattern = 0
			}
		}

		return flat + out + children
	}

	/**
	 * Select
	 *
	 * @param {Array<string>} parent
	 * @param {string} current
	 * @param {number} invert
	 * @return {Array<string>}
	 */
	function select (parent, current, invert) {
		var selectors = current.trim().split(selectorptn)
		var out = selectors

		var length = selectors.length
		var l = parent.length

		switch (l) {
			// 0-1 parent selectors
			case 0:
			case 1: {
				for (var i = 0, selector = l === 0 ? '' : parent[0] + ' '; i < length; ++i) {
					out[i] = scope(selector, out[i], invert, l).trim()
				}
				break
			}
			// >2 parent selectors, nested
			default: {
				for (var i = 0, j = 0, out = []; i < length; ++i) {
					for (var k = 0; k < l; ++k) {
						out[j++] = scope(parent[k] + ' ', selectors[i], invert, l).trim()
					}
				}
			}
		}

		return out
	}

	/**
	 * Scope
	 *
	 * @param {string} parent
	 * @param {string} current
	 * @param {number} invert
	 * @param {number} level
	 * @return {string}
	 */
	function scope (parent, current, invert, level) {
		var selector = current
		var code = selector.charCodeAt(0)

		// trim leading whitespace
		if (code < 33) {
			code = (selector = selector.trim()).charCodeAt(0)
		}

		switch (code) {
			// &
			case AND: {
				switch (cascade + level) {
					case 0:
					case 1: {
						if (parent.trim().length === 0) {
							break
						}
					}
					default: {
						return selector.replace(andptn, '$1'+parent.trim())
					}
				}
				break
			}
			// :
			case COLON: {
				switch (selector.charCodeAt(1)) {
					// g in :global
					case 103: {
						if (escape > 0 && cascade > 0) {
							return selector.replace(escapeptn, '$1').replace(andptn, '$1'+nscope)
						}
						break
					}
					default: {
						// :hover
						return parent.trim() + selector.replace(andptn, '$1'+parent.trim())
					}
				}
			}
			default: {
				// html &
				if (invert*cascade > 0 && selector.indexOf('\f') > 0) {
					return selector.replace(andptn, (parent.charCodeAt(0) === COLON ? '' : '$1')+parent.trim())
				}
			}
		}

		return parent + selector
	}

	/**
	 * Property
	 *
	 * @param {string} input
	 * @param {number} first
	 * @param {number} second
	 * @param {number} third
	 * @return {string}
	 */
	function property (input, first, second, third) {
		var index = 0
		var out = input + ';'
		var hash = (first*2) + (second*3) + (third*4)
		var cache

		// animation: a, n, i characters
		if (hash === 944) {
			return animation(out)
		} else if (prefix === 0 || (prefix === 2 && !vendor(out, 1))) {
			return out
		}

		// vendor prefix
		switch (hash) {
			// text-decoration/text-size-adjust/text-shadow/text-align/text-transform: t, e, x
			case 1015: {
				// text-shadow/text-align/text-transform, a
				return out.charCodeAt(10) === 97 ? webkit + out + out : out
			}
			// filter/fill f, i, l
			case 951: {
				// filter, t
				return out.charCodeAt(3) === 116 ? webkit + out + out : out
			}
			// color/column, c, o, l
			case 963: {
				// column, n
				return out.charCodeAt(5) === 110 ? webkit + out + out : out
			}
			// box-decoration-break, b, o, x
			case 1009: {
				if (out.charCodeAt(4) !== 100) {
					break
				}
			}
			// mask, m, a, s
			// clip-path, c, l, i
			case 969:
			case 942: {
				return webkit + out + out
			}
			// appearance: a, p, p
			case 978: {
				return webkit + out + moz + out + out
			}
			// hyphens: h, y, p
			// user-select: u, s, e
			case 1019:
			case 983: {
				return webkit + out + moz + out + ms + out + out
			}
			// background/backface-visibility, b, a, c
			case 883: {
				// backface-visibility, -
				if (out.charCodeAt(8) === DASH) {
					return webkit + out + out
				}

				// image-set(...)
				if (out.indexOf('image-set(', 11) > 0) {
					return out.replace(imgsrcptn, '$1'+webkit+'$2') + out
				}

				return out
			}
			// flex: f, l, e
			case 932: {
				if (out.charCodeAt(4) === DASH) {
					switch (out.charCodeAt(5)) {
						// flex-grow, g
						case 103: {
							return webkit + 'box-' + out.replace('-grow', '') + webkit + out + ms + out.replace('grow', 'positive') + out
						}
						// flex-shrink, s
						case 115: {
							return webkit + out + ms + out.replace('shrink', 'negative') + out
						}
						// flex-basis, b
						case 98: {
							return webkit + out + ms + out.replace('basis', 'preferred-size') + out
						}
					}
				}

				return webkit + out + ms + out + out
			}
			// order: o, r, d
			case 964: {
				return webkit + out + ms + 'flex' + '-' + out + out
			}
			// justify-items/justify-content, j, u, s
			case 1023: {
				// justify-content, c
				if (out.charCodeAt(8) !== 99) {
					break
				}

				cache = out.substring(out.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify')
				return webkit + 'box-pack' + cache + webkit + out + ms + 'flex-pack' + cache + out
			}
			// cursor, c, u, r
			case 1005: {
				return cursorptn.test(out) ? out.replace(colonptn, ':' + webkit) + out.replace(colonptn, ':' + moz) + out : out
			}
			// writing-mode, w, r, i
			case 1000: {
				cache = out.substring(13).trim()
				index = cache.indexOf('-') + 1

				switch (cache.charCodeAt(0)+cache.charCodeAt(index)) {
					// vertical-lr
					case 226: {
						cache = out.replace(writingptn, 'tb')
						break
					}
					// vertical-rl
					case 232: {
						cache = out.replace(writingptn, 'tb-rl')
						break
					}
					// horizontal-tb
					case 220: {
						cache = out.replace(writingptn, 'lr')
						break
					}
					default: {
						return out
					}
				}

				return webkit + out + ms + cache + out
			}
			// position: sticky
			case 1017: {
				if (out.indexOf('sticky', 9) === -1) {
					return out
				}
			}
			// display(flex/inline-flex/inline-box): d, i, s
			case 975: {
				index = (out = input).length - 10
				cache = (out.charCodeAt(index) === 33 ? out.substring(0, index) : out).substring(input.indexOf(':', 7) + 1).trim()

				switch (hash = cache.charCodeAt(0) + (cache.charCodeAt(7)|0)) {
					// inline-
					case 203: {
						// inline-box
						if (cache.charCodeAt(8) < 111) {
							break
						}
					}
					// inline-box/sticky
					case 115: {
						out = out.replace(cache, webkit+cache)+';'+out
						break
					}
					// inline-flex
					// flex
					case 207:
					case 102: {
						out = (
							out.replace(cache, webkit+(hash > 102 ? 'inline-' : '')+'box')+';'+
							out.replace(cache, webkit+cache)+';'+
							out.replace(cache, ms+cache+'box')+';'+
							out
						)
					}
				}

				return out + ';'
			}
			// align-items, align-center, align-self: a, l, i, -
			case 938: {
				if (out.charCodeAt(5) === DASH) {
					switch (out.charCodeAt(6)) {
						// align-items, i
						case 105: {
							cache = out.replace('-items', '')
							return webkit + out + webkit + 'box-' + cache + ms + 'flex-' + cache + out
						}
						// align-self, s
						case 115: {
							return webkit + out + ms + 'flex-item-' + out.replace(selfptn, '') + out
						}
						// align-content
						default: {
							return webkit + out + ms + 'flex-line-pack' + out.replace('align-content', '').replace(selfptn, '') + out
						}
					}
				}
				break
			}
			// min/max
			case 973:
			case 989: {
				// min-/max- height/width/block-size/inline-size
				if (out.charCodeAt(3) !== DASH || out.charCodeAt(4) === 122) {
					break
				}
			}
			// height/width: min-content / width: max-content
			case 931:
			case 953: {
				if (dimensionptn.test(input) === true) {
					// stretch
					if ((cache = input.substring(input.indexOf(':') + 1)).charCodeAt(0) === 115)
						return property(input.replace('stretch', 'fill-available'), first, second, third).replace(':fill-available', ':stretch')
					else
						return out.replace(cache, webkit + cache) + out.replace(cache, moz + cache.replace('fill-', '')) + out
				}
				break
			}
			// transform, transition: t, r, a
			case 962: {
				out = webkit + out + (out.charCodeAt(5) === 102 ? ms + out : '') + out

				// transitions
				if (second + third === 211 && out.charCodeAt(13) === 105 && out.indexOf('transform', 10) > 0) {
					return out.substring(0, out.indexOf(';', 27) + 1).replace(transformptn, '$1' + webkit + '$2') + out
				}

				break
			}
		}

		return out
	}

	/**
	 * Vendor
	 *
	 * @param {string} content
	 * @param {number} context
	 * @return {boolean}
	 */
	function vendor (content, context) {
		var index = content.indexOf(context === 1 ? ':' : '{')
		var key = content.substring(0, context !== 3 ? index : 10)
		var value = content.substring(index + 1, content.length - 1)

		return should(context !== 2 ? key : key.replace(pseudofmt, '$1'), value, context)
	}

	/**
	 * Supports
	 *
	 * @param {string} match
	 * @param {string} group
	 * @return {string}
	 */
	function supports (match, group) {
		var out = property(group, group.charCodeAt(0), group.charCodeAt(1), group.charCodeAt(2))

		return out !== group+';' ? out.replace(propertyptn, ' or ($1)').substring(4) : '('+group+')'
	}

	/**
	 * Animation
	 *
	 * @param {string} input
	 * @return {string}
	 */
	function animation (input) {
		var length = input.length
		var index = input.indexOf(':', 9) + 1
		var declare = input.substring(0, index).trim()
		var out = input.substring(index, length-1).trim()

		switch (input.charCodeAt(9)*keyed) {
			case 0: {
				break
			}
			// animation-*, -
			case DASH: {
				// animation-name, n
				if (input.charCodeAt(10) !== 110) {
					break
				}
			}
			// animation/animation-name
			default: {
				// split in case of multiple animations
				var list = out.split((out = '', animationptn))

				for (var i = 0, index = 0, length = list.length; i < length; index = 0, ++i) {
					var value = list[i]
					var items = value.split(propertiesptn)

					while (value = items[index]) {
						var peak = value.charCodeAt(0)

						if (keyed === 1 && (
							// letters
							(peak > AT && peak < 90) || (peak > 96 && peak < 123) || peak === UNDERSCORE ||
							// dash but not in sequence i.e --
							(peak === DASH && value.charCodeAt(1) !== DASH)
						)) {
							// not a number/function
							switch (isNaN(parseFloat(value)) + (value.indexOf('(') !== -1)) {
								case 1: {
									switch (value) {
										// not a valid reserved keyword
										case 'infinite': case 'alternate': case 'backwards': case 'running':
										case 'normal': case 'forwards': case 'both': case 'none': case 'linear':
										case 'ease': case 'ease-in': case 'ease-out': case 'ease-in-out':
										case 'paused': case 'reverse': case 'alternate-reverse': case 'inherit':
										case 'initial': case 'unset': case 'step-start': case 'step-end': {
											break
										}
										default: {
											value += key
										}
									}
								}
							}
						}

						items[index++] = value
					}

					out += (i === 0 ? '' : ',') + items.join(' ')
				}
			}
		}

		out = declare + out + ';'

		if (prefix === 1 || (prefix === 2 && vendor(out, 1)))
			return webkit + out + out

		return out
	}

	/**
	 * Isolate
	 *
	 * @param {Array<string>} current
	 */
	function isolate (current) {
		for (var i = 0, length = current.length, selector = Array(length), padding, element; i < length; ++i) {
			// split individual elements in a selector i.e h1 h2 === [h1, h2]
			var elements = current[i].split(elementptn)
			var out = ''

			for (var j = 0, size = 0, tail = 0, code = 0, l = elements.length; j < l; ++j) {
				// empty element
				if ((size = (element = elements[j]).length) === 0 && l > 1) {
					continue
				}

				tail = out.charCodeAt(out.length-1)
				code = element.charCodeAt(0)
				padding = ''

				if (j !== 0) {
					// determine if we need padding
					switch (tail) {
						case STAR:
						case TILDE:
						case GREATERTHAN:
						case PLUS:
						case SPACE:
						case OPENPARENTHESES:  {
							break
						}
						default: {
							padding = ' '
						}
					}
				}

				switch (code) {
					case AND: {
						element = padding + nscopealt
					}
					case TILDE:
					case GREATERTHAN:
					case PLUS:
					case SPACE:
					case CLOSEPARENTHESES:
					case OPENPARENTHESES: {
						break
					}
					case OPENBRACKET: {
						element = padding + element + nscopealt
						break
					}
					case COLON: {
						switch (element.charCodeAt(1)*2 + element.charCodeAt(2)*3) {
							// :global
							case 530: {
								if (escape > 0) {
									element = padding + element.substring(8, size - 1)
									break
								}
							}
							// :hover, :nth-child(), ...
							default: {
								if (j < 1 || elements[j-1].length < 1) {
									element = padding + nscopealt + element
								}
							}
						}
						break
					}
					case COMMA: {
						padding = ''
					}
					default: {
						if (size > 1 && element.indexOf(':') > 0) {
							element = padding + element.replace(pseudoptn, '$1' + nscopealt + '$2')
						} else {
							element = padding + element + nscopealt
						}
					}
				}

				out += element
			}

			selector[i] = out.replace(formatptn, '').trim()
		}

		return selector
	}

	/**
	 * Proxy
	 *
	 * @param {number} context
	 * @param {string} content
	 * @param {Array<string>} selectors
	 * @param {Array<string>} parents
	 * @param {number} line
	 * @param {number} column
	 * @param {number} length
	 * @param {number} id
	 * @param {number} depth
	 * @param {number} at
	 * @return {(string|void|*)}
	 */
	function proxy (context, content, selectors, parents, line, column, length, id, depth, at) {
		for (var i = 0, out = content, next; i < plugged; ++i) {
			switch (next = plugins[i].call(stylis, context, out, selectors, parents, line, column, length, id, depth, at)) {
				case void 0:
				case false:
				case true:
				case null: {
					break
				}
				default: {
					out = next
				}
			}
		}
		if (out !== content) {
		  return out
		}
	}

	/**
	 * @param {number} code
	 * @param {number} index
	 * @param {number} length
	 * @param {string} body
	 * @return {number}
	 */
	function delimited (code, index, length, body) {
		for (var i = index + 1; i < length; ++i) {
			switch (body.charCodeAt(i)) {
				// /*
				case FOWARDSLASH: {
					if (code === STAR) {
						if (body.charCodeAt(i - 1) === STAR &&  index + 2 !== i) {
							return i + 1
						}
					}
					break
				}
				// //
				case NEWLINE: {
					if (code === FOWARDSLASH) {
						return i + 1
					}
				}
			}
		}

		return i
	}

	/**
	 * @param {number} type
	 * @param {number} index
	 * @param {number} length
	 * @param {number} find
	 * @param {string} body
	 * @return {number}
	 */
	function match (type, index, length, body) {
		for (var i = index + 1; i < length; ++i) {
			switch (body.charCodeAt(i)) {
				case type: {
					return i
				}
			}
		}

		return i
	}

	/**
	 * Minify
	 *
	 * @param {(string|*)} output
	 * @return {string}
	 */
	function minify (output) {
		return output
			.replace(formatptn, '')
			.replace(beforeptn, '')
			.replace(afterptn, '$1')
			.replace(tailptn, '$1')
			.replace(whiteptn, ' ')
	}

	/**
	 * Use
	 *
	 * @param {(Array<function(...?)>|function(...?)|number|void)?} plugin
	 */
	function use (plugin) {
		switch (plugin) {
			case void 0:
			case null: {
				plugged = plugins.length = 0
				break
			}
			default: {
				if (typeof plugin === 'function') {
					plugins[plugged++] = plugin
				}	else if (typeof plugin === 'object') {
					for (var i = 0, length = plugin.length; i < length; ++i) {
						use(plugin[i])
					}
				} else {
					unkwn = !!plugin|0
				}
			}
 		}

 		return use
	}

	/**
	 * Set
	 *
	 * @param {*} options
	 */
	function set (options) {
		for (var name in options) {
			var value = options[name]
			switch (name) {
				case 'keyframe': keyed = value|0; break
				case 'global': escape = value|0; break
				case 'cascade': cascade = value|0; break
				case 'compress': compress = value|0; break
				case 'semicolon': semicolon = value|0; break
				case 'preserve': preserve = value|0; break
				case 'prefix':
					should = null

					if (!value) {
						prefix = 0
					} else if (typeof value !== 'function') {
						prefix = 1
					} else {
						prefix = 2
						should = value
					}
			}
		}

		return set
	}

	/**
	 * Stylis
	 *
	 * @param {string} selector
	 * @param {string} input
	 * @return {*}
	 */
	function stylis (selector, input) {
		if (this !== void 0 && this.constructor === stylis) {
			return factory(selector)
		}

		// setup
		var ns = selector
		var code = ns.charCodeAt(0)

		// trim leading whitespace
		if (code < 33) {
			code = (ns = ns.trim()).charCodeAt(0)
		}

		// keyframe/animation namespace
		if (keyed > 0) {
			key = ns.replace(invalidptn, code === OPENBRACKET ? '' : '-')
		}

		// reset, used to assert if a plugin is moneky-patching the return value
		code = 1

		// cascade/isolate
		if (cascade === 1) {
			nscope = ns
		} else {
			nscopealt = ns
		}

		var selectors = [nscope]
		var result

		// execute plugins, pre-process context
		if (plugged > 0) {
			result = proxy(PREPS, input, selectors, selectors, line, column, 0, 0, 0, 0)

			if (result !== void 0 && typeof result === 'string') {
				input = result
			}
		}

		// build
		var output = compile(array, selectors, input, 0, 0)

		// execute plugins, post-process context
		if (plugged > 0) {
			result = proxy(POSTS, output, selectors, selectors, line, column, output.length, 0, 0, 0)

			// bypass minification
			if (result !== void 0 && typeof(output = result) !== 'string') {
				code = 0
			}
		}

		// reset
		key = ''
		nscope = ''
		nscopealt = ''
		pattern = 0
		line = 1
		column = 1

		return compress*code === 0 ? output : minify(output)
	}

	stylis['use'] = use
	stylis['set'] = set

	if (options !== void 0) {
		set(options)
	}

	return stylis
}));


/***/ }),
/* 1388 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(global, module) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ponyfill_js__ = __webpack_require__(1389);
/* global window */


var root;

if (typeof self !== 'undefined') {
  root = self;
} else if (typeof window !== 'undefined') {
  root = window;
} else if (typeof global !== 'undefined') {
  root = global;
} else if (true) {
  root = module;
} else {
  root = Function('return this')();
}

var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__ponyfill_js__["a" /* default */])(root);
/* harmony default export */ __webpack_exports__["a"] = (result);

/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(51), __webpack_require__(383)(module)))

/***/ }),
/* 1389 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = symbolObservablePonyfill;
function symbolObservablePonyfill(root) {
	var result;
	var Symbol = root.Symbol;

	if (typeof Symbol === 'function') {
		if (Symbol.observable) {
			result = Symbol.observable;
		} else {
			result = Symbol('observable');
			Symbol.observable = result;
		}
	} else {
		result = '@@observable';
	}

	return result;
};


/***/ }),
/* 1390 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
            (typeof self !== "undefined" && self) ||
            window;
var apply = Function.prototype.apply;

// DOM APIs, for completeness

exports.setTimeout = function() {
  return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
};
exports.setInterval = function() {
  return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) {
  if (timeout) {
    timeout.close();
  }
};

function Timeout(id, clearFn) {
  this._id = id;
  this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
  this._clearFn.call(scope, this._id);
};

// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
  clearTimeout(item._idleTimeoutId);
  item._idleTimeout = msecs;
};

exports.unenroll = function(item) {
  clearTimeout(item._idleTimeoutId);
  item._idleTimeout = -1;
};

exports._unrefActive = exports.active = function(item) {
  clearTimeout(item._idleTimeoutId);

  var msecs = item._idleTimeout;
  if (msecs >= 0) {
    item._idleTimeoutId = setTimeout(function onTimeout() {
      if (item._onTimeout)
        item._onTimeout();
    }, msecs);
  }
};

// setimmediate attaches itself to the global object
__webpack_require__(1382);
// On some exotic environments, it's not clear which object `setimmediate` was
// able to install onto.  Search each possibility in the same order as the
// `setimmediate` library.
exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
                       (typeof global !== "undefined" && global.setImmediate) ||
                       (this && this.setImmediate);
exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
                         (typeof global !== "undefined" && global.clearImmediate) ||
                         (this && this.clearImmediate);

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1391 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "AG_MasterBrandmark_strip_v1__43feb94afbecac28bbd6685efddc0152.png";

/***/ }),
/* 1392 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

function valueEqual(a, b) {
  if (a === b) return true;

  if (a == null || b == null) return false;

  if (Array.isArray(a)) {
    return Array.isArray(b) && a.length === b.length && a.every(function (item, index) {
      return valueEqual(item, b[index]);
    });
  }

  var aType = typeof a === 'undefined' ? 'undefined' : _typeof(a);
  var bType = typeof b === 'undefined' ? 'undefined' : _typeof(b);

  if (aType !== bType) return false;

  if (aType === 'object') {
    var aValue = a.valueOf();
    var bValue = b.valueOf();

    if (aValue !== a || bValue !== b) return valueEqual(aValue, bValue);

    var aKeys = Object.keys(a);
    var bKeys = Object.keys(b);

    if (aKeys.length !== bKeys.length) return false;

    return aKeys.every(function (key) {
      return valueEqual(a[key], b[key]);
    });
  }

  return false;
}

/* harmony default export */ __webpack_exports__["a"] = (valueEqual);

/***/ }),
/* 1393 */
/***/ (function(module, exports) {

module.exports = function(module) {
	if(!module.webpackPolyfill) {
		module.deprecate = function() {};
		module.paths = [];
		// module.parent = undefined by default
		if(!module.children) module.children = [];
		Object.defineProperty(module, "loaded", {
			enumerable: true,
			get: function() {
				return module.l;
			}
		});
		Object.defineProperty(module, "id", {
			enumerable: true,
			get: function() {
				return module.i;
			}
		});
		module.webpackPolyfill = 1;
	}
	return module;
};


/***/ }),
/* 1394 */
/***/ (function(module, exports, __webpack_require__) {

/* WEBPACK VAR INJECTION */(function(global) {var win;

if (typeof window !== "undefined") {
    win = window;
} else if (typeof global !== "undefined") {
    win = global;
} else if (typeof self !== "undefined"){
    win = self;
} else {
    win = {};
}

module.exports = win;

/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(51)))

/***/ }),
/* 1395 */
/***/ (function(module, exports) {

module.exports = once

once.proto = once(function () {
  Object.defineProperty(Function.prototype, 'once', {
    value: function () {
      return once(this)
    },
    configurable: true
  })
})

function once (fn) {
  var called = false
  return function () {
    if (called) return
    called = true
    return fn.apply(this, arguments)
  }
}


/***/ }),
/* 1396 */
/***/ (function(module, exports, __webpack_require__) {

__webpack_require__(384);
module.exports = __webpack_require__(385);


/***/ })
/******/ ]);;
