@lingk/sync 0.1.79 → 0.1.81

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
@@ -68,7 +68,7 @@ module.exports =
68
68
  /* 0 */
69
69
  /***/ function(module, exports, __webpack_require__) {
70
70
 
71
- module.exports = __webpack_require__(127);
71
+ module.exports = __webpack_require__(128);
72
72
 
73
73
 
74
74
  /***/ },
@@ -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;
@@ -946,7 +944,7 @@ module.exports =
946
944
 
947
945
  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; };
948
946
 
949
- var _propertyUtils = __webpack_require__(170);
947
+ var _propertyUtils = __webpack_require__(171);
950
948
 
951
949
  var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source;
952
950
 
@@ -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__(176)();
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__(204);
1552
+ var _TransitionGroup = __webpack_require__(206);
1555
1553
 
1556
1554
  var _TransitionGroup2 = _interopRequireDefault(_TransitionGroup);
1557
1555
 
1558
- var _CSSTransitionGroupChild = __webpack_require__(203);
1556
+ var _CSSTransitionGroupChild = __webpack_require__(205);
1559
1557
 
1560
1558
  var _CSSTransitionGroupChild2 = _interopRequireDefault(_CSSTransitionGroupChild);
1561
1559
 
@@ -1818,7 +1816,7 @@ module.exports =
1818
1816
 
1819
1817
  exports.__esModule = true;
1820
1818
 
1821
- var _assign = __webpack_require__(129);
1819
+ var _assign = __webpack_require__(130);
1822
1820
 
1823
1821
  var _assign2 = _interopRequireDefault(_assign);
1824
1822
 
@@ -2704,6 +2702,12 @@ module.exports =
2704
2702
  primaryKeyResource = primarySourceResource.type;
2705
2703
  }
2706
2704
 
2705
+ var rscParentProvider = null;
2706
+ if (rsc.parentNameAndProvider) {
2707
+ var provArray = rsc.parentNameAndProvider.split('_');
2708
+ rscParentProvider = provArray[provArray.length - 1];
2709
+ }
2710
+
2707
2711
  if (sourceResource) {
2708
2712
  return Object.assign({
2709
2713
  resourceName: sourceResource.type,
@@ -2721,7 +2725,7 @@ module.exports =
2721
2725
  return pf.val;
2722
2726
  }) }, {
2723
2727
  level: rsc.level || (rscIndex === 0 ? 0 : 1)
2724
- }, primaryKeyResource && { parentNameAndProvider: primaryKeyResource + '_' + rsc.provider.toLowerCase() });
2728
+ }, primaryKeyResource && rscParentProvider && { parentNameAndProvider: primaryKeyResource + '_' + rscParentProvider.toLowerCase() });
2725
2729
  } else return null;
2726
2730
  });
2727
2731
  }
@@ -2776,7 +2780,7 @@ module.exports =
2776
2780
 
2777
2781
  exports.__esModule = true;
2778
2782
 
2779
- var _defineProperty = __webpack_require__(130);
2783
+ var _defineProperty = __webpack_require__(131);
2780
2784
 
2781
2785
  var _defineProperty2 = _interopRequireDefault(_defineProperty);
2782
2786
 
@@ -2911,7 +2915,7 @@ module.exports =
2911
2915
  value: true
2912
2916
  });
2913
2917
 
2914
- var _objectWithoutProperties2 = __webpack_require__(132);
2918
+ var _objectWithoutProperties2 = __webpack_require__(133);
2915
2919
 
2916
2920
  var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
2917
2921
 
@@ -4747,7 +4751,7 @@ module.exports =
4747
4751
 
4748
4752
  var _EventBaseObject2 = _interopRequireDefault(_EventBaseObject);
4749
4753
 
4750
- var _objectAssign = __webpack_require__(175);
4754
+ var _objectAssign = __webpack_require__(176);
4751
4755
 
4752
4756
  var _objectAssign2 = _interopRequireDefault(_objectAssign);
4753
4757
 
@@ -5098,9 +5102,11 @@ module.exports =
5098
5102
  value: true
5099
5103
  });
5100
5104
  exports.callGetMetadata = callGetMetadata;
5105
+ exports.setCsvFields = setCsvFields;
5101
5106
  exports.tryCheckConnection = tryCheckConnection;
5102
5107
  exports.callGetProviderMetadata = callGetProviderMetadata;
5103
5108
  exports.getOauthUrl = getOauthUrl;
5109
+ exports.generateNewAdapterSecret = generateNewAdapterSecret;
5104
5110
  exports.createLingkExternalIds = createLingkExternalIds;
5105
5111
  exports.callAddCustomField = callAddCustomField;
5106
5112
  exports.gotEmptyScenario = gotEmptyScenario;
@@ -5120,10 +5126,12 @@ module.exports =
5120
5126
  exports.callDeployTrigger = callDeployTrigger;
5121
5127
  exports.callInit = callInit;
5122
5128
  exports.callGetPiConfig = callGetPiConfig;
5123
- exports.tryGetMetadataIntro = tryGetMetadataIntro;
5124
5129
  exports.callGetCredentials = callGetCredentials;
5130
+ exports.clearAdapterSecrets = clearAdapterSecrets;
5131
+ exports.setLoadedAdapterSecret = setLoadedAdapterSecret;
5125
5132
  exports.getCredentialForEnvironment = getCredentialForEnvironment;
5126
5133
  exports.tryGetCredentials = tryGetCredentials;
5134
+ exports.tryGetAdapterSecret = tryGetAdapterSecret;
5127
5135
  exports.tryGetMetadataReload = tryGetMetadataReload;
5128
5136
  exports.callGetBundles = callGetBundles;
5129
5137
  exports.callGetMapping = callGetMapping;
@@ -5149,6 +5157,8 @@ module.exports =
5149
5157
 
5150
5158
  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; } }
5151
5159
 
5160
+ 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; }
5161
+
5152
5162
  function callGetMetadata(tenantId, appId, mode, providerType, urlSuffix, apiUrl, endpoint, credsConfig, isFramework, creds, environment, isReload) {
5153
5163
  var metadata = null;
5154
5164
  var isOauth = credsConfig && credsConfig[0] === 'Oauth';
@@ -5181,6 +5191,13 @@ module.exports =
5181
5191
  };
5182
5192
  }
5183
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
+
5184
5201
  // "fake" credentials for demo purposes
5185
5202
  function isDemoCreds(creds, providerType) {
5186
5203
  if (creds && providerType) {
@@ -5227,13 +5244,17 @@ module.exports =
5227
5244
  // 'testconnection ' GET route is for adapter only. Should be called 'adaptermetadata'
5228
5245
 
5229
5246
 
5247
+ var isAdapter = false;
5230
5248
  if (urlSuffix === 'testconnection') {
5231
5249
  urlSuffix = 'testconnection?url=' + endpoint;
5250
+ isAdapter = true;
5232
5251
  }
5233
5252
  if (urlSuffix === 'adaptermetadata') {
5234
5253
  urlSuffix = 'adaptermetadata?url=' + endpoint;
5254
+ isAdapter = true;
5235
5255
  }
5236
- if (isOauth) {
5256
+ if (isOauth || isAdapter) {
5257
+ // USE ONLY ENVS!!!
5237
5258
  return api.get(tenantId + '/' + appId + '/environments/' + envName + '/' + urlSuffix, {
5238
5259
  endpoint: config[apiUrl]
5239
5260
  });
@@ -5270,10 +5291,29 @@ module.exports =
5270
5291
  };
5271
5292
  }
5272
5293
 
5273
- function createLingkExternalIds(tenantId, appId, bundles, mappings, metadata, envName) {
5294
+ function generateNewAdapterSecret(tenantId, accountId, envName, mode) {
5274
5295
  return function (dispatch, getState, api) {
5275
5296
  var _getState4 = getState(),
5276
- config = _getState4.config;
5297
+ config = _getState4.config,
5298
+ wizard = _getState4.wizard;
5299
+
5300
+ var TRANS_API_URL = config.TRANS_API_URL;
5301
+
5302
+ return api.post(tenantId + '/' + accountId + '/credentials/AdapterSecret/environment/' + envName + '/generate', {
5303
+ endpoint: TRANS_API_URL
5304
+ }).then(function (data) {
5305
+ dispatch({
5306
+ type: types.SET_WIZARD_SAVED_CREDENTIALS,
5307
+ data: Object.assign({}, wizard.savedCredentials, _defineProperty({}, mode + 'AdapterSecret', data))
5308
+ });
5309
+ });
5310
+ };
5311
+ }
5312
+
5313
+ function createLingkExternalIds(tenantId, appId, bundles, mappings, metadata, envName) {
5314
+ return function (dispatch, getState, api) {
5315
+ var _getState5 = getState(),
5316
+ config = _getState5.config;
5277
5317
 
5278
5318
  var externalIdlessObjects = [];
5279
5319
  // only run for Salesforce
@@ -5311,8 +5351,8 @@ module.exports =
5311
5351
 
5312
5352
  function callAddCustomField(tenantId, appId, objectType, fieldName, completedCallback, envName) {
5313
5353
  return function (dispatch, getState, api) {
5314
- var _getState5 = getState(),
5315
- config = _getState5.config;
5354
+ var _getState6 = getState(),
5355
+ config = _getState6.config;
5316
5356
 
5317
5357
  return api.post(tenantId + '/' + appId + '/environments/' + envName + '/salesforceschema/field', {
5318
5358
  endpoint: config.SF_AGENT_API_URL,
@@ -5364,8 +5404,8 @@ module.exports =
5364
5404
 
5365
5405
  function callGetScenarioList(tenantId, appId, typeGuid) {
5366
5406
  return function (dispatch, getState, api) {
5367
- var _getState6 = getState(),
5368
- config = _getState6.config;
5407
+ var _getState7 = getState(),
5408
+ config = _getState7.config;
5369
5409
 
5370
5410
  return api.get(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
5371
5411
  endpoint: config.TRANS_API_URL
@@ -5375,8 +5415,8 @@ module.exports =
5375
5415
 
5376
5416
  function callCreateScenario(tenantId, appId, data) {
5377
5417
  return function (dispatch, getState, api) {
5378
- var _getState7 = getState(),
5379
- config = _getState7.config;
5418
+ var _getState8 = getState(),
5419
+ config = _getState8.config;
5380
5420
 
5381
5421
  return api.post(tenantId + '/' + appId + '/scenario', {
5382
5422
  endpoint: config.TRANS_API_URL,
@@ -5387,8 +5427,8 @@ module.exports =
5387
5427
 
5388
5428
  function callUpdateScenarioList(tenantId, appId, typeGuid, scenarioIds) {
5389
5429
  return function (dispatch, getState, api) {
5390
- var _getState8 = getState(),
5391
- config = _getState8.config;
5430
+ var _getState9 = getState(),
5431
+ config = _getState9.config;
5392
5432
 
5393
5433
  return api.post(tenantId + '/' + appId + '/scenarios/' + typeGuid, {
5394
5434
  endpoint: config.TRANS_API_URL,
@@ -5401,8 +5441,8 @@ module.exports =
5401
5441
 
5402
5442
  function callPostBundles(tenantId, appId, bundles, onGenerationError) {
5403
5443
  return function (dispatch, getState, api) {
5404
- var _getState9 = getState(),
5405
- config = _getState9.config;
5444
+ var _getState10 = getState(),
5445
+ config = _getState10.config;
5406
5446
 
5407
5447
  var data = { bundles: bundles };
5408
5448
  return api.post(tenantId + '/' + appId + '/bundle', {
@@ -5418,8 +5458,8 @@ module.exports =
5418
5458
 
5419
5459
  function callPostMapping(tenantId, appId, mappings, onGenerationError) {
5420
5460
  return function (dispatch, getState, api) {
5421
- var _getState10 = getState(),
5422
- config = _getState10.config;
5461
+ var _getState11 = getState(),
5462
+ config = _getState11.config;
5423
5463
 
5424
5464
  var data = { mappings: mappings };
5425
5465
  return api.post(tenantId + '/' + appId + '/schemamappings', {
@@ -5435,8 +5475,8 @@ module.exports =
5435
5475
 
5436
5476
  function callPostProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, onGenerationError) {
5437
5477
  return function (dispatch, getState, api) {
5438
- var _getState11 = getState(),
5439
- config = _getState11.config;
5478
+ var _getState12 = getState(),
5479
+ config = _getState12.config;
5440
5480
 
5441
5481
  var data = {
5442
5482
  schemaMappingGuid: schemaMappingGuid,
@@ -5458,8 +5498,8 @@ module.exports =
5458
5498
 
5459
5499
  function callUpdateProductizedIntegration(tenantId, appId, schemaMappingGuid, bundlePackGuid, configuration, title, typeGuid, piGuid, onGenerationError) {
5460
5500
  return function (dispatch, getState, api) {
5461
- var _getState12 = getState(),
5462
- config = _getState12.config;
5501
+ var _getState13 = getState(),
5502
+ config = _getState13.config;
5463
5503
 
5464
5504
  var data = {
5465
5505
  schemaMappingGuid: schemaMappingGuid,
@@ -5481,8 +5521,8 @@ module.exports =
5481
5521
 
5482
5522
  function callGenerateRecipe(tenantId, appId, typeId, typeGuid, title, piGuid, mappingGuid, sourceMetadata, destinationMetadata, isManagedPackage, onGenerationError, envName) {
5483
5523
  return function (dispatch, getState, api) {
5484
- var _getState13 = getState(),
5485
- config = _getState13.config;
5524
+ var _getState14 = getState(),
5525
+ config = _getState14.config;
5486
5526
 
5487
5527
  return api.post(tenantId + '/' + appId + '/productizedintegrations/' + piGuid + '/generate', {
5488
5528
  endpoint: config.TRANS_API_URL,
@@ -5543,8 +5583,8 @@ module.exports =
5543
5583
 
5544
5584
  function callExecuteTransformer(transId) {
5545
5585
  return function (dispatch, getState, api) {
5546
- var _getState14 = getState(),
5547
- config = _getState14.config;
5586
+ var _getState15 = getState(),
5587
+ config = _getState15.config;
5548
5588
 
5549
5589
  var query = '';
5550
5590
  var d = new Date();
@@ -5568,8 +5608,8 @@ module.exports =
5568
5608
 
5569
5609
  function callLookupLogData(externalExecutionId, index, onFinish, generatedRecipe, pi) {
5570
5610
  return function (dispatch, getState, api) {
5571
- var _getState15 = getState(),
5572
- config = _getState15.config;
5611
+ var _getState16 = getState(),
5612
+ config = _getState16.config;
5573
5613
 
5574
5614
  return api.get('logs/transformers/externalExecutionId/' + externalExecutionId, {
5575
5615
  endpoint: config.TRANS_API_URL
@@ -5612,8 +5652,8 @@ module.exports =
5612
5652
  };
5613
5653
  }
5614
5654
  return function (dispatch, getState, api) {
5615
- var _getState16 = getState(),
5616
- config = _getState16.config;
5655
+ var _getState17 = getState(),
5656
+ config = _getState17.config;
5617
5657
 
5618
5658
  return api.post('createtrigger', {
5619
5659
  endpoint: config.TRANS_API_URL,
@@ -5626,8 +5666,8 @@ module.exports =
5626
5666
 
5627
5667
  function callDeployTrigger(generatedRecipe, pi, onFinish) {
5628
5668
  return function (dispatch, getState, api) {
5629
- var _getState17 = getState(),
5630
- config = _getState17.config;
5669
+ var _getState18 = getState(),
5670
+ config = _getState18.config;
5631
5671
 
5632
5672
  return api.put('transformer/deploy/' + generatedRecipe.Id, {
5633
5673
  endpoint: config.TRANS_API_URL,
@@ -5668,8 +5708,8 @@ module.exports =
5668
5708
 
5669
5709
  if (piGuid && piGuid !== '_') {
5670
5710
  return function (dispatch, getState, api) {
5671
- var _getState18 = getState(),
5672
- config = _getState18.config;
5711
+ var _getState19 = getState(),
5712
+ config = _getState19.config;
5673
5713
 
5674
5714
  return api.get(tenantId + '/' + accountId + '/productizedintegration/' + piGuid, {
5675
5715
  endpoint: config.TRANS_API_URL
@@ -5685,65 +5725,97 @@ module.exports =
5685
5725
  var creds = res[0];
5686
5726
  var sourceCreds = creds[0] && creds[0].credentialsJson;
5687
5727
  var destCreds = creds[1] && creds[1].credentialsJson;
5728
+ dispatch({
5729
+ type: types.SET_WIZARD_SAVED_CREDENTIALS,
5730
+ data: {
5731
+ source: sourceCreds,
5732
+ destination: destCreds,
5733
+ sourceAdapterSecret: creds[2],
5734
+ destinationAdapterSecret: creds[3]
5735
+ }
5736
+ });
5688
5737
  var savedSourceEndpoint = sourceCreds && sourceCreds.rootUrl;
5689
5738
  var savedDestinationEndpoint = destCreds && destCreds.rootUrl;
5690
5739
  return Promise.all([dispatch(tryGetMetadataReload(tenantId, accountId, 'source', source, savedSourceEndpoint, sourceCreds, envName)), dispatch(tryGetMetadataReload(tenantId, accountId, 'destination', destination, savedDestinationEndpoint, destCreds, envName))]);
5691
5740
  });
5692
5741
  });
5693
5742
  };
5694
- } else return function (dispatch) {
5695
- // FIRST TIME!
5696
- return Promise.all([dispatch(tryGetMetadataIntro(tenantId, accountId, 'source', source)), dispatch(tryGetMetadataIntro(tenantId, accountId, 'destination', destination))]);
5743
+ } else return function () {
5744
+ return Promise.resolve(null);
5697
5745
  };
5698
5746
  }
5699
5747
 
5700
5748
  // this function runs when a NEW wizard first loads ONLY in Salesforce App (no env step)
5701
- function tryGetMetadataIntro(tenantId, appId, mode, wiz) {
5702
- var type = wiz.type,
5703
- metadataEndpoint = wiz.metadataEndpoint,
5704
- metadataApi = wiz.metadataApi,
5705
- skipEnvStep = wiz.skipEnvStep,
5706
- credentials = wiz.credentials;
5749
+ /*export function tryGetMetadataIntro(tenantId, appId, mode, wiz) {
5750
+ const {type, metadataEndpoint, metadataApi, skipEnvStep, credentials} = wiz
5707
5751
  // automatically pull metadata (SF app)
5752
+ if(skipEnvStep) {
5753
+ return dispatch => dispatch(callGetMetadata(tenantId, appId, mode, type, metadataEndpoint, metadataApi, '_blank', credentials))
5754
+ } else return () => Promise.resolve(null)
5755
+ }*/
5708
5756
 
5709
- if (skipEnvStep) {
5710
- return function (dispatch) {
5711
- return dispatch(callGetMetadata(tenantId, appId, mode, type, metadataEndpoint, metadataApi, '_blank', credentials));
5712
- };
5713
- } else return function () {
5714
- return Promise.resolve(null);
5715
- };
5716
- }
5757
+ /*
5758
+
5759
+ CREDENTIALS ARE A LITTLE BIT WEIRD RIGHT NOW
5760
+
5761
+ The main "source" and "destination" credentials are like rootUrl or secretKey for accessing an external api
5762
+
5763
+ for oauth (SF), actual credentials are not really needed in the front-end, as they are just an AuthCode that is generated in the oauth flow. The only credential to show on the front-end is the userName which is saved along with the AuthCode
5717
5764
 
5718
- function callGetCredentials(tenantId, appId, wiz, envName) {
5765
+ For Adapter providers, the only credential to show front-end is the rootUrl. But there is also the AdapterSecret which is generated server side. We need to check if this exists, but do not need to show it. So it stored separately in redux in credentials.sourceAdapterSecret
5766
+
5767
+ */
5768
+
5769
+ function callGetCredentials(tenantId, appId, wiz, envName, fromUI) {
5719
5770
  var source = wiz.source,
5720
5771
  destination = wiz.destination;
5721
5772
 
5722
5773
  return function (dispatch, getState, api) {
5723
- return Promise.all([dispatch(tryGetCredentials(tenantId, appId, source.type, source.credentials, envName)), dispatch(tryGetCredentials(tenantId, appId, destination.type, destination.credentials, envName))]).then(function (res) {
5774
+ if (fromUI) {
5724
5775
  dispatch({
5725
- type: types.SET_WIZARD_SAVED_CREDENTIALS,
5726
- data: {
5727
- source: res[0] && res[0].credentialsJson,
5728
- destination: res[1] && res[1].credentialsJson
5729
- }
5776
+ type: types.START_WIZARD_ENV_CHECK,
5777
+ mode: 'source'
5730
5778
  });
5731
- return res;
5779
+ dispatch({
5780
+ type: types.START_WIZARD_ENV_CHECK,
5781
+ mode: 'destination'
5782
+ });
5783
+ }
5784
+ return Promise.all([dispatch(tryGetCredentials(tenantId, appId, source.type, source.credentials, envName)), dispatch(tryGetCredentials(tenantId, appId, destination.type, destination.credentials, envName)), dispatch(tryGetAdapterSecret(tenantId, appId, source.metadataEndpoint, envName)), dispatch(tryGetAdapterSecret(tenantId, appId, destination.metadataEndpoint, envName))]);
5785
+ };
5786
+ }
5787
+
5788
+ function clearAdapterSecrets() {
5789
+ return function (dispatch, getState, api) {
5790
+ var _getState20 = getState(),
5791
+ wizard = _getState20.wizard;
5792
+
5793
+ dispatch({
5794
+ type: types.SET_WIZARD_SAVED_CREDENTIALS,
5795
+ data: Object.assign({}, wizard.savedCredentials, {
5796
+ sourceAdapterSecret: null,
5797
+ destinationAdapterSecret: null
5798
+ })
5732
5799
  });
5733
5800
  };
5734
5801
  }
5735
5802
 
5736
- function getCredentialForEnvironment(tenantId, appId, credentialType, envName, mode) {
5803
+ function setLoadedAdapterSecret(cred, mode) {
5737
5804
  return function (dispatch, getState, api) {
5738
- if (mode) {
5739
- dispatch({
5740
- type: types.START_WIZARD_ENV_CHECK,
5741
- mode: mode
5742
- });
5743
- }
5805
+ var _getState21 = getState(),
5806
+ wizard = _getState21.wizard;
5744
5807
 
5745
- var _getState19 = getState(),
5746
- config = _getState19.config;
5808
+ dispatch({
5809
+ type: types.SET_WIZARD_SAVED_CREDENTIALS,
5810
+ data: Object.assign({}, wizard.savedCredentials, _defineProperty({}, mode + 'AdapterSecret', cred))
5811
+ });
5812
+ };
5813
+ }
5814
+
5815
+ function getCredentialForEnvironment(tenantId, appId, credentialType, envName, mode) {
5816
+ return function (dispatch, getState, api) {
5817
+ var _getState22 = getState(),
5818
+ config = _getState22.config;
5747
5819
 
5748
5820
  return api.get(tenantId + '/' + appId + '/credentials/' + credentialType + '/' + envName, {
5749
5821
  endpoint: config.TRANS_API_URL
@@ -5753,9 +5825,22 @@ module.exports =
5753
5825
 
5754
5826
  function tryGetCredentials(tenantId, appId, credentialType, credsConfig, envName) {
5755
5827
  return function (dispatch, getState, api) {
5756
- var isOauth = credsConfig && credsConfig.length === 1 && credsConfig[0] === 'Oauth';
5757
- if (!isOauth && envName) {
5758
- return dispatch(getCredentialForEnvironment(tenantId, appId, credentialType, envName));
5828
+ if (envName) {
5829
+ credentialType = credentialType === 'Salesforce' ? 'SalesforceAuthCode' : credentialType;
5830
+ return dispatch(getCredentialForEnvironment(tenantId, appId, credentialType, envName)).catch(function () {
5831
+ return null;
5832
+ });
5833
+ } else return Promise.resolve(null);
5834
+ };
5835
+ }
5836
+
5837
+ function tryGetAdapterSecret(tenantId, appId, metadataEndpoint, envName) {
5838
+ return function (dispatch, getState, api) {
5839
+ var isAdapter = metadataEndpoint === 'testconnection' || metadataEndpoint === 'adaptermetadata';
5840
+ if (isAdapter) {
5841
+ return dispatch(getCredentialForEnvironment(tenantId, appId, 'AdapterSecret', envName)).catch(function () {
5842
+ return null;
5843
+ });
5759
5844
  } else return Promise.resolve(null);
5760
5845
  };
5761
5846
  }
@@ -5780,8 +5865,8 @@ module.exports =
5780
5865
  function callGetBundles(tenantId, accountId, bundlePackGuid) {
5781
5866
  if (bundlePackGuid) {
5782
5867
  return function (dispatch, getState, api) {
5783
- var _getState20 = getState(),
5784
- config = _getState20.config;
5868
+ var _getState23 = getState(),
5869
+ config = _getState23.config;
5785
5870
 
5786
5871
  return api.get(tenantId + '/' + accountId + '/bundle/' + bundlePackGuid, {
5787
5872
  endpoint: config.TRANS_API_URL
@@ -5798,8 +5883,8 @@ module.exports =
5798
5883
  function callGetMapping(tenantId, accountId, mappingGuid) {
5799
5884
  if (mappingGuid) {
5800
5885
  return function (dispatch, getState, api) {
5801
- var _getState21 = getState(),
5802
- config = _getState21.config;
5886
+ var _getState24 = getState(),
5887
+ config = _getState24.config;
5803
5888
 
5804
5889
  return api.get(tenantId + '/' + accountId + '/schemamappings/' + mappingGuid, {
5805
5890
  endpoint: config.TRANS_API_URL
@@ -5820,8 +5905,8 @@ module.exports =
5820
5905
  mode: mode
5821
5906
  });
5822
5907
 
5823
- var _getState22 = getState(),
5824
- config = _getState22.config;
5908
+ var _getState25 = getState(),
5909
+ config = _getState25.config;
5825
5910
 
5826
5911
  return api.post(tenantId + '/' + appId + '/environments/' + envId + '/credentials', {
5827
5912
  endpoint: config.TRANS_API_URL,
@@ -5835,8 +5920,8 @@ module.exports =
5835
5920
 
5836
5921
  function getEnvironments(tenantId, appId) {
5837
5922
  return function (dispatch, getState, api) {
5838
- var _getState23 = getState(),
5839
- config = _getState23.config;
5923
+ var _getState26 = getState(),
5924
+ config = _getState26.config;
5840
5925
 
5841
5926
  return api.get(tenantId + '/' + appId + '/environments', {
5842
5927
  endpoint: config.TRANS_API_URL
@@ -5856,8 +5941,8 @@ module.exports =
5856
5941
 
5857
5942
  function postEnvironment(tenantId, appId, name) {
5858
5943
  return function (dispatch, getState, api) {
5859
- var _getState24 = getState(),
5860
- config = _getState24.config;
5944
+ var _getState27 = getState(),
5945
+ config = _getState27.config;
5861
5946
 
5862
5947
  return api.post(tenantId + '/' + appId + '/environments', {
5863
5948
  endpoint: config.TRANS_API_URL,
@@ -5870,8 +5955,8 @@ module.exports =
5870
5955
 
5871
5956
  function callGetTrigger(transBaseId) {
5872
5957
  return function (dispatch, getState, api) {
5873
- var _getState25 = getState(),
5874
- config = _getState25.config;
5958
+ var _getState28 = getState(),
5959
+ config = _getState28.config;
5875
5960
 
5876
5961
  if (transBaseId) {
5877
5962
  return api.get('gettrigger/' + transBaseId, {
@@ -6784,12 +6869,22 @@ module.exports =
6784
6869
 
6785
6870
  var _reduxForm = __webpack_require__(2);
6786
6871
 
6787
- var _reactDropzone = __webpack_require__(201);
6872
+ var _reactDropzone = __webpack_require__(203);
6788
6873
 
6789
6874
  var _reactDropzone2 = _interopRequireDefault(_reactDropzone);
6790
6875
 
6876
+ var _papaparse = __webpack_require__(177);
6877
+
6878
+ var _papaparse2 = _interopRequireDefault(_papaparse);
6879
+
6880
+ var _clipboard = __webpack_require__(122);
6881
+
6882
+ var _clipboard2 = _interopRequireDefault(_clipboard);
6883
+
6791
6884
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6792
6885
 
6886
+ 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); } }
6887
+
6793
6888
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6794
6889
 
6795
6890
  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; }
@@ -6806,23 +6901,13 @@ module.exports =
6806
6901
  getOauthUrl = props.getOauthUrl,
6807
6902
  config = props.config,
6808
6903
  check = props.check,
6809
- checking = props.checking;
6904
+ checking = props.checking,
6905
+ generateNewAdapterSecret = props.generateNewAdapterSecret,
6906
+ tenantKey = props.tenantKey,
6907
+ accountKey = props.accountKey,
6908
+ setCsvFields = props.setCsvFields;
6810
6909
 
6811
6910
 
6812
- if (config.skipEnvStep) return _react2.default.createElement(
6813
- 'div',
6814
- { className: 'env-section-body', style: { paddingBottom: 11 } },
6815
- wizard[mode + 'Metadata'] ? _react2.default.createElement(
6816
- 'span',
6817
- null,
6818
- 'Your Salesforce Org is connected. Click Inspect to explore your available Salesforce resources.'
6819
- ) : _react2.default.createElement(
6820
- 'span',
6821
- null,
6822
- 'Your Salesforce Org is not connected. Please revoke all Oauth grants and reauthorize this managed package.'
6823
- )
6824
- );
6825
-
6826
6911
  var Button = inputs.Button;
6827
6912
  var Spinner = inputs.Spinner;
6828
6913
 
@@ -6857,6 +6942,8 @@ module.exports =
6857
6942
  return m.method === 'POST' || m.method === 'PUT';
6858
6943
  });
6859
6944
 
6945
+ var isAdapter = config && (config.metadataEndpoint === 'testconnection' || config.metadataEndpoint === 'adaptermetadata');
6946
+
6860
6947
  return _react2.default.createElement(
6861
6948
  'div',
6862
6949
  { className: 'env-section-body' },
@@ -6867,11 +6954,12 @@ module.exports =
6867
6954
  ),
6868
6955
  _react2.default.createElement('br', null),
6869
6956
  isOauth ? _react2.default.createElement(Oauth, { step: step, wizard: wizard, onCheck: check,
6957
+ creds: formValues[mode + 'Credentials'],
6870
6958
  onGenerateUrl: function onGenerateUrl(urlType) {
6871
6959
  return getOauthUrl(urlType, mode);
6872
6960
  },
6873
6961
  mode: mode, inputs: inputs, checking: checking }) : isSFTP ? _react2.default.createElement(SFTP, { step: step, wizard: wizard, onCheck: check,
6874
- mode: mode, checking: checking }) : _react2.default.createElement(
6962
+ mode: mode, checking: checking, setCsvFields: setCsvFields }) : _react2.default.createElement(
6875
6963
  'div',
6876
6964
  null,
6877
6965
  _react2.default.createElement(
@@ -6933,7 +7021,11 @@ module.exports =
6933
7021
  );
6934
7022
  })
6935
7023
  )
6936
- )
7024
+ ),
7025
+ isAdapter && _react2.default.createElement(AdapterSecret, { step: step, wizard: wizard, onCheck: check,
7026
+ mode: mode, checking: checking, inputs: inputs,
7027
+ generateNewAdapterSecret: generateNewAdapterSecret,
7028
+ tenantKey: tenantKey, accountKey: accountKey })
6937
7029
  ),
6938
7030
  wizard[mode + 'Metadata'] && mode === 'source' && config.bidirectional && POSTS && POSTS.length > 0 && _react2.default.createElement(
6939
7031
  'div',
@@ -6958,6 +7050,9 @@ module.exports =
6958
7050
  var SFTP = function (_Component) {
6959
7051
  _inherits(SFTP, _Component);
6960
7052
 
7053
+ // react-dropzone
7054
+ // papaparse
7055
+
6961
7056
  function SFTP() {
6962
7057
  _classCallCheck(this, SFTP);
6963
7058
 
@@ -6971,9 +7066,42 @@ module.exports =
6971
7066
 
6972
7067
  _createClass(SFTP, [{
6973
7068
  key: 'onDrop',
6974
- value: function onDrop(files) {
6975
- console.log(files);
6976
- this.setState({ files: files });
7069
+ value: function onDrop(fs) {
7070
+ var _this2 = this;
7071
+
7072
+ var _props = this.props,
7073
+ setCsvFields = _props.setCsvFields,
7074
+ mode = _props.mode,
7075
+ step = _props.step,
7076
+ wizard = _props.wizard;
7077
+
7078
+ var m = wizard[mode + 'Metadata'] || [];
7079
+ var files = [].concat(_toConsumableArray(this.state.files));
7080
+ var counter = 0;
7081
+ fs.forEach(function (file) {
7082
+ _papaparse2.default.parse(file, {
7083
+ header: true,
7084
+ complete: function complete(result) {
7085
+ m = m.concat({
7086
+ name: file.name.split('.')[0],
7087
+ type: file.name.split('.')[0],
7088
+ properties: result.meta.fields.map(function (f) {
7089
+ return {
7090
+ label: f,
7091
+ name: f,
7092
+ type: 'string'
7093
+ };
7094
+ })
7095
+ });
7096
+ files = files.concat(file);
7097
+ counter += 1;
7098
+ if (counter === fs.length) {
7099
+ _this2.setState({ files: files });
7100
+ setCsvFields(m, mode, step[mode + 'Provider']);
7101
+ }
7102
+ }
7103
+ });
7104
+ });
6977
7105
  }
6978
7106
  }, {
6979
7107
  key: 'render',
@@ -6998,9 +7126,9 @@ module.exports =
6998
7126
  )
6999
7127
  )
7000
7128
  ),
7001
- _react2.default.createElement(
7129
+ files && files.length > 0 && _react2.default.createElement(
7002
7130
  'aside',
7003
- { style: { marginLeft: 30 } },
7131
+ { style: { marginLeft: 30, display: 'inline-block' } },
7004
7132
  _react2.default.createElement(
7005
7133
  'h3',
7006
7134
  { style: { marginTop: 10 } },
@@ -7009,10 +7137,10 @@ module.exports =
7009
7137
  _react2.default.createElement(
7010
7138
  'ul',
7011
7139
  null,
7012
- files.map(function (f) {
7140
+ files.map(function (f, i) {
7013
7141
  return _react2.default.createElement(
7014
7142
  'li',
7015
- { key: f.name },
7143
+ { key: i },
7016
7144
  f.name,
7017
7145
  ' - ',
7018
7146
  f.size,
@@ -7035,7 +7163,8 @@ module.exports =
7035
7163
  onCheck = _ref.onCheck,
7036
7164
  inputs = _ref.inputs,
7037
7165
  mode = _ref.mode,
7038
- checking = _ref.checking;
7166
+ checking = _ref.checking,
7167
+ creds = _ref.creds;
7039
7168
 
7040
7169
 
7041
7170
  var startOauth = function startOauth() {
@@ -7048,10 +7177,31 @@ module.exports =
7048
7177
  popup.focus();
7049
7178
  };
7050
7179
 
7180
+ var userName = creds && creds.userName;
7181
+
7051
7182
  return _react2.default.createElement(
7052
7183
  'div',
7053
7184
  null,
7054
- _react2.default.createElement(
7185
+ userName && _react2.default.createElement(
7186
+ 'div',
7187
+ null,
7188
+ _react2.default.createElement(
7189
+ 'div',
7190
+ null,
7191
+ 'Authorized with account ',
7192
+ _react2.default.createElement(
7193
+ 'strong',
7194
+ null,
7195
+ userName
7196
+ )
7197
+ ),
7198
+ _react2.default.createElement('br', null)
7199
+ ),
7200
+ userName ? _react2.default.createElement(
7201
+ 'div',
7202
+ null,
7203
+ 'Connect to a different Salesforce Org:'
7204
+ ) : _react2.default.createElement(
7055
7205
  'div',
7056
7206
  null,
7057
7207
  'Are you connecting to a Sandbox or Production Org?'
@@ -7133,85 +7283,209 @@ module.exports =
7133
7283
  );
7134
7284
  };
7135
7285
 
7136
- var CustomSalesforceSettings = function (_Component2) {
7137
- _inherits(CustomSalesforceSettings, _Component2);
7286
+ var AdapterSecret = function (_Component2) {
7287
+ _inherits(AdapterSecret, _Component2);
7138
7288
 
7139
- function CustomSalesforceSettings() {
7140
- _classCallCheck(this, CustomSalesforceSettings);
7289
+ function AdapterSecret() {
7290
+ _classCallCheck(this, AdapterSecret);
7141
7291
 
7142
- var _this2 = _possibleConstructorReturn(this, (CustomSalesforceSettings.__proto__ || Object.getPrototypeOf(CustomSalesforceSettings)).call(this));
7292
+ var _this3 = _possibleConstructorReturn(this, (AdapterSecret.__proto__ || Object.getPrototypeOf(AdapterSecret)).call(this));
7143
7293
 
7144
- _this2.state = {
7145
- custom: false
7294
+ _this3.copy = function () {
7295
+ var _this3$props = _this3.props,
7296
+ wizard = _this3$props.wizard,
7297
+ mode = _this3$props.mode;
7298
+
7299
+ var secret = wizard.savedCredentials && wizard.savedCredentials[mode + 'AdapterSecret'];
7300
+ _clipboard2.default.copy({
7301
+ 'text/plain': secret.credentials
7302
+ });
7303
+ _this3.setState({ secretCopied: true });
7304
+ setTimeout(function () {
7305
+ _this3.setState({ secretCopied: false });
7306
+ }, 4000);
7146
7307
  };
7147
- return _this2;
7148
- }
7149
7308
 
7150
- _createClass(CustomSalesforceSettings, [{
7151
- key: 'componentWillMount',
7152
- value: function componentWillMount() {
7153
- var formValues = this.props.formValues;
7309
+ _this3.state = {
7310
+ generating: false,
7311
+ secretCopied: false
7312
+ };
7313
+ return _this3;
7314
+ }
7154
7315
 
7155
- if (formValues && formValues.batchSize) {
7156
- this.setState({ custom: true });
7157
- }
7158
- }
7159
- }, {
7316
+ _createClass(AdapterSecret, [{
7160
7317
  key: 'render',
7161
7318
  value: function render() {
7162
- var _this3 = this;
7319
+ var _this4 = this;
7163
7320
 
7164
- var inputs = this.props.inputs;
7165
- var Radio = inputs.Radio;
7321
+ var _props2 = this.props,
7322
+ wizard = _props2.wizard,
7323
+ mode = _props2.mode,
7324
+ inputs = _props2.inputs,
7325
+ generateNewAdapterSecret = _props2.generateNewAdapterSecret,
7326
+ tenantKey = _props2.tenantKey,
7327
+ accountKey = _props2.accountKey;
7166
7328
 
7329
+ var secret = wizard.savedCredentials && wizard.savedCredentials[mode + 'AdapterSecret'];
7330
+ var Button = inputs.Button;
7331
+ var Spinner = inputs.Spinner;
7332
+ var Input = inputs.Input;
7167
7333
 
7168
7334
  return _react2.default.createElement(
7169
7335
  'div',
7170
- { style: { marginTop: 23 } },
7171
- _react2.default.createElement(
7172
- 'label',
7173
- { className: 'labelz', style: { fontWeight: 'bold' } },
7174
- 'Bulk Upload Batch Size:'
7175
- ),
7176
- _react2.default.createElement('br', null),
7177
- _react2.default.createElement(Radio, { onChange: function onChange() {
7178
- return _this3.setState({ custom: false });
7179
- },
7180
- label: 'Default Batch Size (10,000)',
7181
- checked: this.state.custom === false,
7182
- style: { cursor: 'pointer', fontWeight: 'normal' }
7183
- }),
7336
+ { style: { marginLeft: 16 } },
7184
7337
  _react2.default.createElement('br', null),
7185
- _react2.default.createElement(Radio, { onChange: function onChange() {
7186
- return _this3.setState({ custom: true });
7187
- },
7188
- label: 'Custom Batch Size',
7189
- checked: this.state.custom === true,
7190
- style: { cursor: 'pointer', fontWeight: 'normal' }
7191
- }),
7192
- this.state.custom === true && _react2.default.createElement(
7338
+ secret && secret.credentials ? _react2.default.createElement(
7193
7339
  'div',
7194
7340
  null,
7195
- _react2.default.createElement('br', null),
7196
- _react2.default.createElement(_reduxForm.Field, { name: 'batchSize', type: 'number', component: inputs.rfInput,
7197
- label: 'Set Batch Size:', placeholder: 'Number of Records' })
7198
- )
7199
- );
7200
- }
7201
- }]);
7202
-
7203
- return CustomSalesforceSettings;
7204
- }(_react.Component);
7205
-
7206
- exports.default = EnvSection;
7207
-
7208
- /***/ },
7209
- /* 106 */
7210
- /***/ function(module, exports, __webpack_require__) {
7211
-
7212
- 'use strict';
7213
-
7214
- Object.defineProperty(exports, "__esModule", {
7341
+ _react2.default.createElement(
7342
+ 'strong',
7343
+ null,
7344
+ 'Adapter Credentials'
7345
+ ),
7346
+ _react2.default.createElement(
7347
+ 'div',
7348
+ { style: { marginTop: 6, marginLeft: 16 } },
7349
+ _react2.default.createElement(
7350
+ 'span',
7351
+ null,
7352
+ 'Client Key'
7353
+ ),
7354
+ _react2.default.createElement('br', null),
7355
+ _react2.default.createElement(Input, { value: 'client.secret.' + tenantKey + '.' + accountKey, readOnly: true })
7356
+ ),
7357
+ _react2.default.createElement(
7358
+ 'div',
7359
+ { style: { marginTop: 6, marginLeft: 16 } },
7360
+ _react2.default.createElement(
7361
+ 'span',
7362
+ null,
7363
+ 'Client Secret'
7364
+ ),
7365
+ _react2.default.createElement('br', null),
7366
+ _react2.default.createElement(Input, { value: secret.credentials, readOnly: true }),
7367
+ _react2.default.createElement(
7368
+ Button,
7369
+ {
7370
+ iconAlign: 'left',
7371
+ onClick: this.copy,
7372
+ style: { margin: '0 8px', marginBottom: 2, height: 30, lineHeight: '10px' } },
7373
+ 'Copy to clipboard'
7374
+ ),
7375
+ this.state.secretCopied && _react2.default.createElement(
7376
+ 'span',
7377
+ null,
7378
+ 'Copied!'
7379
+ )
7380
+ )
7381
+ ) : _react2.default.createElement(
7382
+ 'div',
7383
+ null,
7384
+ _react2.default.createElement(
7385
+ 'span',
7386
+ null,
7387
+ 'Adapter Secret not found:'
7388
+ ),
7389
+ _react2.default.createElement(
7390
+ Button,
7391
+ {
7392
+ icon: 'sync',
7393
+ iconAlign: 'left',
7394
+ onClick: function onClick() {
7395
+ _this4.setState({ generating: true });
7396
+ generateNewAdapterSecret(mode);
7397
+ },
7398
+ style: { margin: '0 8px', marginBottom: 2, height: 30, lineHeight: '10px' } },
7399
+ 'Generate New Adapter Secret'
7400
+ ),
7401
+ this.state.generating && _react2.default.createElement(Spinner, null)
7402
+ )
7403
+ );
7404
+ }
7405
+ }]);
7406
+
7407
+ return AdapterSecret;
7408
+ }(_react.Component);
7409
+
7410
+ var CustomSalesforceSettings = function (_Component3) {
7411
+ _inherits(CustomSalesforceSettings, _Component3);
7412
+
7413
+ function CustomSalesforceSettings() {
7414
+ _classCallCheck(this, CustomSalesforceSettings);
7415
+
7416
+ var _this5 = _possibleConstructorReturn(this, (CustomSalesforceSettings.__proto__ || Object.getPrototypeOf(CustomSalesforceSettings)).call(this));
7417
+
7418
+ _this5.state = {
7419
+ custom: false
7420
+ };
7421
+ return _this5;
7422
+ }
7423
+
7424
+ _createClass(CustomSalesforceSettings, [{
7425
+ key: 'componentWillMount',
7426
+ value: function componentWillMount() {
7427
+ var formValues = this.props.formValues;
7428
+
7429
+ if (formValues && formValues.batchSize) {
7430
+ this.setState({ custom: true });
7431
+ }
7432
+ }
7433
+ }, {
7434
+ key: 'render',
7435
+ value: function render() {
7436
+ var _this6 = this;
7437
+
7438
+ var inputs = this.props.inputs;
7439
+ var Radio = inputs.Radio;
7440
+
7441
+
7442
+ return _react2.default.createElement(
7443
+ 'div',
7444
+ { style: { marginTop: 23 } },
7445
+ _react2.default.createElement(
7446
+ 'label',
7447
+ { className: 'labelz', style: { fontWeight: 'bold' } },
7448
+ 'Bulk Upload Batch Size:'
7449
+ ),
7450
+ _react2.default.createElement('br', null),
7451
+ _react2.default.createElement(Radio, { onChange: function onChange() {
7452
+ return _this6.setState({ custom: false });
7453
+ },
7454
+ label: 'Default Batch Size (10,000)',
7455
+ checked: this.state.custom === false,
7456
+ style: { cursor: 'pointer', fontWeight: 'normal' }
7457
+ }),
7458
+ _react2.default.createElement('br', null),
7459
+ _react2.default.createElement(Radio, { onChange: function onChange() {
7460
+ return _this6.setState({ custom: true });
7461
+ },
7462
+ label: 'Custom Batch Size',
7463
+ checked: this.state.custom === true,
7464
+ style: { cursor: 'pointer', fontWeight: 'normal' }
7465
+ }),
7466
+ this.state.custom === true && _react2.default.createElement(
7467
+ 'div',
7468
+ null,
7469
+ _react2.default.createElement('br', null),
7470
+ _react2.default.createElement(_reduxForm.Field, { name: 'batchSize', type: 'number', component: inputs.rfInput,
7471
+ label: 'Set Batch Size:', placeholder: 'Number of Records' })
7472
+ )
7473
+ );
7474
+ }
7475
+ }]);
7476
+
7477
+ return CustomSalesforceSettings;
7478
+ }(_react.Component);
7479
+
7480
+ exports.default = EnvSection;
7481
+
7482
+ /***/ },
7483
+ /* 106 */
7484
+ /***/ function(module, exports, __webpack_require__) {
7485
+
7486
+ 'use strict';
7487
+
7488
+ Object.defineProperty(exports, "__esModule", {
7215
7489
  value: true
7216
7490
  });
7217
7491
 
@@ -7225,7 +7499,7 @@ module.exports =
7225
7499
 
7226
7500
  var _CSSTransitionGroup2 = _interopRequireDefault(_CSSTransitionGroup);
7227
7501
 
7228
- var _nestedField = __webpack_require__(123);
7502
+ var _nestedField = __webpack_require__(124);
7229
7503
 
7230
7504
  var _nestedField2 = _interopRequireDefault(_nestedField);
7231
7505
 
@@ -8191,7 +8465,7 @@ module.exports =
8191
8465
 
8192
8466
  var _reduxForm = __webpack_require__(2);
8193
8467
 
8194
- var _joinVenn = __webpack_require__(122);
8468
+ var _joinVenn = __webpack_require__(123);
8195
8469
 
8196
8470
  var _joinVenn2 = _interopRequireDefault(_joinVenn);
8197
8471
 
@@ -8702,7 +8976,8 @@ module.exports =
8702
8976
  fieldPropLabel: 'label',
8703
8977
  selectedValues: [{
8704
8978
  label: rsc.primaryKeyName,
8705
- parents: rsc.primaryKeyParents
8979
+ parents: rsc.primaryKeyParents,
8980
+ section: rsc.primaryKeyResource
8706
8981
  }],
8707
8982
  sectionLabelSuffix: 'Fields'
8708
8983
  })
@@ -9665,11 +9940,11 @@ module.exports =
9665
9940
 
9666
9941
  var _moment2 = _interopRequireDefault(_moment);
9667
9942
 
9668
- __webpack_require__(212);
9943
+ __webpack_require__(214);
9669
9944
 
9670
- __webpack_require__(171);
9945
+ __webpack_require__(172);
9671
9946
 
9672
- var _rcTimePicker = __webpack_require__(192);
9947
+ var _rcTimePicker = __webpack_require__(194);
9673
9948
 
9674
9949
  var _rcTimePicker2 = _interopRequireDefault(_rcTimePicker);
9675
9950
 
@@ -10077,36 +10352,20 @@ module.exports =
10077
10352
  _this3.envNameInput.blur();
10078
10353
  });
10079
10354
  }
10080
-
10081
- /*saveEnvironment(envName){
10082
- const { actions, tenantId, accountId, formValues, step } = this.props
10083
- const mode = 'source'
10084
- const credentials = formValues[`${mode}Credentials`]
10085
- let endpoint = credentials.rootUrl
10086
- if(endpoint && endpoint[endpoint.length-1]==='/' && endpoint.length>8){
10087
- endpoint = endpoint.slice(0, -1);
10088
- }
10089
- this.setState({savingEnv:true})
10090
- actions.postEnvironment(tenantId, accountId, envName, step[`${mode}Provider`], endpoint,
10091
- credentials)
10092
- .then(savedEnvName=>{
10093
- this.props.change('environment', savedEnvName)
10094
- this.setState({savingEnv:false})
10095
- })
10096
- }*/
10097
-
10098
10355
  }, {
10099
10356
  key: 'selectEnvironment',
10100
10357
  value: function selectEnvironment(v, i, env) {
10101
10358
  this.props.change('environment', env.name);
10102
- if (env.environmentId > -1) {
10103
- this.tryGetCredentialAndCheck('source', env);
10104
- this.tryGetCredentialAndCheck('destination', env);
10105
- }
10359
+ this.props.actions.clearAdapterSecrets();
10360
+ /*if(env.environmentId>-1){
10361
+ this.tryGetCredentialAndCheck('source',env)
10362
+ this.tryGetCredentialAndCheck('destination',env)
10363
+ }*/
10364
+ this.tryGetCredentialAndCheck(env);
10106
10365
  }
10107
10366
  }, {
10108
10367
  key: 'tryGetCredentialAndCheck',
10109
- value: function tryGetCredentialAndCheck(m, env) {
10368
+ value: function tryGetCredentialAndCheck(env) {
10110
10369
  var _this4 = this;
10111
10370
 
10112
10371
  var _props7 = this.props,
@@ -10116,48 +10375,88 @@ module.exports =
10116
10375
  accountId = _props7.accountId,
10117
10376
  change = _props7.change;
10118
10377
 
10119
- var config = step[m + 'Config'];
10120
- var credentials = config.credentials;
10378
+ var modes = ['source', 'destination'];
10379
+ //const config = step[`${m}Config`]
10380
+ //const {credentials} = config
10121
10381
  //dont load creds for oauth, since there are none
10382
+ change('sourceCredentials', { rootUrl: 'https://' });
10383
+ change('destinationCredentials', { rootUrl: 'https://' });
10384
+ this.setState({ sourceEnvChecking: true });
10385
+ this.setState({ destinationEnvChecking: true });
10386
+ //if(!isOauth){
10387
+ var wiz = {
10388
+ source: step.sourceConfig,
10389
+ destination: step.destinationConfig
10390
+ };
10391
+ var fromUI = true;
10392
+ actions.callGetCredentials(tenantId, accountId, wiz, env.name, fromUI).then(function (res) {
10393
+ res.forEach(function (cred, resIndex) {
10394
+ var m = modes[resIndex % 2];
10395
+ if (resIndex === 0 || resIndex === 1) {
10396
+ // main creds
10397
+ if (cred && cred.credentialsJson) {
10398
+ (function () {
10399
+ var modeCreds = {};
10400
+ var credentials = wiz[m].credentials;
10122
10401
 
10123
- var isOauth = credentials && credentials.length === 1 && credentials[0] === 'Oauth';
10124
- this.setState(_defineProperty({}, m + 'EnvChecking', true));
10125
- if (!isOauth) {
10126
- actions.getCredentialForEnvironment(tenantId, accountId, step[m + 'Provider'], env.name, m).then(function (cred) {
10127
- if (cred && cred.credentialsJson && cred.credentialsJson.rootUrl) {
10128
- (function () {
10129
- var modeCreds = {};
10130
- modeCreds['rootUrl'] = cred.credentialsJson.rootUrl;
10131
- credentials && credentials.length > 0 && credentials.forEach(function (credType) {
10132
- if (cred.credentialsJson[credType]) {
10133
- modeCreds[credType] = cred.credentialsJson[credType];
10402
+ var isOauth = credentials && credentials.length === 1 && credentials[0] === 'Oauth';
10403
+ if (isOauth) {
10404
+ modeCreds = cred.credentialsJson;
10405
+ } else {
10406
+ modeCreds['rootUrl'] = cred.credentialsJson.rootUrl;
10407
+ credentials && credentials.length > 0 && credentials.forEach(function (credType) {
10408
+ if (cred.credentialsJson[credType]) {
10409
+ modeCreds[credType] = cred.credentialsJson[credType];
10410
+ }
10411
+ });
10134
10412
  }
10135
- });
10136
- change(m + 'Credentials', modeCreds);
10137
- _this4.check(m, env);
10138
- })();
10413
+ change(m + 'Credentials', modeCreds);
10414
+ _this4.check(m, env);
10415
+ })();
10416
+ } else {
10417
+ _this4.setState(_defineProperty({}, m + 'EnvChecking', false));
10418
+ }
10419
+ } else {
10420
+ // adapter secret if exists
10421
+ if (cred) {
10422
+ actions.setLoadedAdapterSecret(cred, m);
10423
+ }
10139
10424
  }
10140
- }).catch(function (err) {
10141
- _this4.setState(_defineProperty({}, m + 'EnvChecking', false));
10142
10425
  });
10143
- // if oauth, just go ahead and check
10144
- } else {
10145
- this.check(m, env);
10146
- }
10426
+ });
10427
+ }
10428
+ }, {
10429
+ key: 'generateNewAdapterSecret',
10430
+ value: function generateNewAdapterSecret(mode) {
10431
+ var _props8 = this.props,
10432
+ actions = _props8.actions,
10433
+ tenantId = _props8.tenantId,
10434
+ accountId = _props8.accountId,
10435
+ formValues = _props8.formValues;
10436
+
10437
+ var envName = formValues['environment'];
10438
+ actions.generateNewAdapterSecret(tenantId, accountId, envName, mode);
10439
+ }
10440
+ }, {
10441
+ key: 'setCsvFields',
10442
+ value: function setCsvFields(metadata, mode, providerType) {
10443
+ this.props.actions.setCsvFields(metadata, mode, providerType);
10147
10444
  }
10148
10445
  }, {
10149
10446
  key: 'render',
10150
10447
  value: function render() {
10151
10448
  var _this5 = this;
10152
10449
 
10153
- var _props8 = this.props,
10154
- inputs = _props8.inputs,
10155
- step = _props8.step,
10156
- handleSubmit = _props8.handleSubmit,
10157
- nav = _props8.nav,
10158
- reset = _props8.reset,
10159
- wizard = _props8.wizard,
10160
- formValues = _props8.formValues;
10450
+ var _props9 = this.props,
10451
+ inputs = _props9.inputs,
10452
+ step = _props9.step,
10453
+ handleSubmit = _props9.handleSubmit,
10454
+ nav = _props9.nav,
10455
+ reset = _props9.reset,
10456
+ wizard = _props9.wizard,
10457
+ formValues = _props9.formValues,
10458
+ tenantKey = _props9.tenantKey,
10459
+ accountKey = _props9.accountKey;
10161
10460
 
10162
10461
  var modes = ['source', 'destination'];
10163
10462
  var _state = this.state,
@@ -10308,9 +10607,12 @@ module.exports =
10308
10607
  { className: 'env-creds' },
10309
10608
  _react2.default.createElement(_envSections2.default, { config: step[m + 'Config'], mode: m, checking: checking,
10310
10609
  wizard: wizard, getOauthUrl: _this5.getOauthUrl.bind(_this5),
10311
- formValues: formValues,
10312
- clickDirection: _this5.clickDirection.bind(_this5), inputs: inputs, step: step,
10313
- seeFields: _this5.seeFields.bind(_this5), check: _this5.check })
10610
+ formValues: formValues, inputs: inputs, step: step,
10611
+ generateNewAdapterSecret: _this5.generateNewAdapterSecret.bind(_this5),
10612
+ clickDirection: _this5.clickDirection.bind(_this5),
10613
+ seeFields: _this5.seeFields.bind(_this5), check: _this5.check,
10614
+ tenantKey: tenantKey, accountKey: accountKey,
10615
+ setCsvFields: _this5.setCsvFields.bind(_this5) })
10314
10616
  )
10315
10617
  )
10316
10618
  );
@@ -11221,7 +11523,7 @@ module.exports =
11221
11523
 
11222
11524
  var Rows = _interopRequireWildcard(_mapTableRows);
11223
11525
 
11224
- var _newScenarioModal = __webpack_require__(124);
11526
+ var _newScenarioModal = __webpack_require__(125);
11225
11527
 
11226
11528
  var _newScenarioModal2 = _interopRequireDefault(_newScenarioModal);
11227
11529
 
@@ -12145,6 +12447,8 @@ module.exports =
12145
12447
  _createClass(SchemaStep, [{
12146
12448
  key: 'componentDidMount',
12147
12449
  value: function componentDidMount() {
12450
+ var _this2 = this;
12451
+
12148
12452
  var _props = this.props,
12149
12453
  step = _props.step,
12150
12454
  wizard = _props.wizard,
@@ -12156,6 +12460,10 @@ module.exports =
12156
12460
  if (!wizard.dataLoaded) {
12157
12461
  (0, _loadData2.default)(step, wizard, change, formValues, actions, isReverse);
12158
12462
  }
12463
+ var resourceGroups = [].concat(_toConsumableArray(formValues['resourceGroups']));
12464
+ resourceGroups.forEach(function (rg, i) {
12465
+ _this2.assignAllParents(i);
12466
+ });
12159
12467
  }
12160
12468
  }, {
12161
12469
  key: 'openConnectionModal',
@@ -12376,6 +12684,8 @@ module.exports =
12376
12684
  break;
12377
12685
  }
12378
12686
  }
12687
+ console.log(eachR.parentNameAndProvider);
12688
+ //console.log(`${newParent}_${newParentProvider}`.toLowerCase())
12379
12689
  if (newParent && newParentProvider && (newParent + '_' + newParentProvider).toLowerCase() !== (eachR.parentNameAndProvider && eachR.parentNameAndProvider.toLowerCase())) {
12380
12690
  eachR.primaryKeyResource = newParent;
12381
12691
  eachR.parentNameAndProvider = newParent + '_' + newParentProvider;
@@ -12453,7 +12763,7 @@ module.exports =
12453
12763
  }, {
12454
12764
  key: 'render',
12455
12765
  value: function render() {
12456
- var _this2 = this;
12766
+ var _this3 = this;
12457
12767
 
12458
12768
  var _props14 = this.props,
12459
12769
  inputs = _props14.inputs,
@@ -12543,7 +12853,7 @@ module.exports =
12543
12853
  bundleIndex: this.state.selectedBundleIndex,
12544
12854
  sourceSchema: sourceSchema, destinationSchema: destinationSchema,
12545
12855
  update: function update() {
12546
- return _this2.forceUpdate();
12856
+ return _this3.forceUpdate();
12547
12857
  },
12548
12858
  direction: formValues.direction
12549
12859
  })
@@ -12568,6 +12878,185 @@ module.exports =
12568
12878
 
12569
12879
  /***/ },
12570
12880
  /* 122 */
12881
+ /***/ function(module, exports, __webpack_require__) {
12882
+
12883
+ "use strict";
12884
+
12885
+ // https://www.npmjs.com/package/clipboard-js
12886
+
12887
+ // Import support https://stackoverflow.com/questions/13673346/supporting-both-commonjs-and-amd
12888
+ (function (name, definition) {
12889
+ if (true) {
12890
+ module.exports = definition();
12891
+ } else {
12892
+ this[name] = definition();
12893
+ }
12894
+ })("clipboard", function () {
12895
+ if (typeof document === 'undefined' || !document.addEventListener) {
12896
+ return null;
12897
+ }
12898
+
12899
+ var clipboard = {};
12900
+
12901
+ clipboard.copy = function () {
12902
+ var _intercept = false;
12903
+ var _data = null; // Map from data type (e.g. "text/html") to value.
12904
+ var _bogusSelection = false;
12905
+
12906
+ function cleanup() {
12907
+ _intercept = false;
12908
+ _data = null;
12909
+ if (_bogusSelection) {
12910
+ window.getSelection().removeAllRanges();
12911
+ }
12912
+ _bogusSelection = false;
12913
+ }
12914
+
12915
+ document.addEventListener("copy", function (e) {
12916
+ if (_intercept) {
12917
+ for (var key in _data) {
12918
+ e.clipboardData.setData(key, _data[key]);
12919
+ }
12920
+ e.preventDefault();
12921
+ }
12922
+ });
12923
+
12924
+ // Workaround for Safari: https://bugs.webkit.org/show_bug.cgi?id=156529
12925
+ function bogusSelect() {
12926
+ var sel = document.getSelection();
12927
+ // If "nothing" is selected...
12928
+ if (!document.queryCommandEnabled("copy") && sel.isCollapsed) {
12929
+ // ... temporarily select the entire body.
12930
+ //
12931
+ // We select the entire body because:
12932
+ // - it's guaranteed to exist,
12933
+ // - it works (unlike, say, document.head, or phantom element that is
12934
+ // not inserted into the DOM),
12935
+ // - it doesn't seem to flicker (due to the synchronous copy event), and
12936
+ // - it avoids modifying the DOM (can trigger mutation observers).
12937
+ //
12938
+ // Because we can't do proper feature detection (we already checked
12939
+ // document.queryCommandEnabled("copy") , which actually gives a false
12940
+ // negative for Blink when nothing is selected) and UA sniffing is not
12941
+ // reliable (a lot of UA strings contain "Safari"), this will also
12942
+ // happen for some browsers other than Safari. :-()
12943
+ var range = document.createRange();
12944
+ range.selectNodeContents(document.body);
12945
+ sel.removeAllRanges();
12946
+ sel.addRange(range);
12947
+ _bogusSelection = true;
12948
+ }
12949
+ };
12950
+
12951
+ return function (data) {
12952
+ return new Promise(function (resolve, reject) {
12953
+ _intercept = true;
12954
+ if (typeof data === "string") {
12955
+ _data = { "text/plain": data };
12956
+ } else if (data instanceof Node) {
12957
+ _data = { "text/html": new XMLSerializer().serializeToString(data) };
12958
+ } else {
12959
+ _data = data;
12960
+ }
12961
+
12962
+ function triggerCopy(tryBogusSelect) {
12963
+ try {
12964
+ if (document.execCommand("copy")) {
12965
+ // document.execCommand is synchronous: http://www.w3.org/TR/2015/WD-clipboard-apis-20150421/#integration-with-rich-text-editing-apis
12966
+ // So we can call resolve() back here.
12967
+ cleanup();
12968
+ resolve();
12969
+ } else {
12970
+ if (!tryBogusSelect) {
12971
+ bogusSelect();
12972
+ triggerCopy(true);
12973
+ } else {
12974
+ cleanup();
12975
+ throw new Error("Unable to copy. Perhaps it's not available in your browser?");
12976
+ }
12977
+ }
12978
+ } catch (e) {
12979
+ cleanup();
12980
+ reject(e);
12981
+ }
12982
+ }
12983
+ triggerCopy(false);
12984
+ });
12985
+ };
12986
+ }();
12987
+
12988
+ clipboard.paste = function () {
12989
+ var _intercept = false;
12990
+ var _resolve;
12991
+ var _dataType;
12992
+
12993
+ document.addEventListener("paste", function (e) {
12994
+ if (_intercept) {
12995
+ _intercept = false;
12996
+ e.preventDefault();
12997
+ var resolve = _resolve;
12998
+ _resolve = null;
12999
+ resolve(e.clipboardData.getData(_dataType));
13000
+ }
13001
+ });
13002
+
13003
+ return function (dataType) {
13004
+ return new Promise(function (resolve, reject) {
13005
+ _intercept = true;
13006
+ _resolve = resolve;
13007
+ _dataType = dataType || "text/plain";
13008
+ try {
13009
+ if (!document.execCommand("paste")) {
13010
+ _intercept = false;
13011
+ reject(new Error("Unable to paste. Pasting only works in Internet Explorer at the moment."));
13012
+ }
13013
+ } catch (e) {
13014
+ _intercept = false;
13015
+ reject(new Error(e));
13016
+ }
13017
+ });
13018
+ };
13019
+ }();
13020
+
13021
+ // Handle IE behaviour.
13022
+ if (typeof ClipboardEvent === "undefined" && typeof window.clipboardData !== "undefined" && typeof window.clipboardData.setData !== "undefined") {
13023
+
13024
+ clipboard.copy = function (data) {
13025
+ return new Promise(function (resolve, reject) {
13026
+ // IE supports string and URL types: https://msdn.microsoft.com/en-us/library/ms536744(v=vs.85).aspx
13027
+ // We only support the string type for now.
13028
+ if (typeof data !== "string" && !("text/plain" in data)) {
13029
+ throw new Error("You must provide a text/plain type.");
13030
+ }
13031
+
13032
+ var strData = typeof data === "string" ? data : data["text/plain"];
13033
+ var copySucceeded = window.clipboardData.setData("Text", strData);
13034
+ if (copySucceeded) {
13035
+ resolve();
13036
+ } else {
13037
+ reject(new Error("Copying was rejected."));
13038
+ }
13039
+ });
13040
+ };
13041
+
13042
+ clipboard.paste = function () {
13043
+ return new Promise(function (resolve, reject) {
13044
+ var strData = window.clipboardData.getData("Text");
13045
+ if (strData) {
13046
+ resolve(strData);
13047
+ } else {
13048
+ // The user rejected the paste request.
13049
+ reject(new Error("Pasting was rejected."));
13050
+ }
13051
+ });
13052
+ };
13053
+ }
13054
+
13055
+ return clipboard;
13056
+ });
13057
+
13058
+ /***/ },
13059
+ /* 123 */
12571
13060
  /***/ function(module, exports, __webpack_require__) {
12572
13061
 
12573
13062
  'use strict';
@@ -12618,7 +13107,7 @@ module.exports =
12618
13107
  exports.default = JoinVenn;
12619
13108
 
12620
13109
  /***/ },
12621
- /* 123 */
13110
+ /* 124 */
12622
13111
  /***/ function(module, exports, __webpack_require__) {
12623
13112
 
12624
13113
  'use strict';
@@ -12730,7 +13219,7 @@ module.exports =
12730
13219
  exports.default = SourceField;
12731
13220
 
12732
13221
  /***/ },
12733
- /* 124 */
13222
+ /* 125 */
12734
13223
  /***/ function(module, exports, __webpack_require__) {
12735
13224
 
12736
13225
  'use strict';
@@ -12749,7 +13238,7 @@ module.exports =
12749
13238
 
12750
13239
  var _saveData3 = _interopRequireDefault(_saveData2);
12751
13240
 
12752
- var _objectAssignDeep = __webpack_require__(125);
13241
+ var _objectAssignDeep = __webpack_require__(126);
12753
13242
 
12754
13243
  var _objectAssignDeep2 = _interopRequireDefault(_objectAssignDeep);
12755
13244
 
@@ -13021,7 +13510,7 @@ module.exports =
13021
13510
  exports.default = TransformModal;
13022
13511
 
13023
13512
  /***/ },
13024
- /* 125 */
13513
+ /* 126 */
13025
13514
  /***/ function(module, exports) {
13026
13515
 
13027
13516
  'use strict';
@@ -13160,7 +13649,7 @@ module.exports =
13160
13649
  exports.default = objectAssignDeep;
13161
13650
 
13162
13651
  /***/ },
13163
- /* 126 */
13652
+ /* 127 */
13164
13653
  /***/ function(module, exports, __webpack_require__) {
13165
13654
 
13166
13655
  'use strict';
@@ -13395,7 +13884,9 @@ module.exports =
13395
13884
  formValues = _props3.formValues,
13396
13885
  inputs = _props3.inputs,
13397
13886
  tenantId = _props3.tenantId,
13887
+ tenantKey = _props3.tenantKey,
13398
13888
  accountId = _props3.accountId,
13889
+ accountKey = _props3.accountKey,
13399
13890
  config = _props3.config;
13400
13891
  var Sidebar = inputs.Sidebar;
13401
13892
 
@@ -13453,7 +13944,9 @@ module.exports =
13453
13944
  inputs: inputs,
13454
13945
  nav: nav,
13455
13946
  tenantId: tenantId,
13947
+ tenantKey: tenantKey,
13456
13948
  accountId: accountId,
13949
+ accountKey: accountKey,
13457
13950
  configUrls: config
13458
13951
  })
13459
13952
  );
@@ -13500,7 +13993,7 @@ module.exports =
13500
13993
  exports.default = WizardForm;
13501
13994
 
13502
13995
  /***/ },
13503
- /* 127 */
13996
+ /* 128 */
13504
13997
  /***/ function(module, exports, __webpack_require__) {
13505
13998
 
13506
13999
  'use strict';
@@ -13515,7 +14008,7 @@ module.exports =
13515
14008
 
13516
14009
  var _react2 = _interopRequireDefault(_react);
13517
14010
 
13518
- var _redux = __webpack_require__(213);
14011
+ var _redux = __webpack_require__(215);
13519
14012
 
13520
14013
  var _reactRedux = __webpack_require__(65);
13521
14014
 
@@ -13523,9 +14016,9 @@ module.exports =
13523
14016
 
13524
14017
  var wizardActions = _interopRequireWildcard(_wizard);
13525
14018
 
13526
- __webpack_require__(172);
14019
+ __webpack_require__(173);
13527
14020
 
13528
- var _wizardForm = __webpack_require__(126);
14021
+ var _wizardForm = __webpack_require__(127);
13529
14022
 
13530
14023
  var _wizardForm2 = _interopRequireDefault(_wizardForm);
13531
14024
 
@@ -13694,21 +14187,21 @@ module.exports =
13694
14187
  exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(LingkSync);
13695
14188
 
13696
14189
  /***/ },
13697
- /* 128 */,
13698
- /* 129 */
14190
+ /* 129 */,
14191
+ /* 130 */
13699
14192
  /***/ function(module, exports, __webpack_require__) {
13700
14193
 
13701
- module.exports = { "default": __webpack_require__(134), __esModule: true };
14194
+ module.exports = { "default": __webpack_require__(135), __esModule: true };
13702
14195
 
13703
14196
  /***/ },
13704
- /* 130 */
14197
+ /* 131 */
13705
14198
  /***/ function(module, exports, __webpack_require__) {
13706
14199
 
13707
- module.exports = { "default": __webpack_require__(135), __esModule: true };
14200
+ module.exports = { "default": __webpack_require__(136), __esModule: true };
13708
14201
 
13709
14202
  /***/ },
13710
- /* 131 */,
13711
- /* 132 */
14203
+ /* 132 */,
14204
+ /* 133 */
13712
14205
  /***/ function(module, exports) {
13713
14206
 
13714
14207
  "use strict";
@@ -13728,39 +14221,39 @@ module.exports =
13728
14221
  };
13729
14222
 
13730
14223
  /***/ },
13731
- /* 133 */,
13732
- /* 134 */
14224
+ /* 134 */,
14225
+ /* 135 */
13733
14226
  /***/ function(module, exports, __webpack_require__) {
13734
14227
 
13735
- __webpack_require__(155);
14228
+ __webpack_require__(156);
13736
14229
  module.exports = __webpack_require__(8).Object.assign;
13737
14230
 
13738
14231
  /***/ },
13739
- /* 135 */
14232
+ /* 136 */
13740
14233
  /***/ function(module, exports, __webpack_require__) {
13741
14234
 
13742
- __webpack_require__(156);
14235
+ __webpack_require__(157);
13743
14236
  var $Object = __webpack_require__(8).Object;
13744
14237
  module.exports = function defineProperty(it, key, desc){
13745
14238
  return $Object.defineProperty(it, key, desc);
13746
14239
  };
13747
14240
 
13748
14241
  /***/ },
13749
- /* 136 */,
13750
14242
  /* 137 */,
13751
14243
  /* 138 */,
13752
14244
  /* 139 */,
13753
14245
  /* 140 */,
13754
14246
  /* 141 */,
13755
14247
  /* 142 */,
13756
- /* 143 */
14248
+ /* 143 */,
14249
+ /* 144 */
13757
14250
  /***/ function(module, exports, __webpack_require__) {
13758
14251
 
13759
14252
  'use strict';
13760
14253
  // 19.1.2.1 Object.assign(target, source, ...)
13761
14254
  var getKeys = __webpack_require__(34)
13762
- , gOPS = __webpack_require__(146)
13763
- , pIE = __webpack_require__(148)
14255
+ , gOPS = __webpack_require__(147)
14256
+ , pIE = __webpack_require__(149)
13764
14257
  , toObject = __webpack_require__(37)
13765
14258
  , IObject = __webpack_require__(32)
13766
14259
  , $assign = Object.assign;
@@ -13791,37 +14284,37 @@ module.exports =
13791
14284
  } : $assign;
13792
14285
 
13793
14286
  /***/ },
13794
- /* 144 */,
13795
14287
  /* 145 */,
13796
- /* 146 */
14288
+ /* 146 */,
14289
+ /* 147 */
13797
14290
  /***/ function(module, exports) {
13798
14291
 
13799
14292
  exports.f = Object.getOwnPropertySymbols;
13800
14293
 
13801
14294
  /***/ },
13802
- /* 147 */,
13803
- /* 148 */
14295
+ /* 148 */,
14296
+ /* 149 */
13804
14297
  /***/ function(module, exports) {
13805
14298
 
13806
14299
  exports.f = {}.propertyIsEnumerable;
13807
14300
 
13808
14301
  /***/ },
13809
- /* 149 */,
13810
14302
  /* 150 */,
13811
14303
  /* 151 */,
13812
14304
  /* 152 */,
13813
14305
  /* 153 */,
13814
14306
  /* 154 */,
13815
- /* 155 */
14307
+ /* 155 */,
14308
+ /* 156 */
13816
14309
  /***/ function(module, exports, __webpack_require__) {
13817
14310
 
13818
14311
  // 19.1.3.1 Object.assign(target, source)
13819
14312
  var $export = __webpack_require__(24);
13820
14313
 
13821
- $export($export.S + $export.F, 'Object', {assign: __webpack_require__(143)});
14314
+ $export($export.S + $export.F, 'Object', {assign: __webpack_require__(144)});
13822
14315
 
13823
14316
  /***/ },
13824
- /* 156 */
14317
+ /* 157 */
13825
14318
  /***/ function(module, exports, __webpack_require__) {
13826
14319
 
13827
14320
  var $export = __webpack_require__(24);
@@ -13829,10 +14322,10 @@ module.exports =
13829
14322
  $export($export.S + $export.F * !__webpack_require__(9), 'Object', {defineProperty: __webpack_require__(18).f});
13830
14323
 
13831
14324
  /***/ },
13832
- /* 157 */,
13833
14325
  /* 158 */,
13834
14326
  /* 159 */,
13835
- /* 160 */
14327
+ /* 160 */,
14328
+ /* 161 */
13836
14329
  /***/ function(module, exports) {
13837
14330
 
13838
14331
 
@@ -13858,7 +14351,7 @@ module.exports =
13858
14351
 
13859
14352
 
13860
14353
  /***/ },
13861
- /* 161 */
14354
+ /* 162 */
13862
14355
  /***/ function(module, exports, __webpack_require__) {
13863
14356
 
13864
14357
  /**
@@ -14055,7 +14548,7 @@ module.exports =
14055
14548
 
14056
14549
 
14057
14550
  /***/ },
14058
- /* 162 */
14551
+ /* 163 */
14059
14552
  /***/ function(module, exports) {
14060
14553
 
14061
14554
  'use strict';
@@ -14148,7 +14641,7 @@ module.exports =
14148
14641
  module.exports = exports['default'];
14149
14642
 
14150
14643
  /***/ },
14151
- /* 163 */
14644
+ /* 164 */
14152
14645
  /***/ function(module, exports, __webpack_require__) {
14153
14646
 
14154
14647
  'use strict';
@@ -14159,11 +14652,11 @@ module.exports =
14159
14652
 
14160
14653
  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; };
14161
14654
 
14162
- var _Event = __webpack_require__(162);
14655
+ var _Event = __webpack_require__(163);
14163
14656
 
14164
14657
  var _Event2 = _interopRequireDefault(_Event);
14165
14658
 
14166
- var _componentClasses = __webpack_require__(161);
14659
+ var _componentClasses = __webpack_require__(162);
14167
14660
 
14168
14661
  var _componentClasses2 = _interopRequireDefault(_componentClasses);
14169
14662
 
@@ -14343,7 +14836,7 @@ module.exports =
14343
14836
  module.exports = exports['default'];
14344
14837
 
14345
14838
  /***/ },
14346
- /* 164 */
14839
+ /* 165 */
14347
14840
  /***/ function(module, exports, __webpack_require__) {
14348
14841
 
14349
14842
  'use strict';
@@ -14403,7 +14896,7 @@ module.exports =
14403
14896
  module.exports = exports['default'];
14404
14897
 
14405
14898
  /***/ },
14406
- /* 165 */
14899
+ /* 166 */
14407
14900
  /***/ function(module, exports) {
14408
14901
 
14409
14902
  'use strict';
@@ -14448,7 +14941,7 @@ module.exports =
14448
14941
  module.exports = exports['default'];
14449
14942
 
14450
14943
  /***/ },
14451
- /* 166 */
14944
+ /* 167 */
14452
14945
  /***/ function(module, exports, __webpack_require__) {
14453
14946
 
14454
14947
  'use strict';
@@ -14457,7 +14950,7 @@ module.exports =
14457
14950
  value: true
14458
14951
  });
14459
14952
 
14460
- var _getAlignOffset = __webpack_require__(165);
14953
+ var _getAlignOffset = __webpack_require__(166);
14461
14954
 
14462
14955
  var _getAlignOffset2 = _interopRequireDefault(_getAlignOffset);
14463
14956
 
@@ -14489,7 +14982,7 @@ module.exports =
14489
14982
  module.exports = exports['default'];
14490
14983
 
14491
14984
  /***/ },
14492
- /* 167 */
14985
+ /* 168 */
14493
14986
  /***/ function(module, exports, __webpack_require__) {
14494
14987
 
14495
14988
  'use strict';
@@ -14530,7 +15023,7 @@ module.exports =
14530
15023
  module.exports = exports['default'];
14531
15024
 
14532
15025
  /***/ },
14533
- /* 168 */
15026
+ /* 169 */
14534
15027
  /***/ function(module, exports, __webpack_require__) {
14535
15028
 
14536
15029
  'use strict';
@@ -14611,7 +15104,7 @@ module.exports =
14611
15104
  module.exports = exports['default'];
14612
15105
 
14613
15106
  /***/ },
14614
- /* 169 */
15107
+ /* 170 */
14615
15108
  /***/ function(module, exports, __webpack_require__) {
14616
15109
 
14617
15110
  'use strict';
@@ -14628,19 +15121,19 @@ module.exports =
14628
15121
 
14629
15122
  var _getOffsetParent2 = _interopRequireDefault(_getOffsetParent);
14630
15123
 
14631
- var _getVisibleRectForElement = __webpack_require__(168);
15124
+ var _getVisibleRectForElement = __webpack_require__(169);
14632
15125
 
14633
15126
  var _getVisibleRectForElement2 = _interopRequireDefault(_getVisibleRectForElement);
14634
15127
 
14635
- var _adjustForViewport = __webpack_require__(164);
15128
+ var _adjustForViewport = __webpack_require__(165);
14636
15129
 
14637
15130
  var _adjustForViewport2 = _interopRequireDefault(_adjustForViewport);
14638
15131
 
14639
- var _getRegion = __webpack_require__(167);
15132
+ var _getRegion = __webpack_require__(168);
14640
15133
 
14641
15134
  var _getRegion2 = _interopRequireDefault(_getRegion);
14642
15135
 
14643
- var _getElFuturePos = __webpack_require__(166);
15136
+ var _getElFuturePos = __webpack_require__(167);
14644
15137
 
14645
15138
  var _getElFuturePos2 = _interopRequireDefault(_getElFuturePos);
14646
15139
 
@@ -14842,7 +15335,7 @@ module.exports =
14842
15335
  module.exports = exports['default'];
14843
15336
 
14844
15337
  /***/ },
14845
- /* 170 */
15338
+ /* 171 */
14846
15339
  /***/ function(module, exports) {
14847
15340
 
14848
15341
  'use strict';
@@ -14957,17 +15450,17 @@ module.exports =
14957
15450
  }
14958
15451
 
14959
15452
  /***/ },
14960
- /* 171 */
15453
+ /* 172 */
14961
15454
  /***/ function(module, exports) {
14962
15455
 
14963
15456
  // removed by extract-text-webpack-plugin
14964
15457
 
14965
15458
  /***/ },
14966
- /* 172 */
14967
- 171,
14968
- /* 173 */,
15459
+ /* 173 */
15460
+ 172,
14969
15461
  /* 174 */,
14970
- /* 175 */
15462
+ /* 175 */,
15463
+ /* 176 */
14971
15464
  /***/ function(module, exports) {
14972
15465
 
14973
15466
  'use strict';
@@ -15056,7 +15549,1602 @@ module.exports =
15056
15549
 
15057
15550
 
15058
15551
  /***/ },
15059
- /* 176 */
15552
+ /* 177 */
15553
+ /***/ function(module, exports, __webpack_require__) {
15554
+
15555
+ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
15556
+ Papa Parse
15557
+ v4.3.6
15558
+ https://github.com/mholt/PapaParse
15559
+ License: MIT
15560
+ */
15561
+ (function(root, factory)
15562
+ {
15563
+ if (true)
15564
+ {
15565
+ // AMD. Register as an anonymous module.
15566
+ !(__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__));
15567
+ }
15568
+ else if (typeof module === 'object' && typeof exports !== 'undefined')
15569
+ {
15570
+ // Node. Does not work with strict CommonJS, but
15571
+ // only CommonJS-like environments that support module.exports,
15572
+ // like Node.
15573
+ module.exports = factory();
15574
+ }
15575
+ else
15576
+ {
15577
+ // Browser globals (root is window)
15578
+ root.Papa = factory();
15579
+ }
15580
+ }(this, function()
15581
+ {
15582
+ 'use strict';
15583
+
15584
+ var global = (function () {
15585
+ // alternative method, similar to `Function('return this')()`
15586
+ // but without using `eval` (which is disabled when
15587
+ // using Content Security Policy).
15588
+
15589
+ if (typeof self !== 'undefined') { return self; }
15590
+ if (typeof window !== 'undefined') { return window; }
15591
+ if (typeof global !== 'undefined') { return global; }
15592
+
15593
+ // When running tests none of the above have been defined
15594
+ return {};
15595
+ })();
15596
+
15597
+
15598
+ var IS_WORKER = !global.document && !!global.postMessage,
15599
+ IS_PAPA_WORKER = IS_WORKER && /(\?|&)papaworker(=|&|$)/.test(global.location.search),
15600
+ LOADED_SYNC = false, AUTO_SCRIPT_PATH;
15601
+ var workers = {}, workerIdCounter = 0;
15602
+
15603
+ var Papa = {};
15604
+
15605
+ Papa.parse = CsvToJson;
15606
+ Papa.unparse = JsonToCsv;
15607
+
15608
+ Papa.RECORD_SEP = String.fromCharCode(30);
15609
+ Papa.UNIT_SEP = String.fromCharCode(31);
15610
+ Papa.BYTE_ORDER_MARK = '\ufeff';
15611
+ Papa.BAD_DELIMITERS = ['\r', '\n', '"', Papa.BYTE_ORDER_MARK];
15612
+ Papa.WORKERS_SUPPORTED = !IS_WORKER && !!global.Worker;
15613
+ Papa.SCRIPT_PATH = null; // Must be set by your code if you use workers and this lib is loaded asynchronously
15614
+
15615
+ // Configurable chunk sizes for local and remote files, respectively
15616
+ Papa.LocalChunkSize = 1024 * 1024 * 10; // 10 MB
15617
+ Papa.RemoteChunkSize = 1024 * 1024 * 5; // 5 MB
15618
+ Papa.DefaultDelimiter = ','; // Used if not specified and detection fails
15619
+
15620
+ // Exposed for testing and development only
15621
+ Papa.Parser = Parser;
15622
+ Papa.ParserHandle = ParserHandle;
15623
+ Papa.NetworkStreamer = NetworkStreamer;
15624
+ Papa.FileStreamer = FileStreamer;
15625
+ Papa.StringStreamer = StringStreamer;
15626
+ Papa.ReadableStreamStreamer = ReadableStreamStreamer;
15627
+
15628
+ if (global.jQuery)
15629
+ {
15630
+ var $ = global.jQuery;
15631
+ $.fn.parse = function(options)
15632
+ {
15633
+ var config = options.config || {};
15634
+ var queue = [];
15635
+
15636
+ this.each(function(idx)
15637
+ {
15638
+ var supported = $(this).prop('tagName').toUpperCase() === 'INPUT'
15639
+ && $(this).attr('type').toLowerCase() === 'file'
15640
+ && global.FileReader;
15641
+
15642
+ if (!supported || !this.files || this.files.length === 0)
15643
+ return true; // continue to next input element
15644
+
15645
+ for (var i = 0; i < this.files.length; i++)
15646
+ {
15647
+ queue.push({
15648
+ file: this.files[i],
15649
+ inputElem: this,
15650
+ instanceConfig: $.extend({}, config)
15651
+ });
15652
+ }
15653
+ });
15654
+
15655
+ parseNextFile(); // begin parsing
15656
+ return this; // maintains chainability
15657
+
15658
+
15659
+ function parseNextFile()
15660
+ {
15661
+ if (queue.length === 0)
15662
+ {
15663
+ if (isFunction(options.complete))
15664
+ options.complete();
15665
+ return;
15666
+ }
15667
+
15668
+ var f = queue[0];
15669
+
15670
+ if (isFunction(options.before))
15671
+ {
15672
+ var returned = options.before(f.file, f.inputElem);
15673
+
15674
+ if (typeof returned === 'object')
15675
+ {
15676
+ if (returned.action === 'abort')
15677
+ {
15678
+ error('AbortError', f.file, f.inputElem, returned.reason);
15679
+ return; // Aborts all queued files immediately
15680
+ }
15681
+ else if (returned.action === 'skip')
15682
+ {
15683
+ fileComplete(); // parse the next file in the queue, if any
15684
+ return;
15685
+ }
15686
+ else if (typeof returned.config === 'object')
15687
+ f.instanceConfig = $.extend(f.instanceConfig, returned.config);
15688
+ }
15689
+ else if (returned === 'skip')
15690
+ {
15691
+ fileComplete(); // parse the next file in the queue, if any
15692
+ return;
15693
+ }
15694
+ }
15695
+
15696
+ // Wrap up the user's complete callback, if any, so that ours also gets executed
15697
+ var userCompleteFunc = f.instanceConfig.complete;
15698
+ f.instanceConfig.complete = function(results)
15699
+ {
15700
+ if (isFunction(userCompleteFunc))
15701
+ userCompleteFunc(results, f.file, f.inputElem);
15702
+ fileComplete();
15703
+ };
15704
+
15705
+ Papa.parse(f.file, f.instanceConfig);
15706
+ }
15707
+
15708
+ function error(name, file, elem, reason)
15709
+ {
15710
+ if (isFunction(options.error))
15711
+ options.error({name: name}, file, elem, reason);
15712
+ }
15713
+
15714
+ function fileComplete()
15715
+ {
15716
+ queue.splice(0, 1);
15717
+ parseNextFile();
15718
+ }
15719
+ }
15720
+ }
15721
+
15722
+
15723
+ if (IS_PAPA_WORKER)
15724
+ {
15725
+ global.onmessage = workerThreadReceivedMessage;
15726
+ }
15727
+ else if (Papa.WORKERS_SUPPORTED)
15728
+ {
15729
+ AUTO_SCRIPT_PATH = getScriptPath();
15730
+
15731
+ // Check if the script was loaded synchronously
15732
+ if (!document.body)
15733
+ {
15734
+ // Body doesn't exist yet, must be synchronous
15735
+ LOADED_SYNC = true;
15736
+ }
15737
+ else
15738
+ {
15739
+ document.addEventListener('DOMContentLoaded', function () {
15740
+ LOADED_SYNC = true;
15741
+ }, true);
15742
+ }
15743
+ }
15744
+
15745
+
15746
+
15747
+
15748
+ function CsvToJson(_input, _config)
15749
+ {
15750
+ _config = _config || {};
15751
+ var dynamicTyping = _config.dynamicTyping || false;
15752
+ if (isFunction(dynamicTyping)) {
15753
+ _config.dynamicTypingFunction = dynamicTyping;
15754
+ // Will be filled on first row call
15755
+ dynamicTyping = {};
15756
+ }
15757
+ _config.dynamicTyping = dynamicTyping;
15758
+
15759
+ if (_config.worker && Papa.WORKERS_SUPPORTED)
15760
+ {
15761
+ var w = newWorker();
15762
+
15763
+ w.userStep = _config.step;
15764
+ w.userChunk = _config.chunk;
15765
+ w.userComplete = _config.complete;
15766
+ w.userError = _config.error;
15767
+
15768
+ _config.step = isFunction(_config.step);
15769
+ _config.chunk = isFunction(_config.chunk);
15770
+ _config.complete = isFunction(_config.complete);
15771
+ _config.error = isFunction(_config.error);
15772
+ delete _config.worker; // prevent infinite loop
15773
+
15774
+ w.postMessage({
15775
+ input: _input,
15776
+ config: _config,
15777
+ workerId: w.id
15778
+ });
15779
+
15780
+ return;
15781
+ }
15782
+
15783
+ var streamer = null;
15784
+ if (typeof _input === 'string')
15785
+ {
15786
+ if (_config.download)
15787
+ streamer = new NetworkStreamer(_config);
15788
+ else
15789
+ streamer = new StringStreamer(_config);
15790
+ }
15791
+ else if (_input.readable === true && isFunction(_input.read) && isFunction(_input.on))
15792
+ {
15793
+ streamer = new ReadableStreamStreamer(_config);
15794
+ }
15795
+ else if ((global.File && _input instanceof File) || _input instanceof Object) // ...Safari. (see issue #106)
15796
+ streamer = new FileStreamer(_config);
15797
+
15798
+ return streamer.stream(_input);
15799
+ }
15800
+
15801
+
15802
+
15803
+
15804
+
15805
+
15806
+ function JsonToCsv(_input, _config)
15807
+ {
15808
+ var _output = '';
15809
+ var _fields = [];
15810
+
15811
+ // Default configuration
15812
+
15813
+ /** whether to surround every datum with quotes */
15814
+ var _quotes = false;
15815
+
15816
+ /** whether to write headers */
15817
+ var _writeHeader = true;
15818
+
15819
+ /** delimiting character */
15820
+ var _delimiter = ',';
15821
+
15822
+ /** newline character(s) */
15823
+ var _newline = '\r\n';
15824
+
15825
+ /** quote character */
15826
+ var _quoteChar = '"';
15827
+
15828
+ unpackConfig();
15829
+
15830
+ var quoteCharRegex = new RegExp(_quoteChar, 'g');
15831
+
15832
+ if (typeof _input === 'string')
15833
+ _input = JSON.parse(_input);
15834
+
15835
+ if (_input instanceof Array)
15836
+ {
15837
+ if (!_input.length || _input[0] instanceof Array)
15838
+ return serialize(null, _input);
15839
+ else if (typeof _input[0] === 'object')
15840
+ return serialize(objectKeys(_input[0]), _input);
15841
+ }
15842
+ else if (typeof _input === 'object')
15843
+ {
15844
+ if (typeof _input.data === 'string')
15845
+ _input.data = JSON.parse(_input.data);
15846
+
15847
+ if (_input.data instanceof Array)
15848
+ {
15849
+ if (!_input.fields)
15850
+ _input.fields = _input.meta && _input.meta.fields;
15851
+
15852
+ if (!_input.fields)
15853
+ _input.fields = _input.data[0] instanceof Array
15854
+ ? _input.fields
15855
+ : objectKeys(_input.data[0]);
15856
+
15857
+ if (!(_input.data[0] instanceof Array) && typeof _input.data[0] !== 'object')
15858
+ _input.data = [_input.data]; // handles input like [1,2,3] or ['asdf']
15859
+ }
15860
+
15861
+ return serialize(_input.fields || [], _input.data || []);
15862
+ }
15863
+
15864
+ // Default (any valid paths should return before this)
15865
+ throw 'exception: Unable to serialize unrecognized input';
15866
+
15867
+
15868
+ function unpackConfig()
15869
+ {
15870
+ if (typeof _config !== 'object')
15871
+ return;
15872
+
15873
+ if (typeof _config.delimiter === 'string'
15874
+ && _config.delimiter.length === 1
15875
+ && Papa.BAD_DELIMITERS.indexOf(_config.delimiter) === -1)
15876
+ {
15877
+ _delimiter = _config.delimiter;
15878
+ }
15879
+
15880
+ if (typeof _config.quotes === 'boolean'
15881
+ || _config.quotes instanceof Array)
15882
+ _quotes = _config.quotes;
15883
+
15884
+ if (typeof _config.newline === 'string')
15885
+ _newline = _config.newline;
15886
+
15887
+ if (typeof _config.quoteChar === 'string')
15888
+ _quoteChar = _config.quoteChar;
15889
+
15890
+ if (typeof _config.header === 'boolean')
15891
+ _writeHeader = _config.header;
15892
+ }
15893
+
15894
+
15895
+ /** Turns an object's keys into an array */
15896
+ function objectKeys(obj)
15897
+ {
15898
+ if (typeof obj !== 'object')
15899
+ return [];
15900
+ var keys = [];
15901
+ for (var key in obj)
15902
+ keys.push(key);
15903
+ return keys;
15904
+ }
15905
+
15906
+ /** The double for loop that iterates the data and writes out a CSV string including header row */
15907
+ function serialize(fields, data)
15908
+ {
15909
+ var csv = '';
15910
+
15911
+ if (typeof fields === 'string')
15912
+ fields = JSON.parse(fields);
15913
+ if (typeof data === 'string')
15914
+ data = JSON.parse(data);
15915
+
15916
+ var hasHeader = fields instanceof Array && fields.length > 0;
15917
+ var dataKeyedByField = !(data[0] instanceof Array);
15918
+
15919
+ // If there a header row, write it first
15920
+ if (hasHeader && _writeHeader)
15921
+ {
15922
+ for (var i = 0; i < fields.length; i++)
15923
+ {
15924
+ if (i > 0)
15925
+ csv += _delimiter;
15926
+ csv += safe(fields[i], i);
15927
+ }
15928
+ if (data.length > 0)
15929
+ csv += _newline;
15930
+ }
15931
+
15932
+ // Then write out the data
15933
+ for (var row = 0; row < data.length; row++)
15934
+ {
15935
+ var maxCol = hasHeader ? fields.length : data[row].length;
15936
+
15937
+ for (var col = 0; col < maxCol; col++)
15938
+ {
15939
+ if (col > 0)
15940
+ csv += _delimiter;
15941
+ var colIdx = hasHeader && dataKeyedByField ? fields[col] : col;
15942
+ csv += safe(data[row][colIdx], col);
15943
+ }
15944
+
15945
+ if (row < data.length - 1)
15946
+ csv += _newline;
15947
+ }
15948
+
15949
+ return csv;
15950
+ }
15951
+
15952
+ /** Encloses a value around quotes if needed (makes a value safe for CSV insertion) */
15953
+ function safe(str, col)
15954
+ {
15955
+ if (typeof str === 'undefined' || str === null)
15956
+ return '';
15957
+
15958
+ str = str.toString().replace(quoteCharRegex, _quoteChar+_quoteChar);
15959
+
15960
+ var needsQuotes = (typeof _quotes === 'boolean' && _quotes)
15961
+ || (_quotes instanceof Array && _quotes[col])
15962
+ || hasAny(str, Papa.BAD_DELIMITERS)
15963
+ || str.indexOf(_delimiter) > -1
15964
+ || str.charAt(0) === ' '
15965
+ || str.charAt(str.length - 1) === ' ';
15966
+
15967
+ return needsQuotes ? _quoteChar + str + _quoteChar : str;
15968
+ }
15969
+
15970
+ function hasAny(str, substrings)
15971
+ {
15972
+ for (var i = 0; i < substrings.length; i++)
15973
+ if (str.indexOf(substrings[i]) > -1)
15974
+ return true;
15975
+ return false;
15976
+ }
15977
+ }
15978
+
15979
+ /** ChunkStreamer is the base prototype for various streamer implementations. */
15980
+ function ChunkStreamer(config)
15981
+ {
15982
+ this._handle = null;
15983
+ this._paused = false;
15984
+ this._finished = false;
15985
+ this._input = null;
15986
+ this._baseIndex = 0;
15987
+ this._partialLine = '';
15988
+ this._rowCount = 0;
15989
+ this._start = 0;
15990
+ this._nextChunk = null;
15991
+ this.isFirstChunk = true;
15992
+ this._completeResults = {
15993
+ data: [],
15994
+ errors: [],
15995
+ meta: {}
15996
+ };
15997
+ replaceConfig.call(this, config);
15998
+
15999
+ this.parseChunk = function(chunk)
16000
+ {
16001
+ // First chunk pre-processing
16002
+ if (this.isFirstChunk && isFunction(this._config.beforeFirstChunk))
16003
+ {
16004
+ var modifiedChunk = this._config.beforeFirstChunk(chunk);
16005
+ if (modifiedChunk !== undefined)
16006
+ chunk = modifiedChunk;
16007
+ }
16008
+ this.isFirstChunk = false;
16009
+
16010
+ // Rejoin the line we likely just split in two by chunking the file
16011
+ var aggregate = this._partialLine + chunk;
16012
+ this._partialLine = '';
16013
+
16014
+ var results = this._handle.parse(aggregate, this._baseIndex, !this._finished);
16015
+
16016
+ if (this._handle.paused() || this._handle.aborted())
16017
+ return;
16018
+
16019
+ var lastIndex = results.meta.cursor;
16020
+
16021
+ if (!this._finished)
16022
+ {
16023
+ this._partialLine = aggregate.substring(lastIndex - this._baseIndex);
16024
+ this._baseIndex = lastIndex;
16025
+ }
16026
+
16027
+ if (results && results.data)
16028
+ this._rowCount += results.data.length;
16029
+
16030
+ var finishedIncludingPreview = this._finished || (this._config.preview && this._rowCount >= this._config.preview);
16031
+
16032
+ if (IS_PAPA_WORKER)
16033
+ {
16034
+ global.postMessage({
16035
+ results: results,
16036
+ workerId: Papa.WORKER_ID,
16037
+ finished: finishedIncludingPreview
16038
+ });
16039
+ }
16040
+ else if (isFunction(this._config.chunk))
16041
+ {
16042
+ this._config.chunk(results, this._handle);
16043
+ if (this._paused)
16044
+ return;
16045
+ results = undefined;
16046
+ this._completeResults = undefined;
16047
+ }
16048
+
16049
+ if (!this._config.step && !this._config.chunk) {
16050
+ this._completeResults.data = this._completeResults.data.concat(results.data);
16051
+ this._completeResults.errors = this._completeResults.errors.concat(results.errors);
16052
+ this._completeResults.meta = results.meta;
16053
+ }
16054
+
16055
+ if (finishedIncludingPreview && isFunction(this._config.complete) && (!results || !results.meta.aborted))
16056
+ this._config.complete(this._completeResults, this._input);
16057
+
16058
+ if (!finishedIncludingPreview && (!results || !results.meta.paused))
16059
+ this._nextChunk();
16060
+
16061
+ return results;
16062
+ };
16063
+
16064
+ this._sendError = function(error)
16065
+ {
16066
+ if (isFunction(this._config.error))
16067
+ this._config.error(error);
16068
+ else if (IS_PAPA_WORKER && this._config.error)
16069
+ {
16070
+ global.postMessage({
16071
+ workerId: Papa.WORKER_ID,
16072
+ error: error,
16073
+ finished: false
16074
+ });
16075
+ }
16076
+ };
16077
+
16078
+ function replaceConfig(config)
16079
+ {
16080
+ // Deep-copy the config so we can edit it
16081
+ var configCopy = copy(config);
16082
+ configCopy.chunkSize = parseInt(configCopy.chunkSize); // parseInt VERY important so we don't concatenate strings!
16083
+ if (!config.step && !config.chunk)
16084
+ configCopy.chunkSize = null; // disable Range header if not streaming; bad values break IIS - see issue #196
16085
+ this._handle = new ParserHandle(configCopy);
16086
+ this._handle.streamer = this;
16087
+ this._config = configCopy; // persist the copy to the caller
16088
+ }
16089
+ }
16090
+
16091
+
16092
+ function NetworkStreamer(config)
16093
+ {
16094
+ config = config || {};
16095
+ if (!config.chunkSize)
16096
+ config.chunkSize = Papa.RemoteChunkSize;
16097
+ ChunkStreamer.call(this, config);
16098
+
16099
+ var xhr;
16100
+
16101
+ if (IS_WORKER)
16102
+ {
16103
+ this._nextChunk = function()
16104
+ {
16105
+ this._readChunk();
16106
+ this._chunkLoaded();
16107
+ };
16108
+ }
16109
+ else
16110
+ {
16111
+ this._nextChunk = function()
16112
+ {
16113
+ this._readChunk();
16114
+ };
16115
+ }
16116
+
16117
+ this.stream = function(url)
16118
+ {
16119
+ this._input = url;
16120
+ this._nextChunk(); // Starts streaming
16121
+ };
16122
+
16123
+ this._readChunk = function()
16124
+ {
16125
+ if (this._finished)
16126
+ {
16127
+ this._chunkLoaded();
16128
+ return;
16129
+ }
16130
+
16131
+ xhr = new XMLHttpRequest();
16132
+
16133
+ if (this._config.withCredentials)
16134
+ {
16135
+ xhr.withCredentials = this._config.withCredentials;
16136
+ }
16137
+
16138
+ if (!IS_WORKER)
16139
+ {
16140
+ xhr.onload = bindFunction(this._chunkLoaded, this);
16141
+ xhr.onerror = bindFunction(this._chunkError, this);
16142
+ }
16143
+
16144
+ xhr.open('GET', this._input, !IS_WORKER);
16145
+ // Headers can only be set when once the request state is OPENED
16146
+ if (this._config.downloadRequestHeaders)
16147
+ {
16148
+ var headers = this._config.downloadRequestHeaders;
16149
+
16150
+ for (var headerName in headers)
16151
+ {
16152
+ xhr.setRequestHeader(headerName, headers[headerName]);
16153
+ }
16154
+ }
16155
+
16156
+ if (this._config.chunkSize)
16157
+ {
16158
+ var end = this._start + this._config.chunkSize - 1; // minus one because byte range is inclusive
16159
+ xhr.setRequestHeader('Range', 'bytes='+this._start+'-'+end);
16160
+ xhr.setRequestHeader('If-None-Match', 'webkit-no-cache'); // https://bugs.webkit.org/show_bug.cgi?id=82672
16161
+ }
16162
+
16163
+ try {
16164
+ xhr.send();
16165
+ }
16166
+ catch (err) {
16167
+ this._chunkError(err.message);
16168
+ }
16169
+
16170
+ if (IS_WORKER && xhr.status === 0)
16171
+ this._chunkError();
16172
+ else
16173
+ this._start += this._config.chunkSize;
16174
+ }
16175
+
16176
+ this._chunkLoaded = function()
16177
+ {
16178
+ if (xhr.readyState != 4)
16179
+ return;
16180
+
16181
+ if (xhr.status < 200 || xhr.status >= 400)
16182
+ {
16183
+ this._chunkError();
16184
+ return;
16185
+ }
16186
+
16187
+ this._finished = !this._config.chunkSize || this._start > getFileSize(xhr);
16188
+ this.parseChunk(xhr.responseText);
16189
+ }
16190
+
16191
+ this._chunkError = function(errorMessage)
16192
+ {
16193
+ var errorText = xhr.statusText || errorMessage;
16194
+ this._sendError(errorText);
16195
+ }
16196
+
16197
+ function getFileSize(xhr)
16198
+ {
16199
+ var contentRange = xhr.getResponseHeader('Content-Range');
16200
+ if (contentRange === null) { // no content range, then finish!
16201
+ return -1;
16202
+ }
16203
+ return parseInt(contentRange.substr(contentRange.lastIndexOf('/') + 1));
16204
+ }
16205
+ }
16206
+ NetworkStreamer.prototype = Object.create(ChunkStreamer.prototype);
16207
+ NetworkStreamer.prototype.constructor = NetworkStreamer;
16208
+
16209
+
16210
+ function FileStreamer(config)
16211
+ {
16212
+ config = config || {};
16213
+ if (!config.chunkSize)
16214
+ config.chunkSize = Papa.LocalChunkSize;
16215
+ ChunkStreamer.call(this, config);
16216
+
16217
+ var reader, slice;
16218
+
16219
+ // FileReader is better than FileReaderSync (even in worker) - see http://stackoverflow.com/q/24708649/1048862
16220
+ // But Firefox is a pill, too - see issue #76: https://github.com/mholt/PapaParse/issues/76
16221
+ var usingAsyncReader = typeof FileReader !== 'undefined'; // Safari doesn't consider it a function - see issue #105
16222
+
16223
+ this.stream = function(file)
16224
+ {
16225
+ this._input = file;
16226
+ slice = file.slice || file.webkitSlice || file.mozSlice;
16227
+
16228
+ if (usingAsyncReader)
16229
+ {
16230
+ reader = new FileReader(); // Preferred method of reading files, even in workers
16231
+ reader.onload = bindFunction(this._chunkLoaded, this);
16232
+ reader.onerror = bindFunction(this._chunkError, this);
16233
+ }
16234
+ else
16235
+ reader = new FileReaderSync(); // Hack for running in a web worker in Firefox
16236
+
16237
+ this._nextChunk(); // Starts streaming
16238
+ };
16239
+
16240
+ this._nextChunk = function()
16241
+ {
16242
+ if (!this._finished && (!this._config.preview || this._rowCount < this._config.preview))
16243
+ this._readChunk();
16244
+ }
16245
+
16246
+ this._readChunk = function()
16247
+ {
16248
+ var input = this._input;
16249
+ if (this._config.chunkSize)
16250
+ {
16251
+ var end = Math.min(this._start + this._config.chunkSize, this._input.size);
16252
+ input = slice.call(input, this._start, end);
16253
+ }
16254
+ var txt = reader.readAsText(input, this._config.encoding);
16255
+ if (!usingAsyncReader)
16256
+ this._chunkLoaded({ target: { result: txt } }); // mimic the async signature
16257
+ }
16258
+
16259
+ this._chunkLoaded = function(event)
16260
+ {
16261
+ // Very important to increment start each time before handling results
16262
+ this._start += this._config.chunkSize;
16263
+ this._finished = !this._config.chunkSize || this._start >= this._input.size;
16264
+ this.parseChunk(event.target.result);
16265
+ }
16266
+
16267
+ this._chunkError = function()
16268
+ {
16269
+ this._sendError(reader.error);
16270
+ }
16271
+
16272
+ }
16273
+ FileStreamer.prototype = Object.create(ChunkStreamer.prototype);
16274
+ FileStreamer.prototype.constructor = FileStreamer;
16275
+
16276
+
16277
+ function StringStreamer(config)
16278
+ {
16279
+ config = config || {};
16280
+ ChunkStreamer.call(this, config);
16281
+
16282
+ var string;
16283
+ var remaining;
16284
+ this.stream = function(s)
16285
+ {
16286
+ string = s;
16287
+ remaining = s;
16288
+ return this._nextChunk();
16289
+ }
16290
+ this._nextChunk = function()
16291
+ {
16292
+ if (this._finished) return;
16293
+ var size = this._config.chunkSize;
16294
+ var chunk = size ? remaining.substr(0, size) : remaining;
16295
+ remaining = size ? remaining.substr(size) : '';
16296
+ this._finished = !remaining;
16297
+ return this.parseChunk(chunk);
16298
+ }
16299
+ }
16300
+ StringStreamer.prototype = Object.create(StringStreamer.prototype);
16301
+ StringStreamer.prototype.constructor = StringStreamer;
16302
+
16303
+
16304
+ function ReadableStreamStreamer(config)
16305
+ {
16306
+ config = config || {};
16307
+
16308
+ ChunkStreamer.call(this, config);
16309
+
16310
+ var queue = [];
16311
+ var parseOnData = true;
16312
+
16313
+ this.stream = function(stream)
16314
+ {
16315
+ this._input = stream;
16316
+
16317
+ this._input.on('data', this._streamData);
16318
+ this._input.on('end', this._streamEnd);
16319
+ this._input.on('error', this._streamError);
16320
+ }
16321
+
16322
+ this._nextChunk = function()
16323
+ {
16324
+ if (queue.length)
16325
+ {
16326
+ this.parseChunk(queue.shift());
16327
+ }
16328
+ else
16329
+ {
16330
+ parseOnData = true;
16331
+ }
16332
+ }
16333
+
16334
+ this._streamData = bindFunction(function(chunk)
16335
+ {
16336
+ try
16337
+ {
16338
+ queue.push(typeof chunk === 'string' ? chunk : chunk.toString(this._config.encoding));
16339
+
16340
+ if (parseOnData)
16341
+ {
16342
+ parseOnData = false;
16343
+ this.parseChunk(queue.shift());
16344
+ }
16345
+ }
16346
+ catch (error)
16347
+ {
16348
+ this._streamError(error);
16349
+ }
16350
+ }, this);
16351
+
16352
+ this._streamError = bindFunction(function(error)
16353
+ {
16354
+ this._streamCleanUp();
16355
+ this._sendError(error.message);
16356
+ }, this);
16357
+
16358
+ this._streamEnd = bindFunction(function()
16359
+ {
16360
+ this._streamCleanUp();
16361
+ this._finished = true;
16362
+ this._streamData('');
16363
+ }, this);
16364
+
16365
+ this._streamCleanUp = bindFunction(function()
16366
+ {
16367
+ this._input.removeListener('data', this._streamData);
16368
+ this._input.removeListener('end', this._streamEnd);
16369
+ this._input.removeListener('error', this._streamError);
16370
+ }, this);
16371
+ }
16372
+ ReadableStreamStreamer.prototype = Object.create(ChunkStreamer.prototype);
16373
+ ReadableStreamStreamer.prototype.constructor = ReadableStreamStreamer;
16374
+
16375
+
16376
+ // Use one ParserHandle per entire CSV file or string
16377
+ function ParserHandle(_config)
16378
+ {
16379
+ // One goal is to minimize the use of regular expressions...
16380
+ var FLOAT = /^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i;
16381
+
16382
+ var self = this;
16383
+ var _stepCounter = 0; // Number of times step was called (number of rows parsed)
16384
+ var _input; // The input being parsed
16385
+ var _parser; // The core parser being used
16386
+ var _paused = false; // Whether we are paused or not
16387
+ var _aborted = false; // Whether the parser has aborted or not
16388
+ var _delimiterError; // Temporary state between delimiter detection and processing results
16389
+ var _fields = []; // Fields are from the header row of the input, if there is one
16390
+ var _results = { // The last results returned from the parser
16391
+ data: [],
16392
+ errors: [],
16393
+ meta: {}
16394
+ };
16395
+
16396
+ if (isFunction(_config.step))
16397
+ {
16398
+ var userStep = _config.step;
16399
+ _config.step = function(results)
16400
+ {
16401
+ _results = results;
16402
+
16403
+ if (needsHeaderRow())
16404
+ processResults();
16405
+ else // only call user's step function after header row
16406
+ {
16407
+ processResults();
16408
+
16409
+ // It's possbile that this line was empty and there's no row here after all
16410
+ if (_results.data.length === 0)
16411
+ return;
16412
+
16413
+ _stepCounter += results.data.length;
16414
+ if (_config.preview && _stepCounter > _config.preview)
16415
+ _parser.abort();
16416
+ else
16417
+ userStep(_results, self);
16418
+ }
16419
+ };
16420
+ }
16421
+
16422
+ /**
16423
+ * Parses input. Most users won't need, and shouldn't mess with, the baseIndex
16424
+ * and ignoreLastRow parameters. They are used by streamers (wrapper functions)
16425
+ * when an input comes in multiple chunks, like from a file.
16426
+ */
16427
+ this.parse = function(input, baseIndex, ignoreLastRow)
16428
+ {
16429
+ if (!_config.newline)
16430
+ _config.newline = guessLineEndings(input);
16431
+
16432
+ _delimiterError = false;
16433
+ if (!_config.delimiter)
16434
+ {
16435
+ var delimGuess = guessDelimiter(input, _config.newline, _config.skipEmptyLines);
16436
+ if (delimGuess.successful)
16437
+ _config.delimiter = delimGuess.bestDelimiter;
16438
+ else
16439
+ {
16440
+ _delimiterError = true; // add error after parsing (otherwise it would be overwritten)
16441
+ _config.delimiter = Papa.DefaultDelimiter;
16442
+ }
16443
+ _results.meta.delimiter = _config.delimiter;
16444
+ }
16445
+ else if(isFunction(_config.delimiter))
16446
+ {
16447
+ _config.delimiter = _config.delimiter(input);
16448
+ _results.meta.delimiter = _config.delimiter;
16449
+ }
16450
+
16451
+ var parserConfig = copy(_config);
16452
+ if (_config.preview && _config.header)
16453
+ parserConfig.preview++; // to compensate for header row
16454
+
16455
+ _input = input;
16456
+ _parser = new Parser(parserConfig);
16457
+ _results = _parser.parse(_input, baseIndex, ignoreLastRow);
16458
+ processResults();
16459
+ return _paused ? { meta: { paused: true } } : (_results || { meta: { paused: false } });
16460
+ };
16461
+
16462
+ this.paused = function()
16463
+ {
16464
+ return _paused;
16465
+ };
16466
+
16467
+ this.pause = function()
16468
+ {
16469
+ _paused = true;
16470
+ _parser.abort();
16471
+ _input = _input.substr(_parser.getCharIndex());
16472
+ };
16473
+
16474
+ this.resume = function()
16475
+ {
16476
+ _paused = false;
16477
+ self.streamer.parseChunk(_input);
16478
+ };
16479
+
16480
+ this.aborted = function ()
16481
+ {
16482
+ return _aborted;
16483
+ };
16484
+
16485
+ this.abort = function()
16486
+ {
16487
+ _aborted = true;
16488
+ _parser.abort();
16489
+ _results.meta.aborted = true;
16490
+ if (isFunction(_config.complete))
16491
+ _config.complete(_results);
16492
+ _input = '';
16493
+ };
16494
+
16495
+ function processResults()
16496
+ {
16497
+ if (_results && _delimiterError)
16498
+ {
16499
+ addError('Delimiter', 'UndetectableDelimiter', 'Unable to auto-detect delimiting character; defaulted to \''+Papa.DefaultDelimiter+'\'');
16500
+ _delimiterError = false;
16501
+ }
16502
+
16503
+ if (_config.skipEmptyLines)
16504
+ {
16505
+ for (var i = 0; i < _results.data.length; i++)
16506
+ if (_results.data[i].length === 1 && _results.data[i][0] === '')
16507
+ _results.data.splice(i--, 1);
16508
+ }
16509
+
16510
+ if (needsHeaderRow())
16511
+ fillHeaderFields();
16512
+
16513
+ return applyHeaderAndDynamicTyping();
16514
+ }
16515
+
16516
+ function needsHeaderRow()
16517
+ {
16518
+ return _config.header && _fields.length === 0;
16519
+ }
16520
+
16521
+ function fillHeaderFields()
16522
+ {
16523
+ if (!_results)
16524
+ return;
16525
+ for (var i = 0; needsHeaderRow() && i < _results.data.length; i++)
16526
+ for (var j = 0; j < _results.data[i].length; j++)
16527
+ _fields.push(_results.data[i][j]);
16528
+ _results.data.splice(0, 1);
16529
+ }
16530
+
16531
+ function shouldApplyDynamicTyping(field) {
16532
+ // Cache function values to avoid calling it for each row
16533
+ if (_config.dynamicTypingFunction && _config.dynamicTyping[field] === undefined) {
16534
+ _config.dynamicTyping[field] = _config.dynamicTypingFunction(field);
16535
+ }
16536
+ return (_config.dynamicTyping[field] || _config.dynamicTyping) === true
16537
+ }
16538
+
16539
+ function parseDynamic(field, value)
16540
+ {
16541
+ if (shouldApplyDynamicTyping(field))
16542
+ {
16543
+ if (value === 'true' || value === 'TRUE')
16544
+ return true;
16545
+ else if (value === 'false' || value === 'FALSE')
16546
+ return false;
16547
+ else
16548
+ return tryParseFloat(value);
16549
+ }
16550
+ return value;
16551
+ }
16552
+
16553
+ function applyHeaderAndDynamicTyping()
16554
+ {
16555
+ if (!_results || (!_config.header && !_config.dynamicTyping))
16556
+ return _results;
16557
+
16558
+ for (var i = 0; i < _results.data.length; i++)
16559
+ {
16560
+ var row = _config.header ? {} : [];
16561
+
16562
+ for (var j = 0; j < _results.data[i].length; j++)
16563
+ {
16564
+ var field = j;
16565
+ var value = _results.data[i][j];
16566
+
16567
+ if (_config.header)
16568
+ field = j >= _fields.length ? '__parsed_extra' : _fields[j];
16569
+
16570
+ value = parseDynamic(field, value);
16571
+
16572
+ if (field === '__parsed_extra')
16573
+ {
16574
+ row[field] = row[field] || [];
16575
+ row[field].push(value);
16576
+ }
16577
+ else
16578
+ row[field] = value;
16579
+ }
16580
+
16581
+ _results.data[i] = row;
16582
+
16583
+ if (_config.header)
16584
+ {
16585
+ if (j > _fields.length)
16586
+ addError('FieldMismatch', 'TooManyFields', 'Too many fields: expected ' + _fields.length + ' fields but parsed ' + j, i);
16587
+ else if (j < _fields.length)
16588
+ addError('FieldMismatch', 'TooFewFields', 'Too few fields: expected ' + _fields.length + ' fields but parsed ' + j, i);
16589
+ }
16590
+ }
16591
+
16592
+ if (_config.header && _results.meta)
16593
+ _results.meta.fields = _fields;
16594
+ return _results;
16595
+ }
16596
+
16597
+ function guessDelimiter(input, newline, skipEmptyLines)
16598
+ {
16599
+ var delimChoices = [',', '\t', '|', ';', Papa.RECORD_SEP, Papa.UNIT_SEP];
16600
+ var bestDelim, bestDelta, fieldCountPrevRow;
16601
+
16602
+ for (var i = 0; i < delimChoices.length; i++)
16603
+ {
16604
+ var delim = delimChoices[i];
16605
+ var delta = 0, avgFieldCount = 0, emptyLinesCount = 0;
16606
+ fieldCountPrevRow = undefined;
16607
+
16608
+ var preview = new Parser({
16609
+ delimiter: delim,
16610
+ newline: newline,
16611
+ preview: 10
16612
+ }).parse(input);
16613
+
16614
+ for (var j = 0; j < preview.data.length; j++)
16615
+ {
16616
+ if (skipEmptyLines && preview.data[j].length === 1 && preview.data[j][0].length === 0) {
16617
+ emptyLinesCount++
16618
+ continue
16619
+ }
16620
+ var fieldCount = preview.data[j].length;
16621
+ avgFieldCount += fieldCount;
16622
+
16623
+ if (typeof fieldCountPrevRow === 'undefined')
16624
+ {
16625
+ fieldCountPrevRow = fieldCount;
16626
+ continue;
16627
+ }
16628
+ else if (fieldCount > 1)
16629
+ {
16630
+ delta += Math.abs(fieldCount - fieldCountPrevRow);
16631
+ fieldCountPrevRow = fieldCount;
16632
+ }
16633
+ }
16634
+
16635
+ if (preview.data.length > 0)
16636
+ avgFieldCount /= (preview.data.length - emptyLinesCount);
16637
+
16638
+ if ((typeof bestDelta === 'undefined' || delta < bestDelta)
16639
+ && avgFieldCount > 1.99)
16640
+ {
16641
+ bestDelta = delta;
16642
+ bestDelim = delim;
16643
+ }
16644
+ }
16645
+
16646
+ _config.delimiter = bestDelim;
16647
+
16648
+ return {
16649
+ successful: !!bestDelim,
16650
+ bestDelimiter: bestDelim
16651
+ }
16652
+ }
16653
+
16654
+ function guessLineEndings(input)
16655
+ {
16656
+ input = input.substr(0, 1024*1024); // max length 1 MB
16657
+
16658
+ var r = input.split('\r');
16659
+
16660
+ var n = input.split('\n');
16661
+
16662
+ var nAppearsFirst = (n.length > 1 && n[0].length < r[0].length);
16663
+
16664
+ if (r.length === 1 || nAppearsFirst)
16665
+ return '\n';
16666
+
16667
+ var numWithN = 0;
16668
+ for (var i = 0; i < r.length; i++)
16669
+ {
16670
+ if (r[i][0] === '\n')
16671
+ numWithN++;
16672
+ }
16673
+
16674
+ return numWithN >= r.length / 2 ? '\r\n' : '\r';
16675
+ }
16676
+
16677
+ function tryParseFloat(val)
16678
+ {
16679
+ var isNumber = FLOAT.test(val);
16680
+ return isNumber ? parseFloat(val) : val;
16681
+ }
16682
+
16683
+ function addError(type, code, msg, row)
16684
+ {
16685
+ _results.errors.push({
16686
+ type: type,
16687
+ code: code,
16688
+ message: msg,
16689
+ row: row
16690
+ });
16691
+ }
16692
+ }
16693
+
16694
+
16695
+
16696
+
16697
+
16698
+ /** The core parser implements speedy and correct CSV parsing */
16699
+ function Parser(config)
16700
+ {
16701
+ // Unpack the config object
16702
+ config = config || {};
16703
+ var delim = config.delimiter;
16704
+ var newline = config.newline;
16705
+ var comments = config.comments;
16706
+ var step = config.step;
16707
+ var preview = config.preview;
16708
+ var fastMode = config.fastMode;
16709
+ var quoteChar = config.quoteChar || '"';
16710
+
16711
+ // Delimiter must be valid
16712
+ if (typeof delim !== 'string'
16713
+ || Papa.BAD_DELIMITERS.indexOf(delim) > -1)
16714
+ delim = ',';
16715
+
16716
+ // Comment character must be valid
16717
+ if (comments === delim)
16718
+ throw 'Comment character same as delimiter';
16719
+ else if (comments === true)
16720
+ comments = '#';
16721
+ else if (typeof comments !== 'string'
16722
+ || Papa.BAD_DELIMITERS.indexOf(comments) > -1)
16723
+ comments = false;
16724
+
16725
+ // Newline must be valid: \r, \n, or \r\n
16726
+ if (newline != '\n' && newline != '\r' && newline != '\r\n')
16727
+ newline = '\n';
16728
+
16729
+ // We're gonna need these at the Parser scope
16730
+ var cursor = 0;
16731
+ var aborted = false;
16732
+
16733
+ this.parse = function(input, baseIndex, ignoreLastRow)
16734
+ {
16735
+ // For some reason, in Chrome, this speeds things up (!?)
16736
+ if (typeof input !== 'string')
16737
+ throw 'Input must be a string';
16738
+
16739
+ // We don't need to compute some of these every time parse() is called,
16740
+ // but having them in a more local scope seems to perform better
16741
+ var inputLen = input.length,
16742
+ delimLen = delim.length,
16743
+ newlineLen = newline.length,
16744
+ commentsLen = comments.length;
16745
+ var stepIsFunction = isFunction(step);
16746
+
16747
+ // Establish starting state
16748
+ cursor = 0;
16749
+ var data = [], errors = [], row = [], lastCursor = 0;
16750
+
16751
+ if (!input)
16752
+ return returnable();
16753
+
16754
+ if (fastMode || (fastMode !== false && input.indexOf(quoteChar) === -1))
16755
+ {
16756
+ var rows = input.split(newline);
16757
+ for (var i = 0; i < rows.length; i++)
16758
+ {
16759
+ var row = rows[i];
16760
+ cursor += row.length;
16761
+ if (i !== rows.length - 1)
16762
+ cursor += newline.length;
16763
+ else if (ignoreLastRow)
16764
+ return returnable();
16765
+ if (comments && row.substr(0, commentsLen) === comments)
16766
+ continue;
16767
+ if (stepIsFunction)
16768
+ {
16769
+ data = [];
16770
+ pushRow(row.split(delim));
16771
+ doStep();
16772
+ if (aborted)
16773
+ return returnable();
16774
+ }
16775
+ else
16776
+ pushRow(row.split(delim));
16777
+ if (preview && i >= preview)
16778
+ {
16779
+ data = data.slice(0, preview);
16780
+ return returnable(true);
16781
+ }
16782
+ }
16783
+ return returnable();
16784
+ }
16785
+
16786
+ var nextDelim = input.indexOf(delim, cursor);
16787
+ var nextNewline = input.indexOf(newline, cursor);
16788
+ var quoteCharRegex = new RegExp(quoteChar+quoteChar, 'g');
16789
+
16790
+ // Parser loop
16791
+ for (;;)
16792
+ {
16793
+ // Field has opening quote
16794
+ if (input[cursor] === quoteChar)
16795
+ {
16796
+ // Start our search for the closing quote where the cursor is
16797
+ var quoteSearch = cursor;
16798
+
16799
+ // Skip the opening quote
16800
+ cursor++;
16801
+
16802
+ for (;;)
16803
+ {
16804
+ // Find closing quote
16805
+ var quoteSearch = input.indexOf(quoteChar, quoteSearch+1);
16806
+
16807
+ //No other quotes are found - no other delimiters
16808
+ if (quoteSearch === -1)
16809
+ {
16810
+ if (!ignoreLastRow) {
16811
+ // No closing quote... what a pity
16812
+ errors.push({
16813
+ type: 'Quotes',
16814
+ code: 'MissingQuotes',
16815
+ message: 'Quoted field unterminated',
16816
+ row: data.length, // row has yet to be inserted
16817
+ index: cursor
16818
+ });
16819
+ }
16820
+ return finish();
16821
+ }
16822
+
16823
+ // Closing quote at EOF
16824
+ if (quoteSearch === inputLen-1)
16825
+ {
16826
+ var value = input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar);
16827
+ return finish(value);
16828
+ }
16829
+
16830
+ // If this quote is escaped, it's part of the data; skip it
16831
+ if (input[quoteSearch+1] === quoteChar)
16832
+ {
16833
+ quoteSearch++;
16834
+ continue;
16835
+ }
16836
+
16837
+ // Closing quote followed by delimiter
16838
+ if (input[quoteSearch+1] === delim)
16839
+ {
16840
+ row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar));
16841
+ cursor = quoteSearch + 1 + delimLen;
16842
+ nextDelim = input.indexOf(delim, cursor);
16843
+ nextNewline = input.indexOf(newline, cursor);
16844
+ break;
16845
+ }
16846
+
16847
+ // Closing quote followed by newline
16848
+ if (input.substr(quoteSearch+1, newlineLen) === newline)
16849
+ {
16850
+ row.push(input.substring(cursor, quoteSearch).replace(quoteCharRegex, quoteChar));
16851
+ saveRow(quoteSearch + 1 + newlineLen);
16852
+ nextDelim = input.indexOf(delim, cursor); // because we may have skipped the nextDelim in the quoted field
16853
+
16854
+ if (stepIsFunction)
16855
+ {
16856
+ doStep();
16857
+ if (aborted)
16858
+ return returnable();
16859
+ }
16860
+
16861
+ if (preview && data.length >= preview)
16862
+ return returnable(true);
16863
+
16864
+ break;
16865
+ }
16866
+
16867
+
16868
+ // 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
16869
+ errors.push({
16870
+ type: 'Quotes',
16871
+ code: 'InvalidQuotes',
16872
+ message: 'Trailing quote on quoted field is malformed',
16873
+ row: data.length, // row has yet to be inserted
16874
+ index: cursor
16875
+ });
16876
+
16877
+ quoteSearch++;
16878
+ continue;
16879
+
16880
+ }
16881
+
16882
+ continue;
16883
+ }
16884
+
16885
+ // Comment found at start of new line
16886
+ if (comments && row.length === 0 && input.substr(cursor, commentsLen) === comments)
16887
+ {
16888
+ if (nextNewline === -1) // Comment ends at EOF
16889
+ return returnable();
16890
+ cursor = nextNewline + newlineLen;
16891
+ nextNewline = input.indexOf(newline, cursor);
16892
+ nextDelim = input.indexOf(delim, cursor);
16893
+ continue;
16894
+ }
16895
+
16896
+ // Next delimiter comes before next newline, so we've reached end of field
16897
+ if (nextDelim !== -1 && (nextDelim < nextNewline || nextNewline === -1))
16898
+ {
16899
+ row.push(input.substring(cursor, nextDelim));
16900
+ cursor = nextDelim + delimLen;
16901
+ nextDelim = input.indexOf(delim, cursor);
16902
+ continue;
16903
+ }
16904
+
16905
+ // End of row
16906
+ if (nextNewline !== -1)
16907
+ {
16908
+ row.push(input.substring(cursor, nextNewline));
16909
+ saveRow(nextNewline + newlineLen);
16910
+
16911
+ if (stepIsFunction)
16912
+ {
16913
+ doStep();
16914
+ if (aborted)
16915
+ return returnable();
16916
+ }
16917
+
16918
+ if (preview && data.length >= preview)
16919
+ return returnable(true);
16920
+
16921
+ continue;
16922
+ }
16923
+
16924
+ break;
16925
+ }
16926
+
16927
+
16928
+ return finish();
16929
+
16930
+
16931
+ function pushRow(row)
16932
+ {
16933
+ data.push(row);
16934
+ lastCursor = cursor;
16935
+ }
16936
+
16937
+ /**
16938
+ * Appends the remaining input from cursor to the end into
16939
+ * row, saves the row, calls step, and returns the results.
16940
+ */
16941
+ function finish(value)
16942
+ {
16943
+ if (ignoreLastRow)
16944
+ return returnable();
16945
+ if (typeof value === 'undefined')
16946
+ value = input.substr(cursor);
16947
+ row.push(value);
16948
+ cursor = inputLen; // important in case parsing is paused
16949
+ pushRow(row);
16950
+ if (stepIsFunction)
16951
+ doStep();
16952
+ return returnable();
16953
+ }
16954
+
16955
+ /**
16956
+ * Appends the current row to the results. It sets the cursor
16957
+ * to newCursor and finds the nextNewline. The caller should
16958
+ * take care to execute user's step function and check for
16959
+ * preview and end parsing if necessary.
16960
+ */
16961
+ function saveRow(newCursor)
16962
+ {
16963
+ cursor = newCursor;
16964
+ pushRow(row);
16965
+ row = [];
16966
+ nextNewline = input.indexOf(newline, cursor);
16967
+ }
16968
+
16969
+ /** Returns an object with the results, errors, and meta. */
16970
+ function returnable(stopped)
16971
+ {
16972
+ return {
16973
+ data: data,
16974
+ errors: errors,
16975
+ meta: {
16976
+ delimiter: delim,
16977
+ linebreak: newline,
16978
+ aborted: aborted,
16979
+ truncated: !!stopped,
16980
+ cursor: lastCursor + (baseIndex || 0)
16981
+ }
16982
+ };
16983
+ }
16984
+
16985
+ /** Executes the user's step function and resets data & errors. */
16986
+ function doStep()
16987
+ {
16988
+ step(returnable());
16989
+ data = [], errors = [];
16990
+ }
16991
+ };
16992
+
16993
+ /** Sets the abort flag */
16994
+ this.abort = function()
16995
+ {
16996
+ aborted = true;
16997
+ };
16998
+
16999
+ /** Gets the cursor position */
17000
+ this.getCharIndex = function()
17001
+ {
17002
+ return cursor;
17003
+ };
17004
+ }
17005
+
17006
+
17007
+ // If you need to load Papa Parse asynchronously and you also need worker threads, hard-code
17008
+ // the script path here. See: https://github.com/mholt/PapaParse/issues/87#issuecomment-57885358
17009
+ function getScriptPath()
17010
+ {
17011
+ var scripts = document.getElementsByTagName('script');
17012
+ return scripts.length ? scripts[scripts.length - 1].src : '';
17013
+ }
17014
+
17015
+ function newWorker()
17016
+ {
17017
+ if (!Papa.WORKERS_SUPPORTED)
17018
+ return false;
17019
+ if (!LOADED_SYNC && Papa.SCRIPT_PATH === null)
17020
+ throw new Error(
17021
+ 'Script path cannot be determined automatically when Papa Parse is loaded asynchronously. ' +
17022
+ 'You need to set Papa.SCRIPT_PATH manually.'
17023
+ );
17024
+ var workerUrl = Papa.SCRIPT_PATH || AUTO_SCRIPT_PATH;
17025
+ // Append 'papaworker' to the search string to tell papaparse that this is our worker.
17026
+ workerUrl += (workerUrl.indexOf('?') !== -1 ? '&' : '?') + 'papaworker';
17027
+ var w = new global.Worker(workerUrl);
17028
+ w.onmessage = mainThreadReceivedMessage;
17029
+ w.id = workerIdCounter++;
17030
+ workers[w.id] = w;
17031
+ return w;
17032
+ }
17033
+
17034
+ /** Callback when main thread receives a message */
17035
+ function mainThreadReceivedMessage(e)
17036
+ {
17037
+ var msg = e.data;
17038
+ var worker = workers[msg.workerId];
17039
+ var aborted = false;
17040
+
17041
+ if (msg.error)
17042
+ worker.userError(msg.error, msg.file);
17043
+ else if (msg.results && msg.results.data)
17044
+ {
17045
+ var abort = function() {
17046
+ aborted = true;
17047
+ completeWorker(msg.workerId, { data: [], errors: [], meta: { aborted: true } });
17048
+ };
17049
+
17050
+ var handle = {
17051
+ abort: abort,
17052
+ pause: notImplemented,
17053
+ resume: notImplemented
17054
+ };
17055
+
17056
+ if (isFunction(worker.userStep))
17057
+ {
17058
+ for (var i = 0; i < msg.results.data.length; i++)
17059
+ {
17060
+ worker.userStep({
17061
+ data: [msg.results.data[i]],
17062
+ errors: msg.results.errors,
17063
+ meta: msg.results.meta
17064
+ }, handle);
17065
+ if (aborted)
17066
+ break;
17067
+ }
17068
+ delete msg.results; // free memory ASAP
17069
+ }
17070
+ else if (isFunction(worker.userChunk))
17071
+ {
17072
+ worker.userChunk(msg.results, handle, msg.file);
17073
+ delete msg.results;
17074
+ }
17075
+ }
17076
+
17077
+ if (msg.finished && !aborted)
17078
+ completeWorker(msg.workerId, msg.results);
17079
+ }
17080
+
17081
+ function completeWorker(workerId, results) {
17082
+ var worker = workers[workerId];
17083
+ if (isFunction(worker.userComplete))
17084
+ worker.userComplete(results);
17085
+ worker.terminate();
17086
+ delete workers[workerId];
17087
+ }
17088
+
17089
+ function notImplemented() {
17090
+ throw 'Not implemented.';
17091
+ }
17092
+
17093
+ /** Callback when worker thread receives a message */
17094
+ function workerThreadReceivedMessage(e)
17095
+ {
17096
+ var msg = e.data;
17097
+
17098
+ if (typeof Papa.WORKER_ID === 'undefined' && msg)
17099
+ Papa.WORKER_ID = msg.workerId;
17100
+
17101
+ if (typeof msg.input === 'string')
17102
+ {
17103
+ global.postMessage({
17104
+ workerId: Papa.WORKER_ID,
17105
+ results: Papa.parse(msg.input, msg.config),
17106
+ finished: true
17107
+ });
17108
+ }
17109
+ else if ((global.File && msg.input instanceof File) || msg.input instanceof Object) // thank you, Safari (see issue #106)
17110
+ {
17111
+ var results = Papa.parse(msg.input, msg.config);
17112
+ if (results)
17113
+ global.postMessage({
17114
+ workerId: Papa.WORKER_ID,
17115
+ results: results,
17116
+ finished: true
17117
+ });
17118
+ }
17119
+ }
17120
+
17121
+ /** Makes a deep copy of an array or object (mostly) */
17122
+ function copy(obj)
17123
+ {
17124
+ if (typeof obj !== 'object')
17125
+ return obj;
17126
+ var cpy = obj instanceof Array ? [] : {};
17127
+ for (var key in obj)
17128
+ cpy[key] = copy(obj[key]);
17129
+ return cpy;
17130
+ }
17131
+
17132
+ function bindFunction(f, self)
17133
+ {
17134
+ return function() { f.apply(self, arguments); };
17135
+ }
17136
+
17137
+ function isFunction(func)
17138
+ {
17139
+ return typeof func === 'function';
17140
+ }
17141
+
17142
+ return Papa;
17143
+ }));
17144
+
17145
+
17146
+ /***/ },
17147
+ /* 178 */
15060
17148
  /***/ function(module, exports, __webpack_require__) {
15061
17149
 
15062
17150
  /**
@@ -15070,9 +17158,9 @@ module.exports =
15070
17158
 
15071
17159
  'use strict';
15072
17160
 
15073
- var emptyFunction = __webpack_require__(178);
15074
- var invariant = __webpack_require__(179);
15075
- var ReactPropTypesSecret = __webpack_require__(177);
17161
+ var emptyFunction = __webpack_require__(180);
17162
+ var invariant = __webpack_require__(181);
17163
+ var ReactPropTypesSecret = __webpack_require__(179);
15076
17164
 
15077
17165
  module.exports = function() {
15078
17166
  function shim(props, propName, componentName, location, propFullName, secret) {
@@ -15121,7 +17209,7 @@ module.exports =
15121
17209
 
15122
17210
 
15123
17211
  /***/ },
15124
- /* 177 */
17212
+ /* 179 */
15125
17213
  /***/ function(module, exports) {
15126
17214
 
15127
17215
  /**
@@ -15141,7 +17229,7 @@ module.exports =
15141
17229
 
15142
17230
 
15143
17231
  /***/ },
15144
- /* 178 */
17232
+ /* 180 */
15145
17233
  /***/ function(module, exports) {
15146
17234
 
15147
17235
  "use strict";
@@ -15184,7 +17272,7 @@ module.exports =
15184
17272
  module.exports = emptyFunction;
15185
17273
 
15186
17274
  /***/ },
15187
- /* 179 */
17275
+ /* 181 */
15188
17276
  /***/ function(module, exports, __webpack_require__) {
15189
17277
 
15190
17278
  /**
@@ -15244,7 +17332,7 @@ module.exports =
15244
17332
  module.exports = invariant;
15245
17333
 
15246
17334
  /***/ },
15247
- /* 180 */
17335
+ /* 182 */
15248
17336
  /***/ function(module, exports, __webpack_require__) {
15249
17337
 
15250
17338
  'use strict';
@@ -15261,7 +17349,7 @@ module.exports =
15261
17349
 
15262
17350
  var _reactDom2 = _interopRequireDefault(_reactDom);
15263
17351
 
15264
- var _domAlign = __webpack_require__(169);
17352
+ var _domAlign = __webpack_require__(170);
15265
17353
 
15266
17354
  var _domAlign2 = _interopRequireDefault(_domAlign);
15267
17355
 
@@ -15269,7 +17357,7 @@ module.exports =
15269
17357
 
15270
17358
  var _addEventListener2 = _interopRequireDefault(_addEventListener);
15271
17359
 
15272
- var _isWindow = __webpack_require__(182);
17360
+ var _isWindow = __webpack_require__(184);
15273
17361
 
15274
17362
  var _isWindow2 = _interopRequireDefault(_isWindow);
15275
17363
 
@@ -15403,7 +17491,7 @@ module.exports =
15403
17491
  module.exports = exports['default'];
15404
17492
 
15405
17493
  /***/ },
15406
- /* 181 */
17494
+ /* 183 */
15407
17495
  /***/ function(module, exports, __webpack_require__) {
15408
17496
 
15409
17497
  'use strict';
@@ -15412,7 +17500,7 @@ module.exports =
15412
17500
  value: true
15413
17501
  });
15414
17502
 
15415
- var _Align = __webpack_require__(180);
17503
+ var _Align = __webpack_require__(182);
15416
17504
 
15417
17505
  var _Align2 = _interopRequireDefault(_Align);
15418
17506
 
@@ -15423,7 +17511,7 @@ module.exports =
15423
17511
  module.exports = exports['default'];
15424
17512
 
15425
17513
  /***/ },
15426
- /* 182 */
17514
+ /* 184 */
15427
17515
  /***/ function(module, exports) {
15428
17516
 
15429
17517
  "use strict";
@@ -15440,7 +17528,7 @@ module.exports =
15440
17528
  module.exports = exports['default'];
15441
17529
 
15442
17530
  /***/ },
15443
- /* 183 */
17531
+ /* 185 */
15444
17532
  /***/ function(module, exports, __webpack_require__) {
15445
17533
 
15446
17534
  'use strict';
@@ -15455,9 +17543,9 @@ module.exports =
15455
17543
 
15456
17544
  var _react2 = _interopRequireDefault(_react);
15457
17545
 
15458
- var _ChildrenUtils = __webpack_require__(185);
17546
+ var _ChildrenUtils = __webpack_require__(187);
15459
17547
 
15460
- var _AnimateChild = __webpack_require__(184);
17548
+ var _AnimateChild = __webpack_require__(186);
15461
17549
 
15462
17550
  var _AnimateChild2 = _interopRequireDefault(_AnimateChild);
15463
17551
 
@@ -15776,7 +17864,7 @@ module.exports =
15776
17864
  module.exports = exports['default'];
15777
17865
 
15778
17866
  /***/ },
15779
- /* 184 */
17867
+ /* 186 */
15780
17868
  /***/ function(module, exports, __webpack_require__) {
15781
17869
 
15782
17870
  'use strict';
@@ -15795,7 +17883,7 @@ module.exports =
15795
17883
 
15796
17884
  var _reactDom2 = _interopRequireDefault(_reactDom);
15797
17885
 
15798
- var _cssAnimation = __webpack_require__(163);
17886
+ var _cssAnimation = __webpack_require__(164);
15799
17887
 
15800
17888
  var _cssAnimation2 = _interopRequireDefault(_cssAnimation);
15801
17889
 
@@ -15887,7 +17975,7 @@ module.exports =
15887
17975
  module.exports = exports['default'];
15888
17976
 
15889
17977
  /***/ },
15890
- /* 185 */
17978
+ /* 187 */
15891
17979
  /***/ function(module, exports, __webpack_require__) {
15892
17980
 
15893
17981
  'use strict';
@@ -16009,16 +18097,16 @@ module.exports =
16009
18097
  }
16010
18098
 
16011
18099
  /***/ },
16012
- /* 186 */
18100
+ /* 188 */
16013
18101
  /***/ function(module, exports, __webpack_require__) {
16014
18102
 
16015
18103
  'use strict';
16016
18104
 
16017
18105
  // export this package's api
16018
- module.exports = __webpack_require__(183);
18106
+ module.exports = __webpack_require__(185);
16019
18107
 
16020
18108
  /***/ },
16021
- /* 187 */
18109
+ /* 189 */
16022
18110
  /***/ function(module, exports, __webpack_require__) {
16023
18111
 
16024
18112
  'use strict';
@@ -16031,7 +18119,7 @@ module.exports =
16031
18119
 
16032
18120
  var _react2 = _interopRequireDefault(_react);
16033
18121
 
16034
- var _Select = __webpack_require__(190);
18122
+ var _Select = __webpack_require__(192);
16035
18123
 
16036
18124
  var _Select2 = _interopRequireDefault(_Select);
16037
18125
 
@@ -16255,7 +18343,7 @@ module.exports =
16255
18343
  module.exports = exports['default'];
16256
18344
 
16257
18345
  /***/ },
16258
- /* 188 */
18346
+ /* 190 */
16259
18347
  /***/ function(module, exports, __webpack_require__) {
16260
18348
 
16261
18349
  'use strict';
@@ -16451,7 +18539,7 @@ module.exports =
16451
18539
  module.exports = exports['default'];
16452
18540
 
16453
18541
  /***/ },
16454
- /* 189 */
18542
+ /* 191 */
16455
18543
  /***/ function(module, exports, __webpack_require__) {
16456
18544
 
16457
18545
  'use strict';
@@ -16468,11 +18556,11 @@ module.exports =
16468
18556
 
16469
18557
  var _react2 = _interopRequireDefault(_react);
16470
18558
 
16471
- var _Header = __webpack_require__(188);
18559
+ var _Header = __webpack_require__(190);
16472
18560
 
16473
18561
  var _Header2 = _interopRequireDefault(_Header);
16474
18562
 
16475
- var _Combobox = __webpack_require__(187);
18563
+ var _Combobox = __webpack_require__(189);
16476
18564
 
16477
18565
  var _Combobox2 = _interopRequireDefault(_Combobox);
16478
18566
 
@@ -16645,7 +18733,7 @@ module.exports =
16645
18733
  module.exports = exports['default'];
16646
18734
 
16647
18735
  /***/ },
16648
- /* 190 */
18736
+ /* 192 */
16649
18737
  /***/ function(module, exports, __webpack_require__) {
16650
18738
 
16651
18739
  'use strict';
@@ -16806,7 +18894,7 @@ module.exports =
16806
18894
  module.exports = exports['default'];
16807
18895
 
16808
18896
  /***/ },
16809
- /* 191 */
18897
+ /* 193 */
16810
18898
  /***/ function(module, exports, __webpack_require__) {
16811
18899
 
16812
18900
  'use strict';
@@ -16819,15 +18907,15 @@ module.exports =
16819
18907
 
16820
18908
  var _react2 = _interopRequireDefault(_react);
16821
18909
 
16822
- var _rcTrigger = __webpack_require__(197);
18910
+ var _rcTrigger = __webpack_require__(199);
16823
18911
 
16824
18912
  var _rcTrigger2 = _interopRequireDefault(_rcTrigger);
16825
18913
 
16826
- var _Panel = __webpack_require__(189);
18914
+ var _Panel = __webpack_require__(191);
16827
18915
 
16828
18916
  var _Panel2 = _interopRequireDefault(_Panel);
16829
18917
 
16830
- var _placements = __webpack_require__(193);
18918
+ var _placements = __webpack_require__(195);
16831
18919
 
16832
18920
  var _placements2 = _interopRequireDefault(_placements);
16833
18921
 
@@ -17109,7 +19197,7 @@ module.exports =
17109
19197
  module.exports = exports['default'];
17110
19198
 
17111
19199
  /***/ },
17112
- /* 192 */
19200
+ /* 194 */
17113
19201
  /***/ function(module, exports, __webpack_require__) {
17114
19202
 
17115
19203
  'use strict';
@@ -17118,7 +19206,7 @@ module.exports =
17118
19206
  value: true
17119
19207
  });
17120
19208
 
17121
- var _TimePicker = __webpack_require__(191);
19209
+ var _TimePicker = __webpack_require__(193);
17122
19210
 
17123
19211
  var _TimePicker2 = _interopRequireDefault(_TimePicker);
17124
19212
 
@@ -17128,7 +19216,7 @@ module.exports =
17128
19216
  module.exports = exports['default'];
17129
19217
 
17130
19218
  /***/ },
17131
- /* 193 */
19219
+ /* 195 */
17132
19220
  /***/ function(module, exports) {
17133
19221
 
17134
19222
  'use strict';
@@ -17174,7 +19262,7 @@ module.exports =
17174
19262
  module.exports = exports['default'];
17175
19263
 
17176
19264
  /***/ },
17177
- /* 194 */
19265
+ /* 196 */
17178
19266
  /***/ function(module, exports, __webpack_require__) {
17179
19267
 
17180
19268
  'use strict';
@@ -17195,15 +19283,15 @@ module.exports =
17195
19283
 
17196
19284
  var _reactDom2 = _interopRequireDefault(_reactDom);
17197
19285
 
17198
- var _rcAlign = __webpack_require__(181);
19286
+ var _rcAlign = __webpack_require__(183);
17199
19287
 
17200
19288
  var _rcAlign2 = _interopRequireDefault(_rcAlign);
17201
19289
 
17202
- var _rcAnimate = __webpack_require__(186);
19290
+ var _rcAnimate = __webpack_require__(188);
17203
19291
 
17204
19292
  var _rcAnimate2 = _interopRequireDefault(_rcAnimate);
17205
19293
 
17206
- var _PopupInner = __webpack_require__(195);
19294
+ var _PopupInner = __webpack_require__(197);
17207
19295
 
17208
19296
  var _PopupInner2 = _interopRequireDefault(_PopupInner);
17209
19297
 
@@ -17405,7 +19493,7 @@ module.exports =
17405
19493
  module.exports = exports['default'];
17406
19494
 
17407
19495
  /***/ },
17408
- /* 195 */
19496
+ /* 197 */
17409
19497
  /***/ function(module, exports, __webpack_require__) {
17410
19498
 
17411
19499
  'use strict';
@@ -17462,7 +19550,7 @@ module.exports =
17462
19550
  module.exports = exports['default'];
17463
19551
 
17464
19552
  /***/ },
17465
- /* 196 */
19553
+ /* 198 */
17466
19554
  /***/ function(module, exports, __webpack_require__) {
17467
19555
 
17468
19556
  'use strict';
@@ -17483,7 +19571,7 @@ module.exports =
17483
19571
 
17484
19572
  var _reactDom2 = _interopRequireDefault(_reactDom);
17485
19573
 
17486
- var _contains = __webpack_require__(199);
19574
+ var _contains = __webpack_require__(201);
17487
19575
 
17488
19576
  var _contains2 = _interopRequireDefault(_contains);
17489
19577
 
@@ -17491,13 +19579,13 @@ module.exports =
17491
19579
 
17492
19580
  var _addEventListener2 = _interopRequireDefault(_addEventListener);
17493
19581
 
17494
- var _Popup = __webpack_require__(194);
19582
+ var _Popup = __webpack_require__(196);
17495
19583
 
17496
19584
  var _Popup2 = _interopRequireDefault(_Popup);
17497
19585
 
17498
- var _utils = __webpack_require__(198);
19586
+ var _utils = __webpack_require__(200);
17499
19587
 
17500
- var _getContainerRenderMixin = __webpack_require__(200);
19588
+ var _getContainerRenderMixin = __webpack_require__(202);
17501
19589
 
17502
19590
  var _getContainerRenderMixin2 = _interopRequireDefault(_getContainerRenderMixin);
17503
19591
 
@@ -17961,15 +20049,15 @@ module.exports =
17961
20049
  module.exports = exports['default'];
17962
20050
 
17963
20051
  /***/ },
17964
- /* 197 */
20052
+ /* 199 */
17965
20053
  /***/ function(module, exports, __webpack_require__) {
17966
20054
 
17967
20055
  'use strict';
17968
20056
 
17969
- module.exports = __webpack_require__(196);
20057
+ module.exports = __webpack_require__(198);
17970
20058
 
17971
20059
  /***/ },
17972
- /* 198 */
20060
+ /* 200 */
17973
20061
  /***/ function(module, exports, __webpack_require__) {
17974
20062
 
17975
20063
  'use strict';
@@ -18009,7 +20097,7 @@ module.exports =
18009
20097
  }
18010
20098
 
18011
20099
  /***/ },
18012
- /* 199 */
20100
+ /* 201 */
18013
20101
  /***/ function(module, exports) {
18014
20102
 
18015
20103
  "use strict";
@@ -18032,7 +20120,7 @@ module.exports =
18032
20120
  module.exports = exports['default'];
18033
20121
 
18034
20122
  /***/ },
18035
- /* 200 */
20123
+ /* 202 */
18036
20124
  /***/ function(module, exports, __webpack_require__) {
18037
20125
 
18038
20126
  'use strict';
@@ -18137,7 +20225,7 @@ module.exports =
18137
20225
  module.exports = exports['default'];
18138
20226
 
18139
20227
  /***/ },
18140
- /* 201 */
20228
+ /* 203 */
18141
20229
  /***/ function(module, exports, __webpack_require__) {
18142
20230
 
18143
20231
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -19158,8 +21246,8 @@ module.exports =
19158
21246
  //# sourceMappingURL=index.js.map
19159
21247
 
19160
21248
  /***/ },
19161
- /* 202 */,
19162
- /* 203 */
21249
+ /* 204 */,
21250
+ /* 205 */
19163
21251
  /***/ function(module, exports, __webpack_require__) {
19164
21252
 
19165
21253
  'use strict';
@@ -19168,19 +21256,19 @@ module.exports =
19168
21256
 
19169
21257
  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; };
19170
21258
 
19171
- var _addClass = __webpack_require__(205);
21259
+ var _addClass = __webpack_require__(207);
19172
21260
 
19173
21261
  var _addClass2 = _interopRequireDefault(_addClass);
19174
21262
 
19175
- var _removeClass = __webpack_require__(207);
21263
+ var _removeClass = __webpack_require__(209);
19176
21264
 
19177
21265
  var _removeClass2 = _interopRequireDefault(_removeClass);
19178
21266
 
19179
- var _requestAnimationFrame = __webpack_require__(209);
21267
+ var _requestAnimationFrame = __webpack_require__(211);
19180
21268
 
19181
21269
  var _requestAnimationFrame2 = _interopRequireDefault(_requestAnimationFrame);
19182
21270
 
19183
- var _properties = __webpack_require__(208);
21271
+ var _properties = __webpack_require__(210);
19184
21272
 
19185
21273
  var _react = __webpack_require__(1);
19186
21274
 
@@ -19393,7 +21481,7 @@ module.exports =
19393
21481
  module.exports = exports['default'];
19394
21482
 
19395
21483
  /***/ },
19396
- /* 204 */
21484
+ /* 206 */
19397
21485
  /***/ function(module, exports, __webpack_require__) {
19398
21486
 
19399
21487
  'use strict';
@@ -19402,7 +21490,7 @@ module.exports =
19402
21490
 
19403
21491
  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; };
19404
21492
 
19405
- var _chainFunction = __webpack_require__(160);
21493
+ var _chainFunction = __webpack_require__(161);
19406
21494
 
19407
21495
  var _chainFunction2 = _interopRequireDefault(_chainFunction);
19408
21496
 
@@ -19414,11 +21502,11 @@ module.exports =
19414
21502
 
19415
21503
  var _propTypes2 = _interopRequireDefault(_propTypes);
19416
21504
 
19417
- var _warning = __webpack_require__(211);
21505
+ var _warning = __webpack_require__(213);
19418
21506
 
19419
21507
  var _warning2 = _interopRequireDefault(_warning);
19420
21508
 
19421
- var _ChildMapping = __webpack_require__(210);
21509
+ var _ChildMapping = __webpack_require__(212);
19422
21510
 
19423
21511
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19424
21512
 
@@ -19670,7 +21758,7 @@ module.exports =
19670
21758
  module.exports = exports['default'];
19671
21759
 
19672
21760
  /***/ },
19673
- /* 205 */
21761
+ /* 207 */
19674
21762
  /***/ function(module, exports, __webpack_require__) {
19675
21763
 
19676
21764
  'use strict';
@@ -19680,7 +21768,7 @@ module.exports =
19680
21768
  });
19681
21769
  exports.default = addClass;
19682
21770
 
19683
- var _hasClass = __webpack_require__(206);
21771
+ var _hasClass = __webpack_require__(208);
19684
21772
 
19685
21773
  var _hasClass2 = _interopRequireDefault(_hasClass);
19686
21774
 
@@ -19692,7 +21780,7 @@ module.exports =
19692
21780
  module.exports = exports['default'];
19693
21781
 
19694
21782
  /***/ },
19695
- /* 206 */
21783
+ /* 208 */
19696
21784
  /***/ function(module, exports) {
19697
21785
 
19698
21786
  "use strict";
@@ -19707,7 +21795,7 @@ module.exports =
19707
21795
  module.exports = exports["default"];
19708
21796
 
19709
21797
  /***/ },
19710
- /* 207 */
21798
+ /* 209 */
19711
21799
  /***/ function(module, exports) {
19712
21800
 
19713
21801
  'use strict';
@@ -19717,7 +21805,7 @@ module.exports =
19717
21805
  };
19718
21806
 
19719
21807
  /***/ },
19720
- /* 208 */
21808
+ /* 210 */
19721
21809
  /***/ function(module, exports, __webpack_require__) {
19722
21810
 
19723
21811
  'use strict';
@@ -19832,7 +21920,7 @@ module.exports =
19832
21920
  }
19833
21921
 
19834
21922
  /***/ },
19835
- /* 209 */
21923
+ /* 211 */
19836
21924
  /***/ function(module, exports, __webpack_require__) {
19837
21925
 
19838
21926
  'use strict';
@@ -19890,7 +21978,7 @@ module.exports =
19890
21978
  module.exports = exports['default'];
19891
21979
 
19892
21980
  /***/ },
19893
- /* 210 */
21981
+ /* 212 */
19894
21982
  /***/ function(module, exports, __webpack_require__) {
19895
21983
 
19896
21984
  'use strict';
@@ -19986,7 +22074,7 @@ module.exports =
19986
22074
  }
19987
22075
 
19988
22076
  /***/ },
19989
- /* 211 */
22077
+ /* 213 */
19990
22078
  /***/ function(module, exports, __webpack_require__) {
19991
22079
 
19992
22080
  /**
@@ -20052,13 +22140,13 @@ module.exports =
20052
22140
 
20053
22141
 
20054
22142
  /***/ },
20055
- /* 212 */
22143
+ /* 214 */
20056
22144
  /***/ function(module, exports) {
20057
22145
 
20058
22146
  module.exports = require("moment-timezone");
20059
22147
 
20060
22148
  /***/ },
20061
- /* 213 */
22149
+ /* 215 */
20062
22150
  /***/ function(module, exports) {
20063
22151
 
20064
22152
  module.exports = require("redux");