@lingk/sync 0.1.80 → 0.1.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.js CHANGED
@@ -355,7 +355,7 @@ module.exports =
355
355
  joinKeyResourceName = rsc.joinKeyResource;
356
356
 
357
357
  // joinKeyName coming from field on this resource
358
- if (rsc.resourceLabel === rsc.joinKeyResource) {
358
+ if (rsc.resourceName === rsc.joinKeyResource) {
359
359
  var joinKeyResource = dataSourceMetadata.find(function (r) {
360
360
  return r.type === rsc.joinKeyResource;
361
361
  });
@@ -400,9 +400,7 @@ module.exports =
400
400
  joinType: rsc.joinType || 'LEFT JOIN'
401
401
  }, rscResource.parentRef && { parentRef: rscResource.parentRef }, rsc.parameterFilters && { parameterFilters: rsc.parameterFilters }, {
402
402
  level: rsc.level || (rscIndex === 0 ? 0 : 1)
403
- }, primaryKeyResourceName && {
404
- parentNameAndProvider: primaryKeyResourceName + '_' + resourceProvider
405
- }));
403
+ }, rsc.parentNameAndProvider && { parentNameAndProvider: rsc.parentNameAndProvider }));
406
404
  }
407
405
  }); // end bundle.resource.forEach
408
406
 
@@ -801,7 +799,7 @@ module.exports =
801
799
  isSelected = selectedValues && selectedValues.length > 0 && selectedValues.some(function (rsc) {
802
800
  return rsc[fieldPropLabel] === entity[fieldPropLabel] && (!(parents && rsc.parents) || JSON.stringify(rsc.parents) === JSON.stringify(parents)) && (!rsc.section || sectionLabel === rsc.section);
803
801
  });
804
-
802
+ //console.log(entity.name)
805
803
  sectionValues.push(Object.assign({}, entity, {
806
804
  title: title,
807
805
  section: sectionLabel,
@@ -819,11 +817,11 @@ module.exports =
819
817
  return sectionValues;
820
818
  }.bind(this);
821
819
 
822
- var vals = [].concat(_toConsumableArray(values));
820
+ var vals = values && [].concat(_toConsumableArray(values));
823
821
  if (sectionLabels) {
824
822
  var v = [];
825
823
  sectionLabels.forEach(function (s, i) {
826
- if (values[i] && values[i].length > 0) {
824
+ if (values && values[i] && values[i].length > 0) {
827
825
  (function () {
828
826
  v = v.concat(sectionLabels[i]);
829
827
  var sectionValues = [];
@@ -838,7 +836,7 @@ module.exports =
838
836
  } else {
839
837
  (function () {
840
838
  var sectionValues = [];
841
- values.forEach(function (entity) {
839
+ values && values.forEach(function (entity) {
842
840
  iterator(sectionValues, entity, '', 0, []);
843
841
  });
844
842
  vals = sectionValues;
@@ -1529,7 +1527,7 @@ module.exports =
1529
1527
  } else {
1530
1528
  // By explicitly using `prop-types` you are opting into new production behavior.
1531
1529
  // http://fb.me/prop-types-in-prod
1532
- module.exports = __webpack_require__(177)();
1530
+ module.exports = __webpack_require__(178)();
1533
1531
  }
1534
1532
 
1535
1533
 
@@ -1551,11 +1549,11 @@ module.exports =
1551
1549
 
1552
1550
  var _propTypes2 = _interopRequireDefault(_propTypes);
1553
1551
 
1554
- var _TransitionGroup = __webpack_require__(205);
1552
+ var _TransitionGroup = __webpack_require__(206);
1555
1553
 
1556
1554
  var _TransitionGroup2 = _interopRequireDefault(_TransitionGroup);
1557
1555
 
1558
- var _CSSTransitionGroupChild = __webpack_require__(204);
1556
+ var _CSSTransitionGroupChild = __webpack_require__(205);
1559
1557
 
1560
1558
  var _CSSTransitionGroupChild2 = _interopRequireDefault(_CSSTransitionGroupChild);
1561
1559
 
@@ -5104,6 +5102,7 @@ module.exports =
5104
5102
  value: true
5105
5103
  });
5106
5104
  exports.callGetMetadata = callGetMetadata;
5105
+ exports.setCsvFields = setCsvFields;
5107
5106
  exports.tryCheckConnection = tryCheckConnection;
5108
5107
  exports.callGetProviderMetadata = callGetProviderMetadata;
5109
5108
  exports.getOauthUrl = getOauthUrl;
@@ -5192,6 +5191,13 @@ module.exports =
5192
5191
  };
5193
5192
  }
5194
5193
 
5194
+ function setCsvFields(metadata, mode, providerType) {
5195
+ return {
5196
+ type: types.FINISH_WIZARD_ENV_CHECK,
5197
+ data: { metadata: metadata, mode: mode, code: '200 OK', providerType: providerType }
5198
+ };
5199
+ }
5200
+
5195
5201
  // "fake" credentials for demo purposes
5196
5202
  function isDemoCreds(creds, providerType) {
5197
5203
  if (creds && providerType) {
@@ -5442,10 +5448,9 @@ module.exports =
5442
5448
  return api.post(tenantId + '/' + appId + '/bundle', {
5443
5449
  endpoint: config.TRANS_API_URL,
5444
5450
  data: data
5445
- }).then(function (res) {
5446
- return res;
5447
5451
  }).catch(function (err) {
5448
5452
  onGenerationError('There was an error in your Object Mapping. Please contact Lingk Support');
5453
+ return Promise.reject(err);
5449
5454
  });
5450
5455
  };
5451
5456
  }
@@ -5459,10 +5464,9 @@ module.exports =
5459
5464
  return api.post(tenantId + '/' + appId + '/schemamappings', {
5460
5465
  endpoint: config.TRANS_API_URL,
5461
5466
  data: data
5462
- }).then(function (res) {
5463
- return res;
5464
5467
  }).catch(function (err) {
5465
5468
  onGenerationError('There was an error in your Field Mapping. Please contact Lingk Support');
5469
+ return Promise.reject(err);
5466
5470
  });
5467
5471
  };
5468
5472
  }
@@ -5482,10 +5486,9 @@ module.exports =
5482
5486
  return api.post(tenantId + '/' + appId + '/productizedintegrations', {
5483
5487
  endpoint: config.TRANS_API_URL,
5484
5488
  data: data
5485
- }).then(function (pi) {
5486
- return pi;
5487
5489
  }).catch(function (err) {
5488
5490
  onGenerationError('There was an error creating your Integration. Please contact Lingk Support');
5491
+ return Promise.reject(err);
5489
5492
  });
5490
5493
  };
5491
5494
  }
@@ -5505,10 +5508,9 @@ module.exports =
5505
5508
  return api.put(tenantId + '/' + appId + '/productizedintegrations/' + piGuid, {
5506
5509
  endpoint: config.TRANS_API_URL,
5507
5510
  data: data
5508
- }).then(function (pi) {
5509
- return pi;
5510
5511
  }).catch(function (err) {
5511
5512
  onGenerationError('There was an error updating your Integration. Please contact Lingk Support');
5513
+ return Promise.reject(err);
5512
5514
  });
5513
5515
  };
5514
5516
  }
@@ -5530,10 +5532,9 @@ module.exports =
5530
5532
  "isManagedPackage": isManagedPackage,
5531
5533
  "environment": envName
5532
5534
  }
5533
- }).then(function (res) {
5534
- return res;
5535
5535
  }).catch(function (err) {
5536
5536
  onGenerationError('There was an error generating the Integration. Please contact Lingk Support');
5537
+ return Promise.reject(err);
5537
5538
  });
5538
5539
  };
5539
5540
  }
@@ -6863,16 +6864,22 @@ module.exports =
6863
6864
 
6864
6865
  var _reduxForm = __webpack_require__(2);
6865
6866
 
6866
- var _reactDropzone = __webpack_require__(202);
6867
+ var _reactDropzone = __webpack_require__(203);
6867
6868
 
6868
6869
  var _reactDropzone2 = _interopRequireDefault(_reactDropzone);
6869
6870
 
6871
+ var _papaparse = __webpack_require__(177);
6872
+
6873
+ var _papaparse2 = _interopRequireDefault(_papaparse);
6874
+
6870
6875
  var _clipboard = __webpack_require__(122);
6871
6876
 
6872
6877
  var _clipboard2 = _interopRequireDefault(_clipboard);
6873
6878
 
6874
6879
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6875
6880
 
6881
+ 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); } }
6882
+
6876
6883
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6877
6884
 
6878
6885
  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; }
@@ -6892,23 +6899,10 @@ module.exports =
6892
6899
  checking = props.checking,
6893
6900
  generateNewAdapterSecret = props.generateNewAdapterSecret,
6894
6901
  tenantKey = props.tenantKey,
6895
- accountKey = props.accountKey;
6902
+ accountKey = props.accountKey,
6903
+ setCsvFields = props.setCsvFields;
6896
6904
 
6897
6905
 
6898
- if (config.skipEnvStep) return _react2.default.createElement(
6899
- 'div',
6900
- { className: 'env-section-body', style: { paddingBottom: 11 } },
6901
- wizard[mode + 'Metadata'] ? _react2.default.createElement(
6902
- 'span',
6903
- null,
6904
- 'Your Salesforce Org is connected. Click Inspect to explore your available Salesforce resources.'
6905
- ) : _react2.default.createElement(
6906
- 'span',
6907
- null,
6908
- 'Your Salesforce Org is not connected. Please revoke all Oauth grants and reauthorize this managed package.'
6909
- )
6910
- );
6911
-
6912
6906
  var Button = inputs.Button;
6913
6907
  var Spinner = inputs.Spinner;
6914
6908
 
@@ -6960,7 +6954,7 @@ module.exports =
6960
6954
  return getOauthUrl(urlType, mode);
6961
6955
  },
6962
6956
  mode: mode, inputs: inputs, checking: checking }) : isSFTP ? _react2.default.createElement(SFTP, { step: step, wizard: wizard, onCheck: check,
6963
- mode: mode, checking: checking }) : _react2.default.createElement(
6957
+ mode: mode, checking: checking, setCsvFields: setCsvFields }) : _react2.default.createElement(
6964
6958
  'div',
6965
6959
  null,
6966
6960
  _react2.default.createElement(
@@ -7051,6 +7045,9 @@ module.exports =
7051
7045
  var SFTP = function (_Component) {
7052
7046
  _inherits(SFTP, _Component);
7053
7047
 
7048
+ // react-dropzone
7049
+ // papaparse
7050
+
7054
7051
  function SFTP() {
7055
7052
  _classCallCheck(this, SFTP);
7056
7053
 
@@ -7064,9 +7061,42 @@ module.exports =
7064
7061
 
7065
7062
  _createClass(SFTP, [{
7066
7063
  key: 'onDrop',
7067
- value: function onDrop(files) {
7068
- console.log(files);
7069
- this.setState({ files: files });
7064
+ value: function onDrop(fs) {
7065
+ var _this2 = this;
7066
+
7067
+ var _props = this.props,
7068
+ setCsvFields = _props.setCsvFields,
7069
+ mode = _props.mode,
7070
+ step = _props.step,
7071
+ wizard = _props.wizard;
7072
+
7073
+ var m = wizard[mode + 'Metadata'] || [];
7074
+ var files = [].concat(_toConsumableArray(this.state.files));
7075
+ var counter = 0;
7076
+ fs.forEach(function (file) {
7077
+ _papaparse2.default.parse(file, {
7078
+ header: true,
7079
+ complete: function complete(result) {
7080
+ m = m.concat({
7081
+ name: file.name.split('.')[0],
7082
+ type: file.name.split('.')[0],
7083
+ properties: result.meta.fields.map(function (f) {
7084
+ return {
7085
+ label: f,
7086
+ name: f,
7087
+ type: 'string'
7088
+ };
7089
+ })
7090
+ });
7091
+ files = files.concat(file);
7092
+ counter += 1;
7093
+ if (counter === fs.length) {
7094
+ _this2.setState({ files: files });
7095
+ setCsvFields(m, mode, step[mode + 'Provider']);
7096
+ }
7097
+ }
7098
+ });
7099
+ });
7070
7100
  }
7071
7101
  }, {
7072
7102
  key: 'render',
@@ -7091,9 +7121,9 @@ module.exports =
7091
7121
  )
7092
7122
  )
7093
7123
  ),
7094
- _react2.default.createElement(
7124
+ files && files.length > 0 && _react2.default.createElement(
7095
7125
  'aside',
7096
- { style: { marginLeft: 30 } },
7126
+ { style: { marginLeft: 30, display: 'inline-block' } },
7097
7127
  _react2.default.createElement(
7098
7128
  'h3',
7099
7129
  { style: { marginTop: 10 } },
@@ -7102,10 +7132,10 @@ module.exports =
7102
7132
  _react2.default.createElement(
7103
7133
  'ul',
7104
7134
  null,
7105
- files.map(function (f) {
7135
+ files.map(function (f, i) {
7106
7136
  return _react2.default.createElement(
7107
7137
  'li',
7108
- { key: f.name },
7138
+ { key: i },
7109
7139
  f.name,
7110
7140
  ' - ',
7111
7141
  f.size,
@@ -7254,42 +7284,42 @@ module.exports =
7254
7284
  function AdapterSecret() {
7255
7285
  _classCallCheck(this, AdapterSecret);
7256
7286
 
7257
- var _this2 = _possibleConstructorReturn(this, (AdapterSecret.__proto__ || Object.getPrototypeOf(AdapterSecret)).call(this));
7287
+ var _this3 = _possibleConstructorReturn(this, (AdapterSecret.__proto__ || Object.getPrototypeOf(AdapterSecret)).call(this));
7258
7288
 
7259
- _this2.copy = function () {
7260
- var _this2$props = _this2.props,
7261
- wizard = _this2$props.wizard,
7262
- mode = _this2$props.mode;
7289
+ _this3.copy = function () {
7290
+ var _this3$props = _this3.props,
7291
+ wizard = _this3$props.wizard,
7292
+ mode = _this3$props.mode;
7263
7293
 
7264
7294
  var secret = wizard.savedCredentials && wizard.savedCredentials[mode + 'AdapterSecret'];
7265
7295
  _clipboard2.default.copy({
7266
7296
  'text/plain': secret.credentials
7267
7297
  });
7268
- _this2.setState({ secretCopied: true });
7298
+ _this3.setState({ secretCopied: true });
7269
7299
  setTimeout(function () {
7270
- _this2.setState({ secretCopied: false });
7300
+ _this3.setState({ secretCopied: false });
7271
7301
  }, 4000);
7272
7302
  };
7273
7303
 
7274
- _this2.state = {
7304
+ _this3.state = {
7275
7305
  generating: false,
7276
7306
  secretCopied: false
7277
7307
  };
7278
- return _this2;
7308
+ return _this3;
7279
7309
  }
7280
7310
 
7281
7311
  _createClass(AdapterSecret, [{
7282
7312
  key: 'render',
7283
7313
  value: function render() {
7284
- var _this3 = this;
7314
+ var _this4 = this;
7285
7315
 
7286
- var _props = this.props,
7287
- wizard = _props.wizard,
7288
- mode = _props.mode,
7289
- inputs = _props.inputs,
7290
- generateNewAdapterSecret = _props.generateNewAdapterSecret,
7291
- tenantKey = _props.tenantKey,
7292
- accountKey = _props.accountKey;
7316
+ var _props2 = this.props,
7317
+ wizard = _props2.wizard,
7318
+ mode = _props2.mode,
7319
+ inputs = _props2.inputs,
7320
+ generateNewAdapterSecret = _props2.generateNewAdapterSecret,
7321
+ tenantKey = _props2.tenantKey,
7322
+ accountKey = _props2.accountKey;
7293
7323
 
7294
7324
  var secret = wizard.savedCredentials && wizard.savedCredentials[mode + 'AdapterSecret'];
7295
7325
  var Button = inputs.Button;
@@ -7357,7 +7387,7 @@ module.exports =
7357
7387
  icon: 'sync',
7358
7388
  iconAlign: 'left',
7359
7389
  onClick: function onClick() {
7360
- _this3.setState({ generating: true });
7390
+ _this4.setState({ generating: true });
7361
7391
  generateNewAdapterSecret(mode);
7362
7392
  },
7363
7393
  style: { margin: '0 8px', marginBottom: 2, height: 30, lineHeight: '10px' } },
@@ -7378,12 +7408,12 @@ module.exports =
7378
7408
  function CustomSalesforceSettings() {
7379
7409
  _classCallCheck(this, CustomSalesforceSettings);
7380
7410
 
7381
- var _this4 = _possibleConstructorReturn(this, (CustomSalesforceSettings.__proto__ || Object.getPrototypeOf(CustomSalesforceSettings)).call(this));
7411
+ var _this5 = _possibleConstructorReturn(this, (CustomSalesforceSettings.__proto__ || Object.getPrototypeOf(CustomSalesforceSettings)).call(this));
7382
7412
 
7383
- _this4.state = {
7413
+ _this5.state = {
7384
7414
  custom: false
7385
7415
  };
7386
- return _this4;
7416
+ return _this5;
7387
7417
  }
7388
7418
 
7389
7419
  _createClass(CustomSalesforceSettings, [{
@@ -7398,7 +7428,7 @@ module.exports =
7398
7428
  }, {
7399
7429
  key: 'render',
7400
7430
  value: function render() {
7401
- var _this5 = this;
7431
+ var _this6 = this;
7402
7432
 
7403
7433
  var inputs = this.props.inputs;
7404
7434
  var Radio = inputs.Radio;
@@ -7414,7 +7444,7 @@ module.exports =
7414
7444
  ),
7415
7445
  _react2.default.createElement('br', null),
7416
7446
  _react2.default.createElement(Radio, { onChange: function onChange() {
7417
- return _this5.setState({ custom: false });
7447
+ return _this6.setState({ custom: false });
7418
7448
  },
7419
7449
  label: 'Default Batch Size (10,000)',
7420
7450
  checked: this.state.custom === false,
@@ -7422,7 +7452,7 @@ module.exports =
7422
7452
  }),
7423
7453
  _react2.default.createElement('br', null),
7424
7454
  _react2.default.createElement(Radio, { onChange: function onChange() {
7425
- return _this5.setState({ custom: true });
7455
+ return _this6.setState({ custom: true });
7426
7456
  },
7427
7457
  label: 'Custom Batch Size',
7428
7458
  checked: this.state.custom === true,
@@ -8941,7 +8971,8 @@ module.exports =
8941
8971
  fieldPropLabel: 'label',
8942
8972
  selectedValues: [{
8943
8973
  label: rsc.primaryKeyName,
8944
- parents: rsc.primaryKeyParents
8974
+ parents: rsc.primaryKeyParents,
8975
+ section: rsc.primaryKeyResource
8945
8976
  }],
8946
8977
  sectionLabelSuffix: 'Fields'
8947
8978
  })
@@ -9904,11 +9935,11 @@ module.exports =
9904
9935
 
9905
9936
  var _moment2 = _interopRequireDefault(_moment);
9906
9937
 
9907
- __webpack_require__(213);
9938
+ __webpack_require__(214);
9908
9939
 
9909
9940
  __webpack_require__(172);
9910
9941
 
9911
- var _rcTimePicker = __webpack_require__(193);
9942
+ var _rcTimePicker = __webpack_require__(194);
9912
9943
 
9913
9944
  var _rcTimePicker2 = _interopRequireDefault(_rcTimePicker);
9914
9945
 
@@ -10399,9 +10430,13 @@ module.exports =
10399
10430
  formValues = _props8.formValues;
10400
10431
 
10401
10432
  var envName = formValues['environment'];
10402
- console.log('gen gen', mode);
10403
10433
  actions.generateNewAdapterSecret(tenantId, accountId, envName, mode);
10404
10434
  }
10435
+ }, {
10436
+ key: 'setCsvFields',
10437
+ value: function setCsvFields(metadata, mode, providerType) {
10438
+ this.props.actions.setCsvFields(metadata, mode, providerType);
10439
+ }
10405
10440
  }, {
10406
10441
  key: 'render',
10407
10442
  value: function render() {
@@ -10571,7 +10606,8 @@ module.exports =
10571
10606
  generateNewAdapterSecret: _this5.generateNewAdapterSecret.bind(_this5),
10572
10607
  clickDirection: _this5.clickDirection.bind(_this5),
10573
10608
  seeFields: _this5.seeFields.bind(_this5), check: _this5.check,
10574
- tenantKey: tenantKey, accountKey: accountKey })
10609
+ tenantKey: tenantKey, accountKey: accountKey,
10610
+ setCsvFields: _this5.setCsvFields.bind(_this5) })
10575
10611
  )
10576
10612
  )
10577
10613
  );
@@ -12406,6 +12442,8 @@ module.exports =
12406
12442
  _createClass(SchemaStep, [{
12407
12443
  key: 'componentDidMount',
12408
12444
  value: function componentDidMount() {
12445
+ var _this2 = this;
12446
+
12409
12447
  var _props = this.props,
12410
12448
  step = _props.step,
12411
12449
  wizard = _props.wizard,
@@ -12417,6 +12455,12 @@ module.exports =
12417
12455
  if (!wizard.dataLoaded) {
12418
12456
  (0, _loadData2.default)(step, wizard, change, formValues, actions, isReverse);
12419
12457
  }
12458
+ if (formValues['resourceGroups']) {
12459
+ var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
12460
+ resourceGroups && resourceGroups.forEach(function (rg, i) {
12461
+ _this2.assignAllParents(i);
12462
+ });
12463
+ }
12420
12464
  }
12421
12465
  }, {
12422
12466
  key: 'openConnectionModal',
@@ -12637,6 +12681,8 @@ module.exports =
12637
12681
  break;
12638
12682
  }
12639
12683
  }
12684
+ console.log(eachR.parentNameAndProvider);
12685
+ //console.log(`${newParent}_${newParentProvider}`.toLowerCase())
12640
12686
  if (newParent && newParentProvider && (newParent + '_' + newParentProvider).toLowerCase() !== (eachR.parentNameAndProvider && eachR.parentNameAndProvider.toLowerCase())) {
12641
12687
  eachR.primaryKeyResource = newParent;
12642
12688
  eachR.parentNameAndProvider = newParent + '_' + newParentProvider;
@@ -12714,7 +12760,7 @@ module.exports =
12714
12760
  }, {
12715
12761
  key: 'render',
12716
12762
  value: function render() {
12717
- var _this2 = this;
12763
+ var _this3 = this;
12718
12764
 
12719
12765
  var _props14 = this.props,
12720
12766
  inputs = _props14.inputs,
@@ -12804,7 +12850,7 @@ module.exports =
12804
12850
  bundleIndex: this.state.selectedBundleIndex,
12805
12851
  sourceSchema: sourceSchema, destinationSchema: destinationSchema,
12806
12852
  update: function update() {
12807
- return _this2.forceUpdate();
12853
+ return _this3.forceUpdate();
12808
12854
  },
12809
12855
  direction: formValues.direction
12810
12856
  })
@@ -13959,7 +14005,7 @@ module.exports =
13959
14005
 
13960
14006
  var _react2 = _interopRequireDefault(_react);
13961
14007
 
13962
- var _redux = __webpack_require__(214);
14008
+ var _redux = __webpack_require__(215);
13963
14009
 
13964
14010
  var _reactRedux = __webpack_require__(65);
13965
14011
 
@@ -15501,6 +15547,1601 @@ module.exports =
15501
15547
 
15502
15548
  /***/ },
15503
15549
  /* 177 */
15550
+ /***/ function(module, exports, __webpack_require__) {
15551
+
15552
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
15553
+ Papa Parse
15554
+ v4.3.6
15555
+ https://github.com/mholt/PapaParse
15556
+ License: MIT
15557
+ */
15558
+ (function(root, factory)
15559
+ {
15560
+ if (true)
15561
+ {
15562
+ // AMD. Register as an anonymous module.
15563
+ !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __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__));
15564
+ }
15565
+ else if (typeof module === 'object' && typeof exports !== 'undefined')
15566
+ {
15567
+ // Node. Does not work with strict CommonJS, but
15568
+ // only CommonJS-like environments that support module.exports,
15569
+ // like Node.
15570
+ module.exports = factory();
15571
+ }
15572
+ else
15573
+ {
15574
+ // Browser globals (root is window)
15575
+ root.Papa = factory();
15576
+ }
15577
+ }(this, function()
15578
+ {
15579
+ 'use strict';
15580
+
15581
+ var global = (function () {
15582
+ // alternative method, similar to `Function('return this')()`
15583
+ // but without using `eval` (which is disabled when
15584
+ // using Content Security Policy).
15585
+
15586
+ if (typeof self !== 'undefined') { return self; }
15587
+ if (typeof window !== 'undefined') { return window; }
15588
+ if (typeof global !== 'undefined') { return global; }
15589
+
15590
+ // When running tests none of the above have been defined
15591
+ return {};
15592
+ })();
15593
+
15594
+
15595
+ var IS_WORKER = !global.document && !!global.postMessage,
15596
+ IS_PAPA_WORKER = IS_WORKER && /(\?|&)papaworker(=|&|$)/.test(global.location.search),
15597
+ LOADED_SYNC = false, AUTO_SCRIPT_PATH;
15598
+ var workers = {}, workerIdCounter = 0;
15599
+
15600
+ var Papa = {};
15601
+
15602
+ Papa.parse = CsvToJson;
15603
+ Papa.unparse = JsonToCsv;
15604
+
15605
+ Papa.RECORD_SEP = String.fromCharCode(30);
15606
+ Papa.UNIT_SEP = String.fromCharCode(31);
15607
+ Papa.BYTE_ORDER_MARK = '\ufeff';
15608
+ Papa.BAD_DELIMITERS = ['\r', '\n', '"', Papa.BYTE_ORDER_MARK];
15609
+ Papa.WORKERS_SUPPORTED = !IS_WORKER && !!global.Worker;
15610
+ Papa.SCRIPT_PATH = null; // Must be set by your code if you use workers and this lib is loaded asynchronously
15611
+
15612
+ // Configurable chunk sizes for local and remote files, respectively
15613
+ Papa.LocalChunkSize = 1024 * 1024 * 10; // 10 MB
15614
+ Papa.RemoteChunkSize = 1024 * 1024 * 5; // 5 MB
15615
+ Papa.DefaultDelimiter = ','; // Used if not specified and detection fails
15616
+
15617
+ // Exposed for testing and development only
15618
+ Papa.Parser = Parser;
15619
+ Papa.ParserHandle = ParserHandle;
15620
+ Papa.NetworkStreamer = NetworkStreamer;
15621
+ Papa.FileStreamer = FileStreamer;
15622
+ Papa.StringStreamer = StringStreamer;
15623
+ Papa.ReadableStreamStreamer = ReadableStreamStreamer;
15624
+
15625
+ if (global.jQuery)
15626
+ {
15627
+ var $ = global.jQuery;
15628
+ $.fn.parse = function(options)
15629
+ {
15630
+ var config = options.config || {};
15631
+ var queue = [];
15632
+
15633
+ this.each(function(idx)
15634
+ {
15635
+ var supported = $(this).prop('tagName').toUpperCase() === 'INPUT'
15636
+ && $(this).attr('type').toLowerCase() === 'file'
15637
+ && global.FileReader;
15638
+
15639
+ if (!supported || !this.files || this.files.length === 0)
15640
+ return true; // continue to next input element
15641
+
15642
+ for (var i = 0; i < this.files.length; i++)
15643
+ {
15644
+ queue.push({
15645
+ file: this.files[i],
15646
+ inputElem: this,
15647
+ instanceConfig: $.extend({}, config)
15648
+ });
15649
+ }
15650
+ });
15651
+
15652
+ parseNextFile(); // begin parsing
15653
+ return this; // maintains chainability
15654
+
15655
+
15656
+ function parseNextFile()
15657
+ {
15658
+ if (queue.length === 0)
15659
+ {
15660
+ if (isFunction(options.complete))
15661
+ options.complete();
15662
+ return;
15663
+ }
15664
+
15665
+ var f = queue[0];
15666
+
15667
+ if (isFunction(options.before))
15668
+ {
15669
+ var returned = options.before(f.file, f.inputElem);
15670
+
15671
+ if (typeof returned === 'object')
15672
+ {
15673
+ if (returned.action === 'abort')
15674
+ {
15675
+ error('AbortError', f.file, f.inputElem, returned.reason);
15676
+ return; // Aborts all queued files immediately
15677
+ }
15678
+ else if (returned.action === 'skip')
15679
+ {
15680
+ fileComplete(); // parse the next file in the queue, if any
15681
+ return;
15682
+ }
15683
+ else if (typeof returned.config === 'object')
15684
+ f.instanceConfig = $.extend(f.instanceConfig, returned.config);
15685
+ }
15686
+ else if (returned === 'skip')
15687
+ {
15688
+ fileComplete(); // parse the next file in the queue, if any
15689
+ return;
15690
+ }
15691
+ }
15692
+
15693
+ // Wrap up the user's complete callback, if any, so that ours also gets executed
15694
+ var userCompleteFunc = f.instanceConfig.complete;
15695
+ f.instanceConfig.complete = function(results)
15696
+ {
15697
+ if (isFunction(userCompleteFunc))
15698
+ userCompleteFunc(results, f.file, f.inputElem);
15699
+ fileComplete();
15700
+ };
15701
+
15702
+ Papa.parse(f.file, f.instanceConfig);
15703
+ }
15704
+
15705
+ function error(name, file, elem, reason)
15706
+ {
15707
+ if (isFunction(options.error))
15708
+ options.error({name: name}, file, elem, reason);
15709
+ }
15710
+
15711
+ function fileComplete()
15712
+ {
15713
+ queue.splice(0, 1);
15714
+ parseNextFile();
15715
+ }
15716
+ }
15717
+ }
15718
+
15719
+
15720
+ if (IS_PAPA_WORKER)
15721
+ {
15722
+ global.onmessage = workerThreadReceivedMessage;
15723
+ }
15724
+ else if (Papa.WORKERS_SUPPORTED)
15725
+ {
15726
+ AUTO_SCRIPT_PATH = getScriptPath();
15727
+
15728
+ // Check if the script was loaded synchronously
15729
+ if (!document.body)
15730
+ {
15731
+ // Body doesn't exist yet, must be synchronous
15732
+ LOADED_SYNC = true;
15733
+ }
15734
+ else
15735
+ {
15736
+ document.addEventListener('DOMContentLoaded', function () {
15737
+ LOADED_SYNC = true;
15738
+ }, true);
15739
+ }
15740
+ }
15741
+
15742
+
15743
+
15744
+
15745
+ function CsvToJson(_input, _config)
15746
+ {
15747
+ _config = _config || {};
15748
+ var dynamicTyping = _config.dynamicTyping || false;
15749
+ if (isFunction(dynamicTyping)) {
15750
+ _config.dynamicTypingFunction = dynamicTyping;
15751
+ // Will be filled on first row call
15752
+ dynamicTyping = {};
15753
+ }
15754
+ _config.dynamicTyping = dynamicTyping;
15755
+
15756
+ if (_config.worker && Papa.WORKERS_SUPPORTED)
15757
+ {
15758
+ var w = newWorker();
15759
+
15760
+ w.userStep = _config.step;
15761
+ w.userChunk = _config.chunk;
15762
+ w.userComplete = _config.complete;
15763
+ w.userError = _config.error;
15764
+
15765
+ _config.step = isFunction(_config.step);
15766
+ _config.chunk = isFunction(_config.chunk);
15767
+ _config.complete = isFunction(_config.complete);
15768
+ _config.error = isFunction(_config.error);
15769
+ delete _config.worker; // prevent infinite loop
15770
+
15771
+ w.postMessage({
15772
+ input: _input,
15773
+ config: _config,
15774
+ workerId: w.id
15775
+ });
15776
+
15777
+ return;
15778
+ }
15779
+
15780
+ var streamer = null;
15781
+ if (typeof _input === 'string')
15782
+ {
15783
+ if (_config.download)
15784
+ streamer = new NetworkStreamer(_config);
15785
+ else
15786
+ streamer = new StringStreamer(_config);
15787
+ }
15788
+ else if (_input.readable === true && isFunction(_input.read) && isFunction(_input.on))
15789
+ {
15790
+ streamer = new ReadableStreamStreamer(_config);
15791
+ }
15792
+ else if ((global.File && _input instanceof File) || _input instanceof Object) // ...Safari. (see issue #106)
15793
+ streamer = new FileStreamer(_config);
15794
+
15795
+ return streamer.stream(_input);
15796
+ }
15797
+
15798
+
15799
+
15800
+
15801
+
15802
+
15803
+ function JsonToCsv(_input, _config)
15804
+ {
15805
+ var _output = '';
15806
+ var _fields = [];
15807
+
15808
+ // Default configuration
15809
+
15810
+ /** whether to surround every datum with quotes */
15811
+ var _quotes = false;
15812
+
15813
+ /** whether to write headers */
15814
+ var _writeHeader = true;
15815
+
15816
+ /** delimiting character */
15817
+ var _delimiter = ',';
15818
+
15819
+ /** newline character(s) */
15820
+ var _newline = '\r\n';
15821
+
15822
+ /** quote character */
15823
+ var _quoteChar = '"';
15824
+
15825
+ unpackConfig();
15826
+
15827
+ var quoteCharRegex = new RegExp(_quoteChar, 'g');
15828
+
15829
+ if (typeof _input === 'string')
15830
+ _input = JSON.parse(_input);
15831
+
15832
+ if (_input instanceof Array)
15833
+ {
15834
+ if (!_input.length || _input[0] instanceof Array)
15835
+ return serialize(null, _input);
15836
+ else if (typeof _input[0] === 'object')
15837
+ return serialize(objectKeys(_input[0]), _input);
15838
+ }
15839
+ else if (typeof _input === 'object')
15840
+ {
15841
+ if (typeof _input.data === 'string')
15842
+ _input.data = JSON.parse(_input.data);
15843
+
15844
+ if (_input.data instanceof Array)
15845
+ {
15846
+ if (!_input.fields)
15847
+ _input.fields = _input.meta && _input.meta.fields;
15848
+
15849
+ if (!_input.fields)
15850
+ _input.fields = _input.data[0] instanceof Array
15851
+ ? _input.fields
15852
+ : objectKeys(_input.data[0]);
15853
+
15854
+ if (!(_input.data[0] instanceof Array) && typeof _input.data[0] !== 'object')
15855
+ _input.data = [_input.data]; // handles input like [1,2,3] or ['asdf']
15856
+ }
15857
+
15858
+ return serialize(_input.fields || [], _input.data || []);
15859
+ }
15860
+
15861
+ // Default (any valid paths should return before this)
15862
+ throw 'exception: Unable to serialize unrecognized input';
15863
+
15864
+
15865
+ function unpackConfig()
15866
+ {
15867
+ if (typeof _config !== 'object')
15868
+ return;
15869
+
15870
+ if (typeof _config.delimiter === 'string'
15871
+ && _config.delimiter.length === 1
15872
+ && Papa.BAD_DELIMITERS.indexOf(_config.delimiter) === -1)
15873
+ {
15874
+ _delimiter = _config.delimiter;
15875
+ }
15876
+
15877
+ if (typeof _config.quotes === 'boolean'
15878
+ || _config.quotes instanceof Array)
15879
+ _quotes = _config.quotes;
15880
+
15881
+ if (typeof _config.newline === 'string')
15882
+ _newline = _config.newline;
15883
+
15884
+ if (typeof _config.quoteChar === 'string')
15885
+ _quoteChar = _config.quoteChar;
15886
+
15887
+ if (typeof _config.header === 'boolean')
15888
+ _writeHeader = _config.header;
15889
+ }
15890
+
15891
+
15892
+ /** Turns an object's keys into an array */
15893
+ function objectKeys(obj)
15894
+ {
15895
+ if (typeof obj !== 'object')
15896
+ return [];
15897
+ var keys = [];
15898
+ for (var key in obj)
15899
+ keys.push(key);
15900
+ return keys;
15901
+ }
15902
+
15903
+ /** The double for loop that iterates the data and writes out a CSV string including header row */
15904
+ function serialize(fields, data)
15905
+ {
15906
+ var csv = '';
15907
+
15908
+ if (typeof fields === 'string')
15909
+ fields = JSON.parse(fields);
15910
+ if (typeof data === 'string')
15911
+ data = JSON.parse(data);
15912
+
15913
+ var hasHeader = fields instanceof Array && fields.length > 0;
15914
+ var dataKeyedByField = !(data[0] instanceof Array);
15915
+
15916
+ // If there a header row, write it first
15917
+ if (hasHeader && _writeHeader)
15918
+ {
15919
+ for (var i = 0; i < fields.length; i++)
15920
+ {
15921
+ if (i > 0)
15922
+ csv += _delimiter;
15923
+ csv += safe(fields[i], i);
15924
+ }
15925
+ if (data.length > 0)
15926
+ csv += _newline;
15927
+ }
15928
+
15929
+ // Then write out the data
15930
+ for (var row = 0; row < data.length; row++)
15931
+ {
15932
+ var maxCol = hasHeader ? fields.length : data[row].length;
15933
+
15934
+ for (var col = 0; col < maxCol; col++)
15935
+ {
15936
+ if (col > 0)
15937
+ csv += _delimiter;
15938
+ var colIdx = hasHeader && dataKeyedByField ? fields[col] : col;
15939
+ csv += safe(data[row][colIdx], col);
15940
+ }
15941
+
15942
+ if (row < data.length - 1)
15943
+ csv += _newline;
15944
+ }
15945
+
15946
+ return csv;
15947
+ }
15948
+
15949
+ /** Encloses a value around quotes if needed (makes a value safe for CSV insertion) */
15950
+ function safe(str, col)
15951
+ {
15952
+ if (typeof str === 'undefined' || str === null)
15953
+ return '';
15954
+
15955
+ str = str.toString().replace(quoteCharRegex, _quoteChar+_quoteChar);
15956
+
15957
+ var needsQuotes = (typeof _quotes === 'boolean' && _quotes)
15958
+ || (_quotes instanceof Array && _quotes[col])
15959
+ || hasAny(str, Papa.BAD_DELIMITERS)
15960
+ || str.indexOf(_delimiter) > -1
15961
+ || str.charAt(0) === ' '
15962
+ || str.charAt(str.length - 1) === ' ';
15963
+
15964
+ return needsQuotes ? _quoteChar + str + _quoteChar : str;
15965
+ }
15966
+
15967
+ function hasAny(str, substrings)
15968
+ {
15969
+ for (var i = 0; i < substrings.length; i++)
15970
+ if (str.indexOf(substrings[i]) > -1)
15971
+ return true;
15972
+ return false;
15973
+ }
15974
+ }
15975
+
15976
+ /** ChunkStreamer is the base prototype for various streamer implementations. */
15977
+ function ChunkStreamer(config)
15978
+ {
15979
+ this._handle = null;
15980
+ this._paused = false;
15981
+ this._finished = false;
15982
+ this._input = null;
15983
+ this._baseIndex = 0;
15984
+ this._partialLine = '';
15985
+ this._rowCount = 0;
15986
+ this._start = 0;
15987
+ this._nextChunk = null;
15988
+ this.isFirstChunk = true;
15989
+ this._completeResults = {
15990
+ data: [],
15991
+ errors: [],
15992
+ meta: {}
15993
+ };
15994
+ replaceConfig.call(this, config);
15995
+
15996
+ this.parseChunk = function(chunk)
15997
+ {
15998
+ // First chunk pre-processing
15999
+ if (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))
16000
+ {
16001
+ var modifiedChunk = this._config.beforeFirstChunk(chunk);
16002
+ if (modifiedChunk !== undefined)
16003
+ chunk = modifiedChunk;
16004
+ }
16005
+ this.isFirstChunk = false;
16006
+
16007
+ // Rejoin the line we likely just split in two by chunking the file
16008
+ var aggregate = this._partialLine + chunk;
16009
+ this._partialLine = '';
16010
+
16011
+ var results = this._handle.parse(aggregate, this._baseIndex, !this._finished);
16012
+
16013
+ if (this._handle.paused() || this._handle.aborted())
16014
+ return;
16015
+
16016
+ var lastIndex = results.meta.cursor;
16017
+
16018
+ if (!this._finished)
16019
+ {
16020
+ this._partialLine = aggregate.substring(lastIndex - this._baseIndex);
16021
+ this._baseIndex = lastIndex;
16022
+ }
16023
+
16024
+ if (results && results.data)
16025
+ this._rowCount += results.data.length;
16026
+
16027
+ var finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);
16028
+
16029
+ if (IS_PAPA_WORKER)
16030
+ {
16031
+ global.postMessage({
16032
+ results: results,
16033
+ workerId: Papa.WORKER_ID,
16034
+ finished: finishedIncludingPreview
16035
+ });
16036
+ }
16037
+ else if (isFunction(this._config.chunk))
16038
+ {
16039
+ this._config.chunk(results, this._handle);
16040
+ if (this._paused)
16041
+ return;
16042
+ results = undefined;
16043
+ this._completeResults = undefined;
16044
+ }
16045
+
16046
+ if (!this._config.step && !this._config.chunk) {
16047
+ this._completeResults.data = this._completeResults.data.concat(results.data);
16048
+ this._completeResults.errors = this._completeResults.errors.concat(results.errors);
16049
+ this._completeResults.meta = results.meta;
16050
+ }
16051
+
16052
+ if (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))
16053
+ this._config.complete(this._completeResults, this._input);
16054
+
16055
+ if (!finishedIncludingPreview && (!results || !results.meta.paused))
16056
+ this._nextChunk();
16057
+
16058
+ return results;
16059
+ };
16060
+
16061
+ this._sendError = function(error)
16062
+ {
16063
+ if (isFunction(this._config.error))
16064
+ this._config.error(error);
16065
+ else if (IS_PAPA_WORKER && this._config.error)
16066
+ {
16067
+ global.postMessage({
16068
+ workerId: Papa.WORKER_ID,
16069
+ error: error,
16070
+ finished: false
16071
+ });
16072
+ }
16073
+ };
16074
+
16075
+ function replaceConfig(config)
16076
+ {
16077
+ // Deep-copy the config so we can edit it
16078
+ var configCopy = copy(config);
16079
+ configCopy.chunkSize = parseInt(configCopy.chunkSize); // parseInt VERY important so we don't concatenate strings!
16080
+ if (!config.step && !config.chunk)
16081
+ configCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196
16082
+ this._handle = new ParserHandle(configCopy);
16083
+ this._handle.streamer = this;
16084
+ this._config = configCopy; // persist the copy to the caller
16085
+ }
16086
+ }
16087
+
16088
+
16089
+ function NetworkStreamer(config)
16090
+ {
16091
+ config = config || {};
16092
+ if (!config.chunkSize)
16093
+ config.chunkSize = Papa.RemoteChunkSize;
16094
+ ChunkStreamer.call(this, config);
16095
+
16096
+ var xhr;
16097
+
16098
+ if (IS_WORKER)
16099
+ {
16100
+ this._nextChunk = function()
16101
+ {
16102
+ this._readChunk();
16103
+ this._chunkLoaded();
16104
+ };
16105
+ }
16106
+ else
16107
+ {
16108
+ this._nextChunk = function()
16109
+ {
16110
+ this._readChunk();
16111
+ };
16112
+ }
16113
+
16114
+ this.stream = function(url)
16115
+ {
16116
+ this._input = url;
16117
+ this._nextChunk(); // Starts streaming
16118
+ };
16119
+
16120
+ this._readChunk = function()
16121
+ {
16122
+ if (this._finished)
16123
+ {
16124
+ this._chunkLoaded();
16125
+ return;
16126
+ }
16127
+
16128
+ xhr = new XMLHttpRequest();
16129
+
16130
+ if (this._config.withCredentials)
16131
+ {
16132
+ xhr.withCredentials = this._config.withCredentials;
16133
+ }
16134
+
16135
+ if (!IS_WORKER)
16136
+ {
16137
+ xhr.onload = bindFunction(this._chunkLoaded, this);
16138
+ xhr.onerror = bindFunction(this._chunkError, this);
16139
+ }
16140
+
16141
+ xhr.open('GET', this._input, !IS_WORKER);
16142
+ // Headers can only be set when once the request state is OPENED
16143
+ if (this._config.downloadRequestHeaders)
16144
+ {
16145
+ var headers = this._config.downloadRequestHeaders;
16146
+
16147
+ for (var headerName in headers)
16148
+ {
16149
+ xhr.setRequestHeader(headerName, headers[headerName]);
16150
+ }
16151
+ }
16152
+
16153
+ if (this._config.chunkSize)
16154
+ {
16155
+ var end = this._start + this._config.chunkSize - 1; // minus one because byte range is inclusive
16156
+ xhr.setRequestHeader('Range', 'bytes='+this._start+'-'+end);
16157
+ xhr.setRequestHeader('If-None-Match', 'webkit-no-cache'); // https://bugs.webkit.org/show_bug.cgi?id=82672
16158
+ }
16159
+
16160
+ try {
16161
+ xhr.send();
16162
+ }
16163
+ catch (err) {
16164
+ this._chunkError(err.message);
16165
+ }
16166
+
16167
+ if (IS_WORKER && xhr.status === 0)
16168
+ this._chunkError();
16169
+ else
16170
+ this._start += this._config.chunkSize;
16171
+ }
16172
+
16173
+ this._chunkLoaded = function()
16174
+ {
16175
+ if (xhr.readyState != 4)
16176
+ return;
16177
+
16178
+ if (xhr.status < 200 || xhr.status >= 400)
16179
+ {
16180
+ this._chunkError();
16181
+ return;
16182
+ }
16183
+
16184
+ this._finished = !this._config.chunkSize || this._start > getFileSize(xhr);
16185
+ this.parseChunk(xhr.responseText);
16186
+ }
16187
+
16188
+ this._chunkError = function(errorMessage)
16189
+ {
16190
+ var errorText = xhr.statusText || errorMessage;
16191
+ this._sendError(errorText);
16192
+ }
16193
+
16194
+ function getFileSize(xhr)
16195
+ {
16196
+ var contentRange = xhr.getResponseHeader('Content-Range');
16197
+ if (contentRange === null) { // no content range, then finish!
16198
+ return -1;
16199
+ }
16200
+ return parseInt(contentRange.substr(contentRange.lastIndexOf('/') + 1));
16201
+ }
16202
+ }
16203
+ NetworkStreamer.prototype = Object.create(ChunkStreamer.prototype);
16204
+ NetworkStreamer.prototype.constructor = NetworkStreamer;
16205
+
16206
+
16207
+ function FileStreamer(config)
16208
+ {
16209
+ config = config || {};
16210
+ if (!config.chunkSize)
16211
+ config.chunkSize = Papa.LocalChunkSize;
16212
+ ChunkStreamer.call(this, config);
16213
+
16214
+ var reader, slice;
16215
+
16216
+ // FileReader is better than FileReaderSync (even in worker) - see http://stackoverflow.com/q/24708649/1048862
16217
+ // But Firefox is a pill, too - see issue #76: https://github.com/mholt/PapaParse/issues/76
16218
+ var usingAsyncReader = typeof FileReader !== 'undefined'; // Safari doesn't consider it a function - see issue #105
16219
+
16220
+ this.stream = function(file)
16221
+ {
16222
+ this._input = file;
16223
+ slice = file.slice || file.webkitSlice || file.mozSlice;
16224
+
16225
+ if (usingAsyncReader)
16226
+ {
16227
+ reader = new FileReader(); // Preferred method of reading files, even in workers
16228
+ reader.onload = bindFunction(this._chunkLoaded, this);
16229
+ reader.onerror = bindFunction(this._chunkError, this);
16230
+ }
16231
+ else
16232
+ reader = new FileReaderSync(); // Hack for running in a web worker in Firefox
16233
+
16234
+ this._nextChunk(); // Starts streaming
16235
+ };
16236
+
16237
+ this._nextChunk = function()
16238
+ {
16239
+ if (!this._finished && (!this._config.preview || this._rowCount < this._config.preview))
16240
+ this._readChunk();
16241
+ }
16242
+
16243
+ this._readChunk = function()
16244
+ {
16245
+ var input = this._input;
16246
+ if (this._config.chunkSize)
16247
+ {
16248
+ var end = Math.min(this._start + this._config.chunkSize, this._input.size);
16249
+ input = slice.call(input, this._start, end);
16250
+ }
16251
+ var txt = reader.readAsText(input, this._config.encoding);
16252
+ if (!usingAsyncReader)
16253
+ this._chunkLoaded({ target: { result: txt } }); // mimic the async signature
16254
+ }
16255
+
16256
+ this._chunkLoaded = function(event)
16257
+ {
16258
+ // Very important to increment start each time before handling results
16259
+ this._start += this._config.chunkSize;
16260
+ this._finished = !this._config.chunkSize || this._start >= this._input.size;
16261
+ this.parseChunk(event.target.result);
16262
+ }
16263
+
16264
+ this._chunkError = function()
16265
+ {
16266
+ this._sendError(reader.error);
16267
+ }
16268
+
16269
+ }
16270
+ FileStreamer.prototype = Object.create(ChunkStreamer.prototype);
16271
+ FileStreamer.prototype.constructor = FileStreamer;
16272
+
16273
+
16274
+ function StringStreamer(config)
16275
+ {
16276
+ config = config || {};
16277
+ ChunkStreamer.call(this, config);
16278
+
16279
+ var string;
16280
+ var remaining;
16281
+ this.stream = function(s)
16282
+ {
16283
+ string = s;
16284
+ remaining = s;
16285
+ return this._nextChunk();
16286
+ }
16287
+ this._nextChunk = function()
16288
+ {
16289
+ if (this._finished) return;
16290
+ var size = this._config.chunkSize;
16291
+ var chunk = size ? remaining.substr(0, size) : remaining;
16292
+ remaining = size ? remaining.substr(size) : '';
16293
+ this._finished = !remaining;
16294
+ return this.parseChunk(chunk);
16295
+ }
16296
+ }
16297
+ StringStreamer.prototype = Object.create(StringStreamer.prototype);
16298
+ StringStreamer.prototype.constructor = StringStreamer;
16299
+
16300
+
16301
+ function ReadableStreamStreamer(config)
16302
+ {
16303
+ config = config || {};
16304
+
16305
+ ChunkStreamer.call(this, config);
16306
+
16307
+ var queue = [];
16308
+ var parseOnData = true;
16309
+
16310
+ this.stream = function(stream)
16311
+ {
16312
+ this._input = stream;
16313
+
16314
+ this._input.on('data', this._streamData);
16315
+ this._input.on('end', this._streamEnd);
16316
+ this._input.on('error', this._streamError);
16317
+ }
16318
+
16319
+ this._nextChunk = function()
16320
+ {
16321
+ if (queue.length)
16322
+ {
16323
+ this.parseChunk(queue.shift());
16324
+ }
16325
+ else
16326
+ {
16327
+ parseOnData = true;
16328
+ }
16329
+ }
16330
+
16331
+ this._streamData = bindFunction(function(chunk)
16332
+ {
16333
+ try
16334
+ {
16335
+ queue.push(typeof chunk === 'string' ? chunk : chunk.toString(this._config.encoding));
16336
+
16337
+ if (parseOnData)
16338
+ {
16339
+ parseOnData = false;
16340
+ this.parseChunk(queue.shift());
16341
+ }
16342
+ }
16343
+ catch (error)
16344
+ {
16345
+ this._streamError(error);
16346
+ }
16347
+ }, this);
16348
+
16349
+ this._streamError = bindFunction(function(error)
16350
+ {
16351
+ this._streamCleanUp();
16352
+ this._sendError(error.message);
16353
+ }, this);
16354
+
16355
+ this._streamEnd = bindFunction(function()
16356
+ {
16357
+ this._streamCleanUp();
16358
+ this._finished = true;
16359
+ this._streamData('');
16360
+ }, this);
16361
+
16362
+ this._streamCleanUp = bindFunction(function()
16363
+ {
16364
+ this._input.removeListener('data', this._streamData);
16365
+ this._input.removeListener('end', this._streamEnd);
16366
+ this._input.removeListener('error', this._streamError);
16367
+ }, this);
16368
+ }
16369
+ ReadableStreamStreamer.prototype = Object.create(ChunkStreamer.prototype);
16370
+ ReadableStreamStreamer.prototype.constructor = ReadableStreamStreamer;
16371
+
16372
+
16373
+ // Use one ParserHandle per entire CSV file or string
16374
+ function ParserHandle(_config)
16375
+ {
16376
+ // One goal is to minimize the use of regular expressions...
16377
+ var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
16378
+
16379
+ var self = this;
16380
+ var _stepCounter = 0; // Number of times step was called (number of rows parsed)
16381
+ var _input; // The input being parsed
16382
+ var _parser; // The core parser being used
16383
+ var _paused = false; // Whether we are paused or not
16384
+ var _aborted = false; // Whether the parser has aborted or not
16385
+ var _delimiterError; // Temporary state between delimiter detection and processing results
16386
+ var _fields = []; // Fields are from the header row of the input, if there is one
16387
+ var _results = { // The last results returned from the parser
16388
+ data: [],
16389
+ errors: [],
16390
+ meta: {}
16391
+ };
16392
+
16393
+ if (isFunction(_config.step))
16394
+ {
16395
+ var userStep = _config.step;
16396
+ _config.step = function(results)
16397
+ {
16398
+ _results = results;
16399
+
16400
+ if (needsHeaderRow())
16401
+ processResults();
16402
+ else // only call user's step function after header row
16403
+ {
16404
+ processResults();
16405
+
16406
+ // It's possbile that this line was empty and there's no row here after all
16407
+ if (_results.data.length === 0)
16408
+ return;
16409
+
16410
+ _stepCounter += results.data.length;
16411
+ if (_config.preview && _stepCounter > _config.preview)
16412
+ _parser.abort();
16413
+ else
16414
+ userStep(_results, self);
16415
+ }
16416
+ };
16417
+ }
16418
+
16419
+ /**
16420
+ * Parses input. Most users won't need, and shouldn't mess with, the baseIndex
16421
+ * and ignoreLastRow parameters. They are used by streamers (wrapper functions)
16422
+ * when an input comes in multiple chunks, like from a file.
16423
+ */
16424
+ this.parse = function(input, baseIndex, ignoreLastRow)
16425
+ {
16426
+ if (!_config.newline)
16427
+ _config.newline = guessLineEndings(input);
16428
+
16429
+ _delimiterError = false;
16430
+ if (!_config.delimiter)
16431
+ {
16432
+ var delimGuess = guessDelimiter(input, _config.newline, _config.skipEmptyLines);
16433
+ if (delimGuess.successful)
16434
+ _config.delimiter = delimGuess.bestDelimiter;
16435
+ else
16436
+ {
16437
+ _delimiterError = true; // add error after parsing (otherwise it would be overwritten)
16438
+ _config.delimiter = Papa.DefaultDelimiter;
16439
+ }
16440
+ _results.meta.delimiter = _config.delimiter;
16441
+ }
16442
+ else if(isFunction(_config.delimiter))
16443
+ {
16444
+ _config.delimiter = _config.delimiter(input);
16445
+ _results.meta.delimiter = _config.delimiter;
16446
+ }
16447
+
16448
+ var parserConfig = copy(_config);
16449
+ if (_config.preview && _config.header)
16450
+ parserConfig.preview++; // to compensate for header row
16451
+
16452
+ _input = input;
16453
+ _parser = new Parser(parserConfig);
16454
+ _results = _parser.parse(_input, baseIndex, ignoreLastRow);
16455
+ processResults();
16456
+ return _paused ? { meta: { paused: true } } : (_results || { meta: { paused: false } });
16457
+ };
16458
+
16459
+ this.paused = function()
16460
+ {
16461
+ return _paused;
16462
+ };
16463
+
16464
+ this.pause = function()
16465
+ {
16466
+ _paused = true;
16467
+ _parser.abort();
16468
+ _input = _input.substr(_parser.getCharIndex());
16469
+ };
16470
+
16471
+ this.resume = function()
16472
+ {
16473
+ _paused = false;
16474
+ self.streamer.parseChunk(_input);
16475
+ };
16476
+
16477
+ this.aborted = function ()
16478
+ {
16479
+ return _aborted;
16480
+ };
16481
+
16482
+ this.abort = function()
16483
+ {
16484
+ _aborted = true;
16485
+ _parser.abort();
16486
+ _results.meta.aborted = true;
16487
+ if (isFunction(_config.complete))
16488
+ _config.complete(_results);
16489
+ _input = '';
16490
+ };
16491
+
16492
+ function processResults()
16493
+ {
16494
+ if (_results && _delimiterError)
16495
+ {
16496
+ addError('Delimiter', 'UndetectableDelimiter', 'Unable to auto-detect delimiting character; defaulted to \''+Papa.DefaultDelimiter+'\'');
16497
+ _delimiterError = false;
16498
+ }
16499
+
16500
+ if (_config.skipEmptyLines)
16501
+ {
16502
+ for (var i = 0; i < _results.data.length; i++)
16503
+ if (_results.data[i].length === 1 && _results.data[i][0] === '')
16504
+ _results.data.splice(i--, 1);
16505
+ }
16506
+
16507
+ if (needsHeaderRow())
16508
+ fillHeaderFields();
16509
+
16510
+ return applyHeaderAndDynamicTyping();
16511
+ }
16512
+
16513
+ function needsHeaderRow()
16514
+ {
16515
+ return _config.header && _fields.length === 0;
16516
+ }
16517
+
16518
+ function fillHeaderFields()
16519
+ {
16520
+ if (!_results)
16521
+ return;
16522
+ for (var i = 0; needsHeaderRow() && i < _results.data.length; i++)
16523
+ for (var j = 0; j < _results.data[i].length; j++)
16524
+ _fields.push(_results.data[i][j]);
16525
+ _results.data.splice(0, 1);
16526
+ }
16527
+
16528
+ function shouldApplyDynamicTyping(field) {
16529
+ // Cache function values to avoid calling it for each row
16530
+ if (_config.dynamicTypingFunction && _config.dynamicTyping[field] === undefined) {
16531
+ _config.dynamicTyping[field] = _config.dynamicTypingFunction(field);
16532
+ }
16533
+ return (_config.dynamicTyping[field] || _config.dynamicTyping) === true
16534
+ }
16535
+
16536
+ function parseDynamic(field, value)
16537
+ {
16538
+ if (shouldApplyDynamicTyping(field))
16539
+ {
16540
+ if (value === 'true' || value === 'TRUE')
16541
+ return true;
16542
+ else if (value === 'false' || value === 'FALSE')
16543
+ return false;
16544
+ else
16545
+ return tryParseFloat(value);
16546
+ }
16547
+ return value;
16548
+ }
16549
+
16550
+ function applyHeaderAndDynamicTyping()
16551
+ {
16552
+ if (!_results || (!_config.header && !_config.dynamicTyping))
16553
+ return _results;
16554
+
16555
+ for (var i = 0; i < _results.data.length; i++)
16556
+ {
16557
+ var row = _config.header ? {} : [];
16558
+
16559
+ for (var j = 0; j < _results.data[i].length; j++)
16560
+ {
16561
+ var field = j;
16562
+ var value = _results.data[i][j];
16563
+
16564
+ if (_config.header)
16565
+ field = j >= _fields.length ? '__parsed_extra' : _fields[j];
16566
+
16567
+ value = parseDynamic(field, value);
16568
+
16569
+ if (field === '__parsed_extra')
16570
+ {
16571
+ row[field] = row[field] || [];
16572
+ row[field].push(value);
16573
+ }
16574
+ else
16575
+ row[field] = value;
16576
+ }
16577
+
16578
+ _results.data[i] = row;
16579
+
16580
+ if (_config.header)
16581
+ {
16582
+ if (j > _fields.length)
16583
+ addError('FieldMismatch', 'TooManyFields', 'Too many fields: expected ' + _fields.length + ' fields but parsed ' + j, i);
16584
+ else if (j < _fields.length)
16585
+ addError('FieldMismatch', 'TooFewFields', 'Too few fields: expected ' + _fields.length + ' fields but parsed ' + j, i);
16586
+ }
16587
+ }
16588
+
16589
+ if (_config.header && _results.meta)
16590
+ _results.meta.fields = _fields;
16591
+ return _results;
16592
+ }
16593
+
16594
+ function guessDelimiter(input, newline, skipEmptyLines)
16595
+ {
16596
+ var delimChoices = [',', '\t', '|', ';', Papa.RECORD_SEP, Papa.UNIT_SEP];
16597
+ var bestDelim, bestDelta, fieldCountPrevRow;
16598
+
16599
+ for (var i = 0; i < delimChoices.length; i++)
16600
+ {
16601
+ var delim = delimChoices[i];
16602
+ var delta = 0, avgFieldCount = 0, emptyLinesCount = 0;
16603
+ fieldCountPrevRow = undefined;
16604
+
16605
+ var preview = new Parser({
16606
+ delimiter: delim,
16607
+ newline: newline,
16608
+ preview: 10
16609
+ }).parse(input);
16610
+
16611
+ for (var j = 0; j < preview.data.length; j++)
16612
+ {
16613
+ if (skipEmptyLines && preview.data[j].length === 1 && preview.data[j][0].length === 0) {
16614
+ emptyLinesCount++
16615
+ continue
16616
+ }
16617
+ var fieldCount = preview.data[j].length;
16618
+ avgFieldCount += fieldCount;
16619
+
16620
+ if (typeof fieldCountPrevRow === 'undefined')
16621
+ {
16622
+ fieldCountPrevRow = fieldCount;
16623
+ continue;
16624
+ }
16625
+ else if (fieldCount > 1)
16626
+ {
16627
+ delta += Math.abs(fieldCount - fieldCountPrevRow);
16628
+ fieldCountPrevRow = fieldCount;
16629
+ }
16630
+ }
16631
+
16632
+ if (preview.data.length > 0)
16633
+ avgFieldCount /= (preview.data.length - emptyLinesCount);
16634
+
16635
+ if ((typeof bestDelta === 'undefined' || delta < bestDelta)
16636
+ && avgFieldCount > 1.99)
16637
+ {
16638
+ bestDelta = delta;
16639
+ bestDelim = delim;
16640
+ }
16641
+ }
16642
+
16643
+ _config.delimiter = bestDelim;
16644
+
16645
+ return {
16646
+ successful: !!bestDelim,
16647
+ bestDelimiter: bestDelim
16648
+ }
16649
+ }
16650
+
16651
+ function guessLineEndings(input)
16652
+ {
16653
+ input = input.substr(0, 1024*1024); // max length 1 MB
16654
+
16655
+ var r = input.split('\r');
16656
+
16657
+ var n = input.split('\n');
16658
+
16659
+ var nAppearsFirst = (n.length > 1 && n[0].length < r[0].length);
16660
+
16661
+ if (r.length === 1 || nAppearsFirst)
16662
+ return '\n';
16663
+
16664
+ var numWithN = 0;
16665
+ for (var i = 0; i < r.length; i++)
16666
+ {
16667
+ if (r[i][0] === '\n')
16668
+ numWithN++;
16669
+ }
16670
+
16671
+ return numWithN >= r.length / 2 ? '\r\n' : '\r';
16672
+ }
16673
+
16674
+ function tryParseFloat(val)
16675
+ {
16676
+ var isNumber = FLOAT.test(val);
16677
+ return isNumber ? parseFloat(val) : val;
16678
+ }
16679
+
16680
+ function addError(type, code, msg, row)
16681
+ {
16682
+ _results.errors.push({
16683
+ type: type,
16684
+ code: code,
16685
+ message: msg,
16686
+ row: row
16687
+ });
16688
+ }
16689
+ }
16690
+
16691
+
16692
+
16693
+
16694
+
16695
+ /** The core parser implements speedy and correct CSV parsing */
16696
+ function Parser(config)
16697
+ {
16698
+ // Unpack the config object
16699
+ config = config || {};
16700
+ var delim = config.delimiter;
16701
+ var newline = config.newline;
16702
+ var comments = config.comments;
16703
+ var step = config.step;
16704
+ var preview = config.preview;
16705
+ var fastMode = config.fastMode;
16706
+ var quoteChar = config.quoteChar || '"';
16707
+
16708
+ // Delimiter must be valid
16709
+ if (typeof delim !== 'string'
16710
+ || Papa.BAD_DELIMITERS.indexOf(delim) > -1)
16711
+ delim = ',';
16712
+
16713
+ // Comment character must be valid
16714
+ if (comments === delim)
16715
+ throw 'Comment character same as delimiter';
16716
+ else if (comments === true)
16717
+ comments = '#';
16718
+ else if (typeof comments !== 'string'
16719
+ || Papa.BAD_DELIMITERS.indexOf(comments) > -1)
16720
+ comments = false;
16721
+
16722
+ // Newline must be valid: \r, \n, or \r\n
16723
+ if (newline != '\n' && newline != '\r' && newline != '\r\n')
16724
+ newline = '\n';
16725
+
16726
+ // We're gonna need these at the Parser scope
16727
+ var cursor = 0;
16728
+ var aborted = false;
16729
+
16730
+ this.parse = function(input, baseIndex, ignoreLastRow)
16731
+ {
16732
+ // For some reason, in Chrome, this speeds things up (!?)
16733
+ if (typeof input !== 'string')
16734
+ throw 'Input must be a string';
16735
+
16736
+ // We don't need to compute some of these every time parse() is called,
16737
+ // but having them in a more local scope seems to perform better
16738
+ var inputLen = input.length,
16739
+ delimLen = delim.length,
16740
+ newlineLen = newline.length,
16741
+ commentsLen = comments.length;
16742
+ var stepIsFunction = isFunction(step);
16743
+
16744
+ // Establish starting state
16745
+ cursor = 0;
16746
+ var data = [], errors = [], row = [], lastCursor = 0;
16747
+
16748
+ if (!input)
16749
+ return returnable();
16750
+
16751
+ if (fastMode || (fastMode !== false && input.indexOf(quoteChar) === -1))
16752
+ {
16753
+ var rows = input.split(newline);
16754
+ for (var i = 0; i < rows.length; i++)
16755
+ {
16756
+ var row = rows[i];
16757
+ cursor += row.length;
16758
+ if (i !== rows.length - 1)
16759
+ cursor += newline.length;
16760
+ else if (ignoreLastRow)
16761
+ return returnable();
16762
+ if (comments && row.substr(0, commentsLen) === comments)
16763
+ continue;
16764
+ if (stepIsFunction)
16765
+ {
16766
+ data = [];
16767
+ pushRow(row.split(delim));
16768
+ doStep();
16769
+ if (aborted)
16770
+ return returnable();
16771
+ }
16772
+ else
16773
+ pushRow(row.split(delim));
16774
+ if (preview && i >= preview)
16775
+ {
16776
+ data = data.slice(0, preview);
16777
+ return returnable(true);
16778
+ }
16779
+ }
16780
+ return returnable();
16781
+ }
16782
+
16783
+ var nextDelim = input.indexOf(delim, cursor);
16784
+ var nextNewline = input.indexOf(newline, cursor);
16785
+ var quoteCharRegex = new RegExp(quoteChar+quoteChar, 'g');
16786
+
16787
+ // Parser loop
16788
+ for (;;)
16789
+ {
16790
+ // Field has opening quote
16791
+ if (input[cursor] === quoteChar)
16792
+ {
16793
+ // Start our search for the closing quote where the cursor is
16794
+ var quoteSearch = cursor;
16795
+
16796
+ // Skip the opening quote
16797
+ cursor++;
16798
+
16799
+ for (;;)
16800
+ {
16801
+ // Find closing quote
16802
+ var quoteSearch = input.indexOf(quoteChar, quoteSearch+1);
16803
+
16804
+ //No other quotes are found - no other delimiters
16805
+ if (quoteSearch === -1)
16806
+ {
16807
+ if (!ignoreLastRow) {
16808
+ // No closing quote... what a pity
16809
+ errors.push({
16810
+ type: 'Quotes',
16811
+ code: 'MissingQuotes',
16812
+ message: 'Quoted field unterminated',
16813
+ row: data.length, // row has yet to be inserted
16814
+ index: cursor
16815
+ });
16816
+ }
16817
+ return finish();
16818
+ }
16819
+
16820
+ // Closing quote at EOF
16821
+ if (quoteSearch === inputLen-1)
16822
+ {
16823
+ var value = input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar);
16824
+ return finish(value);
16825
+ }
16826
+
16827
+ // If this quote is escaped, it's part of the data; skip it
16828
+ if (input[quoteSearch+1] === quoteChar)
16829
+ {
16830
+ quoteSearch++;
16831
+ continue;
16832
+ }
16833
+
16834
+ // Closing quote followed by delimiter
16835
+ if (input[quoteSearch+1] === delim)
16836
+ {
16837
+ row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar));
16838
+ cursor = quoteSearch + 1 + delimLen;
16839
+ nextDelim = input.indexOf(delim, cursor);
16840
+ nextNewline = input.indexOf(newline, cursor);
16841
+ break;
16842
+ }
16843
+
16844
+ // Closing quote followed by newline
16845
+ if (input.substr(quoteSearch+1, newlineLen) === newline)
16846
+ {
16847
+ row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar));
16848
+ saveRow(quoteSearch + 1 + newlineLen);
16849
+ nextDelim = input.indexOf(delim, cursor); // because we may have skipped the nextDelim in the quoted field
16850
+
16851
+ if (stepIsFunction)
16852
+ {
16853
+ doStep();
16854
+ if (aborted)
16855
+ return returnable();
16856
+ }
16857
+
16858
+ if (preview && data.length >= preview)
16859
+ return returnable(true);
16860
+
16861
+ break;
16862
+ }
16863
+
16864
+
16865
+ // Checks for valid closing quotes are complete (escaped quotes or quote followed by EOF/delimiter/newline) -- assume these quotes are part of an invalid text string
16866
+ errors.push({
16867
+ type: 'Quotes',
16868
+ code: 'InvalidQuotes',
16869
+ message: 'Trailing quote on quoted field is malformed',
16870
+ row: data.length, // row has yet to be inserted
16871
+ index: cursor
16872
+ });
16873
+
16874
+ quoteSearch++;
16875
+ continue;
16876
+
16877
+ }
16878
+
16879
+ continue;
16880
+ }
16881
+
16882
+ // Comment found at start of new line
16883
+ if (comments && row.length === 0 && input.substr(cursor, commentsLen) === comments)
16884
+ {
16885
+ if (nextNewline === -1) // Comment ends at EOF
16886
+ return returnable();
16887
+ cursor = nextNewline + newlineLen;
16888
+ nextNewline = input.indexOf(newline, cursor);
16889
+ nextDelim = input.indexOf(delim, cursor);
16890
+ continue;
16891
+ }
16892
+
16893
+ // Next delimiter comes before next newline, so we've reached end of field
16894
+ if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1))
16895
+ {
16896
+ row.push(input.substring(cursor, nextDelim));
16897
+ cursor = nextDelim + delimLen;
16898
+ nextDelim = input.indexOf(delim, cursor);
16899
+ continue;
16900
+ }
16901
+
16902
+ // End of row
16903
+ if (nextNewline !== -1)
16904
+ {
16905
+ row.push(input.substring(cursor, nextNewline));
16906
+ saveRow(nextNewline + newlineLen);
16907
+
16908
+ if (stepIsFunction)
16909
+ {
16910
+ doStep();
16911
+ if (aborted)
16912
+ return returnable();
16913
+ }
16914
+
16915
+ if (preview && data.length >= preview)
16916
+ return returnable(true);
16917
+
16918
+ continue;
16919
+ }
16920
+
16921
+ break;
16922
+ }
16923
+
16924
+
16925
+ return finish();
16926
+
16927
+
16928
+ function pushRow(row)
16929
+ {
16930
+ data.push(row);
16931
+ lastCursor = cursor;
16932
+ }
16933
+
16934
+ /**
16935
+ * Appends the remaining input from cursor to the end into
16936
+ * row, saves the row, calls step, and returns the results.
16937
+ */
16938
+ function finish(value)
16939
+ {
16940
+ if (ignoreLastRow)
16941
+ return returnable();
16942
+ if (typeof value === 'undefined')
16943
+ value = input.substr(cursor);
16944
+ row.push(value);
16945
+ cursor = inputLen; // important in case parsing is paused
16946
+ pushRow(row);
16947
+ if (stepIsFunction)
16948
+ doStep();
16949
+ return returnable();
16950
+ }
16951
+
16952
+ /**
16953
+ * Appends the current row to the results. It sets the cursor
16954
+ * to newCursor and finds the nextNewline. The caller should
16955
+ * take care to execute user's step function and check for
16956
+ * preview and end parsing if necessary.
16957
+ */
16958
+ function saveRow(newCursor)
16959
+ {
16960
+ cursor = newCursor;
16961
+ pushRow(row);
16962
+ row = [];
16963
+ nextNewline = input.indexOf(newline, cursor);
16964
+ }
16965
+
16966
+ /** Returns an object with the results, errors, and meta. */
16967
+ function returnable(stopped)
16968
+ {
16969
+ return {
16970
+ data: data,
16971
+ errors: errors,
16972
+ meta: {
16973
+ delimiter: delim,
16974
+ linebreak: newline,
16975
+ aborted: aborted,
16976
+ truncated: !!stopped,
16977
+ cursor: lastCursor + (baseIndex || 0)
16978
+ }
16979
+ };
16980
+ }
16981
+
16982
+ /** Executes the user's step function and resets data & errors. */
16983
+ function doStep()
16984
+ {
16985
+ step(returnable());
16986
+ data = [], errors = [];
16987
+ }
16988
+ };
16989
+
16990
+ /** Sets the abort flag */
16991
+ this.abort = function()
16992
+ {
16993
+ aborted = true;
16994
+ };
16995
+
16996
+ /** Gets the cursor position */
16997
+ this.getCharIndex = function()
16998
+ {
16999
+ return cursor;
17000
+ };
17001
+ }
17002
+
17003
+
17004
+ // If you need to load Papa Parse asynchronously and you also need worker threads, hard-code
17005
+ // the script path here. See: https://github.com/mholt/PapaParse/issues/87#issuecomment-57885358
17006
+ function getScriptPath()
17007
+ {
17008
+ var scripts = document.getElementsByTagName('script');
17009
+ return scripts.length ? scripts[scripts.length - 1].src : '';
17010
+ }
17011
+
17012
+ function newWorker()
17013
+ {
17014
+ if (!Papa.WORKERS_SUPPORTED)
17015
+ return false;
17016
+ if (!LOADED_SYNC && Papa.SCRIPT_PATH === null)
17017
+ throw new Error(
17018
+ 'Script path cannot be determined automatically when Papa Parse is loaded asynchronously. ' +
17019
+ 'You need to set Papa.SCRIPT_PATH manually.'
17020
+ );
17021
+ var workerUrl = Papa.SCRIPT_PATH || AUTO_SCRIPT_PATH;
17022
+ // Append 'papaworker' to the search string to tell papaparse that this is our worker.
17023
+ workerUrl += (workerUrl.indexOf('?') !== -1 ? '&' : '?') + 'papaworker';
17024
+ var w = new global.Worker(workerUrl);
17025
+ w.onmessage = mainThreadReceivedMessage;
17026
+ w.id = workerIdCounter++;
17027
+ workers[w.id] = w;
17028
+ return w;
17029
+ }
17030
+
17031
+ /** Callback when main thread receives a message */
17032
+ function mainThreadReceivedMessage(e)
17033
+ {
17034
+ var msg = e.data;
17035
+ var worker = workers[msg.workerId];
17036
+ var aborted = false;
17037
+
17038
+ if (msg.error)
17039
+ worker.userError(msg.error, msg.file);
17040
+ else if (msg.results && msg.results.data)
17041
+ {
17042
+ var abort = function() {
17043
+ aborted = true;
17044
+ completeWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });
17045
+ };
17046
+
17047
+ var handle = {
17048
+ abort: abort,
17049
+ pause: notImplemented,
17050
+ resume: notImplemented
17051
+ };
17052
+
17053
+ if (isFunction(worker.userStep))
17054
+ {
17055
+ for (var i = 0; i < msg.results.data.length; i++)
17056
+ {
17057
+ worker.userStep({
17058
+ data: [msg.results.data[i]],
17059
+ errors: msg.results.errors,
17060
+ meta: msg.results.meta
17061
+ }, handle);
17062
+ if (aborted)
17063
+ break;
17064
+ }
17065
+ delete msg.results; // free memory ASAP
17066
+ }
17067
+ else if (isFunction(worker.userChunk))
17068
+ {
17069
+ worker.userChunk(msg.results, handle, msg.file);
17070
+ delete msg.results;
17071
+ }
17072
+ }
17073
+
17074
+ if (msg.finished && !aborted)
17075
+ completeWorker(msg.workerId, msg.results);
17076
+ }
17077
+
17078
+ function completeWorker(workerId, results) {
17079
+ var worker = workers[workerId];
17080
+ if (isFunction(worker.userComplete))
17081
+ worker.userComplete(results);
17082
+ worker.terminate();
17083
+ delete workers[workerId];
17084
+ }
17085
+
17086
+ function notImplemented() {
17087
+ throw 'Not implemented.';
17088
+ }
17089
+
17090
+ /** Callback when worker thread receives a message */
17091
+ function workerThreadReceivedMessage(e)
17092
+ {
17093
+ var msg = e.data;
17094
+
17095
+ if (typeof Papa.WORKER_ID === 'undefined' && msg)
17096
+ Papa.WORKER_ID = msg.workerId;
17097
+
17098
+ if (typeof msg.input === 'string')
17099
+ {
17100
+ global.postMessage({
17101
+ workerId: Papa.WORKER_ID,
17102
+ results: Papa.parse(msg.input, msg.config),
17103
+ finished: true
17104
+ });
17105
+ }
17106
+ else if ((global.File && msg.input instanceof File) || msg.input instanceof Object) // thank you, Safari (see issue #106)
17107
+ {
17108
+ var results = Papa.parse(msg.input, msg.config);
17109
+ if (results)
17110
+ global.postMessage({
17111
+ workerId: Papa.WORKER_ID,
17112
+ results: results,
17113
+ finished: true
17114
+ });
17115
+ }
17116
+ }
17117
+
17118
+ /** Makes a deep copy of an array or object (mostly) */
17119
+ function copy(obj)
17120
+ {
17121
+ if (typeof obj !== 'object')
17122
+ return obj;
17123
+ var cpy = obj instanceof Array ? [] : {};
17124
+ for (var key in obj)
17125
+ cpy[key] = copy(obj[key]);
17126
+ return cpy;
17127
+ }
17128
+
17129
+ function bindFunction(f, self)
17130
+ {
17131
+ return function() { f.apply(self, arguments); };
17132
+ }
17133
+
17134
+ function isFunction(func)
17135
+ {
17136
+ return typeof func === 'function';
17137
+ }
17138
+
17139
+ return Papa;
17140
+ }));
17141
+
17142
+
17143
+ /***/ },
17144
+ /* 178 */
15504
17145
  /***/ function(module, exports, __webpack_require__) {
15505
17146
 
15506
17147
  /**
@@ -15514,9 +17155,9 @@ module.exports =
15514
17155
 
15515
17156
  'use strict';
15516
17157
 
15517
- var emptyFunction = __webpack_require__(179);
15518
- var invariant = __webpack_require__(180);
15519
- var ReactPropTypesSecret = __webpack_require__(178);
17158
+ var emptyFunction = __webpack_require__(180);
17159
+ var invariant = __webpack_require__(181);
17160
+ var ReactPropTypesSecret = __webpack_require__(179);
15520
17161
 
15521
17162
  module.exports = function() {
15522
17163
  function shim(props, propName, componentName, location, propFullName, secret) {
@@ -15565,7 +17206,7 @@ module.exports =
15565
17206
 
15566
17207
 
15567
17208
  /***/ },
15568
- /* 178 */
17209
+ /* 179 */
15569
17210
  /***/ function(module, exports) {
15570
17211
 
15571
17212
  /**
@@ -15585,7 +17226,7 @@ module.exports =
15585
17226
 
15586
17227
 
15587
17228
  /***/ },
15588
- /* 179 */
17229
+ /* 180 */
15589
17230
  /***/ function(module, exports) {
15590
17231
 
15591
17232
  "use strict";
@@ -15628,7 +17269,7 @@ module.exports =
15628
17269
  module.exports = emptyFunction;
15629
17270
 
15630
17271
  /***/ },
15631
- /* 180 */
17272
+ /* 181 */
15632
17273
  /***/ function(module, exports, __webpack_require__) {
15633
17274
 
15634
17275
  /**
@@ -15688,7 +17329,7 @@ module.exports =
15688
17329
  module.exports = invariant;
15689
17330
 
15690
17331
  /***/ },
15691
- /* 181 */
17332
+ /* 182 */
15692
17333
  /***/ function(module, exports, __webpack_require__) {
15693
17334
 
15694
17335
  'use strict';
@@ -15713,7 +17354,7 @@ module.exports =
15713
17354
 
15714
17355
  var _addEventListener2 = _interopRequireDefault(_addEventListener);
15715
17356
 
15716
- var _isWindow = __webpack_require__(183);
17357
+ var _isWindow = __webpack_require__(184);
15717
17358
 
15718
17359
  var _isWindow2 = _interopRequireDefault(_isWindow);
15719
17360
 
@@ -15847,7 +17488,7 @@ module.exports =
15847
17488
  module.exports = exports['default'];
15848
17489
 
15849
17490
  /***/ },
15850
- /* 182 */
17491
+ /* 183 */
15851
17492
  /***/ function(module, exports, __webpack_require__) {
15852
17493
 
15853
17494
  'use strict';
@@ -15856,7 +17497,7 @@ module.exports =
15856
17497
  value: true
15857
17498
  });
15858
17499
 
15859
- var _Align = __webpack_require__(181);
17500
+ var _Align = __webpack_require__(182);
15860
17501
 
15861
17502
  var _Align2 = _interopRequireDefault(_Align);
15862
17503
 
@@ -15867,7 +17508,7 @@ module.exports =
15867
17508
  module.exports = exports['default'];
15868
17509
 
15869
17510
  /***/ },
15870
- /* 183 */
17511
+ /* 184 */
15871
17512
  /***/ function(module, exports) {
15872
17513
 
15873
17514
  "use strict";
@@ -15884,7 +17525,7 @@ module.exports =
15884
17525
  module.exports = exports['default'];
15885
17526
 
15886
17527
  /***/ },
15887
- /* 184 */
17528
+ /* 185 */
15888
17529
  /***/ function(module, exports, __webpack_require__) {
15889
17530
 
15890
17531
  'use strict';
@@ -15899,9 +17540,9 @@ module.exports =
15899
17540
 
15900
17541
  var _react2 = _interopRequireDefault(_react);
15901
17542
 
15902
- var _ChildrenUtils = __webpack_require__(186);
17543
+ var _ChildrenUtils = __webpack_require__(187);
15903
17544
 
15904
- var _AnimateChild = __webpack_require__(185);
17545
+ var _AnimateChild = __webpack_require__(186);
15905
17546
 
15906
17547
  var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
15907
17548
 
@@ -16220,7 +17861,7 @@ module.exports =
16220
17861
  module.exports = exports['default'];
16221
17862
 
16222
17863
  /***/ },
16223
- /* 185 */
17864
+ /* 186 */
16224
17865
  /***/ function(module, exports, __webpack_require__) {
16225
17866
 
16226
17867
  'use strict';
@@ -16331,7 +17972,7 @@ module.exports =
16331
17972
  module.exports = exports['default'];
16332
17973
 
16333
17974
  /***/ },
16334
- /* 186 */
17975
+ /* 187 */
16335
17976
  /***/ function(module, exports, __webpack_require__) {
16336
17977
 
16337
17978
  'use strict';
@@ -16453,16 +18094,16 @@ module.exports =
16453
18094
  }
16454
18095
 
16455
18096
  /***/ },
16456
- /* 187 */
18097
+ /* 188 */
16457
18098
  /***/ function(module, exports, __webpack_require__) {
16458
18099
 
16459
18100
  'use strict';
16460
18101
 
16461
18102
  // export this package's api
16462
- module.exports = __webpack_require__(184);
18103
+ module.exports = __webpack_require__(185);
16463
18104
 
16464
18105
  /***/ },
16465
- /* 188 */
18106
+ /* 189 */
16466
18107
  /***/ function(module, exports, __webpack_require__) {
16467
18108
 
16468
18109
  'use strict';
@@ -16475,7 +18116,7 @@ module.exports =
16475
18116
 
16476
18117
  var _react2 = _interopRequireDefault(_react);
16477
18118
 
16478
- var _Select = __webpack_require__(191);
18119
+ var _Select = __webpack_require__(192);
16479
18120
 
16480
18121
  var _Select2 = _interopRequireDefault(_Select);
16481
18122
 
@@ -16699,7 +18340,7 @@ module.exports =
16699
18340
  module.exports = exports['default'];
16700
18341
 
16701
18342
  /***/ },
16702
- /* 189 */
18343
+ /* 190 */
16703
18344
  /***/ function(module, exports, __webpack_require__) {
16704
18345
 
16705
18346
  'use strict';
@@ -16895,7 +18536,7 @@ module.exports =
16895
18536
  module.exports = exports['default'];
16896
18537
 
16897
18538
  /***/ },
16898
- /* 190 */
18539
+ /* 191 */
16899
18540
  /***/ function(module, exports, __webpack_require__) {
16900
18541
 
16901
18542
  'use strict';
@@ -16912,11 +18553,11 @@ module.exports =
16912
18553
 
16913
18554
  var _react2 = _interopRequireDefault(_react);
16914
18555
 
16915
- var _Header = __webpack_require__(189);
18556
+ var _Header = __webpack_require__(190);
16916
18557
 
16917
18558
  var _Header2 = _interopRequireDefault(_Header);
16918
18559
 
16919
- var _Combobox = __webpack_require__(188);
18560
+ var _Combobox = __webpack_require__(189);
16920
18561
 
16921
18562
  var _Combobox2 = _interopRequireDefault(_Combobox);
16922
18563
 
@@ -17089,7 +18730,7 @@ module.exports =
17089
18730
  module.exports = exports['default'];
17090
18731
 
17091
18732
  /***/ },
17092
- /* 191 */
18733
+ /* 192 */
17093
18734
  /***/ function(module, exports, __webpack_require__) {
17094
18735
 
17095
18736
  'use strict';
@@ -17250,7 +18891,7 @@ module.exports =
17250
18891
  module.exports = exports['default'];
17251
18892
 
17252
18893
  /***/ },
17253
- /* 192 */
18894
+ /* 193 */
17254
18895
  /***/ function(module, exports, __webpack_require__) {
17255
18896
 
17256
18897
  'use strict';
@@ -17263,15 +18904,15 @@ module.exports =
17263
18904
 
17264
18905
  var _react2 = _interopRequireDefault(_react);
17265
18906
 
17266
- var _rcTrigger = __webpack_require__(198);
18907
+ var _rcTrigger = __webpack_require__(199);
17267
18908
 
17268
18909
  var _rcTrigger2 = _interopRequireDefault(_rcTrigger);
17269
18910
 
17270
- var _Panel = __webpack_require__(190);
18911
+ var _Panel = __webpack_require__(191);
17271
18912
 
17272
18913
  var _Panel2 = _interopRequireDefault(_Panel);
17273
18914
 
17274
- var _placements = __webpack_require__(194);
18915
+ var _placements = __webpack_require__(195);
17275
18916
 
17276
18917
  var _placements2 = _interopRequireDefault(_placements);
17277
18918
 
@@ -17553,7 +19194,7 @@ module.exports =
17553
19194
  module.exports = exports['default'];
17554
19195
 
17555
19196
  /***/ },
17556
- /* 193 */
19197
+ /* 194 */
17557
19198
  /***/ function(module, exports, __webpack_require__) {
17558
19199
 
17559
19200
  'use strict';
@@ -17562,7 +19203,7 @@ module.exports =
17562
19203
  value: true
17563
19204
  });
17564
19205
 
17565
- var _TimePicker = __webpack_require__(192);
19206
+ var _TimePicker = __webpack_require__(193);
17566
19207
 
17567
19208
  var _TimePicker2 = _interopRequireDefault(_TimePicker);
17568
19209
 
@@ -17572,7 +19213,7 @@ module.exports =
17572
19213
  module.exports = exports['default'];
17573
19214
 
17574
19215
  /***/ },
17575
- /* 194 */
19216
+ /* 195 */
17576
19217
  /***/ function(module, exports) {
17577
19218
 
17578
19219
  'use strict';
@@ -17618,7 +19259,7 @@ module.exports =
17618
19259
  module.exports = exports['default'];
17619
19260
 
17620
19261
  /***/ },
17621
- /* 195 */
19262
+ /* 196 */
17622
19263
  /***/ function(module, exports, __webpack_require__) {
17623
19264
 
17624
19265
  'use strict';
@@ -17639,15 +19280,15 @@ module.exports =
17639
19280
 
17640
19281
  var _reactDom2 = _interopRequireDefault(_reactDom);
17641
19282
 
17642
- var _rcAlign = __webpack_require__(182);
19283
+ var _rcAlign = __webpack_require__(183);
17643
19284
 
17644
19285
  var _rcAlign2 = _interopRequireDefault(_rcAlign);
17645
19286
 
17646
- var _rcAnimate = __webpack_require__(187);
19287
+ var _rcAnimate = __webpack_require__(188);
17647
19288
 
17648
19289
  var _rcAnimate2 = _interopRequireDefault(_rcAnimate);
17649
19290
 
17650
- var _PopupInner = __webpack_require__(196);
19291
+ var _PopupInner = __webpack_require__(197);
17651
19292
 
17652
19293
  var _PopupInner2 = _interopRequireDefault(_PopupInner);
17653
19294
 
@@ -17849,7 +19490,7 @@ module.exports =
17849
19490
  module.exports = exports['default'];
17850
19491
 
17851
19492
  /***/ },
17852
- /* 196 */
19493
+ /* 197 */
17853
19494
  /***/ function(module, exports, __webpack_require__) {
17854
19495
 
17855
19496
  'use strict';
@@ -17906,7 +19547,7 @@ module.exports =
17906
19547
  module.exports = exports['default'];
17907
19548
 
17908
19549
  /***/ },
17909
- /* 197 */
19550
+ /* 198 */
17910
19551
  /***/ function(module, exports, __webpack_require__) {
17911
19552
 
17912
19553
  'use strict';
@@ -17927,7 +19568,7 @@ module.exports =
17927
19568
 
17928
19569
  var _reactDom2 = _interopRequireDefault(_reactDom);
17929
19570
 
17930
- var _contains = __webpack_require__(200);
19571
+ var _contains = __webpack_require__(201);
17931
19572
 
17932
19573
  var _contains2 = _interopRequireDefault(_contains);
17933
19574
 
@@ -17935,13 +19576,13 @@ module.exports =
17935
19576
 
17936
19577
  var _addEventListener2 = _interopRequireDefault(_addEventListener);
17937
19578
 
17938
- var _Popup = __webpack_require__(195);
19579
+ var _Popup = __webpack_require__(196);
17939
19580
 
17940
19581
  var _Popup2 = _interopRequireDefault(_Popup);
17941
19582
 
17942
- var _utils = __webpack_require__(199);
19583
+ var _utils = __webpack_require__(200);
17943
19584
 
17944
- var _getContainerRenderMixin = __webpack_require__(201);
19585
+ var _getContainerRenderMixin = __webpack_require__(202);
17945
19586
 
17946
19587
  var _getContainerRenderMixin2 = _interopRequireDefault(_getContainerRenderMixin);
17947
19588
 
@@ -18405,15 +20046,15 @@ module.exports =
18405
20046
  module.exports = exports['default'];
18406
20047
 
18407
20048
  /***/ },
18408
- /* 198 */
20049
+ /* 199 */
18409
20050
  /***/ function(module, exports, __webpack_require__) {
18410
20051
 
18411
20052
  'use strict';
18412
20053
 
18413
- module.exports = __webpack_require__(197);
20054
+ module.exports = __webpack_require__(198);
18414
20055
 
18415
20056
  /***/ },
18416
- /* 199 */
20057
+ /* 200 */
18417
20058
  /***/ function(module, exports, __webpack_require__) {
18418
20059
 
18419
20060
  'use strict';
@@ -18453,7 +20094,7 @@ module.exports =
18453
20094
  }
18454
20095
 
18455
20096
  /***/ },
18456
- /* 200 */
20097
+ /* 201 */
18457
20098
  /***/ function(module, exports) {
18458
20099
 
18459
20100
  "use strict";
@@ -18476,7 +20117,7 @@ module.exports =
18476
20117
  module.exports = exports['default'];
18477
20118
 
18478
20119
  /***/ },
18479
- /* 201 */
20120
+ /* 202 */
18480
20121
  /***/ function(module, exports, __webpack_require__) {
18481
20122
 
18482
20123
  'use strict';
@@ -18581,7 +20222,7 @@ module.exports =
18581
20222
  module.exports = exports['default'];
18582
20223
 
18583
20224
  /***/ },
18584
- /* 202 */
20225
+ /* 203 */
18585
20226
  /***/ function(module, exports, __webpack_require__) {
18586
20227
 
18587
20228
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -19602,8 +21243,8 @@ module.exports =
19602
21243
  //# sourceMappingURL=index.js.map
19603
21244
 
19604
21245
  /***/ },
19605
- /* 203 */,
19606
- /* 204 */
21246
+ /* 204 */,
21247
+ /* 205 */
19607
21248
  /***/ function(module, exports, __webpack_require__) {
19608
21249
 
19609
21250
  'use strict';
@@ -19612,19 +21253,19 @@ module.exports =
19612
21253
 
19613
21254
  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; };
19614
21255
 
19615
- var _addClass = __webpack_require__(206);
21256
+ var _addClass = __webpack_require__(207);
19616
21257
 
19617
21258
  var _addClass2 = _interopRequireDefault(_addClass);
19618
21259
 
19619
- var _removeClass = __webpack_require__(208);
21260
+ var _removeClass = __webpack_require__(209);
19620
21261
 
19621
21262
  var _removeClass2 = _interopRequireDefault(_removeClass);
19622
21263
 
19623
- var _requestAnimationFrame = __webpack_require__(210);
21264
+ var _requestAnimationFrame = __webpack_require__(211);
19624
21265
 
19625
21266
  var _requestAnimationFrame2 = _interopRequireDefault(_requestAnimationFrame);
19626
21267
 
19627
- var _properties = __webpack_require__(209);
21268
+ var _properties = __webpack_require__(210);
19628
21269
 
19629
21270
  var _react = __webpack_require__(1);
19630
21271
 
@@ -19837,7 +21478,7 @@ module.exports =
19837
21478
  module.exports = exports['default'];
19838
21479
 
19839
21480
  /***/ },
19840
- /* 205 */
21481
+ /* 206 */
19841
21482
  /***/ function(module, exports, __webpack_require__) {
19842
21483
 
19843
21484
  'use strict';
@@ -19858,11 +21499,11 @@ module.exports =
19858
21499
 
19859
21500
  var _propTypes2 = _interopRequireDefault(_propTypes);
19860
21501
 
19861
- var _warning = __webpack_require__(212);
21502
+ var _warning = __webpack_require__(213);
19862
21503
 
19863
21504
  var _warning2 = _interopRequireDefault(_warning);
19864
21505
 
19865
- var _ChildMapping = __webpack_require__(211);
21506
+ var _ChildMapping = __webpack_require__(212);
19866
21507
 
19867
21508
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19868
21509
 
@@ -20114,7 +21755,7 @@ module.exports =
20114
21755
  module.exports = exports['default'];
20115
21756
 
20116
21757
  /***/ },
20117
- /* 206 */
21758
+ /* 207 */
20118
21759
  /***/ function(module, exports, __webpack_require__) {
20119
21760
 
20120
21761
  'use strict';
@@ -20124,7 +21765,7 @@ module.exports =
20124
21765
  });
20125
21766
  exports.default = addClass;
20126
21767
 
20127
- var _hasClass = __webpack_require__(207);
21768
+ var _hasClass = __webpack_require__(208);
20128
21769
 
20129
21770
  var _hasClass2 = _interopRequireDefault(_hasClass);
20130
21771
 
@@ -20136,7 +21777,7 @@ module.exports =
20136
21777
  module.exports = exports['default'];
20137
21778
 
20138
21779
  /***/ },
20139
- /* 207 */
21780
+ /* 208 */
20140
21781
  /***/ function(module, exports) {
20141
21782
 
20142
21783
  "use strict";
@@ -20151,7 +21792,7 @@ module.exports =
20151
21792
  module.exports = exports["default"];
20152
21793
 
20153
21794
  /***/ },
20154
- /* 208 */
21795
+ /* 209 */
20155
21796
  /***/ function(module, exports) {
20156
21797
 
20157
21798
  'use strict';
@@ -20161,7 +21802,7 @@ module.exports =
20161
21802
  };
20162
21803
 
20163
21804
  /***/ },
20164
- /* 209 */
21805
+ /* 210 */
20165
21806
  /***/ function(module, exports, __webpack_require__) {
20166
21807
 
20167
21808
  'use strict';
@@ -20276,7 +21917,7 @@ module.exports =
20276
21917
  }
20277
21918
 
20278
21919
  /***/ },
20279
- /* 210 */
21920
+ /* 211 */
20280
21921
  /***/ function(module, exports, __webpack_require__) {
20281
21922
 
20282
21923
  'use strict';
@@ -20334,7 +21975,7 @@ module.exports =
20334
21975
  module.exports = exports['default'];
20335
21976
 
20336
21977
  /***/ },
20337
- /* 211 */
21978
+ /* 212 */
20338
21979
  /***/ function(module, exports, __webpack_require__) {
20339
21980
 
20340
21981
  'use strict';
@@ -20430,7 +22071,7 @@ module.exports =
20430
22071
  }
20431
22072
 
20432
22073
  /***/ },
20433
- /* 212 */
22074
+ /* 213 */
20434
22075
  /***/ function(module, exports, __webpack_require__) {
20435
22076
 
20436
22077
  /**
@@ -20496,13 +22137,13 @@ module.exports =
20496
22137
 
20497
22138
 
20498
22139
  /***/ },
20499
- /* 213 */
22140
+ /* 214 */
20500
22141
  /***/ function(module, exports) {
20501
22142
 
20502
22143
  module.exports = require("moment-timezone");
20503
22144
 
20504
22145
  /***/ },
20505
- /* 214 */
22146
+ /* 215 */
20506
22147
  /***/ function(module, exports) {
20507
22148
 
20508
22149
  module.exports = require("redux");